1){var V=F.slice(0,q.index),K=F.slice(q.index+q.length);U=V.join(":")+"::"+K.join(":")}else U=F.join(":");return _&&(U+="%"+_),U}return r}var Ve=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Ke=void 0==="".match(/(){0}/)[1];function parse(r){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g={},y=!1!==h.iri?d:a;"suffix"===h.reference&&(r=(h.scheme?h.scheme+":":"")+"//"+r);var _=r.match(Ve);if(_){Ke?(g.scheme=_[1],g.userinfo=_[3],g.host=_[4],g.port=parseInt(_[5],10),g.path=_[6]||"",g.query=_[7],g.fragment=_[8],isNaN(g.port)&&(g.port=_[5])):(g.scheme=_[1]||void 0,g.userinfo=-1!==r.indexOf("@")?_[3]:void 0,g.host=-1!==r.indexOf("//")?_[4]:void 0,g.port=parseInt(_[5],10),g.path=_[6]||"",g.query=-1!==r.indexOf("?")?_[7]:void 0,g.fragment=-1!==r.indexOf("#")?_[8]:void 0,isNaN(g.port)&&(g.port=r.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?_[4]:void 0)),g.host&&(g.host=_normalizeIPv6(_normalizeIPv4(g.host,y),y)),void 0!==g.scheme||void 0!==g.userinfo||void 0!==g.host||void 0!==g.port||g.path||void 0!==g.query?void 0===g.scheme?g.reference="relative":void 0===g.fragment?g.reference="absolute":g.reference="uri":g.reference="same-document",h.reference&&"suffix"!==h.reference&&h.reference!==g.reference&&(g.error=g.error||"URI is not a "+h.reference+" reference.");var b=Ue[(h.scheme||g.scheme||"").toLowerCase()];if(h.unicodeSupport||b&&b.unicodeSupport)_normalizeComponentEncoding(g,y);else{if(g.host&&(h.domainHost||b&&b.domainHost))try{g.host=qe.toASCII(g.host.replace(y.PCT_ENCODED,pctDecChars).toLowerCase())}catch(r){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+r}_normalizeComponentEncoding(g,a)}b&&b.parse&&b.parse(g,h)}else g.error=g.error||"URI can not be parsed.";return g}function _recomposeAuthority(r,h){var g=!1!==h.iri?d:a,y=[];return void 0!==r.userinfo&&(y.push(r.userinfo),y.push("@")),void 0!==r.host&&y.push(_normalizeIPv6(_normalizeIPv4(String(r.host),g),g).replace(g.IPV6ADDRESS,function(r,a,d){return"["+a+(d?"%25"+d:"")+"]"})),"number"!=typeof r.port&&"string"!=typeof r.port||(y.push(":"),y.push(String(r.port))),y.length?y.join(""):void 0}var He=/^\.\.?\//,Be=/^\/\.(\/|$)/,Qe=/^\/\.\.(\/|$)/,Je=/^\/?(?:.|\n)*?(?=\/|$)/;function removeDotSegments(r){for(var a=[];r.length;)if(r.match(He))r=r.replace(He,"");else if(r.match(Be))r=r.replace(Be,"/");else if(r.match(Qe))r=r.replace(Qe,"/"),a.pop();else if("."===r||".."===r)r="";else{var d=r.match(Je);if(!d)throw new Error("Unexpected dot segment condition");var h=d[0];r=r.slice(h.length),a.push(h)}return a.join("")}function serialize(r){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},g=h.iri?d:a,y=[],_=Ue[(h.scheme||r.scheme||"").toLowerCase()];if(_&&_.serialize&&_.serialize(r,h),r.host)if(g.IPV6ADDRESS.test(r.host));else if(h.domainHost||_&&_.domainHost)try{r.host=h.iri?qe.toUnicode(r.host):qe.toASCII(r.host.replace(g.PCT_ENCODED,pctDecChars).toLowerCase())}catch(a){r.error=r.error||"Host's domain name can not be converted to "+(h.iri?"Unicode":"ASCII")+" via punycode: "+a}_normalizeComponentEncoding(r,g),"suffix"!==h.reference&&r.scheme&&(y.push(r.scheme),y.push(":"));var b=_recomposeAuthority(r,h);if(void 0!==b&&("suffix"!==h.reference&&y.push("//"),y.push(b),r.path&&"/"!==r.path.charAt(0)&&y.push("/")),void 0!==r.path){var P=r.path;h.absolutePath||_&&_.absolutePath||(P=removeDotSegments(P)),void 0===b&&(P=P.replace(/^\/\//,"/%2F")),y.push(P)}return void 0!==r.query&&(y.push("?"),y.push(r.query)),void 0!==r.fragment&&(y.push("#"),y.push(r.fragment)),y.join("")}function resolveComponents(r,a){var d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h={};return arguments[3]||(r=parse(serialize(r,d),d),a=parse(serialize(a,d),d)),!(d=d||{}).tolerant&&a.scheme?(h.scheme=a.scheme,h.userinfo=a.userinfo,h.host=a.host,h.port=a.port,h.path=removeDotSegments(a.path||""),h.query=a.query):(void 0!==a.userinfo||void 0!==a.host||void 0!==a.port?(h.userinfo=a.userinfo,h.host=a.host,h.port=a.port,h.path=removeDotSegments(a.path||""),h.query=a.query):(a.path?("/"===a.path.charAt(0)?h.path=removeDotSegments(a.path):(void 0===r.userinfo&&void 0===r.host&&void 0===r.port||r.path?r.path?h.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+a.path:h.path=a.path:h.path="/"+a.path,h.path=removeDotSegments(h.path)),h.query=a.query):(h.path=r.path,void 0!==a.query?h.query=a.query:h.query=r.query),h.userinfo=r.userinfo,h.host=r.host,h.port=r.port),h.scheme=r.scheme),h.fragment=a.fragment,h}function resolve(r,a,d){var h=assign({scheme:"null"},d);return serialize(resolveComponents(parse(r,h),parse(a,h),h,!0),h)}function normalize(r,a){return"string"==typeof r?r=serialize(parse(r,a),a):"object"===typeOf(r)&&(r=parse(serialize(r,a),a)),r}function equal(r,a,d){return"string"==typeof r?r=serialize(parse(r,d),d):"object"===typeOf(r)&&(r=serialize(r,d)),"string"==typeof a?a=serialize(parse(a,d),d):"object"===typeOf(a)&&(a=serialize(a,d)),r===a}function escapeComponent(r,h){return r&&r.toString().replace(h&&h.iri?d.ESCAPE:a.ESCAPE,pctEncChar)}function unescapeComponent(r,h){return r&&r.toString().replace(h&&h.iri?d.PCT_ENCODED:a.PCT_ENCODED,pctDecChars)}var We={scheme:"http",domainHost:!0,parse:function parse(r,a){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r},serialize:function serialize(r,a){var d="https"===String(r.scheme).toLowerCase();return r.port!==(d?443:80)&&""!==r.port||(r.port=void 0),r.path||(r.path="/"),r}},Ye={scheme:"https",domainHost:We.domainHost,parse:We.parse,serialize:We.serialize};function isSecure(r){return"boolean"==typeof r.secure?r.secure:"wss"===String(r.scheme).toLowerCase()}var Xe={scheme:"ws",domainHost:!0,parse:function parse(r,a){var d=r;return d.secure=isSecure(d),d.resourceName=(d.path||"/")+(d.query?"?"+d.query:""),d.path=void 0,d.query=void 0,d},serialize:function serialize(r,a){if(r.port!==(isSecure(r)?443:80)&&""!==r.port||(r.port=void 0),"boolean"==typeof r.secure&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){var d=r.resourceName.split("?"),g=h(d,2),y=g[0],_=g[1];r.path=y&&"/"!==y?y:void 0,r.query=_,r.resourceName=void 0}return r.fragment=void 0,r}},et={scheme:"wss",domainHost:Xe.domainHost,parse:Xe.parse,serialize:Xe.serialize},tt={},rt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",st="[0-9A-Fa-f]",at=subexp(subexp("%[EFef]"+st+"%"+st+st+"%"+st+st)+"|"+subexp("%[89A-Fa-f]"+st+"%"+st+st)+"|"+subexp("%"+st+st)),nt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ot=merge("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),it="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",dt=new RegExp(rt,"g"),ct=new RegExp(at,"g"),ut=new RegExp(merge("[^]",nt,"[\\.]",'[\\"]',ot),"g"),lt=new RegExp(merge("[^]",rt,it),"g"),pt=lt;function decodeUnreserved(r){var a=pctDecChars(r);return a.match(dt)?a:r}var mt={scheme:"mailto",parse:function parse$$1(r,a){var d=r,h=d.to=d.path?d.path.split(","):[];if(d.path=void 0,d.query){for(var g=!1,y={},_=d.query.split("&"),b=0,P=_.length;b{if(a.description)try{return{...r,...JSON.parse(a.description)}}catch{}return r},g={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},getDefaultOptions=r=>"string"==typeof r?{...g,name:r}:{...g,...r}},"./packages/node_modules/zod-to-json-schema/dist/esm/Refs.js":function(r,a,d){"use strict";d.r(a),d.d(a,{getRefs:function(){return getRefs}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/Options.js");const getRefs=r=>{const a=(0,h.getDefaultOptions)(r),d=void 0!==a.name?[...a.basePath,a.definitionPath,a.name]:a.basePath;return{...a,flags:{hasReferencedOpenAiAnyType:!1},currentPath:d,propertyPath:void 0,seen:new Map(Object.entries(a.definitions).map(([r,d])=>[d._def,{def:d._def,path:[...a.basePath,a.definitionPath,r],jsonSchema:void 0}]))}}},"./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js":function(r,a,d){"use strict";function addErrorMessage(r,a,d,h){h?.errorMessages&&d&&(r.errorMessage={...r.errorMessage,[a]:d})}function setResponseValueAndErrors(r,a,d,h,g){r[a]=d,addErrorMessage(r,a,h,g)}d.r(a),d.d(a,{addErrorMessage:function(){return addErrorMessage},setResponseValueAndErrors:function(){return setResponseValueAndErrors}})},"./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":function(r,a,d){"use strict";d.r(a),d.d(a,{getRelativePath:function(){return getRelativePath}});const getRelativePath=(r,a)=>{let d=0;for(;d{switch(a.$refStrategy){case"root":return{$ref:r.path.join("/")};case"relative":return{$ref:(0,y.getRelativePath)(a.currentPath,r.path)};case"none":case"seen":return r.path.lengtha.currentPath[d]===r)?(console.warn(`Recursive reference detected at ${a.currentPath.join("/")}! Defaulting to any`),(0,_.parseAnyDef)(a)):"seen"===a.$refStrategy?(0,_.parseAnyDef)(a):void 0}},addMeta=(r,a,d)=>(r.description&&(d.description=r.description,a.markdownDescription&&(d.markdownDescription=r.description)),d)},"./packages/node_modules/zod-to-json-schema/dist/esm/parseTypes.js":function(r,a,d){"use strict";d.r(a)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseAnyDef:function(){return parseAnyDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");function parseAnyDef(r){if("openAi"!==r.target)return{};const a=[...r.basePath,r.definitionPath,r.openAiAnyTypeName];return r.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===r.$refStrategy?(0,h.getRelativePath)(a,r.currentPath):a.join("/")}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/array.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseArrayDef:function(){return parseArrayDef}});var h=d("./packages/node_modules/zod/v3/types.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseArrayDef(r,a){const d={type:"array"};return r.type?._def&&r.type?._def?.typeName!==h.ZodFirstPartyTypeKind.ZodAny&&(d.items=(0,y.parseDef)(r.type._def,{...a,currentPath:[...a.currentPath,"items"]})),r.minLength&&(0,g.setResponseValueAndErrors)(d,"minItems",r.minLength.value,r.minLength.message,a),r.maxLength&&(0,g.setResponseValueAndErrors)(d,"maxItems",r.maxLength.value,r.maxLength.message,a),r.exactLength&&((0,g.setResponseValueAndErrors)(d,"minItems",r.exactLength.value,r.exactLength.message,a),(0,g.setResponseValueAndErrors)(d,"maxItems",r.exactLength.value,r.exactLength.message,a)),d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseBigintDef:function(){return parseBigintDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseBigintDef(r,a){const d={type:"integer",format:"int64"};if(!r.checks)return d;for(const g of r.checks)switch(g.kind){case"min":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMinimum",g.value,g.message,a):(g.inclusive||(d.exclusiveMinimum=!0),(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a));break;case"max":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMaximum",g.value,g.message,a):(g.inclusive||(d.exclusiveMaximum=!0),(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a));break;case"multipleOf":(0,h.setResponseValueAndErrors)(d,"multipleOf",g.value,g.message,a)}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":function(r,a,d){"use strict";function parseBooleanDef(){return{type:"boolean"}}d.r(a),d.d(a,{parseBooleanDef:function(){return parseBooleanDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseBrandedDef:function(){return parseBrandedDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseBrandedDef(r,a){return(0,h.parseDef)(r.type._def,a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseCatchDef:function(){return parseCatchDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseCatchDef=(r,a)=>(0,h.parseDef)(r.innerType._def,a)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/date.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseDateDef:function(){return parseDateDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseDateDef(r,a,d){const h=d??a.dateStrategy;if(Array.isArray(h))return{anyOf:h.map((d,h)=>parseDateDef(r,a,d))};switch(h){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return integerDateParser(r,a)}}const integerDateParser=(r,a)=>{const d={type:"integer",format:"unix-time"};if("openApi3"===a.target)return d;for(const g of r.checks)switch(g.kind){case"min":(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a);break;case"max":(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a)}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/default.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseDefaultDef:function(){return parseDefaultDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseDefaultDef(r,a){return{...(0,h.parseDef)(r.innerType._def,a),default:r.defaultValue()}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseEffectsDef:function(){return parseEffectsDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseEffectsDef(r,a){return"input"===a.effectStrategy?(0,h.parseDef)(r.schema._def,a):(0,g.parseAnyDef)(a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":function(r,a,d){"use strict";function parseEnumDef(r){return{type:"string",enum:Array.from(r.values)}}d.r(a),d.d(a,{parseEnumDef:function(){return parseEnumDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseIntersectionDef:function(){return parseIntersectionDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const isJsonSchema7AllOfType=r=>(!("type"in r)||"string"!==r.type)&&"allOf"in r;function parseIntersectionDef(r,a){const d=[(0,h.parseDef)(r.left._def,{...a,currentPath:[...a.currentPath,"allOf","0"]}),(0,h.parseDef)(r.right._def,{...a,currentPath:[...a.currentPath,"allOf","1"]})].filter(r=>!!r);let g="jsonSchema2019-09"===a.target?{unevaluatedProperties:!1}:void 0;const y=[];return d.forEach(r=>{if(isJsonSchema7AllOfType(r))y.push(...r.allOf),void 0===r.unevaluatedProperties&&(g=void 0);else{let a=r;if("additionalProperties"in r&&!1===r.additionalProperties){const{additionalProperties:d,...h}=r;a=h}else g=void 0;y.push(a)}}),y.length?{allOf:y,...g}:void 0}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":function(r,a,d){"use strict";function parseLiteralDef(r,a){const d=typeof r.value;return"bigint"!==d&&"number"!==d&&"boolean"!==d&&"string"!==d?{type:Array.isArray(r.value)?"array":"object"}:"openApi3"===a.target?{type:"bigint"===d?"integer":d,enum:[r.value]}:{type:"bigint"===d?"integer":d,const:r.value}}d.r(a),d.d(a,{parseLiteralDef:function(){return parseLiteralDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/map.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseMapDef:function(){return parseMapDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseMapDef(r,a){if("record"===a.mapStrategy)return(0,g.parseRecordDef)(r,a);return{type:"array",maxItems:125,items:{type:"array",items:[(0,h.parseDef)(r.keyType._def,{...a,currentPath:[...a.currentPath,"items","items","0"]})||(0,y.parseAnyDef)(a),(0,h.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"items","items","1"]})||(0,y.parseAnyDef)(a)],minItems:2,maxItems:2}}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":function(r,a,d){"use strict";function parseNativeEnumDef(r){const a=r.values,d=Object.keys(r.values).filter(r=>"number"!=typeof a[a[r]]).map(r=>a[r]),h=Array.from(new Set(d.map(r=>typeof r)));return{type:1===h.length?"string"===h[0]?"string":"number":["string","number"],enum:d}}d.r(a),d.d(a,{parseNativeEnumDef:function(){return parseNativeEnumDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/never.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseNeverDef:function(){return parseNeverDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseNeverDef(r){return"openAi"===r.target?void 0:{not:(0,h.parseAnyDef)({...r,currentPath:[...r.currentPath,"not"]})}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/null.js":function(r,a,d){"use strict";function parseNullDef(r){return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"}}d.r(a),d.d(a,{parseNullDef:function(){return parseNullDef}})},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseNullableDef:function(){return parseNullableDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");function parseNullableDef(r,a){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(r.innerType._def.typeName)&&(!r.innerType._def.checks||!r.innerType._def.checks.length))return"openApi3"===a.target?{type:g.primitiveMappings[r.innerType._def.typeName],nullable:!0}:{type:[g.primitiveMappings[r.innerType._def.typeName],"null"]};if("openApi3"===a.target){const d=(0,h.parseDef)(r.innerType._def,{...a,currentPath:[...a.currentPath]});return d&&"$ref"in d?{allOf:[d],nullable:!0}:d&&{...d,nullable:!0}}const d=(0,h.parseDef)(r.innerType._def,{...a,currentPath:[...a.currentPath,"anyOf","0"]});return d&&{anyOf:[d,{type:"null"}]}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/number.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseNumberDef:function(){return parseNumberDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseNumberDef(r,a){const d={type:"number"};if(!r.checks)return d;for(const g of r.checks)switch(g.kind){case"int":d.type="integer",(0,h.addErrorMessage)(d,"type",g.message,a);break;case"min":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMinimum",g.value,g.message,a):(g.inclusive||(d.exclusiveMinimum=!0),(0,h.setResponseValueAndErrors)(d,"minimum",g.value,g.message,a));break;case"max":"jsonSchema7"===a.target?g.inclusive?(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a):(0,h.setResponseValueAndErrors)(d,"exclusiveMaximum",g.value,g.message,a):(g.inclusive||(d.exclusiveMaximum=!0),(0,h.setResponseValueAndErrors)(d,"maximum",g.value,g.message,a));break;case"multipleOf":(0,h.setResponseValueAndErrors)(d,"multipleOf",g.value,g.message,a)}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/object.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseObjectDef:function(){return parseObjectDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseObjectDef(r,a){const d="openAi"===a.target,g={type:"object",properties:{}},y=[],_=r.shape();for(const r in _){let b=_[r];if(void 0===b||void 0===b._def)continue;let P=safeIsOptional(b);P&&d&&("ZodOptional"===b._def.typeName&&(b=b._def.innerType),b.isNullable()||(b=b.nullable()),P=!1);const j=(0,h.parseDef)(b._def,{...a,currentPath:[...a.currentPath,"properties",r],propertyPath:[...a.currentPath,"properties",r]});void 0!==j&&(g.properties[r]=j,P||y.push(r))}y.length&&(g.required=y);const b=function decideAdditionalProperties(r,a){if("ZodNever"!==r.catchall._def.typeName)return(0,h.parseDef)(r.catchall._def,{...a,currentPath:[...a.currentPath,"additionalProperties"]});switch(r.unknownKeys){case"passthrough":return a.allowedAdditionalProperties;case"strict":return a.rejectedAdditionalProperties;case"strip":return"strict"===a.removeAdditionalStrategy?a.allowedAdditionalProperties:a.rejectedAdditionalProperties}}(r,a);return void 0!==b&&(g.additionalProperties=b),g}function safeIsOptional(r){try{return r.isOptional()}catch{return!0}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseOptionalDef:function(){return parseOptionalDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const parseOptionalDef=(r,a)=>{if(a.currentPath.toString()===a.propertyPath?.toString())return(0,h.parseDef)(r.innerType._def,a);const d=(0,h.parseDef)(r.innerType._def,{...a,currentPath:[...a.currentPath,"anyOf","1"]});return d?{anyOf:[{not:(0,g.parseAnyDef)(a)},d]}:(0,g.parseAnyDef)(a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parsePipelineDef:function(){return parsePipelineDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parsePipelineDef=(r,a)=>{if("input"===a.pipeStrategy)return(0,h.parseDef)(r.in._def,a);if("output"===a.pipeStrategy)return(0,h.parseDef)(r.out._def,a);const d=(0,h.parseDef)(r.in._def,{...a,currentPath:[...a.currentPath,"allOf","0"]});return{allOf:[d,(0,h.parseDef)(r.out._def,{...a,currentPath:[...a.currentPath,"allOf",d?"1":"0"]})].filter(r=>void 0!==r)}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parsePromiseDef:function(){return parsePromiseDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parsePromiseDef(r,a){return(0,h.parseDef)(r.type._def,a)}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseReadonlyDef:function(){return parseReadonlyDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseReadonlyDef=(r,a)=>(0,h.parseDef)(r.innerType._def,a)},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseRecordDef:function(){return parseRecordDef}});var h=d("./packages/node_modules/zod/v3/types.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),_=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),b=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseRecordDef(r,a){if("openAi"===a.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===a.target&&r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:r.keyType._def.values,properties:r.keyType._def.values.reduce((d,h)=>({...d,[h]:(0,g.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"properties",h]})??(0,b.parseAnyDef)(a)}),{}),additionalProperties:a.rejectedAdditionalProperties};const d={type:"object",additionalProperties:(0,g.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"additionalProperties"]})??a.allowedAdditionalProperties};if("openApi3"===a.target)return d;if(r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodString&&r.keyType._def.checks?.length){const{type:h,...g}=(0,y.parseStringDef)(r.keyType._def,a);return{...d,propertyNames:g}}if(r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodEnum)return{...d,propertyNames:{enum:r.keyType._def.values}};if(r.keyType?._def.typeName===h.ZodFirstPartyTypeKind.ZodBranded&&r.keyType._def.type._def.typeName===h.ZodFirstPartyTypeKind.ZodString&&r.keyType._def.type._def.checks?.length){const{type:h,...g}=(0,_.parseBrandedDef)(r.keyType._def,a);return{...d,propertyNames:g}}return d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/set.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseSetDef:function(){return parseSetDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseSetDef(r,a){const d={type:"array",uniqueItems:!0,items:(0,g.parseDef)(r.valueType._def,{...a,currentPath:[...a.currentPath,"items"]})};return r.minSize&&(0,h.setResponseValueAndErrors)(d,"minItems",r.minSize.value,r.minSize.message,a),r.maxSize&&(0,h.setResponseValueAndErrors)(d,"maxItems",r.maxSize.value,r.maxSize.message,a),d}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseStringDef:function(){return parseStringDef},zodPatterns:function(){return y}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");let g;const y={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===g&&(g=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),g),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function parseStringDef(r,a){const d={type:"string"};if(r.checks)for(const g of r.checks)switch(g.kind){case"min":(0,h.setResponseValueAndErrors)(d,"minLength","number"==typeof d.minLength?Math.max(d.minLength,g.value):g.value,g.message,a);break;case"max":(0,h.setResponseValueAndErrors)(d,"maxLength","number"==typeof d.maxLength?Math.min(d.maxLength,g.value):g.value,g.message,a);break;case"email":switch(a.emailStrategy){case"format:email":addFormat(d,"email",g.message,a);break;case"format:idn-email":addFormat(d,"idn-email",g.message,a);break;case"pattern:zod":addPattern(d,y.email,g.message,a)}break;case"url":addFormat(d,"uri",g.message,a);break;case"uuid":addFormat(d,"uuid",g.message,a);break;case"regex":addPattern(d,g.regex,g.message,a);break;case"cuid":addPattern(d,y.cuid,g.message,a);break;case"cuid2":addPattern(d,y.cuid2,g.message,a);break;case"startsWith":addPattern(d,RegExp(`^${escapeLiteralCheckValue(g.value,a)}`),g.message,a);break;case"endsWith":addPattern(d,RegExp(`${escapeLiteralCheckValue(g.value,a)}$`),g.message,a);break;case"datetime":addFormat(d,"date-time",g.message,a);break;case"date":addFormat(d,"date",g.message,a);break;case"time":addFormat(d,"time",g.message,a);break;case"duration":addFormat(d,"duration",g.message,a);break;case"length":(0,h.setResponseValueAndErrors)(d,"minLength","number"==typeof d.minLength?Math.max(d.minLength,g.value):g.value,g.message,a),(0,h.setResponseValueAndErrors)(d,"maxLength","number"==typeof d.maxLength?Math.min(d.maxLength,g.value):g.value,g.message,a);break;case"includes":addPattern(d,RegExp(escapeLiteralCheckValue(g.value,a)),g.message,a);break;case"ip":"v6"!==g.version&&addFormat(d,"ipv4",g.message,a),"v4"!==g.version&&addFormat(d,"ipv6",g.message,a);break;case"base64url":addPattern(d,y.base64url,g.message,a);break;case"jwt":addPattern(d,y.jwt,g.message,a);break;case"cidr":"v6"!==g.version&&addPattern(d,y.ipv4Cidr,g.message,a),"v4"!==g.version&&addPattern(d,y.ipv6Cidr,g.message,a);break;case"emoji":addPattern(d,y.emoji(),g.message,a);break;case"ulid":addPattern(d,y.ulid,g.message,a);break;case"base64":switch(a.base64Strategy){case"format:binary":addFormat(d,"binary",g.message,a);break;case"contentEncoding:base64":(0,h.setResponseValueAndErrors)(d,"contentEncoding","base64",g.message,a);break;case"pattern:zod":addPattern(d,y.base64,g.message,a)}break;case"nanoid":addPattern(d,y.nanoid,g.message,a);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return d}function escapeLiteralCheckValue(r,a){return"escape"===a.patternStrategy?function escapeNonAlphaNumeric(r){let a="";for(let d=0;dr.format)?(r.anyOf||(r.anyOf=[]),r.format&&(r.anyOf.push({format:r.format,...r.errorMessage&&g.errorMessages&&{errorMessage:{format:r.errorMessage.format}}}),delete r.format,r.errorMessage&&(delete r.errorMessage.format,0===Object.keys(r.errorMessage).length&&delete r.errorMessage)),r.anyOf.push({format:a,...d&&g.errorMessages&&{errorMessage:{format:d}}})):(0,h.setResponseValueAndErrors)(r,"format",a,d,g)}function addPattern(r,a,d,g){r.pattern||r.allOf?.some(r=>r.pattern)?(r.allOf||(r.allOf=[]),r.pattern&&(r.allOf.push({pattern:r.pattern,...r.errorMessage&&g.errorMessages&&{errorMessage:{pattern:r.errorMessage.pattern}}}),delete r.pattern,r.errorMessage&&(delete r.errorMessage.pattern,0===Object.keys(r.errorMessage).length&&delete r.errorMessage)),r.allOf.push({pattern:stringifyRegExpWithFlags(a,g),...d&&g.errorMessages&&{errorMessage:{pattern:d}}})):(0,h.setResponseValueAndErrors)(r,"pattern",stringifyRegExpWithFlags(a,g),d,g)}function stringifyRegExpWithFlags(r,a){if(!a.applyRegexFlags||!r.flags)return r.source;const d=r.flags.includes("i"),h=r.flags.includes("m"),g=r.flags.includes("s"),y=d?r.source.toLowerCase():r.source;let _="",b=!1,P=!1,j=!1;for(let r=0;r(0,h.parseDef)(r._def,{...a,currentPath:[...a.currentPath,"items",`${d}`]})).reduce((r,a)=>void 0===a?r:[...r,a],[]),additionalItems:(0,h.parseDef)(r.rest._def,{...a,currentPath:[...a.currentPath,"additionalItems"]})}:{type:"array",minItems:r.items.length,maxItems:r.items.length,items:r.items.map((r,d)=>(0,h.parseDef)(r._def,{...a,currentPath:[...a.currentPath,"items",`${d}`]})).reduce((r,a)=>void 0===a?r:[...r,a],[])}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseUndefinedDef:function(){return parseUndefinedDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUndefinedDef(r){return{not:(0,h.parseAnyDef)(r)}}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseUnionDef:function(){return parseUnionDef},primitiveMappings:function(){return g}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const g={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function parseUnionDef(r,a){if("openApi3"===a.target)return asAnyOf(r,a);const d=r.options instanceof Map?Array.from(r.options.values()):r.options;if(d.every(r=>r._def.typeName in g&&(!r._def.checks||!r._def.checks.length))){const r=d.reduce((r,a)=>{const d=g[a._def.typeName];return d&&!r.includes(d)?[...r,d]:r},[]);return{type:r.length>1?r:r[0]}}if(d.every(r=>"ZodLiteral"===r._def.typeName&&!r.description)){const r=d.reduce((r,a)=>{const d=typeof a._def.value;switch(d){case"string":case"number":case"boolean":return[...r,d];case"bigint":return[...r,"integer"];case"object":if(null===a._def.value)return[...r,"null"];default:return r}},[]);if(r.length===d.length){const a=r.filter((r,a,d)=>d.indexOf(r)===a);return{type:a.length>1?a:a[0],enum:d.reduce((r,a)=>r.includes(a._def.value)?r:[...r,a._def.value],[])}}}else if(d.every(r=>"ZodEnum"===r._def.typeName))return{type:"string",enum:d.reduce((r,a)=>[...r,...a._def.values.filter(a=>!r.includes(a))],[])};return asAnyOf(r,a)}const asAnyOf=(r,a)=>{const d=(r.options instanceof Map?Array.from(r.options.values()):r.options).map((r,d)=>(0,h.parseDef)(r._def,{...a,currentPath:[...a.currentPath,"anyOf",`${d}`]})).filter(r=>!!r&&(!a.strictUnions||"object"==typeof r&&Object.keys(r).length>0));return d.length?{anyOf:d}:void 0}},"./packages/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":function(r,a,d){"use strict";d.r(a),d.d(a,{parseUnknownDef:function(){return parseUnknownDef}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUnknownDef(r){return(0,h.parseAnyDef)(r)}},"./packages/node_modules/zod-to-json-schema/dist/esm/selectParser.js":function(r,a,d){"use strict";d.r(a),d.d(a,{selectParser:function(){return selectParser}});var h=d("./packages/node_modules/zod/v3/types.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),_=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),b=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),P=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),j=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),Z=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),D=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),N=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),$=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),z=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),L=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),F=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),M=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),q=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),U=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),V=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),K=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),H=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),B=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),G=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),ze=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),Fe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),qe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),Ue=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),Ve=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),Ke=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),He=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),Be=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),Qe=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");const selectParser=(r,a,d)=>{switch(a){case h.ZodFirstPartyTypeKind.ZodString:return(0,Ue.parseStringDef)(r,d);case h.ZodFirstPartyTypeKind.ZodNumber:return(0,K.parseNumberDef)(r,d);case h.ZodFirstPartyTypeKind.ZodObject:return(0,H.parseObjectDef)(r,d);case h.ZodFirstPartyTypeKind.ZodBigInt:return(0,_.parseBigintDef)(r,d);case h.ZodFirstPartyTypeKind.ZodBoolean:return(0,b.parseBooleanDef)();case h.ZodFirstPartyTypeKind.ZodDate:return(0,Z.parseDateDef)(r,d);case h.ZodFirstPartyTypeKind.ZodUndefined:return(0,Ke.parseUndefinedDef)(d);case h.ZodFirstPartyTypeKind.ZodNull:return(0,U.parseNullDef)(d);case h.ZodFirstPartyTypeKind.ZodArray:return(0,y.parseArrayDef)(r,d);case h.ZodFirstPartyTypeKind.ZodUnion:case h.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,He.parseUnionDef)(r,d);case h.ZodFirstPartyTypeKind.ZodIntersection:return(0,z.parseIntersectionDef)(r,d);case h.ZodFirstPartyTypeKind.ZodTuple:return(0,Ve.parseTupleDef)(r,d);case h.ZodFirstPartyTypeKind.ZodRecord:return(0,Fe.parseRecordDef)(r,d);case h.ZodFirstPartyTypeKind.ZodLiteral:return(0,L.parseLiteralDef)(r,d);case h.ZodFirstPartyTypeKind.ZodEnum:return(0,$.parseEnumDef)(r);case h.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,M.parseNativeEnumDef)(r);case h.ZodFirstPartyTypeKind.ZodNullable:return(0,V.parseNullableDef)(r,d);case h.ZodFirstPartyTypeKind.ZodOptional:return(0,B.parseOptionalDef)(r,d);case h.ZodFirstPartyTypeKind.ZodMap:return(0,F.parseMapDef)(r,d);case h.ZodFirstPartyTypeKind.ZodSet:return(0,qe.parseSetDef)(r,d);case h.ZodFirstPartyTypeKind.ZodLazy:return()=>r.getter()._def;case h.ZodFirstPartyTypeKind.ZodPromise:return(0,ze.parsePromiseDef)(r,d);case h.ZodFirstPartyTypeKind.ZodNaN:case h.ZodFirstPartyTypeKind.ZodNever:return(0,q.parseNeverDef)(d);case h.ZodFirstPartyTypeKind.ZodEffects:return(0,N.parseEffectsDef)(r,d);case h.ZodFirstPartyTypeKind.ZodAny:return(0,g.parseAnyDef)(d);case h.ZodFirstPartyTypeKind.ZodUnknown:return(0,Be.parseUnknownDef)(d);case h.ZodFirstPartyTypeKind.ZodDefault:return(0,D.parseDefaultDef)(r,d);case h.ZodFirstPartyTypeKind.ZodBranded:return(0,P.parseBrandedDef)(r,d);case h.ZodFirstPartyTypeKind.ZodReadonly:return(0,Qe.parseReadonlyDef)(r,d);case h.ZodFirstPartyTypeKind.ZodCatch:return(0,j.parseCatchDef)(r,d);case h.ZodFirstPartyTypeKind.ZodPipeline:return(0,G.parsePipelineDef)(r,d);case h.ZodFirstPartyTypeKind.ZodFunction:case h.ZodFirstPartyTypeKind.ZodVoid:case h.ZodFirstPartyTypeKind.ZodSymbol:default:return}}},"./packages/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js":function(r,a,d){"use strict";d.r(a),d.d(a,{zodToJsonSchema:function(){return zodToJsonSchema}});var h=d("./packages/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),g=d("./packages/node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=d("./packages/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const zodToJsonSchema=(r,a)=>{const d=(0,g.getRefs)(a);let _="object"==typeof a&&a.definitions?Object.entries(a.definitions).reduce((r,[a,g])=>({...r,[a]:(0,h.parseDef)(g._def,{...d,currentPath:[...d.basePath,d.definitionPath,a]},!0)??(0,y.parseAnyDef)(d)}),{}):void 0;const b="string"==typeof a?a:"title"===a?.nameStrategy?void 0:a?.name,P=(0,h.parseDef)(r._def,void 0===b?d:{...d,currentPath:[...d.basePath,d.definitionPath,b]},!1)??(0,y.parseAnyDef)(d),j="object"==typeof a&&void 0!==a.name&&"title"===a.nameStrategy?a.name:void 0;void 0!==j&&(P.title=j),d.flags.hasReferencedOpenAiAnyType&&(_||(_={}),_[d.openAiAnyTypeName]||(_[d.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===d.$refStrategy?"1":[...d.basePath,d.definitionPath,d.openAiAnyTypeName].join("/")}}));const Z=void 0===b?_?{...P,[d.definitionPath]:_}:P:{$ref:[..."relative"===d.$refStrategy?[]:d.basePath,d.definitionPath,b].join("/"),[d.definitionPath]:{..._,[b]:P}};return"jsonSchema7"===d.target?Z.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==d.target&&"openAi"!==d.target||(Z.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===d.target&&("anyOf"in Z||"oneOf"in Z||"allOf"in Z||"type"in Z&&Array.isArray(Z.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),Z}},"./packages/node_modules/zod/v3/ZodError.js":function(r,a,d){"use strict";d.r(a),d.d(a,{ZodError:function(){return ZodError},ZodIssueCode:function(){return g},quotelessJson:function(){return quotelessJson}});var h=d("./packages/node_modules/zod/v3/helpers/util.js");const g=h.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const a=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,a):this.__proto__=a,this.name="ZodError",this.issues=r}format(r){const a=r||function(r){return r.message},d={_errors:[]},processError=r=>{for(const h of r.issues)if("invalid_union"===h.code)h.unionErrors.map(processError);else if("invalid_return_type"===h.code)processError(h.returnTypeError);else if("invalid_arguments"===h.code)processError(h.argumentsError);else if(0===h.path.length)d._errors.push(a(h));else{let r=d,g=0;for(;gr.message){const a={},d=[];for(const h of this.issues)if(h.path.length>0){const d=h.path[0];a[d]=a[d]||[],a[d].push(r(h))}else d.push(r(h));return{formErrors:d,fieldErrors:a}}get formErrors(){return this.flatten()}}ZodError.create=r=>new ZodError(r)},"./packages/node_modules/zod/v3/errors.js":function(r,a,d){"use strict";d.r(a),d.d(a,{defaultErrorMap:function(){return h.default},getErrorMap:function(){return getErrorMap},setErrorMap:function(){return setErrorMap}});var h=d("./packages/node_modules/zod/v3/locales/en.js");let g=h.default;function setErrorMap(r){g=r}function getErrorMap(){return g}},"./packages/node_modules/zod/v3/helpers/errorUtil.js":function(r,a,d){"use strict";var h;d.r(a),d.d(a,{errorUtil:function(){return h}}),function(r){r.errToObj=r=>"string"==typeof r?{message:r}:r||{},r.toString=r=>"string"==typeof r?r:r?.message}(h||(h={}))},"./packages/node_modules/zod/v3/helpers/parseUtil.js":function(r,a,d){"use strict";d.r(a),d.d(a,{DIRTY:function(){return DIRTY},EMPTY_PATH:function(){return y},INVALID:function(){return _},OK:function(){return OK},ParseStatus:function(){return ParseStatus},addIssueToContext:function(){return addIssueToContext},isAborted:function(){return isAborted},isAsync:function(){return isAsync},isDirty:function(){return isDirty},isValid:function(){return isValid},makeIssue:function(){return makeIssue}});var h=d("./packages/node_modules/zod/v3/errors.js"),g=d("./packages/node_modules/zod/v3/locales/en.js");const makeIssue=r=>{const{data:a,path:d,errorMaps:h,issueData:g}=r,y=[...d,...g.path||[]],_={...g,path:y};if(void 0!==g.message)return{...g,path:y,message:g.message};let b="";const P=h.filter(r=>!!r).slice().reverse();for(const r of P)b=r(_,{data:a,defaultError:b}).message;return{...g,path:y,message:b}},y=[];function addIssueToContext(r,a){const d=(0,h.getErrorMap)(),y=makeIssue({issueData:a,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,d,d===g.default?void 0:g.default].filter(r=>!!r)});r.common.issues.push(y)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(r,a){const d=[];for(const h of a){if("aborted"===h.status)return _;"dirty"===h.status&&r.dirty(),d.push(h.value)}return{status:r.value,value:d}}static async mergeObjectAsync(r,a){const d=[];for(const r of a){const a=await r.key,h=await r.value;d.push({key:a,value:h})}return ParseStatus.mergeObjectSync(r,d)}static mergeObjectSync(r,a){const d={};for(const h of a){const{key:a,value:g}=h;if("aborted"===a.status)return _;if("aborted"===g.status)return _;"dirty"===a.status&&r.dirty(),"dirty"===g.status&&r.dirty(),"__proto__"===a.value||void 0===g.value&&!h.alwaysSet||(d[a.value]=g.value)}return{status:r.value,value:d}}}const _=Object.freeze({status:"aborted"}),DIRTY=r=>({status:"dirty",value:r}),OK=r=>({status:"valid",value:r}),isAborted=r=>"aborted"===r.status,isDirty=r=>"dirty"===r.status,isValid=r=>"valid"===r.status,isAsync=r=>"undefined"!=typeof Promise&&r instanceof Promise},"./packages/node_modules/zod/v3/helpers/util.js":function(r,a,d){"use strict";var h,g;d.r(a),d.d(a,{ZodParsedType:function(){return y},getParsedType:function(){return getParsedType},objectUtil:function(){return g},util:function(){return h}}),function(r){r.assertEqual=r=>{},r.assertIs=function assertIs(r){},r.assertNever=function assertNever(r){throw new Error},r.arrayToEnum=r=>{const a={};for(const d of r)a[d]=d;return a},r.getValidEnumValues=a=>{const d=r.objectKeys(a).filter(r=>"number"!=typeof a[a[r]]),h={};for(const r of d)h[r]=a[r];return r.objectValues(h)},r.objectValues=a=>r.objectKeys(a).map(function(r){return a[r]}),r.objectKeys="function"==typeof Object.keys?r=>Object.keys(r):r=>{const a=[];for(const d in r)Object.prototype.hasOwnProperty.call(r,d)&&a.push(d);return a},r.find=(r,a)=>{for(const d of r)if(a(d))return d},r.isInteger="function"==typeof Number.isInteger?r=>Number.isInteger(r):r=>"number"==typeof r&&Number.isFinite(r)&&Math.floor(r)===r,r.joinValues=function joinValues(r,a=" | "){return r.map(r=>"string"==typeof r?`'${r}'`:r).join(a)},r.jsonStringifyReplacer=(r,a)=>"bigint"==typeof a?a.toString():a}(h||(h={})),function(r){r.mergeShapes=(r,a)=>({...r,...a})}(g||(g={}));const y=h.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=r=>{switch(typeof r){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(r)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(r)?y.array:null===r?y.null:r.then&&"function"==typeof r.then&&r.catch&&"function"==typeof r.catch?y.promise:"undefined"!=typeof Map&&r instanceof Map?y.map:"undefined"!=typeof Set&&r instanceof Set?y.set:"undefined"!=typeof Date&&r instanceof Date?y.date:y.object;default:return y.unknown}}},"./packages/node_modules/zod/v3/locales/en.js":function(r,a,d){"use strict";d.r(a);var h=d("./packages/node_modules/zod/v3/ZodError.js"),g=d("./packages/node_modules/zod/v3/helpers/util.js");a.default=(r,a)=>{let d;switch(r.code){case h.ZodIssueCode.invalid_type:d=r.received===g.ZodParsedType.undefined?"Required":`Expected ${r.expected}, received ${r.received}`;break;case h.ZodIssueCode.invalid_literal:d=`Invalid literal value, expected ${JSON.stringify(r.expected,g.util.jsonStringifyReplacer)}`;break;case h.ZodIssueCode.unrecognized_keys:d=`Unrecognized key(s) in object: ${g.util.joinValues(r.keys,", ")}`;break;case h.ZodIssueCode.invalid_union:d="Invalid input";break;case h.ZodIssueCode.invalid_union_discriminator:d=`Invalid discriminator value. Expected ${g.util.joinValues(r.options)}`;break;case h.ZodIssueCode.invalid_enum_value:d=`Invalid enum value. Expected ${g.util.joinValues(r.options)}, received '${r.received}'`;break;case h.ZodIssueCode.invalid_arguments:d="Invalid function arguments";break;case h.ZodIssueCode.invalid_return_type:d="Invalid function return type";break;case h.ZodIssueCode.invalid_date:d="Invalid date";break;case h.ZodIssueCode.invalid_string:"object"==typeof r.validation?"includes"in r.validation?(d=`Invalid input: must include "${r.validation.includes}"`,"number"==typeof r.validation.position&&(d=`${d} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?d=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?d=`Invalid input: must end with "${r.validation.endsWith}"`:g.util.assertNever(r.validation):d="regex"!==r.validation?`Invalid ${r.validation}`:"Invalid";break;case h.ZodIssueCode.too_small:d="array"===r.type?`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:"string"===r.type?`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:"number"===r.type||"bigint"===r.type?`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:"date"===r.type?`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:"Invalid input";break;case h.ZodIssueCode.too_big:d="array"===r.type?`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:"string"===r.type?`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:"number"===r.type?`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:"bigint"===r.type?`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:"date"===r.type?`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:"Invalid input";break;case h.ZodIssueCode.custom:d="Invalid input";break;case h.ZodIssueCode.invalid_intersection_types:d="Intersection results could not be merged";break;case h.ZodIssueCode.not_multiple_of:d=`Number must be a multiple of ${r.multipleOf}`;break;case h.ZodIssueCode.not_finite:d="Number must be finite";break;default:d=a.defaultError,g.util.assertNever(r)}return{message:d}}},"./packages/node_modules/zod/v3/types.js":function(r,a,d){"use strict";d.r(a),d.d(a,{BRAND:function(){return Fe},NEVER:function(){return St},Schema:function(){return ZodType},ZodAny:function(){return ZodAny},ZodArray:function(){return ZodArray},ZodBigInt:function(){return ZodBigInt},ZodBoolean:function(){return ZodBoolean},ZodBranded:function(){return ZodBranded},ZodCatch:function(){return ZodCatch},ZodDate:function(){return ZodDate},ZodDefault:function(){return ZodDefault},ZodDiscriminatedUnion:function(){return ZodDiscriminatedUnion},ZodEffects:function(){return ZodEffects},ZodEnum:function(){return ZodEnum},ZodFirstPartyTypeKind:function(){return Ue},ZodFunction:function(){return ZodFunction},ZodIntersection:function(){return ZodIntersection},ZodLazy:function(){return ZodLazy},ZodLiteral:function(){return ZodLiteral},ZodMap:function(){return ZodMap},ZodNaN:function(){return ZodNaN},ZodNativeEnum:function(){return ZodNativeEnum},ZodNever:function(){return ZodNever},ZodNull:function(){return ZodNull},ZodNullable:function(){return ZodNullable},ZodNumber:function(){return ZodNumber},ZodObject:function(){return ZodObject},ZodOptional:function(){return ZodOptional},ZodPipeline:function(){return ZodPipeline},ZodPromise:function(){return ZodPromise},ZodReadonly:function(){return ZodReadonly},ZodRecord:function(){return ZodRecord},ZodSchema:function(){return ZodType},ZodSet:function(){return ZodSet},ZodString:function(){return ZodString},ZodSymbol:function(){return ZodSymbol},ZodTransformer:function(){return ZodEffects},ZodTuple:function(){return ZodTuple},ZodType:function(){return ZodType},ZodUndefined:function(){return ZodUndefined},ZodUnion:function(){return ZodUnion},ZodUnknown:function(){return ZodUnknown},ZodVoid:function(){return ZodVoid},any:function(){return et},array:function(){return at},bigint:function(){return Be},boolean:function(){return Qe},coerce:function(){return jt},custom:function(){return custom},date:function(){return Je},datetimeRegex:function(){return datetimeRegex},discriminatedUnion:function(){return dt},effect:function(){return bt},enum:function(){return vt},function:function(){return ht},instanceof:function(){return instanceOfType},intersection:function(){return ct},late:function(){return qe},lazy:function(){return ft},literal:function(){return gt},map:function(){return pt},nan:function(){return He},nativeEnum:function(){return yt},never:function(){return rt},null:function(){return Xe},nullable:function(){return kt},number:function(){return Ke},object:function(){return nt},oboolean:function(){return oboolean},onumber:function(){return onumber},optional:function(){return Pt},ostring:function(){return ostring},pipeline:function(){return xt},preprocess:function(){return wt},promise:function(){return _t},record:function(){return lt},set:function(){return mt},strictObject:function(){return ot},string:function(){return Ve},symbol:function(){return We},transformer:function(){return bt},tuple:function(){return ut},undefined:function(){return Ye},union:function(){return it},unknown:function(){return tt},void:function(){return st}});var h=d("./packages/node_modules/zod/v3/ZodError.js"),g=d("./packages/node_modules/zod/v3/errors.js"),y=d("./packages/node_modules/zod/v3/locales/en.js"),_=d("./packages/node_modules/zod/v3/helpers/errorUtil.js"),b=d("./packages/node_modules/zod/v3/helpers/parseUtil.js"),P=d("./packages/node_modules/zod/v3/helpers/util.js");class ParseInputLazyPath{constructor(r,a,d,h){this._cachedPath=[],this.parent=r,this.data=a,this._path=d,this._key=h}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(r,a)=>{if((0,b.isValid)(a))return{success:!0,data:a.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const a=new h.ZodError(r.common.issues);return this._error=a,this._error}}};function processCreateParams(r){if(!r)return{};const{errorMap:a,invalid_type_error:d,required_error:h,description:g}=r;if(a&&(d||h))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(a)return{errorMap:a,description:g};return{errorMap:(a,g)=>{const{message:y}=r;return"invalid_enum_value"===a.code?{message:y??g.defaultError}:void 0===g.data?{message:y??h??g.defaultError}:"invalid_type"!==a.code?{message:g.defaultError}:{message:y??d??g.defaultError}},description:g}}class ZodType{get description(){return this._def.description}_getType(r){return(0,P.getParsedType)(r.data)}_getOrReturnCtx(r,a){return a||{common:r.parent.common,data:r.data,parsedType:(0,P.getParsedType)(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new b.ParseStatus,ctx:{common:r.parent.common,data:r.data,parsedType:(0,P.getParsedType)(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){const a=this._parse(r);if((0,b.isAsync)(a))throw new Error("Synchronous parse encountered promise.");return a}_parseAsync(r){const a=this._parse(r);return Promise.resolve(a)}parse(r,a){const d=this.safeParse(r,a);if(d.success)return d.data;throw d.error}safeParse(r,a){const d={common:{issues:[],async:a?.async??!1,contextualErrorMap:a?.errorMap},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:(0,P.getParsedType)(r)},h=this._parseSync({data:r,path:d.path,parent:d});return handleResult(d,h)}"~validate"(r){const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:(0,P.getParsedType)(r)};if(!this["~standard"].async)try{const d=this._parseSync({data:r,path:[],parent:a});return(0,b.isValid)(d)?{value:d.value}:{issues:a.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:r,path:[],parent:a}).then(r=>(0,b.isValid)(r)?{value:r.value}:{issues:a.common.issues})}async parseAsync(r,a){const d=await this.safeParseAsync(r,a);if(d.success)return d.data;throw d.error}async safeParseAsync(r,a){const d={common:{issues:[],contextualErrorMap:a?.errorMap,async:!0},path:a?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:(0,P.getParsedType)(r)},h=this._parse({data:r,path:d.path,parent:d}),g=await((0,b.isAsync)(h)?h:Promise.resolve(h));return handleResult(d,g)}refine(r,a){const getIssueProperties=r=>"string"==typeof a||void 0===a?{message:a}:"function"==typeof a?a(r):a;return this._refinement((a,d)=>{const g=r(a),setError=()=>d.addIssue({code:h.ZodIssueCode.custom,...getIssueProperties(a)});return"undefined"!=typeof Promise&&g instanceof Promise?g.then(r=>!!r||(setError(),!1)):!!g||(setError(),!1)})}refinement(r,a){return this._refinement((d,h)=>!!r(d)||(h.addIssue("function"==typeof a?a(d,h):a),!1))}_refinement(r){return new ZodEffects({schema:this,typeName:Ue.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(r){return ZodUnion.create([this,r],this._def)}and(r){return ZodIntersection.create(this,r,this._def)}transform(r){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:Ue.ZodEffects,effect:{type:"transform",transform:r}})}default(r){const a="function"==typeof r?r:()=>r;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:a,typeName:Ue.ZodDefault})}brand(){return new ZodBranded({typeName:Ue.ZodBranded,type:this,...processCreateParams(this._def)})}catch(r){const a="function"==typeof r?r:()=>r;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:a,typeName:Ue.ZodCatch})}describe(r){return new(0,this.constructor)({...this._def,description:r})}pipe(r){return ZodPipeline.create(this,r)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const j=/^c[^\s-]{8,}$/i,Z=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Z]{26}$/i,N=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$=/^[a-z0-9_-]{21}$/i,z=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,L=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const q=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,U=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,B=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,G="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ze=new RegExp(`^${G}$`);function timeRegexSource(r){let a="[0-5]\\d";r.precision?a=`${a}\\.\\d{${r.precision}}`:null==r.precision&&(a=`${a}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${a})${r.precision?"+":"?"}`}function timeRegex(r){return new RegExp(`^${timeRegexSource(r)}$`)}function datetimeRegex(r){let a=`${G}T${timeRegexSource(r)}`;const d=[];return d.push(r.local?"Z?":"Z"),r.offset&&d.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${d.join("|")})`,new RegExp(`^${a}$`)}function isValidIP(r,a){return!("v4"!==a&&a||!q.test(r))||!("v6"!==a&&a||!V.test(r))}function isValidJWT(r,a){if(!z.test(r))return!1;try{const[d]=r.split(".");if(!d)return!1;const h=d.replace(/-/g,"+").replace(/_/g,"/").padEnd(d.length+(4-d.length%4)%4,"="),g=JSON.parse(atob(h));return"object"==typeof g&&null!==g&&((!("typ"in g)||"JWT"===g?.typ)&&(!!g.alg&&(!a||g.alg===a)))}catch{return!1}}function isValidCidr(r,a){return!("v4"!==a&&a||!U.test(r))||!("v6"!==a&&a||!K.test(r))}class ZodString extends ZodType{_parse(r){this._def.coerce&&(r.data=String(r.data));if(this._getType(r)!==P.ZodParsedType.string){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.string,received:a.parsedType}),b.INVALID}const a=new b.ParseStatus;let d;for(const g of this._def.checks)if("min"===g.kind)r.data.lengthg.value&&(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),a.dirty());else if("length"===g.kind){const y=r.data.length>g.value,_=r.data.lengthr.test(a),{validation:a,code:h.ZodIssueCode.invalid_string,..._.errorUtil.errToObj(d)})}_addCheck(r){return new ZodString({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",..._.errorUtil.errToObj(r)})}url(r){return this._addCheck({kind:"url",..._.errorUtil.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",..._.errorUtil.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",..._.errorUtil.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",..._.errorUtil.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",..._.errorUtil.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",..._.errorUtil.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",..._.errorUtil.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",..._.errorUtil.errToObj(r)})}base64url(r){return this._addCheck({kind:"base64url",..._.errorUtil.errToObj(r)})}jwt(r){return this._addCheck({kind:"jwt",..._.errorUtil.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",..._.errorUtil.errToObj(r)})}cidr(r){return this._addCheck({kind:"cidr",..._.errorUtil.errToObj(r)})}datetime(r){return"string"==typeof r?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:void 0===r?.precision?null:r?.precision,offset:r?.offset??!1,local:r?.local??!1,..._.errorUtil.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return"string"==typeof r?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:void 0===r?.precision?null:r?.precision,..._.errorUtil.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",..._.errorUtil.errToObj(r)})}regex(r,a){return this._addCheck({kind:"regex",regex:r,..._.errorUtil.errToObj(a)})}includes(r,a){return this._addCheck({kind:"includes",value:r,position:a?.position,..._.errorUtil.errToObj(a?.message)})}startsWith(r,a){return this._addCheck({kind:"startsWith",value:r,..._.errorUtil.errToObj(a)})}endsWith(r,a){return this._addCheck({kind:"endsWith",value:r,..._.errorUtil.errToObj(a)})}min(r,a){return this._addCheck({kind:"min",value:r,..._.errorUtil.errToObj(a)})}max(r,a){return this._addCheck({kind:"max",value:r,..._.errorUtil.errToObj(a)})}length(r,a){return this._addCheck({kind:"length",value:r,..._.errorUtil.errToObj(a)})}nonempty(r){return this.min(1,_.errorUtil.errToObj(r))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>"datetime"===r.kind)}get isDate(){return!!this._def.checks.find(r=>"date"===r.kind)}get isTime(){return!!this._def.checks.find(r=>"time"===r.kind)}get isDuration(){return!!this._def.checks.find(r=>"duration"===r.kind)}get isEmail(){return!!this._def.checks.find(r=>"email"===r.kind)}get isURL(){return!!this._def.checks.find(r=>"url"===r.kind)}get isEmoji(){return!!this._def.checks.find(r=>"emoji"===r.kind)}get isUUID(){return!!this._def.checks.find(r=>"uuid"===r.kind)}get isNANOID(){return!!this._def.checks.find(r=>"nanoid"===r.kind)}get isCUID(){return!!this._def.checks.find(r=>"cuid"===r.kind)}get isCUID2(){return!!this._def.checks.find(r=>"cuid2"===r.kind)}get isULID(){return!!this._def.checks.find(r=>"ulid"===r.kind)}get isIP(){return!!this._def.checks.find(r=>"ip"===r.kind)}get isCIDR(){return!!this._def.checks.find(r=>"cidr"===r.kind)}get isBase64(){return!!this._def.checks.find(r=>"base64"===r.kind)}get isBase64url(){return!!this._def.checks.find(r=>"base64url"===r.kind)}get minLength(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxLength(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.valueh?d:h;return Number.parseInt(r.toFixed(g).replace(".",""))%Number.parseInt(a.toFixed(g).replace(".",""))/10**g}ZodString.create=r=>new ZodString({checks:[],typeName:Ue.ZodString,coerce:r?.coerce??!1,...processCreateParams(r)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){this._def.coerce&&(r.data=Number(r.data));if(this._getType(r)!==P.ZodParsedType.number){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.number,received:a.parsedType}),b.INVALID}let a;const d=new b.ParseStatus;for(const g of this._def.checks)if("int"===g.kind)P.util.isInteger(r.data)||(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:g.message}),d.dirty());else if("min"===g.kind){(g.inclusive?r.datag.value:r.data>=g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),d.dirty())}else"multipleOf"===g.kind?0!==floatSafeRemainder(r.data,g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.not_multiple_of,multipleOf:g.value,message:g.message}),d.dirty()):"finite"===g.kind?Number.isFinite(r.data)||(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.not_finite,message:g.message}),d.dirty()):P.util.assertNever(g);return{status:d.value,value:r.data}}gte(r,a){return this.setLimit("min",r,!0,_.errorUtil.toString(a))}gt(r,a){return this.setLimit("min",r,!1,_.errorUtil.toString(a))}lte(r,a){return this.setLimit("max",r,!0,_.errorUtil.toString(a))}lt(r,a){return this.setLimit("max",r,!1,_.errorUtil.toString(a))}setLimit(r,a,d,h){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:r,value:a,inclusive:d,message:_.errorUtil.toString(h)}]})}_addCheck(r){return new ZodNumber({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:_.errorUtil.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.errorUtil.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.errorUtil.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.errorUtil.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.errorUtil.toString(r)})}multipleOf(r,a){return this._addCheck({kind:"multipleOf",value:r,message:_.errorUtil.toString(a)})}finite(r){return this._addCheck({kind:"finite",message:_.errorUtil.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.errorUtil.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.errorUtil.toString(r)})}get minValue(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxValue(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.value"int"===r.kind||"multipleOf"===r.kind&&P.util.isInteger(r.value))}get isFinite(){let r=null,a=null;for(const d of this._def.checks){if("finite"===d.kind||"int"===d.kind||"multipleOf"===d.kind)return!0;"min"===d.kind?(null===a||d.value>a)&&(a=d.value):"max"===d.kind&&(null===r||d.valuenew ZodNumber({checks:[],typeName:Ue.ZodNumber,coerce:r?.coerce||!1,...processCreateParams(r)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce)try{r.data=BigInt(r.data)}catch{return this._getInvalidInput(r)}if(this._getType(r)!==P.ZodParsedType.bigint)return this._getInvalidInput(r);let a;const d=new b.ParseStatus;for(const g of this._def.checks)if("min"===g.kind){(g.inclusive?r.datag.value:r.data>=g.value)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_big,type:"bigint",maximum:g.value,inclusive:g.inclusive,message:g.message}),d.dirty())}else"multipleOf"===g.kind?r.data%g.value!==BigInt(0)&&(a=this._getOrReturnCtx(r,a),(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.not_multiple_of,multipleOf:g.value,message:g.message}),d.dirty()):P.util.assertNever(g);return{status:d.value,value:r.data}}_getInvalidInput(r){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.bigint,received:a.parsedType}),b.INVALID}gte(r,a){return this.setLimit("min",r,!0,_.errorUtil.toString(a))}gt(r,a){return this.setLimit("min",r,!1,_.errorUtil.toString(a))}lte(r,a){return this.setLimit("max",r,!0,_.errorUtil.toString(a))}lt(r,a){return this.setLimit("max",r,!1,_.errorUtil.toString(a))}setLimit(r,a,d,h){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:r,value:a,inclusive:d,message:_.errorUtil.toString(h)}]})}_addCheck(r){return new ZodBigInt({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.errorUtil.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.errorUtil.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.errorUtil.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.errorUtil.toString(r)})}multipleOf(r,a){return this._addCheck({kind:"multipleOf",value:r,message:_.errorUtil.toString(a)})}get minValue(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return r}get maxValue(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.valuenew ZodBigInt({checks:[],typeName:Ue.ZodBigInt,coerce:r?.coerce??!1,...processCreateParams(r)});class ZodBoolean extends ZodType{_parse(r){this._def.coerce&&(r.data=Boolean(r.data));if(this._getType(r)!==P.ZodParsedType.boolean){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.boolean,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodBoolean.create=r=>new ZodBoolean({typeName:Ue.ZodBoolean,coerce:r?.coerce||!1,...processCreateParams(r)});class ZodDate extends ZodType{_parse(r){this._def.coerce&&(r.data=new Date(r.data));if(this._getType(r)!==P.ZodParsedType.date){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.date,received:a.parsedType}),b.INVALID}if(Number.isNaN(r.data.getTime())){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_date}),b.INVALID}const a=new b.ParseStatus;let d;for(const g of this._def.checks)"min"===g.kind?r.data.getTime()g.value&&(d=this._getOrReturnCtx(r,d),(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),a.dirty()):P.util.assertNever(g);return{status:a.value,value:new Date(r.data.getTime())}}_addCheck(r){return new ZodDate({...this._def,checks:[...this._def.checks,r]})}min(r,a){return this._addCheck({kind:"min",value:r.getTime(),message:_.errorUtil.toString(a)})}max(r,a){return this._addCheck({kind:"max",value:r.getTime(),message:_.errorUtil.toString(a)})}get minDate(){let r=null;for(const a of this._def.checks)"min"===a.kind&&(null===r||a.value>r)&&(r=a.value);return null!=r?new Date(r):null}get maxDate(){let r=null;for(const a of this._def.checks)"max"===a.kind&&(null===r||a.valuenew ZodDate({checks:[],coerce:r?.coerce||!1,typeName:Ue.ZodDate,...processCreateParams(r)});class ZodSymbol extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.symbol){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.symbol,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodSymbol.create=r=>new ZodSymbol({typeName:Ue.ZodSymbol,...processCreateParams(r)});class ZodUndefined extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.undefined){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.undefined,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodUndefined.create=r=>new ZodUndefined({typeName:Ue.ZodUndefined,...processCreateParams(r)});class ZodNull extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.null){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.null,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodNull.create=r=>new ZodNull({typeName:Ue.ZodNull,...processCreateParams(r)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(r){return(0,b.OK)(r.data)}}ZodAny.create=r=>new ZodAny({typeName:Ue.ZodAny,...processCreateParams(r)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(r){return(0,b.OK)(r.data)}}ZodUnknown.create=r=>new ZodUnknown({typeName:Ue.ZodUnknown,...processCreateParams(r)});class ZodNever extends ZodType{_parse(r){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.never,received:a.parsedType}),b.INVALID}}ZodNever.create=r=>new ZodNever({typeName:Ue.ZodNever,...processCreateParams(r)});class ZodVoid extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.undefined){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.void,received:a.parsedType}),b.INVALID}return(0,b.OK)(r.data)}}ZodVoid.create=r=>new ZodVoid({typeName:Ue.ZodVoid,...processCreateParams(r)});class ZodArray extends ZodType{_parse(r){const{ctx:a,status:d}=this._processInputParams(r),g=this._def;if(a.parsedType!==P.ZodParsedType.array)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.array,received:a.parsedType}),b.INVALID;if(null!==g.exactLength){const r=a.data.length>g.exactLength.value,y=a.data.lengthg.maxLength.value&&((0,b.addIssueToContext)(a,{code:h.ZodIssueCode.too_big,maximum:g.maxLength.value,type:"array",inclusive:!0,exact:!1,message:g.maxLength.message}),d.dirty()),a.common.async)return Promise.all([...a.data].map((r,d)=>g.type._parseAsync(new ParseInputLazyPath(a,r,a.path,d)))).then(r=>b.ParseStatus.mergeArray(d,r));const y=[...a.data].map((r,d)=>g.type._parseSync(new ParseInputLazyPath(a,r,a.path,d)));return b.ParseStatus.mergeArray(d,y)}get element(){return this._def.type}min(r,a){return new ZodArray({...this._def,minLength:{value:r,message:_.errorUtil.toString(a)}})}max(r,a){return new ZodArray({...this._def,maxLength:{value:r,message:_.errorUtil.toString(a)}})}length(r,a){return new ZodArray({...this._def,exactLength:{value:r,message:_.errorUtil.toString(a)}})}nonempty(r){return this.min(1,r)}}function deepPartialify(r){if(r instanceof ZodObject){const a={};for(const d in r.shape){const h=r.shape[d];a[d]=ZodOptional.create(deepPartialify(h))}return new ZodObject({...r._def,shape:()=>a})}return r instanceof ZodArray?new ZodArray({...r._def,type:deepPartialify(r.element)}):r instanceof ZodOptional?ZodOptional.create(deepPartialify(r.unwrap())):r instanceof ZodNullable?ZodNullable.create(deepPartialify(r.unwrap())):r instanceof ZodTuple?ZodTuple.create(r.items.map(r=>deepPartialify(r))):r}ZodArray.create=(r,a)=>new ZodArray({type:r,minLength:null,maxLength:null,exactLength:null,typeName:Ue.ZodArray,...processCreateParams(a)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const r=this._def.shape(),a=P.util.objectKeys(r);return this._cached={shape:r,keys:a},this._cached}_parse(r){if(this._getType(r)!==P.ZodParsedType.object){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.object,received:a.parsedType}),b.INVALID}const{status:a,ctx:d}=this._processInputParams(r),{shape:g,keys:y}=this._getCached(),_=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const r in d.data)y.includes(r)||_.push(r);const j=[];for(const r of y){const a=g[r],h=d.data[r];j.push({key:{status:"valid",value:r},value:a._parse(new ParseInputLazyPath(d,h,d.path,r)),alwaysSet:r in d.data})}if(this._def.catchall instanceof ZodNever){const r=this._def.unknownKeys;if("passthrough"===r)for(const r of _)j.push({key:{status:"valid",value:r},value:{status:"valid",value:d.data[r]}});else if("strict"===r)_.length>0&&((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.unrecognized_keys,keys:_}),a.dirty());else if("strip"!==r)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const r=this._def.catchall;for(const a of _){const h=d.data[a];j.push({key:{status:"valid",value:a},value:r._parse(new ParseInputLazyPath(d,h,d.path,a)),alwaysSet:a in d.data})}}return d.common.async?Promise.resolve().then(async()=>{const r=[];for(const a of j){const d=await a.key,h=await a.value;r.push({key:d,value:h,alwaysSet:a.alwaysSet})}return r}).then(r=>b.ParseStatus.mergeObjectSync(a,r)):b.ParseStatus.mergeObjectSync(a,j)}get shape(){return this._def.shape()}strict(r){return _.errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==r?{errorMap:(a,d)=>{const h=this._def.errorMap?.(a,d).message??d.defaultError;return"unrecognized_keys"===a.code?{message:_.errorUtil.errToObj(r).message??h}:{message:h}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(r){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new ZodObject({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:Ue.ZodObject})}setKey(r,a){return this.augment({[r]:a})}catchall(r){return new ZodObject({...this._def,catchall:r})}pick(r){const a={};for(const d of P.util.objectKeys(r))r[d]&&this.shape[d]&&(a[d]=this.shape[d]);return new ZodObject({...this._def,shape:()=>a})}omit(r){const a={};for(const d of P.util.objectKeys(this.shape))r[d]||(a[d]=this.shape[d]);return new ZodObject({...this._def,shape:()=>a})}deepPartial(){return deepPartialify(this)}partial(r){const a={};for(const d of P.util.objectKeys(this.shape)){const h=this.shape[d];r&&!r[d]?a[d]=h:a[d]=h.optional()}return new ZodObject({...this._def,shape:()=>a})}required(r){const a={};for(const d of P.util.objectKeys(this.shape))if(r&&!r[d])a[d]=this.shape[d];else{let r=this.shape[d];for(;r instanceof ZodOptional;)r=r._def.innerType;a[d]=r}return new ZodObject({...this._def,shape:()=>a})}keyof(){return createZodEnum(P.util.objectKeys(this.shape))}}ZodObject.create=(r,a)=>new ZodObject({shape:()=>r,unknownKeys:"strip",catchall:ZodNever.create(),typeName:Ue.ZodObject,...processCreateParams(a)}),ZodObject.strictCreate=(r,a)=>new ZodObject({shape:()=>r,unknownKeys:"strict",catchall:ZodNever.create(),typeName:Ue.ZodObject,...processCreateParams(a)}),ZodObject.lazycreate=(r,a)=>new ZodObject({shape:r,unknownKeys:"strip",catchall:ZodNever.create(),typeName:Ue.ZodObject,...processCreateParams(a)});class ZodUnion extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r),d=this._def.options;if(a.common.async)return Promise.all(d.map(async r=>{const d={...a,common:{...a.common,issues:[]},parent:null};return{result:await r._parseAsync({data:a.data,path:a.path,parent:d}),ctx:d}})).then(function handleResults(r){for(const a of r)if("valid"===a.result.status)return a.result;for(const d of r)if("dirty"===d.result.status)return a.common.issues.push(...d.ctx.common.issues),d.result;const d=r.map(r=>new h.ZodError(r.ctx.common.issues));return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_union,unionErrors:d}),b.INVALID});{let r;const g=[];for(const h of d){const d={...a,common:{...a.common,issues:[]},parent:null},y=h._parseSync({data:a.data,path:a.path,parent:d});if("valid"===y.status)return y;"dirty"!==y.status||r||(r={result:y,ctx:d}),d.common.issues.length&&g.push(d.common.issues)}if(r)return a.common.issues.push(...r.ctx.common.issues),r.result;const y=g.map(r=>new h.ZodError(r));return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_union,unionErrors:y}),b.INVALID}}get options(){return this._def.options}}ZodUnion.create=(r,a)=>new ZodUnion({options:r,typeName:Ue.ZodUnion,...processCreateParams(a)});const getDiscriminator=r=>r instanceof ZodLazy?getDiscriminator(r.schema):r instanceof ZodEffects?getDiscriminator(r.innerType()):r instanceof ZodLiteral?[r.value]:r instanceof ZodEnum?r.options:r instanceof ZodNativeEnum?P.util.objectValues(r.enum):r instanceof ZodDefault?getDiscriminator(r._def.innerType):r instanceof ZodUndefined?[void 0]:r instanceof ZodNull?[null]:r instanceof ZodOptional?[void 0,...getDiscriminator(r.unwrap())]:r instanceof ZodNullable?[null,...getDiscriminator(r.unwrap())]:r instanceof ZodBranded||r instanceof ZodReadonly?getDiscriminator(r.unwrap()):r instanceof ZodCatch?getDiscriminator(r._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==P.ZodParsedType.object)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.object,received:a.parsedType}),b.INVALID;const d=this.discriminator,g=a.data[d],y=this.optionsMap.get(g);return y?a.common.async?y._parseAsync({data:a.data,path:a.path,parent:a}):y._parseSync({data:a.data,path:a.path,parent:a}):((0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),b.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,a,d){const h=new Map;for(const d of a){const a=getDiscriminator(d.shape[r]);if(!a.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(const g of a){if(h.has(g))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(g)}`);h.set(g,d)}}return new ZodDiscriminatedUnion({typeName:Ue.ZodDiscriminatedUnion,discriminator:r,options:a,optionsMap:h,...processCreateParams(d)})}}function mergeValues(r,a){const d=(0,P.getParsedType)(r),h=(0,P.getParsedType)(a);if(r===a)return{valid:!0,data:r};if(d===P.ZodParsedType.object&&h===P.ZodParsedType.object){const d=P.util.objectKeys(a),h=P.util.objectKeys(r).filter(r=>-1!==d.indexOf(r)),g={...r,...a};for(const d of h){const h=mergeValues(r[d],a[d]);if(!h.valid)return{valid:!1};g[d]=h.data}return{valid:!0,data:g}}if(d===P.ZodParsedType.array&&h===P.ZodParsedType.array){if(r.length!==a.length)return{valid:!1};const d=[];for(let h=0;h{if((0,b.isAborted)(r)||(0,b.isAborted)(g))return b.INVALID;const y=mergeValues(r.value,g.value);return y.valid?(((0,b.isDirty)(r)||(0,b.isDirty)(g))&&a.dirty(),{status:a.value,value:y.data}):((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_intersection_types}),b.INVALID)};return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([r,a])=>handleParsed(r,a)):handleParsed(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}}ZodIntersection.create=(r,a,d)=>new ZodIntersection({left:r,right:a,typeName:Ue.ZodIntersection,...processCreateParams(d)});class ZodTuple extends ZodType{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.array)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.array,received:d.parsedType}),b.INVALID;if(d.data.lengththis._def.items.length&&((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),a.dirty());const g=[...d.data].map((r,a)=>{const h=this._def.items[a]||this._def.rest;return h?h._parse(new ParseInputLazyPath(d,r,d.path,a)):null}).filter(r=>!!r);return d.common.async?Promise.all(g).then(r=>b.ParseStatus.mergeArray(a,r)):b.ParseStatus.mergeArray(a,g)}get items(){return this._def.items}rest(r){return new ZodTuple({...this._def,rest:r})}}ZodTuple.create=(r,a)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:r,typeName:Ue.ZodTuple,rest:null,...processCreateParams(a)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.object)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.object,received:d.parsedType}),b.INVALID;const g=[],y=this._def.keyType,_=this._def.valueType;for(const r in d.data)g.push({key:y._parse(new ParseInputLazyPath(d,r,d.path,r)),value:_._parse(new ParseInputLazyPath(d,d.data[r],d.path,r)),alwaysSet:r in d.data});return d.common.async?b.ParseStatus.mergeObjectAsync(a,g):b.ParseStatus.mergeObjectSync(a,g)}get element(){return this._def.valueType}static create(r,a,d){return new ZodRecord(a instanceof ZodType?{keyType:r,valueType:a,typeName:Ue.ZodRecord,...processCreateParams(d)}:{keyType:ZodString.create(),valueType:r,typeName:Ue.ZodRecord,...processCreateParams(a)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.map)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.map,received:d.parsedType}),b.INVALID;const g=this._def.keyType,y=this._def.valueType,_=[...d.data.entries()].map(([r,a],h)=>({key:g._parse(new ParseInputLazyPath(d,r,d.path,[h,"key"])),value:y._parse(new ParseInputLazyPath(d,a,d.path,[h,"value"]))}));if(d.common.async){const r=new Map;return Promise.resolve().then(async()=>{for(const d of _){const h=await d.key,g=await d.value;if("aborted"===h.status||"aborted"===g.status)return b.INVALID;"dirty"!==h.status&&"dirty"!==g.status||a.dirty(),r.set(h.value,g.value)}return{status:a.value,value:r}})}{const r=new Map;for(const d of _){const h=d.key,g=d.value;if("aborted"===h.status||"aborted"===g.status)return b.INVALID;"dirty"!==h.status&&"dirty"!==g.status||a.dirty(),r.set(h.value,g.value)}return{status:a.value,value:r}}}}ZodMap.create=(r,a,d)=>new ZodMap({valueType:a,keyType:r,typeName:Ue.ZodMap,...processCreateParams(d)});class ZodSet extends ZodType{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.parsedType!==P.ZodParsedType.set)return(0,b.addIssueToContext)(d,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.set,received:d.parsedType}),b.INVALID;const g=this._def;null!==g.minSize&&d.data.sizeg.maxSize.value&&((0,b.addIssueToContext)(d,{code:h.ZodIssueCode.too_big,maximum:g.maxSize.value,type:"set",inclusive:!0,exact:!1,message:g.maxSize.message}),a.dirty());const y=this._def.valueType;function finalizeSet(r){const d=new Set;for(const h of r){if("aborted"===h.status)return b.INVALID;"dirty"===h.status&&a.dirty(),d.add(h.value)}return{status:a.value,value:d}}const _=[...d.data.values()].map((r,a)=>y._parse(new ParseInputLazyPath(d,r,d.path,a)));return d.common.async?Promise.all(_).then(r=>finalizeSet(r)):finalizeSet(_)}min(r,a){return new ZodSet({...this._def,minSize:{value:r,message:_.errorUtil.toString(a)}})}max(r,a){return new ZodSet({...this._def,maxSize:{value:r,message:_.errorUtil.toString(a)}})}size(r,a){return this.min(r,a).max(r,a)}nonempty(r){return this.min(1,r)}}ZodSet.create=(r,a)=>new ZodSet({valueType:r,minSize:null,maxSize:null,typeName:Ue.ZodSet,...processCreateParams(a)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==P.ZodParsedType.function)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.function,received:a.parsedType}),b.INVALID;function makeArgsIssue(r,d){return(0,b.makeIssue)({data:r,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,g.getErrorMap)(),y.default].filter(r=>!!r),issueData:{code:h.ZodIssueCode.invalid_arguments,argumentsError:d}})}function makeReturnsIssue(r,d){return(0,b.makeIssue)({data:r,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,g.getErrorMap)(),y.default].filter(r=>!!r),issueData:{code:h.ZodIssueCode.invalid_return_type,returnTypeError:d}})}const d={errorMap:a.common.contextualErrorMap},_=a.data;if(this._def.returns instanceof ZodPromise){const r=this;return(0,b.OK)(async function(...a){const g=new h.ZodError([]),y=await r._def.args.parseAsync(a,d).catch(r=>{throw g.addIssue(makeArgsIssue(a,r)),g}),b=await Reflect.apply(_,this,y);return await r._def.returns._def.type.parseAsync(b,d).catch(r=>{throw g.addIssue(makeReturnsIssue(b,r)),g})})}{const r=this;return(0,b.OK)(function(...a){const g=r._def.args.safeParse(a,d);if(!g.success)throw new h.ZodError([makeArgsIssue(a,g.error)]);const y=Reflect.apply(_,this,g.data),b=r._def.returns.safeParse(y,d);if(!b.success)throw new h.ZodError([makeReturnsIssue(y,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new ZodFunction({...this._def,args:ZodTuple.create(r).rest(ZodUnknown.create())})}returns(r){return new ZodFunction({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,a,d){return new ZodFunction({args:r||ZodTuple.create([]).rest(ZodUnknown.create()),returns:a||ZodUnknown.create(),typeName:Ue.ZodFunction,...processCreateParams(d)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(r){const{ctx:a}=this._processInputParams(r);return this._def.getter()._parse({data:a.data,path:a.path,parent:a})}}ZodLazy.create=(r,a)=>new ZodLazy({getter:r,typeName:Ue.ZodLazy,...processCreateParams(a)});class ZodLiteral extends ZodType{_parse(r){if(r.data!==this._def.value){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{received:a.data,code:h.ZodIssueCode.invalid_literal,expected:this._def.value}),b.INVALID}return{status:"valid",value:r.data}}get value(){return this._def.value}}function createZodEnum(r,a){return new ZodEnum({values:r,typeName:Ue.ZodEnum,...processCreateParams(a)})}ZodLiteral.create=(r,a)=>new ZodLiteral({value:r,typeName:Ue.ZodLiteral,...processCreateParams(a)});class ZodEnum extends ZodType{_parse(r){if("string"!=typeof r.data){const a=this._getOrReturnCtx(r),d=this._def.values;return(0,b.addIssueToContext)(a,{expected:P.util.joinValues(d),received:a.parsedType,code:h.ZodIssueCode.invalid_type}),b.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(r.data)){const a=this._getOrReturnCtx(r),d=this._def.values;return(0,b.addIssueToContext)(a,{received:a.data,code:h.ZodIssueCode.invalid_enum_value,options:d}),b.INVALID}return(0,b.OK)(r.data)}get options(){return this._def.values}get enum(){const r={};for(const a of this._def.values)r[a]=a;return r}get Values(){const r={};for(const a of this._def.values)r[a]=a;return r}get Enum(){const r={};for(const a of this._def.values)r[a]=a;return r}extract(r,a=this._def){return ZodEnum.create(r,{...this._def,...a})}exclude(r,a=this._def){return ZodEnum.create(this.options.filter(a=>!r.includes(a)),{...this._def,...a})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(r){const a=P.util.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(r);if(d.parsedType!==P.ZodParsedType.string&&d.parsedType!==P.ZodParsedType.number){const r=P.util.objectValues(a);return(0,b.addIssueToContext)(d,{expected:P.util.joinValues(r),received:d.parsedType,code:h.ZodIssueCode.invalid_type}),b.INVALID}if(this._cache||(this._cache=new Set(P.util.getValidEnumValues(this._def.values))),!this._cache.has(r.data)){const r=P.util.objectValues(a);return(0,b.addIssueToContext)(d,{received:d.data,code:h.ZodIssueCode.invalid_enum_value,options:r}),b.INVALID}return(0,b.OK)(r.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(r,a)=>new ZodNativeEnum({values:r,typeName:Ue.ZodNativeEnum,...processCreateParams(a)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(r){const{ctx:a}=this._processInputParams(r);if(a.parsedType!==P.ZodParsedType.promise&&!1===a.common.async)return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.promise,received:a.parsedType}),b.INVALID;const d=a.parsedType===P.ZodParsedType.promise?a.data:Promise.resolve(a.data);return(0,b.OK)(d.then(r=>this._def.type.parseAsync(r,{path:a.path,errorMap:a.common.contextualErrorMap})))}}ZodPromise.create=(r,a)=>new ZodPromise({type:r,typeName:Ue.ZodPromise,...processCreateParams(a)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){const{status:a,ctx:d}=this._processInputParams(r),h=this._def.effect||null,g={addIssue:r=>{(0,b.addIssueToContext)(d,r),r.fatal?a.abort():a.dirty()},get path(){return d.path}};if(g.addIssue=g.addIssue.bind(g),"preprocess"===h.type){const r=h.transform(d.data,g);if(d.common.async)return Promise.resolve(r).then(async r=>{if("aborted"===a.value)return b.INVALID;const h=await this._def.schema._parseAsync({data:r,path:d.path,parent:d});return"aborted"===h.status?b.INVALID:"dirty"===h.status||"dirty"===a.value?(0,b.DIRTY)(h.value):h});{if("aborted"===a.value)return b.INVALID;const h=this._def.schema._parseSync({data:r,path:d.path,parent:d});return"aborted"===h.status?b.INVALID:"dirty"===h.status||"dirty"===a.value?(0,b.DIRTY)(h.value):h}}if("refinement"===h.type){const executeRefinement=r=>{const a=h.refinement(r,g);if(d.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return r};if(!1===d.common.async){const r=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?b.INVALID:("dirty"===r.status&&a.dirty(),executeRefinement(r.value),{status:a.value,value:r.value})}return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(r=>"aborted"===r.status?b.INVALID:("dirty"===r.status&&a.dirty(),executeRefinement(r.value).then(()=>({status:a.value,value:r.value}))))}if("transform"===h.type){if(!1===d.common.async){const r=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!(0,b.isValid)(r))return b.INVALID;const y=h.transform(r.value,g);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:y}}return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(r=>(0,b.isValid)(r)?Promise.resolve(h.transform(r.value,g)).then(r=>({status:a.value,value:r})):b.INVALID)}P.util.assertNever(h)}}ZodEffects.create=(r,a,d)=>new ZodEffects({schema:r,typeName:Ue.ZodEffects,effect:a,...processCreateParams(d)}),ZodEffects.createWithPreprocess=(r,a,d)=>new ZodEffects({schema:a,effect:{type:"preprocess",transform:r},typeName:Ue.ZodEffects,...processCreateParams(d)});class ZodOptional extends ZodType{_parse(r){return this._getType(r)===P.ZodParsedType.undefined?(0,b.OK)(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}ZodOptional.create=(r,a)=>new ZodOptional({innerType:r,typeName:Ue.ZodOptional,...processCreateParams(a)});class ZodNullable extends ZodType{_parse(r){return this._getType(r)===P.ZodParsedType.null?(0,b.OK)(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}}ZodNullable.create=(r,a)=>new ZodNullable({innerType:r,typeName:Ue.ZodNullable,...processCreateParams(a)});class ZodDefault extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r);let d=a.data;return a.parsedType===P.ZodParsedType.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:a.path,parent:a})}removeDefault(){return this._def.innerType}}ZodDefault.create=(r,a)=>new ZodDefault({innerType:r,typeName:Ue.ZodDefault,defaultValue:"function"==typeof a.default?a.default:()=>a.default,...processCreateParams(a)});class ZodCatch extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r),d={...a,common:{...a.common,issues:[]}},g=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return(0,b.isAsync)(g)?g.then(r=>({status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new h.ZodError(d.common.issues)},input:d.data})})):{status:"valid",value:"valid"===g.status?g.value:this._def.catchValue({get error(){return new h.ZodError(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(r,a)=>new ZodCatch({innerType:r,typeName:Ue.ZodCatch,catchValue:"function"==typeof a.catch?a.catch:()=>a.catch,...processCreateParams(a)});class ZodNaN extends ZodType{_parse(r){if(this._getType(r)!==P.ZodParsedType.nan){const a=this._getOrReturnCtx(r);return(0,b.addIssueToContext)(a,{code:h.ZodIssueCode.invalid_type,expected:P.ZodParsedType.nan,received:a.parsedType}),b.INVALID}return{status:"valid",value:r.data}}}ZodNaN.create=r=>new ZodNaN({typeName:Ue.ZodNaN,...processCreateParams(r)});const Fe=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(r){const{ctx:a}=this._processInputParams(r),d=a.data;return this._def.type._parse({data:d,path:a.path,parent:a})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(r){const{status:a,ctx:d}=this._processInputParams(r);if(d.common.async){return(async()=>{const r=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?b.INVALID:"dirty"===r.status?(a.dirty(),(0,b.DIRTY)(r.value)):this._def.out._parseAsync({data:r.value,path:d.path,parent:d})})()}{const r=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return"aborted"===r.status?b.INVALID:"dirty"===r.status?(a.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:d.path,parent:d})}}static create(r,a){return new ZodPipeline({in:r,out:a,typeName:Ue.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(r){const a=this._def.innerType._parse(r),freeze=r=>((0,b.isValid)(r)&&(r.value=Object.freeze(r.value)),r);return(0,b.isAsync)(a)?a.then(r=>freeze(r)):freeze(a)}unwrap(){return this._def.innerType}}function cleanParams(r,a){const d="function"==typeof r?r(a):"string"==typeof r?{message:r}:r;return"string"==typeof d?{message:d}:d}function custom(r,a={},d){return r?ZodAny.create().superRefine((h,g)=>{const y=r(h);if(y instanceof Promise)return y.then(r=>{if(!r){const r=cleanParams(a,h),y=r.fatal??d??!0;g.addIssue({code:"custom",...r,fatal:y})}});if(!y){const r=cleanParams(a,h),y=r.fatal??d??!0;g.addIssue({code:"custom",...r,fatal:y})}}):ZodAny.create()}ZodReadonly.create=(r,a)=>new ZodReadonly({innerType:r,typeName:Ue.ZodReadonly,...processCreateParams(a)});const qe={object:ZodObject.lazycreate};var Ue;!function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"}(Ue||(Ue={}));const instanceOfType=(r,a={message:`Input not instance of ${r.name}`})=>custom(a=>a instanceof r,a),Ve=ZodString.create,Ke=ZodNumber.create,He=ZodNaN.create,Be=ZodBigInt.create,Qe=ZodBoolean.create,Je=ZodDate.create,We=ZodSymbol.create,Ye=ZodUndefined.create,Xe=ZodNull.create,et=ZodAny.create,tt=ZodUnknown.create,rt=ZodNever.create,st=ZodVoid.create,at=ZodArray.create,nt=ZodObject.create,ot=ZodObject.strictCreate,it=ZodUnion.create,dt=ZodDiscriminatedUnion.create,ct=ZodIntersection.create,ut=ZodTuple.create,lt=ZodRecord.create,pt=ZodMap.create,mt=ZodSet.create,ht=ZodFunction.create,ft=ZodLazy.create,gt=ZodLiteral.create,vt=ZodEnum.create,yt=ZodNativeEnum.create,_t=ZodPromise.create,bt=ZodEffects.create,Pt=ZodOptional.create,kt=ZodNullable.create,wt=ZodEffects.createWithPreprocess,xt=ZodPipeline.create,ostring=()=>Ve().optional(),onumber=()=>Ke().optional(),oboolean=()=>Qe().optional(),jt={string:r=>ZodString.create({...r,coerce:!0}),number:r=>ZodNumber.create({...r,coerce:!0}),boolean:r=>ZodBoolean.create({...r,coerce:!0}),bigint:r=>ZodBigInt.create({...r,coerce:!0}),date:r=>ZodDate.create({...r,coerce:!0})},St=b.INVALID},"./packages/packages/libs/editor-mcp/src/angie-annotations.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{ANGIE_MODEL_PREFERENCES:function(){return h}});const h="angie/modelPreferences"},"./packages/packages/libs/editor-mcp/src/init.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{init:function(){return init},startMCPServer:function(){return startMCPServer}});var h=d("@elementor/editor-v1-adapters"),g=d("./packages/packages/libs/editor-mcp/src/mcp-registry.ts"),y=d("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts"),_=d("./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts");function init(){return(0,h.isExperimentActive)("editor_mcp")&&(0,_.isAngieAvailable)()?(0,y.getSDK)().waitForReady():Promise.resolve()}function startMCPServer(){if((0,h.isExperimentActive)("editor_mcp")&&(0,_.isAngieAvailable)()){const r=(0,y.getSDK)();r.waitForReady().then(()=>(0,g.activateMcpRegistration)(r))}return Promise.resolve()}document.addEventListener("DOMContentLoaded",()=>{startMCPServer()},{once:!0})},"./packages/packages/libs/editor-mcp/src/mcp-registry.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{activateMcpRegistration:function(){return activateMcpRegistration},getMCPByDomain:function(){return getMCPByDomain},registerMcp:function(){return registerMcp}});var h=d("@elementor/schema"),g=d("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),y=d("./packages/packages/libs/editor-mcp/src/angie-annotations.ts"),_=d("./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts"),b=d("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts");const P={},j={};let Z=void 0!==globalThis.jest;const registerMcp=(r,a)=>{const d=isAlphabet(a);P[d]=r};async function activateMcpRegistration(r){if(Z)return;Z=!0;const a=Object.entries(P);for await(const d of a){const[a,h]=d;await r.registerLocalServer({name:`editor-${a}`,server:h,version:"1.0.0",description:j[a]||a})}}const isAlphabet=r=>{if(!(!!r&&/^[a-z_]+$/.test(r)))throw new Error("Not alphabet");return r},getMCPByDomain=(r,a)=>{const d=`editor-${isAlphabet(r)}`;if(void 0!==globalThis.jest)return(0,_.mockMcpRegistry)();P[r]||(P[r]=new g.McpServer({name:d,version:"1.0.0"},{instructions:a?.instructions}));const D=P[r],{addTool:N}=function createToolRegistry(r){function addTool(a){const d=a.outputSchema;d&&(Object.assign(d,d.llm_instructions??{llm_instruction:h.z.string().optional().describe("Instructions for what to do next, Important to follow these Instructions!")}),Object.assign(d,d.errors??{errors:h.z.string().optional().describe("Error message if the tool failed")}));const g=a.schema?a.schema:{},toolCallback=async function(r,d){try{const h=await a.handler(a.schema?r:{},d);return{structuredContent:"string"==typeof h?void 0:h,content:[{type:"text",text:"string"==typeof h?h:JSON.stringify(h)}]}}catch(r){return{isError:!0,structuredContent:{errors:r.message||"Unknown error"},content:[{type:"text",text:r.message||"Unknown error"}]}}},_={destructiveHint:a.isDestructive,readOnlyHint:!a.isDestructive&&void 0,title:a.name};a.requiredResources&&(_["angie/requiredResources"]=a.requiredResources),a.modelPreferences&&(_[y.ANGIE_MODEL_PREFERENCES]=a.modelPreferences),r.registerTool(a.name,{description:a.description,inputSchema:g,outputSchema:d,title:a.name,annotations:_},toolCallback),Z&&r.sendToolListChanged()}return{addTool:addTool}}(D);return{waitForReady:()=>(0,b.getSDK)().waitForReady(),resource:async(...r)=>(await(0,b.getSDK)().waitForReady(),D.resource(...r)),sendResourceUpdated:(...r)=>new Promise(async()=>{await(0,b.getSDK)().waitForReady(),D.server.sendResourceUpdated(...r)}),mcpServer:D,addTool:N,setMCPDescription:a=>{j[r]=a},getActiveChatInfo:()=>{const r=localStorage.getItem("angie_active_chat_id");if(!r)return{expiresAt:0,sessionId:""};const a=JSON.parse(r);return{expiresAt:a.expiresAt,sessionId:a.sessionId}}}}},"./packages/packages/libs/editor-mcp/src/sampler.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{createSampler:function(){return createSampler}});var h=d("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const g={maxTokens:1e4,modelPreferences:"openai",model:"gpt-4o"},y={type:"object",properties:{content:{type:"string",description:"Result"}},required:["content"],additionalProperties:!1},createSampler=(r,a=g)=>{const{maxTokens:d=1e3,modelPreferences:_="openai",model:b="gpt-4o"}=a;return async a=>{const g={...a.systemPrompt?{systemPrompt:a.systemPrompt}:{}},P=a.requestParams||{},j=await r.sendRequest({method:"sampling/createMessage",params:{...P,maxTokens:d,modelPreferences:{hints:[{name:_}]},metadata:{model:b,...g,structured_output:a.structuredOutput||y},messages:a.messages}},h.SamplingMessageSchema);try{return JSON.parse(j.content.text)}catch{return j.content}}}},"./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{mockMcpRegistry:function(){return mockMcpRegistry}});const h=new Proxy({},{get:()=>function mockedFn(...r){}}),mockMcpRegistry=()=>({resource:async()=>{},sendResourceUpdated:()=>{},addTool:()=>{},setMCPDescription:()=>{},getActiveChatInfo(){return{sessionId:"mock-session-id",expiresAt:Date.now()+36e5}},mcpServer:h})},"./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{getSDK:function(){return getSDK}});var h=d("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");let g;const getSDK=()=>globalThis.__ELEMENTOR_MCP_DISABLED__?{}:(g||(g=new h.AngieMcpSdk),g)},"./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{isAngieAvailable:function(){return isAngieAvailable}});var h=d("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const isAngieAvailable=()=>!!(0,h.getAngieIframe)()},"./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts":function(r,a,d){"use strict";d.r(a),d.d(a,{toolPrompts:function(){return toolPrompts}});class ToolPrompts{_description="";_parameters={};_examples=[];_furtherInstructions=[];constructor(r){this.name=r}description(r){return void 0===r?this._description:(this._description=r,this)}parameter(r,a){return void 0===a?this._parameters[r]:(this._parameters[r]=`**${r}**:\n${a}`,this)}instruction(r){return this._furtherInstructions.push(r),this}example(r){return this._examples.push(r),this}get examples(){return this._examples.join("\n\n")}prompt(){return`# ${this.name}\n# Description\n${this._description}\n\n${this._parameters.length?"# Parameters":""}\n${Object.values(this._parameters).join("\n\n")}\n\n${this._examples.length?"# Examples":""}\n${this.examples}\n\n${this._furtherInstructions.length?"# Further Instructions":""}\n${this._furtherInstructions.join("\n\n")}\n`.trim()}}const toolPrompts=r=>new ToolPrompts(r)},"@elementor/editor-v1-adapters":function(r){"use strict";r.exports=window.elementorV2.editorV1Adapters},"@elementor/schema":function(r){"use strict";r.exports=window.elementorV2.schema}},a={};function __webpack_require__(d){var h=a[d];if(void 0!==h)return h.exports;var g=a[d]={exports:{}};return r[d].call(g.exports,g,g.exports,__webpack_require__),g.exports}__webpack_require__.n=function(r){var a=r&&r.__esModule?function(){return r.default}:function(){return r};return __webpack_require__.d(a,{a:a}),a},__webpack_require__.d=function(r,a){for(var d in a)__webpack_require__.o(a,d)&&!__webpack_require__.o(r,d)&&Object.defineProperty(r,d,{enumerable:!0,get:a[d]})},__webpack_require__.o=function(r,a){return Object.prototype.hasOwnProperty.call(r,a)},__webpack_require__.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var d={};!function(){"use strict";__webpack_require__.r(d),__webpack_require__.d(d,{ANGIE_MODEL_PREFERENCES:function(){return j.ANGIE_MODEL_PREFERENCES},McpServer:function(){return a.McpServer},ResourceTemplate:function(){return a.ResourceTemplate},SamplingMessageSchema:function(){return h.SamplingMessageSchema},activateMcpRegistration:function(){return _.activateMcpRegistration},createSampler:function(){return b.createSampler},getAngieSdk:function(){return getAngieSdk},getMCPByDomain:function(){return _.getMCPByDomain},init:function(){return g.init},isAngieAvailable:function(){return y.isAngieAvailable},registerMcp:function(){return _.registerMcp},toolPrompts:function(){return P.toolPrompts}});var r=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts"),a=__webpack_require__("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),h=__webpack_require__("./packages/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),g=__webpack_require__("./packages/packages/libs/editor-mcp/src/init.ts"),y=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts"),_=__webpack_require__("./packages/packages/libs/editor-mcp/src/mcp-registry.ts"),b=__webpack_require__("./packages/packages/libs/editor-mcp/src/sampler.ts"),P=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts"),j=__webpack_require__("./packages/packages/libs/editor-mcp/src/angie-annotations.ts");const getAngieSdk=()=>(0,r.getSDK)()}(),(window.elementorV2=window.elementorV2||{}).editorMcp=d}(),window.elementorV2.editorMcp?.init?.();
//# sourceMappingURL=editor-mcp.js.map