logseq-mcp 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +134 -26
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,13 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as i4}from"node:module";var l4=Object.create;var{getPrototypeOf:n4,defineProperty:G2,getOwnPropertyNames:u4}=Object;var c4=Object.prototype.hasOwnProperty;var p4=($,X,W)=>{W=$!=null?l4(n4($)):{};let J=X||!$||!$.__esModule?G2(W,"default",{value:$,enumerable:!0}):W;for(let Y of u4($))if(!c4.call(J,Y))G2(J,Y,{get:()=>$[Y],enumerable:!0});return J};var Q2=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var $1=i4(import.meta.url);var O4=Q2((m8,e$)=>{e$.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var K4=Q2((l8,B0)=>{var s1=$1("fs"),e1=$1("path"),$3=$1("os"),X3=$1("crypto"),W3=O4(),$2=W3.version,J3=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Y3($){let X={},W=$.toString();W=W.replace(/\r\n?/mg,`
|
|
3
|
-
`);let J;while((J=J3.exec(W))!=null){let Y=J[1],G=J[2]||"";G=G.trim();let H=G[0];if(G=G.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),H==='"')G=G.replace(/\\n/g,`
|
|
4
|
-
`),G=G.replace(/\\r/g,"\r");X[Y]=G}return X}function G3($){let X=U4($),W=k.configDotenv({path:X});if(!W.parsed){let H=new Error(`MISSING_DATA: Cannot parse ${X} for an unknown reason`);throw H.code="MISSING_DATA",H}let J=z4($).split(","),Y=J.length,G;for(let H=0;H<Y;H++)try{let w=J[H].trim(),B=w3(W,w);G=k.decrypt(B.ciphertext,B.key);break}catch(w){if(H+1>=Y)throw w}return k.parse(G)}function Q3($){console.log(`[dotenv@${$2}][INFO] ${$}`)}function H3($){console.log(`[dotenv@${$2}][WARN] ${$}`)}function C1($){console.log(`[dotenv@${$2}][DEBUG] ${$}`)}function z4($){if($&&$.DOTENV_KEY&&$.DOTENV_KEY.length>0)return $.DOTENV_KEY;if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0)return process.env.DOTENV_KEY;return""}function w3($,X){let W;try{W=new URL(X)}catch(w){if(w.code==="ERR_INVALID_URL"){let B=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw B.code="INVALID_DOTENV_KEY",B}throw w}let J=W.password;if(!J){let w=new Error("INVALID_DOTENV_KEY: Missing key part");throw w.code="INVALID_DOTENV_KEY",w}let Y=W.searchParams.get("environment");if(!Y){let w=new Error("INVALID_DOTENV_KEY: Missing environment part");throw w.code="INVALID_DOTENV_KEY",w}let G=`DOTENV_VAULT_${Y.toUpperCase()}`,H=$.parsed[G];if(!H){let w=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${G} in your .env.vault file.`);throw w.code="NOT_FOUND_DOTENV_ENVIRONMENT",w}return{ciphertext:H,key:J}}function U4($){let X=null;if($&&$.path&&$.path.length>0)if(Array.isArray($.path)){for(let W of $.path)if(s1.existsSync(W))X=W.endsWith(".vault")?W:`${W}.vault`}else X=$.path.endsWith(".vault")?$.path:`${$.path}.vault`;else X=e1.resolve(process.cwd(),".env.vault");if(s1.existsSync(X))return X;return null}function A4($){return $[0]==="~"?e1.join($3.homedir(),$.slice(1)):$}function B3($){Q3("Loading env from encrypted .env.vault");let X=k._parseVault($),W=process.env;if($&&$.processEnv!=null)W=$.processEnv;return k.populate(W,X,$),{parsed:X}}function D3($){let X=e1.resolve(process.cwd(),".env"),W="utf8",J=Boolean($&&$.debug);if($&&$.encoding)W=$.encoding;else if(J)C1("No encoding is specified. UTF-8 is used by default");let Y=[X];if($&&$.path)if(!Array.isArray($.path))Y=[A4($.path)];else{Y=[];for(let B of $.path)Y.push(A4(B))}let G,H={};for(let B of Y)try{let D=k.parse(s1.readFileSync(B,{encoding:W}));k.populate(H,D,$)}catch(D){if(J)C1(`Failed to load ${B} ${D.message}`);G=D}let w=process.env;if($&&$.processEnv!=null)w=$.processEnv;if(k.populate(w,H,$),G)return{parsed:H,error:G};else return{parsed:H}}function M3($){if(z4($).length===0)return k.configDotenv($);let X=U4($);if(!X)return H3(`You set DOTENV_KEY but you are missing a .env.vault file at ${X}. Did you forget to build it?`),k.configDotenv($);return k._configVault($)}function V3($,X){let W=Buffer.from(X.slice(-64),"hex"),J=Buffer.from($,"base64"),Y=J.subarray(0,12),G=J.subarray(-16);J=J.subarray(12,-16);try{let H=X3.createDecipheriv("aes-256-gcm",W,Y);return H.setAuthTag(G),`${H.update(J)}${H.final()}`}catch(H){let w=H instanceof RangeError,B=H.message==="Invalid key length",D=H.message==="Unsupported state or unable to authenticate data";if(w||B){let j=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw j.code="INVALID_DOTENV_KEY",j}else if(D){let j=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw j.code="DECRYPTION_FAILED",j}else throw H}}function j3($,X,W={}){let J=Boolean(W&&W.debug),Y=Boolean(W&&W.override);if(typeof X!=="object"){let G=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw G.code="OBJECT_REQUIRED",G}for(let G of Object.keys(X))if(Object.prototype.hasOwnProperty.call($,G)){if(Y===!0)$[G]=X[G];if(J)if(Y===!0)C1(`"${G}" is already defined and WAS overwritten`);else C1(`"${G}" is already defined and was NOT overwritten`)}else $[G]=X[G]}var k={configDotenv:D3,_configVault:B3,_parseVault:G3,config:M3,decrypt:V3,parse:Y3,populate:j3};l8.configDotenv=k.configDotenv;l8._configVault=k._configVault;l8._parseVault=k._parseVault;l8.config=k.config;l8.decrypt=k.decrypt;l8.parse=k.parse;l8.populate=k.populate;B0.exports=k});var _;(function($){$.assertEqual=(Y)=>Y;function X(Y){}$.assertIs=X;function W(Y){throw new Error}$.assertNever=W,$.arrayToEnum=(Y)=>{let G={};for(let H of Y)G[H]=H;return G},$.getValidEnumValues=(Y)=>{let G=$.objectKeys(Y).filter((w)=>typeof Y[Y[w]]!=="number"),H={};for(let w of G)H[w]=Y[w];return $.objectValues(H)},$.objectValues=(Y)=>{return $.objectKeys(Y).map(function(G){return Y[G]})},$.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let G=[];for(let H in Y)if(Object.prototype.hasOwnProperty.call(Y,H))G.push(H);return G},$.find=(Y,G)=>{for(let H of Y)if(G(H))return H;return},$.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&isFinite(Y)&&Math.floor(Y)===Y;function J(Y,G=" | "){return Y.map((H)=>typeof H==="string"?`'${H}'`:H).join(G)}$.joinValues=J,$.jsonStringifyReplacer=(Y,G)=>{if(typeof G==="bigint")return G.toString();return G}})(_||(_={}));var P1;(function($){$.mergeShapes=(X,W)=>{return{...X,...W}}})(P1||(P1={}));var A=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Q0=($)=>{switch(typeof $){case"undefined":return A.undefined;case"string":return A.string;case"number":return isNaN($)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":if(Array.isArray($))return A.array;if($===null)return A.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return A.promise;if(typeof Map!=="undefined"&&$ instanceof Map)return A.map;if(typeof Set!=="undefined"&&$ instanceof Set)return A.set;if(typeof Date!=="undefined"&&$ instanceof Date)return A.date;return A.object;default:return A.unknown}},M=_.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"]),d4=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class n extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(W)=>{this.issues=[...this.issues,W]},this.addIssues=(W=[])=>{this.issues=[...this.issues,...W]};let X=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,X);else this.__proto__=X;this.name="ZodError",this.issues=$}format($){let X=$||function(Y){return Y.message},W={_errors:[]},J=(Y)=>{for(let G of Y.issues)if(G.code==="invalid_union")G.unionErrors.map(J);else if(G.code==="invalid_return_type")J(G.returnTypeError);else if(G.code==="invalid_arguments")J(G.argumentsError);else if(G.path.length===0)W._errors.push(X(G));else{let H=W,w=0;while(w<G.path.length){let B=G.path[w];if(w!==G.path.length-1)H[B]=H[B]||{_errors:[]};else H[B]=H[B]||{_errors:[]},H[B]._errors.push(X(G));H=H[B],w++}}};return J(this),W}static assert($){if(!($ instanceof n))throw new Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(X)=>X.message){let X={},W=[];for(let J of this.issues)if(J.path.length>0)X[J.path[0]]=X[J.path[0]]||[],X[J.path[0]].push($(J));else W.push($(J));return{formErrors:W,fieldErrors:X}}get formErrors(){return this.flatten()}}n.create=($)=>{return new n($)};var _0=($,X)=>{let W;switch($.code){case M.invalid_type:if($.received===A.undefined)W="Required";else W=`Expected ${$.expected}, received ${$.received}`;break;case M.invalid_literal:W=`Invalid literal value, expected ${JSON.stringify($.expected,_.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:W=`Unrecognized key(s) in object: ${_.joinValues($.keys,", ")}`;break;case M.invalid_union:W="Invalid input";break;case M.invalid_union_discriminator:W=`Invalid discriminator value. Expected ${_.joinValues($.options)}`;break;case M.invalid_enum_value:W=`Invalid enum value. Expected ${_.joinValues($.options)}, received '${$.received}'`;break;case M.invalid_arguments:W="Invalid function arguments";break;case M.invalid_return_type:W="Invalid function return type";break;case M.invalid_date:W="Invalid date";break;case M.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(W=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")W=`${W} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)W=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)W=`Invalid input: must end with "${$.validation.endsWith}"`;else _.assertNever($.validation);else if($.validation!=="regex")W=`Invalid ${$.validation}`;else W="Invalid";break;case M.too_small:if($.type==="array")W=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")W=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")W=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")W=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else W="Invalid input";break;case M.too_big:if($.type==="array")W=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")W=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")W=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")W=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")W=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else W="Invalid input";break;case M.custom:W="Invalid input";break;case M.invalid_intersection_types:W="Intersection results could not be merged";break;case M.not_multiple_of:W=`Number must be a multiple of ${$.multipleOf}`;break;case M.not_finite:W="Number must be finite";break;default:W=X.defaultError,_.assertNever($)}return{message:W}},D2=_0;function o4($){D2=$}function X1(){return D2}var W1=($)=>{let{data:X,path:W,errorMaps:J,issueData:Y}=$,G=[...W,...Y.path||[]],H={...Y,path:G};if(Y.message!==void 0)return{...Y,path:G,message:Y.message};let w="",B=J.filter((D)=>!!D).slice().reverse();for(let D of B)w=D(H,{data:X,defaultError:w}).message;return{...Y,path:G,message:w}},r4=[];function O($,X){let W=X1(),J=W1({issueData:X,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,W,W===_0?void 0:_0].filter((Y)=>!!Y)});$.common.issues.push(J)}class g{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,X){let W=[];for(let J of X){if(J.status==="aborted")return S;if(J.status==="dirty")$.dirty();W.push(J.value)}return{status:$.value,value:W}}static async mergeObjectAsync($,X){let W=[];for(let J of X){let Y=await J.key,G=await J.value;W.push({key:Y,value:G})}return g.mergeObjectSync($,W)}static mergeObjectSync($,X){let W={};for(let J of X){let{key:Y,value:G}=J;if(Y.status==="aborted")return S;if(G.status==="aborted")return S;if(Y.status==="dirty")$.dirty();if(G.status==="dirty")$.dirty();if(Y.value!=="__proto__"&&(typeof G.value!=="undefined"||J.alwaysSet))W[Y.value]=G.value}return{status:$.value,value:W}}}var S=Object.freeze({status:"aborted"}),R0=($)=>({status:"dirty",value:$}),Z=($)=>({status:"valid",value:$}),T1=($)=>$.status==="aborted",k1=($)=>$.status==="dirty",A0=($)=>$.status==="valid",Z0=($)=>typeof Promise!=="undefined"&&$ instanceof Promise;function J1($,X,W,J){if(W==="a"&&!J)throw new TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!J:!X.has($))throw new TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?J:W==="a"?J.call($):J?J.value:X.get($)}function M2($,X,W,J,Y){if(J==="m")throw new TypeError("Private method is not writable");if(J==="a"&&!Y)throw new TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!Y:!X.has($))throw new TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?Y.call($,W):Y?Y.value=W:X.set($,W),W}var U;(function($){$.errToObj=(X)=>typeof X==="string"?{message:X}:X||{},$.toString=(X)=>typeof X==="string"?X:X===null||X===void 0?void 0:X.message})(U||(U={}));var g0,y0;class a{constructor($,X,W,J){this._cachedPath=[],this.parent=$,this.data=X,this._path=W,this._key=J}get path(){if(!this._cachedPath.length)if(this._key instanceof Array)this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var H2=($,X)=>{if(A0(X))return{success:!0,data:X.value};else{if(!$.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let W=new n($.common.issues);return this._error=W,this._error}}}};function q($){if(!$)return{};let{errorMap:X,invalid_type_error:W,required_error:J,description:Y}=$;if(X&&(W||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(X)return{errorMap:X,description:Y};return{errorMap:(H,w)=>{var B,D;let{message:j}=$;if(H.code==="invalid_enum_value")return{message:j!==null&&j!==void 0?j:w.defaultError};if(typeof w.data==="undefined")return{message:(B=j!==null&&j!==void 0?j:J)!==null&&B!==void 0?B:w.defaultError};if(H.code!=="invalid_type")return{message:w.defaultError};return{message:(D=j!==null&&j!==void 0?j:W)!==null&&D!==void 0?D:w.defaultError}},description:Y}}class N{get description(){return this._def.description}_getType($){return Q0($.data)}_getOrReturnCtx($,X){return X||{common:$.parent.common,data:$.data,parsedType:Q0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new g,ctx:{common:$.parent.common,data:$.data,parsedType:Q0($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let X=this._parse($);if(Z0(X))throw new Error("Synchronous parse encountered promise.");return X}_parseAsync($){let X=this._parse($);return Promise.resolve(X)}parse($,X){let W=this.safeParse($,X);if(W.success)return W.data;throw W.error}safeParse($,X){var W;let J={common:{issues:[],async:(W=X===null||X===void 0?void 0:X.async)!==null&&W!==void 0?W:!1,contextualErrorMap:X===null||X===void 0?void 0:X.errorMap},path:(X===null||X===void 0?void 0:X.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q0($)},Y=this._parseSync({data:$,path:J.path,parent:J});return H2(J,Y)}"~validate"($){var X,W;let J={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q0($)};if(!this["~standard"].async)try{let Y=this._parseSync({data:$,path:[],parent:J});return A0(Y)?{value:Y.value}:{issues:J.common.issues}}catch(Y){if((W=(X=Y===null||Y===void 0?void 0:Y.message)===null||X===void 0?void 0:X.toLowerCase())===null||W===void 0?void 0:W.includes("encountered"))this["~standard"].async=!0;J.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:J}).then((Y)=>A0(Y)?{value:Y.value}:{issues:J.common.issues})}async parseAsync($,X){let W=await this.safeParseAsync($,X);if(W.success)return W.data;throw W.error}async safeParseAsync($,X){let W={common:{issues:[],contextualErrorMap:X===null||X===void 0?void 0:X.errorMap,async:!0},path:(X===null||X===void 0?void 0:X.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:Q0($)},J=this._parse({data:$,path:W.path,parent:W}),Y=await(Z0(J)?J:Promise.resolve(J));return H2(W,Y)}refine($,X){let W=(J)=>{if(typeof X==="string"||typeof X==="undefined")return{message:X};else if(typeof X==="function")return X(J);else return X};return this._refinement((J,Y)=>{let G=$(J),H=()=>Y.addIssue({code:M.custom,...W(J)});if(typeof Promise!=="undefined"&&G instanceof Promise)return G.then((w)=>{if(!w)return H(),!1;else return!0});if(!G)return H(),!1;else return!0})}refinement($,X){return this._refinement((W,J)=>{if(!$(W))return J.addIssue(typeof X==="function"?X(W,J):X),!1;else return!0})}_refinement($){return new i({schema:this,typeName:V.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(X)=>this["~validate"](X)}}optional(){return u.create(this,this._def)}nullable(){return H0.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return r.create(this)}promise(){return F0.create(this,this._def)}or($){return I0.create([this,$],this._def)}and($){return b0.create(this,$,this._def)}transform($){return new i({...q(this._def),schema:this,typeName:V.ZodEffects,effect:{type:"transform",transform:$}})}default($){let X=typeof $==="function"?$:()=>$;return new k0({...q(this._def),innerType:this,defaultValue:X,typeName:V.ZodDefault})}brand(){return new G1({typeName:V.ZodBranded,type:this,...q(this._def)})}catch($){let X=typeof $==="function"?$:()=>$;return new x0({...q(this._def),innerType:this,catchValue:X,typeName:V.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return p0.create(this,$)}readonly(){return h0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var a4=/^c[^\s-]{8,}$/i,t4=/^[0-9a-z]+$/,s4=/^[0-9A-HJKMNP-TV-Z]{26}$/i,e4=/^[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,$6=/^[a-z0-9_-]{21}$/i,X6=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,W6=/^[-+]?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)?)??$/,J6=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Y6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",v1,G6=/^(?:(?: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])$/,Q6=/^(?:(?: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])$/,H6=/^(([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]))$/,w6=/^(([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])$/,B6=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,D6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,V2="((\\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])))",M6=new RegExp(`^${V2}$`);function j2($){let X="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if($.precision)X=`${X}\\.\\d{${$.precision}}`;else if($.precision==null)X=`${X}(\\.\\d+)?`;return X}function V6($){return new RegExp(`^${j2($)}$`)}function O2($){let X=`${V2}T${j2($)}`,W=[];if(W.push($.local?"Z?":"Z"),$.offset)W.push("([+-]\\d{2}:?\\d{2})");return X=`${X}(${W.join("|")})`,new RegExp(`^${X}$`)}function j6($,X){if((X==="v4"||!X)&&G6.test($))return!0;if((X==="v6"||!X)&&H6.test($))return!0;return!1}function O6($,X){if(!X6.test($))return!1;try{let[W]=$.split("."),J=W.replace(/-/g,"+").replace(/_/g,"/").padEnd(W.length+(4-W.length%4)%4,"="),Y=JSON.parse(atob(J));if(typeof Y!=="object"||Y===null)return!1;if(!Y.typ||!Y.alg)return!1;if(X&&Y.alg!==X)return!1;return!0}catch(W){return!1}}function A6($,X){if((X==="v4"||!X)&&Q6.test($))return!0;if((X==="v6"||!X)&&w6.test($))return!0;return!1}class o extends N{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==A.string){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_type,expected:A.string,received:Y.parsedType}),S}let W=new g,J=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if($.data.length<Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),W.dirty()}else if(Y.kind==="max"){if($.data.length>Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),W.dirty()}else if(Y.kind==="length"){let G=$.data.length>Y.value,H=$.data.length<Y.value;if(G||H){if(J=this._getOrReturnCtx($,J),G)O(J,{code:M.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});else if(H)O(J,{code:M.too_small,minimum:Y.value,type:"string",inclusive:!0,exact:!0,message:Y.message});W.dirty()}}else if(Y.kind==="email"){if(!J6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"email",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="emoji"){if(!v1)v1=new RegExp(Y6,"u");if(!v1.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"emoji",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="uuid"){if(!e4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"uuid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="nanoid"){if(!$6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"nanoid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="cuid"){if(!a4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"cuid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="cuid2"){if(!t4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"cuid2",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="ulid"){if(!s4.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"ulid",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="url")try{new URL($.data)}catch(G){J=this._getOrReturnCtx($,J),O(J,{validation:"url",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="regex"){if(Y.regex.lastIndex=0,!Y.regex.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"regex",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="trim")$.data=$.data.trim();else if(Y.kind==="includes"){if(!$.data.includes(Y.value,Y.position))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:{includes:Y.value,position:Y.position},message:Y.message}),W.dirty()}else if(Y.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(Y.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(Y.kind==="startsWith"){if(!$.data.startsWith(Y.value))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:{startsWith:Y.value},message:Y.message}),W.dirty()}else if(Y.kind==="endsWith"){if(!$.data.endsWith(Y.value))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:{endsWith:Y.value},message:Y.message}),W.dirty()}else if(Y.kind==="datetime"){if(!O2(Y).test($.data))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:"datetime",message:Y.message}),W.dirty()}else if(Y.kind==="date"){if(!M6.test($.data))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:"date",message:Y.message}),W.dirty()}else if(Y.kind==="time"){if(!V6(Y).test($.data))J=this._getOrReturnCtx($,J),O(J,{code:M.invalid_string,validation:"time",message:Y.message}),W.dirty()}else if(Y.kind==="duration"){if(!W6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"duration",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="ip"){if(!j6($.data,Y.version))J=this._getOrReturnCtx($,J),O(J,{validation:"ip",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="jwt"){if(!O6($.data,Y.alg))J=this._getOrReturnCtx($,J),O(J,{validation:"jwt",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="cidr"){if(!A6($.data,Y.version))J=this._getOrReturnCtx($,J),O(J,{validation:"cidr",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="base64"){if(!B6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"base64",code:M.invalid_string,message:Y.message}),W.dirty()}else if(Y.kind==="base64url"){if(!D6.test($.data))J=this._getOrReturnCtx($,J),O(J,{validation:"base64url",code:M.invalid_string,message:Y.message}),W.dirty()}else _.assertNever(Y);return{status:W.value,value:$.data}}_regex($,X,W){return this.refinement((J)=>$.test(J),{validation:X,code:M.invalid_string,...U.errToObj(W)})}_addCheck($){return new o({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...U.errToObj($)})}url($){return this._addCheck({kind:"url",...U.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...U.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...U.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...U.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...U.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...U.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...U.errToObj($)})}base64($){return this._addCheck({kind:"base64",...U.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...U.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...U.errToObj($)})}ip($){return this._addCheck({kind:"ip",...U.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...U.errToObj($)})}datetime($){var X,W;if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof($===null||$===void 0?void 0:$.precision)==="undefined"?null:$===null||$===void 0?void 0:$.precision,offset:(X=$===null||$===void 0?void 0:$.offset)!==null&&X!==void 0?X:!1,local:(W=$===null||$===void 0?void 0:$.local)!==null&&W!==void 0?W:!1,...U.errToObj($===null||$===void 0?void 0:$.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof($===null||$===void 0?void 0:$.precision)==="undefined"?null:$===null||$===void 0?void 0:$.precision,...U.errToObj($===null||$===void 0?void 0:$.message)})}duration($){return this._addCheck({kind:"duration",...U.errToObj($)})}regex($,X){return this._addCheck({kind:"regex",regex:$,...U.errToObj(X)})}includes($,X){return this._addCheck({kind:"includes",value:$,position:X===null||X===void 0?void 0:X.position,...U.errToObj(X===null||X===void 0?void 0:X.message)})}startsWith($,X){return this._addCheck({kind:"startsWith",value:$,...U.errToObj(X)})}endsWith($,X){return this._addCheck({kind:"endsWith",value:$,...U.errToObj(X)})}min($,X){return this._addCheck({kind:"min",value:$,...U.errToObj(X)})}max($,X){return this._addCheck({kind:"max",value:$,...U.errToObj(X)})}length($,X){return this._addCheck({kind:"length",value:$,...U.errToObj(X)})}nonempty($){return this.min(1,U.errToObj($))}trim(){return new o({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new o({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new o({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxLength(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}o.create=($)=>{var X;return new o({checks:[],typeName:V.ZodString,coerce:(X=$===null||$===void 0?void 0:$.coerce)!==null&&X!==void 0?X:!1,...q($)})};function z6($,X){let W=($.toString().split(".")[1]||"").length,J=(X.toString().split(".")[1]||"").length,Y=W>J?W:J,G=parseInt($.toFixed(Y).replace(".","")),H=parseInt(X.toFixed(Y).replace(".",""));return G%H/Math.pow(10,Y)}class M0 extends N{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==A.number){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_type,expected:A.number,received:Y.parsedType}),S}let W=void 0,J=new g;for(let Y of this._def.checks)if(Y.kind==="int"){if(!_.isInteger($.data))W=this._getOrReturnCtx($,W),O(W,{code:M.invalid_type,expected:"integer",received:"float",message:Y.message}),J.dirty()}else if(Y.kind==="min"){if(Y.inclusive?$.data<Y.value:$.data<=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_small,minimum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),J.dirty()}else if(Y.kind==="max"){if(Y.inclusive?$.data>Y.value:$.data>=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),J.dirty()}else if(Y.kind==="multipleOf"){if(z6($.data,Y.value)!==0)W=this._getOrReturnCtx($,W),O(W,{code:M.not_multiple_of,multipleOf:Y.value,message:Y.message}),J.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite($.data))W=this._getOrReturnCtx($,W),O(W,{code:M.not_finite,message:Y.message}),J.dirty()}else _.assertNever(Y);return{status:J.value,value:$.data}}gte($,X){return this.setLimit("min",$,!0,U.toString(X))}gt($,X){return this.setLimit("min",$,!1,U.toString(X))}lte($,X){return this.setLimit("max",$,!0,U.toString(X))}lt($,X){return this.setLimit("max",$,!1,U.toString(X))}setLimit($,X,W,J){return new M0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:W,message:U.toString(J)}]})}_addCheck($){return new M0({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:U.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:U.toString(X)})}finite($){return this._addCheck({kind:"finite",message:U.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString($)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&_.isInteger($.value))}get isFinite(){let $=null,X=null;for(let W of this._def.checks)if(W.kind==="finite"||W.kind==="int"||W.kind==="multipleOf")return!0;else if(W.kind==="min"){if(X===null||W.value>X)X=W.value}else if(W.kind==="max"){if($===null||W.value<$)$=W.value}return Number.isFinite(X)&&Number.isFinite($)}}M0.create=($)=>{return new M0({checks:[],typeName:V.ZodNumber,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...q($)})};class V0 extends N{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch(Y){return this._getInvalidInput($)}if(this._getType($)!==A.bigint)return this._getInvalidInput($);let W=void 0,J=new g;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?$.data<Y.value:$.data<=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_small,type:"bigint",minimum:Y.value,inclusive:Y.inclusive,message:Y.message}),J.dirty()}else if(Y.kind==="max"){if(Y.inclusive?$.data>Y.value:$.data>=Y.value)W=this._getOrReturnCtx($,W),O(W,{code:M.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),J.dirty()}else if(Y.kind==="multipleOf"){if($.data%Y.value!==BigInt(0))W=this._getOrReturnCtx($,W),O(W,{code:M.not_multiple_of,multipleOf:Y.value,message:Y.message}),J.dirty()}else _.assertNever(Y);return{status:J.value,value:$.data}}_getInvalidInput($){let X=this._getOrReturnCtx($);return O(X,{code:M.invalid_type,expected:A.bigint,received:X.parsedType}),S}gte($,X){return this.setLimit("min",$,!0,U.toString(X))}gt($,X){return this.setLimit("min",$,!1,U.toString(X))}lte($,X){return this.setLimit("max",$,!0,U.toString(X))}lt($,X){return this.setLimit("max",$,!1,U.toString(X))}setLimit($,X,W,J){return new V0({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:W,message:U.toString(J)}]})}_addCheck($){return new V0({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:U.toString(X)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}V0.create=($)=>{var X;return new V0({checks:[],typeName:V.ZodBigInt,coerce:(X=$===null||$===void 0?void 0:$.coerce)!==null&&X!==void 0?X:!1,...q($)})};class E0 extends N{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==A.boolean){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.boolean,received:W.parsedType}),S}return Z($.data)}}E0.create=($)=>{return new E0({typeName:V.ZodBoolean,coerce:($===null||$===void 0?void 0:$.coerce)||!1,...q($)})};class z0 extends N{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==A.date){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_type,expected:A.date,received:Y.parsedType}),S}if(isNaN($.data.getTime())){let Y=this._getOrReturnCtx($);return O(Y,{code:M.invalid_date}),S}let W=new g,J=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if($.data.getTime()<Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_small,message:Y.message,inclusive:!0,exact:!1,minimum:Y.value,type:"date"}),W.dirty()}else if(Y.kind==="max"){if($.data.getTime()>Y.value)J=this._getOrReturnCtx($,J),O(J,{code:M.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),W.dirty()}else _.assertNever(Y);return{status:W.value,value:new Date($.data.getTime())}}_addCheck($){return new z0({...this._def,checks:[...this._def.checks,$]})}min($,X){return this._addCheck({kind:"min",value:$.getTime(),message:U.toString(X)})}max($,X){return this._addCheck({kind:"max",value:$.getTime(),message:U.toString(X)})}get minDate(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $!=null?new Date($):null}}z0.create=($)=>{return new z0({checks:[],coerce:($===null||$===void 0?void 0:$.coerce)||!1,typeName:V.ZodDate,...q($)})};class m0 extends N{_parse($){if(this._getType($)!==A.symbol){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.symbol,received:W.parsedType}),S}return Z($.data)}}m0.create=($)=>{return new m0({typeName:V.ZodSymbol,...q($)})};class f0 extends N{_parse($){if(this._getType($)!==A.undefined){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.undefined,received:W.parsedType}),S}return Z($.data)}}f0.create=($)=>{return new f0({typeName:V.ZodUndefined,...q($)})};class C0 extends N{_parse($){if(this._getType($)!==A.null){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.null,received:W.parsedType}),S}return Z($.data)}}C0.create=($)=>{return new C0({typeName:V.ZodNull,...q($)})};class U0 extends N{constructor(){super(...arguments);this._any=!0}_parse($){return Z($.data)}}U0.create=($)=>{return new U0({typeName:V.ZodAny,...q($)})};class D0 extends N{constructor(){super(...arguments);this._unknown=!0}_parse($){return Z($.data)}}D0.create=($)=>{return new D0({typeName:V.ZodUnknown,...q($)})};class X0 extends N{_parse($){let X=this._getOrReturnCtx($);return O(X,{code:M.invalid_type,expected:A.never,received:X.parsedType}),S}}X0.create=($)=>{return new X0({typeName:V.ZodNever,...q($)})};class l0 extends N{_parse($){if(this._getType($)!==A.undefined){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.void,received:W.parsedType}),S}return Z($.data)}}l0.create=($)=>{return new l0({typeName:V.ZodVoid,...q($)})};class r extends N{_parse($){let{ctx:X,status:W}=this._processInputParams($),J=this._def;if(X.parsedType!==A.array)return O(X,{code:M.invalid_type,expected:A.array,received:X.parsedType}),S;if(J.exactLength!==null){let G=X.data.length>J.exactLength.value,H=X.data.length<J.exactLength.value;if(G||H)O(X,{code:G?M.too_big:M.too_small,minimum:H?J.exactLength.value:void 0,maximum:G?J.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:J.exactLength.message}),W.dirty()}if(J.minLength!==null){if(X.data.length<J.minLength.value)O(X,{code:M.too_small,minimum:J.minLength.value,type:"array",inclusive:!0,exact:!1,message:J.minLength.message}),W.dirty()}if(J.maxLength!==null){if(X.data.length>J.maxLength.value)O(X,{code:M.too_big,maximum:J.maxLength.value,type:"array",inclusive:!0,exact:!1,message:J.maxLength.message}),W.dirty()}if(X.common.async)return Promise.all([...X.data].map((G,H)=>{return J.type._parseAsync(new a(X,G,X.path,H))})).then((G)=>{return g.mergeArray(W,G)});let Y=[...X.data].map((G,H)=>{return J.type._parseSync(new a(X,G,X.path,H))});return g.mergeArray(W,Y)}get element(){return this._def.type}min($,X){return new r({...this._def,minLength:{value:$,message:U.toString(X)}})}max($,X){return new r({...this._def,maxLength:{value:$,message:U.toString(X)}})}length($,X){return new r({...this._def,exactLength:{value:$,message:U.toString(X)}})}nonempty($){return this.min(1,$)}}r.create=($,X)=>{return new r({type:$,minLength:null,maxLength:null,exactLength:null,typeName:V.ZodArray,...q(X)})};function q0($){if($ instanceof P){let X={};for(let W in $.shape){let J=$.shape[W];X[W]=u.create(q0(J))}return new P({...$._def,shape:()=>X})}else if($ instanceof r)return new r({...$._def,type:q0($.element)});else if($ instanceof u)return u.create(q0($.unwrap()));else if($ instanceof H0)return H0.create(q0($.unwrap()));else if($ instanceof W0)return W0.create($.items.map((X)=>q0(X)));else return $}class P extends N{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),X=_.objectKeys($);return this._cached={shape:$,keys:X}}_parse($){if(this._getType($)!==A.object){let B=this._getOrReturnCtx($);return O(B,{code:M.invalid_type,expected:A.object,received:B.parsedType}),S}let{status:W,ctx:J}=this._processInputParams($),{shape:Y,keys:G}=this._getCached(),H=[];if(!(this._def.catchall instanceof X0&&this._def.unknownKeys==="strip")){for(let B in J.data)if(!G.includes(B))H.push(B)}let w=[];for(let B of G){let D=Y[B],j=J.data[B];w.push({key:{status:"valid",value:B},value:D._parse(new a(J,j,J.path,B)),alwaysSet:B in J.data})}if(this._def.catchall instanceof X0){let B=this._def.unknownKeys;if(B==="passthrough")for(let D of H)w.push({key:{status:"valid",value:D},value:{status:"valid",value:J.data[D]}});else if(B==="strict"){if(H.length>0)O(J,{code:M.unrecognized_keys,keys:H}),W.dirty()}else if(B==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let B=this._def.catchall;for(let D of H){let j=J.data[D];w.push({key:{status:"valid",value:D},value:B._parse(new a(J,j,J.path,D)),alwaysSet:D in J.data})}}if(J.common.async)return Promise.resolve().then(async()=>{let B=[];for(let D of w){let j=await D.key,R=await D.value;B.push({key:j,value:R,alwaysSet:D.alwaysSet})}return B}).then((B)=>{return g.mergeObjectSync(W,B)});else return g.mergeObjectSync(W,w)}get shape(){return this._def.shape()}strict($){return U.errToObj,new P({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(X,W)=>{var J,Y,G,H;let w=(G=(Y=(J=this._def).errorMap)===null||Y===void 0?void 0:Y.call(J,X,W).message)!==null&&G!==void 0?G:W.defaultError;if(X.code==="unrecognized_keys")return{message:(H=U.errToObj($).message)!==null&&H!==void 0?H:w};return{message:w}}}:{}})}strip(){return new P({...this._def,unknownKeys:"strip"})}passthrough(){return new P({...this._def,unknownKeys:"passthrough"})}extend($){return new P({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new P({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:V.ZodObject})}setKey($,X){return this.augment({[$]:X})}catchall($){return new P({...this._def,catchall:$})}pick($){let X={};return _.objectKeys($).forEach((W)=>{if($[W]&&this.shape[W])X[W]=this.shape[W]}),new P({...this._def,shape:()=>X})}omit($){let X={};return _.objectKeys(this.shape).forEach((W)=>{if(!$[W])X[W]=this.shape[W]}),new P({...this._def,shape:()=>X})}deepPartial(){return q0(this)}partial($){let X={};return _.objectKeys(this.shape).forEach((W)=>{let J=this.shape[W];if($&&!$[W])X[W]=J;else X[W]=J.optional()}),new P({...this._def,shape:()=>X})}required($){let X={};return _.objectKeys(this.shape).forEach((W)=>{if($&&!$[W])X[W]=this.shape[W];else{let Y=this.shape[W];while(Y instanceof u)Y=Y._def.innerType;X[W]=Y}}),new P({...this._def,shape:()=>X})}keyof(){return A2(_.objectKeys(this.shape))}}P.create=($,X)=>{return new P({shape:()=>$,unknownKeys:"strip",catchall:X0.create(),typeName:V.ZodObject,...q(X)})};P.strictCreate=($,X)=>{return new P({shape:()=>$,unknownKeys:"strict",catchall:X0.create(),typeName:V.ZodObject,...q(X)})};P.lazycreate=($,X)=>{return new P({shape:$,unknownKeys:"strip",catchall:X0.create(),typeName:V.ZodObject,...q(X)})};class I0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=this._def.options;function J(Y){for(let H of Y)if(H.result.status==="valid")return H.result;for(let H of Y)if(H.result.status==="dirty")return X.common.issues.push(...H.ctx.common.issues),H.result;let G=Y.map((H)=>new n(H.ctx.common.issues));return O(X,{code:M.invalid_union,unionErrors:G}),S}if(X.common.async)return Promise.all(W.map(async(Y)=>{let G={...X,common:{...X.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:X.data,path:X.path,parent:G}),ctx:G}})).then(J);else{let Y=void 0,G=[];for(let w of W){let B={...X,common:{...X.common,issues:[]},parent:null},D=w._parseSync({data:X.data,path:X.path,parent:B});if(D.status==="valid")return D;else if(D.status==="dirty"&&!Y)Y={result:D,ctx:B};if(B.common.issues.length)G.push(B.common.issues)}if(Y)return X.common.issues.push(...Y.ctx.common.issues),Y.result;let H=G.map((w)=>new n(w));return O(X,{code:M.invalid_union,unionErrors:H}),S}}get options(){return this._def.options}}I0.create=($,X)=>{return new I0({options:$,typeName:V.ZodUnion,...q(X)})};var G0=($)=>{if($ instanceof v0)return G0($.schema);else if($ instanceof i)return G0($.innerType());else if($ instanceof P0)return[$.value];else if($ instanceof j0)return $.options;else if($ instanceof T0)return _.objectValues($.enum);else if($ instanceof k0)return G0($._def.innerType);else if($ instanceof f0)return[void 0];else if($ instanceof C0)return[null];else if($ instanceof u)return[void 0,...G0($.unwrap())];else if($ instanceof H0)return[null,...G0($.unwrap())];else if($ instanceof G1)return G0($.unwrap());else if($ instanceof h0)return G0($.unwrap());else if($ instanceof x0)return G0($._def.innerType);else return[]};class Y1 extends N{_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==A.object)return O(X,{code:M.invalid_type,expected:A.object,received:X.parsedType}),S;let W=this.discriminator,J=X.data[W],Y=this.optionsMap.get(J);if(!Y)return O(X,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[W]}),S;if(X.common.async)return Y._parseAsync({data:X.data,path:X.path,parent:X});else return Y._parseSync({data:X.data,path:X.path,parent:X})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,X,W){let J=new Map;for(let Y of X){let G=G0(Y.shape[$]);if(!G.length)throw new Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let H of G){if(J.has(H))throw new Error(`Discriminator property ${String($)} has duplicate value ${String(H)}`);J.set(H,Y)}}return new Y1({typeName:V.ZodDiscriminatedUnion,discriminator:$,options:X,optionsMap:J,...q(W)})}}function x1($,X){let W=Q0($),J=Q0(X);if($===X)return{valid:!0,data:$};else if(W===A.object&&J===A.object){let Y=_.objectKeys(X),G=_.objectKeys($).filter((w)=>Y.indexOf(w)!==-1),H={...$,...X};for(let w of G){let B=x1($[w],X[w]);if(!B.valid)return{valid:!1};H[w]=B.data}return{valid:!0,data:H}}else if(W===A.array&&J===A.array){if($.length!==X.length)return{valid:!1};let Y=[];for(let G=0;G<$.length;G++){let H=$[G],w=X[G],B=x1(H,w);if(!B.valid)return{valid:!1};Y.push(B.data)}return{valid:!0,data:Y}}else if(W===A.date&&J===A.date&&+$===+X)return{valid:!0,data:$};else return{valid:!1}}class b0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($),J=(Y,G)=>{if(T1(Y)||T1(G))return S;let H=x1(Y.value,G.value);if(!H.valid)return O(W,{code:M.invalid_intersection_types}),S;if(k1(Y)||k1(G))X.dirty();return{status:X.value,value:H.data}};if(W.common.async)return Promise.all([this._def.left._parseAsync({data:W.data,path:W.path,parent:W}),this._def.right._parseAsync({data:W.data,path:W.path,parent:W})]).then(([Y,G])=>J(Y,G));else return J(this._def.left._parseSync({data:W.data,path:W.path,parent:W}),this._def.right._parseSync({data:W.data,path:W.path,parent:W}))}}b0.create=($,X,W)=>{return new b0({left:$,right:X,typeName:V.ZodIntersection,...q(W)})};class W0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.array)return O(W,{code:M.invalid_type,expected:A.array,received:W.parsedType}),S;if(W.data.length<this._def.items.length)return O(W,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;if(!this._def.rest&&W.data.length>this._def.items.length)O(W,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X.dirty();let Y=[...W.data].map((G,H)=>{let w=this._def.items[H]||this._def.rest;if(!w)return null;return w._parse(new a(W,G,W.path,H))}).filter((G)=>!!G);if(W.common.async)return Promise.all(Y).then((G)=>{return g.mergeArray(X,G)});else return g.mergeArray(X,Y)}get items(){return this._def.items}rest($){return new W0({...this._def,rest:$})}}W0.create=($,X)=>{if(!Array.isArray($))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new W0({items:$,typeName:V.ZodTuple,rest:null,...q(X)})};class n0 extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.object)return O(W,{code:M.invalid_type,expected:A.object,received:W.parsedType}),S;let J=[],Y=this._def.keyType,G=this._def.valueType;for(let H in W.data)J.push({key:Y._parse(new a(W,H,W.path,H)),value:G._parse(new a(W,W.data[H],W.path,H)),alwaysSet:H in W.data});if(W.common.async)return g.mergeObjectAsync(X,J);else return g.mergeObjectSync(X,J)}get element(){return this._def.valueType}static create($,X,W){if(X instanceof N)return new n0({keyType:$,valueType:X,typeName:V.ZodRecord,...q(W)});return new n0({keyType:o.create(),valueType:$,typeName:V.ZodRecord,...q(X)})}}class u0 extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.map)return O(W,{code:M.invalid_type,expected:A.map,received:W.parsedType}),S;let J=this._def.keyType,Y=this._def.valueType,G=[...W.data.entries()].map(([H,w],B)=>{return{key:J._parse(new a(W,H,W.path,[B,"key"])),value:Y._parse(new a(W,w,W.path,[B,"value"]))}});if(W.common.async){let H=new Map;return Promise.resolve().then(async()=>{for(let w of G){let B=await w.key,D=await w.value;if(B.status==="aborted"||D.status==="aborted")return S;if(B.status==="dirty"||D.status==="dirty")X.dirty();H.set(B.value,D.value)}return{status:X.value,value:H}})}else{let H=new Map;for(let w of G){let{key:B,value:D}=w;if(B.status==="aborted"||D.status==="aborted")return S;if(B.status==="dirty"||D.status==="dirty")X.dirty();H.set(B.value,D.value)}return{status:X.value,value:H}}}}u0.create=($,X,W)=>{return new u0({valueType:X,keyType:$,typeName:V.ZodMap,...q(W)})};class K0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==A.set)return O(W,{code:M.invalid_type,expected:A.set,received:W.parsedType}),S;let J=this._def;if(J.minSize!==null){if(W.data.size<J.minSize.value)O(W,{code:M.too_small,minimum:J.minSize.value,type:"set",inclusive:!0,exact:!1,message:J.minSize.message}),X.dirty()}if(J.maxSize!==null){if(W.data.size>J.maxSize.value)O(W,{code:M.too_big,maximum:J.maxSize.value,type:"set",inclusive:!0,exact:!1,message:J.maxSize.message}),X.dirty()}let Y=this._def.valueType;function G(w){let B=new Set;for(let D of w){if(D.status==="aborted")return S;if(D.status==="dirty")X.dirty();B.add(D.value)}return{status:X.value,value:B}}let H=[...W.data.values()].map((w,B)=>Y._parse(new a(W,w,W.path,B)));if(W.common.async)return Promise.all(H).then((w)=>G(w));else return G(H)}min($,X){return new K0({...this._def,minSize:{value:$,message:U.toString(X)}})}max($,X){return new K0({...this._def,maxSize:{value:$,message:U.toString(X)}})}size($,X){return this.min($,X).max($,X)}nonempty($){return this.min(1,$)}}K0.create=($,X)=>{return new K0({valueType:$,minSize:null,maxSize:null,typeName:V.ZodSet,...q(X)})};class L0 extends N{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==A.function)return O(X,{code:M.invalid_type,expected:A.function,received:X.parsedType}),S;function W(H,w){return W1({data:H,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,X1(),_0].filter((B)=>!!B),issueData:{code:M.invalid_arguments,argumentsError:w}})}function J(H,w){return W1({data:H,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,X1(),_0].filter((B)=>!!B),issueData:{code:M.invalid_return_type,returnTypeError:w}})}let Y={errorMap:X.common.contextualErrorMap},G=X.data;if(this._def.returns instanceof F0){let H=this;return Z(async function(...w){let B=new n([]),D=await H._def.args.parseAsync(w,Y).catch((f)=>{throw B.addIssue(W(w,f)),B}),j=await Reflect.apply(G,this,D);return await H._def.returns._def.type.parseAsync(j,Y).catch((f)=>{throw B.addIssue(J(j,f)),B})})}else{let H=this;return Z(function(...w){let B=H._def.args.safeParse(w,Y);if(!B.success)throw new n([W(w,B.error)]);let D=Reflect.apply(G,this,B.data),j=H._def.returns.safeParse(D,Y);if(!j.success)throw new n([J(D,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new L0({...this._def,args:W0.create($).rest(D0.create())})}returns($){return new L0({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,X,W){return new L0({args:$?$:W0.create([]).rest(D0.create()),returns:X||D0.create(),typeName:V.ZodFunction,...q(W)})}}class v0 extends N{get schema(){return this._def.getter()}_parse($){let{ctx:X}=this._processInputParams($);return this._def.getter()._parse({data:X.data,path:X.path,parent:X})}}v0.create=($,X)=>{return new v0({getter:$,typeName:V.ZodLazy,...q(X)})};class P0 extends N{_parse($){if($.data!==this._def.value){let X=this._getOrReturnCtx($);return O(X,{received:X.data,code:M.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:$.data}}get value(){return this._def.value}}P0.create=($,X)=>{return new P0({value:$,typeName:V.ZodLiteral,...q(X)})};function A2($,X){return new j0({values:$,typeName:V.ZodEnum,...q(X)})}class j0 extends N{constructor(){super(...arguments);g0.set(this,void 0)}_parse($){if(typeof $.data!=="string"){let X=this._getOrReturnCtx($),W=this._def.values;return O(X,{expected:_.joinValues(W),received:X.parsedType,code:M.invalid_type}),S}if(!J1(this,g0,"f"))M2(this,g0,new Set(this._def.values),"f");if(!J1(this,g0,"f").has($.data)){let X=this._getOrReturnCtx($),W=this._def.values;return O(X,{received:X.data,code:M.invalid_enum_value,options:W}),S}return Z($.data)}get options(){return this._def.values}get enum(){let $={};for(let X of this._def.values)$[X]=X;return $}get Values(){let $={};for(let X of this._def.values)$[X]=X;return $}get Enum(){let $={};for(let X of this._def.values)$[X]=X;return $}extract($,X=this._def){return j0.create($,{...this._def,...X})}exclude($,X=this._def){return j0.create(this.options.filter((W)=>!$.includes(W)),{...this._def,...X})}}g0=new WeakMap;j0.create=A2;class T0 extends N{constructor(){super(...arguments);y0.set(this,void 0)}_parse($){let X=_.getValidEnumValues(this._def.values),W=this._getOrReturnCtx($);if(W.parsedType!==A.string&&W.parsedType!==A.number){let J=_.objectValues(X);return O(W,{expected:_.joinValues(J),received:W.parsedType,code:M.invalid_type}),S}if(!J1(this,y0,"f"))M2(this,y0,new Set(_.getValidEnumValues(this._def.values)),"f");if(!J1(this,y0,"f").has($.data)){let J=_.objectValues(X);return O(W,{received:W.data,code:M.invalid_enum_value,options:J}),S}return Z($.data)}get enum(){return this._def.values}}y0=new WeakMap;T0.create=($,X)=>{return new T0({values:$,typeName:V.ZodNativeEnum,...q(X)})};class F0 extends N{unwrap(){return this._def.type}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==A.promise&&X.common.async===!1)return O(X,{code:M.invalid_type,expected:A.promise,received:X.parsedType}),S;let W=X.parsedType===A.promise?X.data:Promise.resolve(X.data);return Z(W.then((J)=>{return this._def.type.parseAsync(J,{path:X.path,errorMap:X.common.contextualErrorMap})}))}}F0.create=($,X)=>{return new F0({type:$,typeName:V.ZodPromise,...q(X)})};class i extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===V.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:X,ctx:W}=this._processInputParams($),J=this._def.effect||null,Y={addIssue:(G)=>{if(O(W,G),G.fatal)X.abort();else X.dirty()},get path(){return W.path}};if(Y.addIssue=Y.addIssue.bind(Y),J.type==="preprocess"){let G=J.transform(W.data,Y);if(W.common.async)return Promise.resolve(G).then(async(H)=>{if(X.value==="aborted")return S;let w=await this._def.schema._parseAsync({data:H,path:W.path,parent:W});if(w.status==="aborted")return S;if(w.status==="dirty")return R0(w.value);if(X.value==="dirty")return R0(w.value);return w});else{if(X.value==="aborted")return S;let H=this._def.schema._parseSync({data:G,path:W.path,parent:W});if(H.status==="aborted")return S;if(H.status==="dirty")return R0(H.value);if(X.value==="dirty")return R0(H.value);return H}}if(J.type==="refinement"){let G=(H)=>{let w=J.refinement(H,Y);if(W.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return H};if(W.common.async===!1){let H=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(H.status==="aborted")return S;if(H.status==="dirty")X.dirty();return G(H.value),{status:X.value,value:H.value}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((H)=>{if(H.status==="aborted")return S;if(H.status==="dirty")X.dirty();return G(H.value).then(()=>{return{status:X.value,value:H.value}})})}if(J.type==="transform")if(W.common.async===!1){let G=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(!A0(G))return G;let H=J.transform(G.value,Y);if(H instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:X.value,value:H}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((G)=>{if(!A0(G))return G;return Promise.resolve(J.transform(G.value,Y)).then((H)=>({status:X.value,value:H}))});_.assertNever(J)}}i.create=($,X,W)=>{return new i({schema:$,typeName:V.ZodEffects,effect:X,...q(W)})};i.createWithPreprocess=($,X,W)=>{return new i({schema:X,effect:{type:"preprocess",transform:$},typeName:V.ZodEffects,...q(W)})};class u extends N{_parse($){if(this._getType($)===A.undefined)return Z(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}u.create=($,X)=>{return new u({innerType:$,typeName:V.ZodOptional,...q(X)})};class H0 extends N{_parse($){if(this._getType($)===A.null)return Z(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}H0.create=($,X)=>{return new H0({innerType:$,typeName:V.ZodNullable,...q(X)})};class k0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=X.data;if(X.parsedType===A.undefined)W=this._def.defaultValue();return this._def.innerType._parse({data:W,path:X.path,parent:X})}removeDefault(){return this._def.innerType}}k0.create=($,X)=>{return new k0({innerType:$,typeName:V.ZodDefault,defaultValue:typeof X.default==="function"?X.default:()=>X.default,...q(X)})};class x0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W={...X,common:{...X.common,issues:[]}},J=this._def.innerType._parse({data:W.data,path:W.path,parent:{...W}});if(Z0(J))return J.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new n(W.common.issues)},input:W.data})}});else return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new n(W.common.issues)},input:W.data})}}removeCatch(){return this._def.innerType}}x0.create=($,X)=>{return new x0({innerType:$,typeName:V.ZodCatch,catchValue:typeof X.catch==="function"?X.catch:()=>X.catch,...q(X)})};class c0 extends N{_parse($){if(this._getType($)!==A.nan){let W=this._getOrReturnCtx($);return O(W,{code:M.invalid_type,expected:A.nan,received:W.parsedType}),S}return{status:"valid",value:$.data}}}c0.create=($)=>{return new c0({typeName:V.ZodNaN,...q($)})};var U6=Symbol("zod_brand");class G1 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=X.data;return this._def.type._parse({data:W,path:X.path,parent:X})}unwrap(){return this._def.type}}class p0 extends N{_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:W.data,path:W.path,parent:W});if(Y.status==="aborted")return S;if(Y.status==="dirty")return X.dirty(),R0(Y.value);else return this._def.out._parseAsync({data:Y.value,path:W.path,parent:W})})();else{let J=this._def.in._parseSync({data:W.data,path:W.path,parent:W});if(J.status==="aborted")return S;if(J.status==="dirty")return X.dirty(),{status:"dirty",value:J.value};else return this._def.out._parseSync({data:J.value,path:W.path,parent:W})}}static create($,X){return new p0({in:$,out:X,typeName:V.ZodPipeline})}}class h0 extends N{_parse($){let X=this._def.innerType._parse($),W=(J)=>{if(A0(J))J.value=Object.freeze(J.value);return J};return Z0(X)?X.then((J)=>W(J)):W(X)}unwrap(){return this._def.innerType}}h0.create=($,X)=>{return new h0({innerType:$,typeName:V.ZodReadonly,...q(X)})};function w2($,X){let W=typeof $==="function"?$(X):typeof $==="string"?{message:$}:$;return typeof W==="string"?{message:W}:W}function z2($,X={},W){if($)return U0.create().superRefine((J,Y)=>{var G,H;let w=$(J);if(w instanceof Promise)return w.then((B)=>{var D,j;if(!B){let R=w2(X,J),f=(j=(D=R.fatal)!==null&&D!==void 0?D:W)!==null&&j!==void 0?j:!0;Y.addIssue({code:"custom",...R,fatal:f})}});if(!w){let B=w2(X,J),D=(H=(G=B.fatal)!==null&&G!==void 0?G:W)!==null&&H!==void 0?H:!0;Y.addIssue({code:"custom",...B,fatal:D})}return});return U0.create()}var K6={object:P.lazycreate},V;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(V||(V={}));var F6=($,X={message:`Input not instance of ${$.name}`})=>z2((W)=>W instanceof $,X),U2=o.create,K2=M0.create,S6=c0.create,N6=V0.create,F2=E0.create,q6=z0.create,R6=m0.create,L6=f0.create,_6=C0.create,E6=U0.create,f6=D0.create,C6=X0.create,I6=l0.create,b6=r.create,v6=P.create,P6=P.strictCreate,T6=I0.create,k6=Y1.create,x6=b0.create,h6=W0.create,g6=n0.create,y6=u0.create,Z6=K0.create,m6=L0.create,l6=v0.create,n6=P0.create,u6=j0.create,c6=T0.create,p6=F0.create,B2=i.create,i6=u.create,d6=H0.create,o6=i.createWithPreprocess,r6=p0.create,a6=()=>U2().optional(),t6=()=>K2().optional(),s6=()=>F2().optional(),e6={string:($)=>o.create({...$,coerce:!0}),number:($)=>M0.create({...$,coerce:!0}),boolean:($)=>E0.create({...$,coerce:!0}),bigint:($)=>V0.create({...$,coerce:!0}),date:($)=>z0.create({...$,coerce:!0})},$$=S,Q=Object.freeze({__proto__:null,defaultErrorMap:_0,setErrorMap:o4,getErrorMap:X1,makeIssue:W1,EMPTY_PATH:r4,addIssueToContext:O,ParseStatus:g,INVALID:S,DIRTY:R0,OK:Z,isAborted:T1,isDirty:k1,isValid:A0,isAsync:Z0,get util(){return _},get objectUtil(){return P1},ZodParsedType:A,getParsedType:Q0,ZodType:N,datetimeRegex:O2,ZodString:o,ZodNumber:M0,ZodBigInt:V0,ZodBoolean:E0,ZodDate:z0,ZodSymbol:m0,ZodUndefined:f0,ZodNull:C0,ZodAny:U0,ZodUnknown:D0,ZodNever:X0,ZodVoid:l0,ZodArray:r,ZodObject:P,ZodUnion:I0,ZodDiscriminatedUnion:Y1,ZodIntersection:b0,ZodTuple:W0,ZodRecord:n0,ZodMap:u0,ZodSet:K0,ZodFunction:L0,ZodLazy:v0,ZodLiteral:P0,ZodEnum:j0,ZodNativeEnum:T0,ZodPromise:F0,ZodEffects:i,ZodTransformer:i,ZodOptional:u,ZodNullable:H0,ZodDefault:k0,ZodCatch:x0,ZodNaN:c0,BRAND:U6,ZodBranded:G1,ZodPipeline:p0,ZodReadonly:h0,custom:z2,Schema:N,ZodSchema:N,late:K6,get ZodFirstPartyTypeKind(){return V},coerce:e6,any:E6,array:b6,bigint:N6,boolean:F2,date:q6,discriminatedUnion:k6,effect:B2,enum:u6,function:m6,instanceof:F6,intersection:x6,lazy:l6,literal:n6,map:y6,nan:S6,nativeEnum:c6,never:C6,null:_6,nullable:d6,number:K2,object:v6,oboolean:s6,onumber:t6,optional:i6,ostring:a6,pipeline:r6,preprocess:o6,promise:p6,record:g6,set:Z6,strictObject:P6,string:U2,symbol:R6,transformer:B2,tuple:h6,undefined:L6,union:T6,unknown:f6,void:I6,NEVER:$$,ZodIssueCode:M,quotelessJson:d4,ZodError:n});var h1="2024-11-05",S2=[h1,"2024-10-07"],Q1="2.0",N2=Q.union([Q.string(),Q.number().int()]),q2=Q.string(),t=Q.object({_meta:Q.optional(Q.object({progressToken:Q.optional(N2)}).passthrough())}).passthrough(),c=Q.object({method:Q.string(),params:Q.optional(t)}),i0=Q.object({_meta:Q.optional(Q.object({}).passthrough())}).passthrough(),J0=Q.object({method:Q.string(),params:Q.optional(i0)}),s=Q.object({_meta:Q.optional(Q.object({}).passthrough())}).passthrough(),H1=Q.union([Q.string(),Q.number().int()]),X$=Q.object({jsonrpc:Q.literal(Q1),id:H1}).merge(c).strict(),W$=Q.object({jsonrpc:Q.literal(Q1)}).merge(J0).strict(),J$=Q.object({jsonrpc:Q.literal(Q1),id:H1,result:s}).strict(),h;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError"})(h||(h={}));var Y$=Q.object({jsonrpc:Q.literal(Q1),id:H1,error:Q.object({code:Q.number().int(),message:Q.string(),data:Q.optional(Q.unknown())})}).strict(),R2=Q.union([X$,W$,J$,Y$]),w1=s.strict(),B1=J0.extend({method:Q.literal("notifications/cancelled"),params:i0.extend({requestId:H1,reason:Q.string().optional()})}),L2=Q.object({name:Q.string(),version:Q.string()}).passthrough(),G$=Q.object({experimental:Q.optional(Q.object({}).passthrough()),sampling:Q.optional(Q.object({}).passthrough()),roots:Q.optional(Q.object({listChanged:Q.optional(Q.boolean())}).passthrough())}).passthrough(),g1=c.extend({method:Q.literal("initialize"),params:t.extend({protocolVersion:Q.string(),capabilities:G$,clientInfo:L2})}),Q$=Q.object({experimental:Q.optional(Q.object({}).passthrough()),logging:Q.optional(Q.object({}).passthrough()),prompts:Q.optional(Q.object({listChanged:Q.optional(Q.boolean())}).passthrough()),resources:Q.optional(Q.object({subscribe:Q.optional(Q.boolean()),listChanged:Q.optional(Q.boolean())}).passthrough()),tools:Q.optional(Q.object({listChanged:Q.optional(Q.boolean())}).passthrough())}).passthrough(),H$=s.extend({protocolVersion:Q.string(),capabilities:Q$,serverInfo:L2,instructions:Q.optional(Q.string())}),y1=J0.extend({method:Q.literal("notifications/initialized")}),D1=c.extend({method:Q.literal("ping")}),w$=Q.object({progress:Q.number(),total:Q.optional(Q.number())}).passthrough(),M1=J0.extend({method:Q.literal("notifications/progress"),params:i0.merge(w$).extend({progressToken:N2})}),V1=c.extend({params:t.extend({cursor:Q.optional(q2)}).optional()}),j1=s.extend({nextCursor:Q.optional(q2)}),_2=Q.object({uri:Q.string(),mimeType:Q.optional(Q.string())}).passthrough(),E2=_2.extend({text:Q.string()}),f2=_2.extend({blob:Q.string().base64()}),B$=Q.object({uri:Q.string(),name:Q.string(),description:Q.optional(Q.string()),mimeType:Q.optional(Q.string())}).passthrough(),D$=Q.object({uriTemplate:Q.string(),name:Q.string(),description:Q.optional(Q.string()),mimeType:Q.optional(Q.string())}).passthrough(),O1=V1.extend({method:Q.literal("resources/list")}),M$=j1.extend({resources:Q.array(B$)}),A1=V1.extend({method:Q.literal("resources/templates/list")}),V$=j1.extend({resourceTemplates:Q.array(D$)}),z1=c.extend({method:Q.literal("resources/read"),params:t.extend({uri:Q.string()})}),j$=s.extend({contents:Q.array(Q.union([E2,f2]))}),O$=J0.extend({method:Q.literal("notifications/resources/list_changed")}),A$=c.extend({method:Q.literal("resources/subscribe"),params:t.extend({uri:Q.string()})}),z$=c.extend({method:Q.literal("resources/unsubscribe"),params:t.extend({uri:Q.string()})}),U$=J0.extend({method:Q.literal("notifications/resources/updated"),params:i0.extend({uri:Q.string()})}),K$=Q.object({name:Q.string(),description:Q.optional(Q.string()),required:Q.optional(Q.boolean())}).passthrough(),F$=Q.object({name:Q.string(),description:Q.optional(Q.string()),arguments:Q.optional(Q.array(K$))}).passthrough(),U1=V1.extend({method:Q.literal("prompts/list")}),S$=j1.extend({prompts:Q.array(F$)}),K1=c.extend({method:Q.literal("prompts/get"),params:t.extend({name:Q.string(),arguments:Q.optional(Q.record(Q.string()))})}),F1=Q.object({type:Q.literal("text"),text:Q.string()}).passthrough(),S1=Q.object({type:Q.literal("image"),data:Q.string().base64(),mimeType:Q.string()}).passthrough(),C2=Q.object({type:Q.literal("resource"),resource:Q.union([E2,f2])}).passthrough(),N$=Q.object({role:Q.enum(["user","assistant"]),content:Q.union([F1,S1,C2])}).passthrough(),q$=s.extend({description:Q.optional(Q.string()),messages:Q.array(N$)}),R$=J0.extend({method:Q.literal("notifications/prompts/list_changed")}),L$=Q.object({name:Q.string(),description:Q.optional(Q.string()),inputSchema:Q.object({type:Q.literal("object"),properties:Q.optional(Q.object({}).passthrough())}).passthrough()}).passthrough(),N1=V1.extend({method:Q.literal("tools/list")}),_$=j1.extend({tools:Q.array(L$)}),I2=s.extend({content:Q.array(Q.union([F1,S1,C2])),isError:Q.boolean().default(!1).optional()}),T3=I2.or(s.extend({toolResult:Q.unknown()})),q1=c.extend({method:Q.literal("tools/call"),params:t.extend({name:Q.string(),arguments:Q.optional(Q.record(Q.unknown()))})}),E$=J0.extend({method:Q.literal("notifications/tools/list_changed")}),b2=Q.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),f$=c.extend({method:Q.literal("logging/setLevel"),params:t.extend({level:b2})}),C$=J0.extend({method:Q.literal("notifications/message"),params:i0.extend({level:b2,logger:Q.optional(Q.string()),data:Q.unknown()})}),I$=Q.object({name:Q.string().optional()}).passthrough(),b$=Q.object({hints:Q.optional(Q.array(I$)),costPriority:Q.optional(Q.number().min(0).max(1)),speedPriority:Q.optional(Q.number().min(0).max(1)),intelligencePriority:Q.optional(Q.number().min(0).max(1))}).passthrough(),v$=Q.object({role:Q.enum(["user","assistant"]),content:Q.union([F1,S1])}).passthrough(),P$=c.extend({method:Q.literal("sampling/createMessage"),params:t.extend({messages:Q.array(v$),systemPrompt:Q.optional(Q.string()),includeContext:Q.optional(Q.enum(["none","thisServer","allServers"])),temperature:Q.optional(Q.number()),maxTokens:Q.number().int(),stopSequences:Q.optional(Q.array(Q.string())),metadata:Q.optional(Q.object({}).passthrough()),modelPreferences:Q.optional(b$)})}),Z1=s.extend({model:Q.string(),stopReason:Q.optional(Q.enum(["endTurn","stopSequence","maxTokens"]).or(Q.string())),role:Q.enum(["user","assistant"]),content:Q.discriminatedUnion("type",[F1,S1])}),T$=Q.object({type:Q.literal("ref/resource"),uri:Q.string()}).passthrough(),k$=Q.object({type:Q.literal("ref/prompt"),name:Q.string()}).passthrough(),R1=c.extend({method:Q.literal("completion/complete"),params:t.extend({ref:Q.union([k$,T$]),argument:Q.object({name:Q.string(),value:Q.string()}).passthrough()})}),x$=s.extend({completion:Q.object({values:Q.array(Q.string()).max(100),total:Q.optional(Q.number().int()),hasMore:Q.optional(Q.boolean())}).passthrough()}),h$=Q.object({uri:Q.string().startsWith("file://"),name:Q.optional(Q.string())}).passthrough(),g$=c.extend({method:Q.literal("roots/list")}),m1=s.extend({roots:Q.array(h$)}),y$=J0.extend({method:Q.literal("notifications/roots/list_changed")}),k3=Q.union([D1,g1,R1,f$,K1,U1,O1,A1,z1,A$,z$,q1,N1]),x3=Q.union([B1,M1,y1,y$]),h3=Q.union([w1,Z1,m1]),g3=Q.union([D1,P$,g$]),y3=Q.union([B1,M1,C$,U$,O$,E$,R$]),Z3=Q.union([w1,H$,x$,q$,S$,M$,V$,j$,I2,_$]);class m extends Error{constructor($,X,W){super(`MCP error ${$}: ${X}`);this.code=$,this.data=W,this.name="McpError"}}var Z$=60000;class l1{constructor($){this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this.setNotificationHandler(B1,(X)=>{let W=this._requestHandlerAbortControllers.get(X.params.requestId);W===null||W===void 0||W.abort(X.params.reason)}),this.setNotificationHandler(M1,(X)=>{this._onprogress(X)}),this.setRequestHandler(D1,(X)=>({}))}_setupTimeout($,X,W,J){this._timeoutInfo.set($,{timeoutId:setTimeout(J,X),startTime:Date.now(),timeout:X,maxTotalTimeout:W,onTimeout:J})}_resetTimeout($){let X=this._timeoutInfo.get($);if(!X)return!1;let W=Date.now()-X.startTime;if(X.maxTotalTimeout&&W>=X.maxTotalTimeout)throw this._timeoutInfo.delete($),new m(h.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:X.maxTotalTimeout,totalElapsed:W});return clearTimeout(X.timeoutId),X.timeoutId=setTimeout(X.onTimeout,X.timeout),!0}_cleanupTimeout($){let X=this._timeoutInfo.get($);if(X)clearTimeout(X.timeoutId),this._timeoutInfo.delete($)}async connect($){this._transport=$,this._transport.onclose=()=>{this._onclose()},this._transport.onerror=(X)=>{this._onerror(X)},this._transport.onmessage=(X)=>{if(!("method"in X))this._onresponse(X);else if("id"in X)this._onrequest(X);else this._onnotification(X)},await this._transport.start()}_onclose(){var $;let X=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let W=new m(h.ConnectionClosed,"Connection closed");for(let J of X.values())J(W)}_onerror($){var X;(X=this.onerror)===null||X===void 0||X.call(this,$)}_onnotification($){var X;let W=(X=this._notificationHandlers.get($.method))!==null&&X!==void 0?X:this.fallbackNotificationHandler;if(W===void 0)return;Promise.resolve().then(()=>W($)).catch((J)=>this._onerror(new Error(`Uncaught error in notification handler: ${J}`)))}_onrequest($){var X,W,J;let Y=(X=this._requestHandlers.get($.method))!==null&&X!==void 0?X:this.fallbackRequestHandler;if(Y===void 0){(W=this._transport)===null||W===void 0||W.send({jsonrpc:"2.0",id:$.id,error:{code:h.MethodNotFound,message:"Method not found"}}).catch((w)=>this._onerror(new Error(`Failed to send an error response: ${w}`)));return}let G=new AbortController;this._requestHandlerAbortControllers.set($.id,G);let H={signal:G.signal,sessionId:(J=this._transport)===null||J===void 0?void 0:J.sessionId};Promise.resolve().then(()=>Y($,H)).then((w)=>{var B;if(G.signal.aborted)return;return(B=this._transport)===null||B===void 0?void 0:B.send({result:w,jsonrpc:"2.0",id:$.id})},(w)=>{var B,D;if(G.signal.aborted)return;return(B=this._transport)===null||B===void 0?void 0:B.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(w.code)?w.code:h.InternalError,message:(D=w.message)!==null&&D!==void 0?D:"Internal error"}})}).catch((w)=>this._onerror(new Error(`Failed to send response: ${w}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:X,...W}=$.params,J=Number(X),Y=this._progressHandlers.get(J);if(!Y){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let G=this._responseHandlers.get(J);if(this._timeoutInfo.has(J)&&G)try{this._resetTimeout(J)}catch(H){G(H);return}Y(W)}_onresponse($){let X=Number($.id),W=this._responseHandlers.get(X);if(W===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(X),this._progressHandlers.delete(X),this._cleanupTimeout(X),"result"in $)W($);else{let J=new m($.error.code,$.error.message,$.error.data);W(J)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,X,W){return new Promise((J,Y)=>{var G,H,w,B;if(!this._transport){Y(new Error("Not connected"));return}if(((G=this._options)===null||G===void 0?void 0:G.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(H=W===null||W===void 0?void 0:W.signal)===null||H===void 0||H.throwIfAborted();let D=this._requestMessageId++,j={...$,jsonrpc:"2.0",id:D};if(W===null||W===void 0?void 0:W.onprogress)this._progressHandlers.set(D,W.onprogress),j.params={...$.params,_meta:{progressToken:D}};let R=(v)=>{var T;this._responseHandlers.delete(D),this._progressHandlers.delete(D),this._cleanupTimeout(D),(T=this._transport)===null||T===void 0||T.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:D,reason:String(v)}}).catch((y)=>this._onerror(new Error(`Failed to send cancellation: ${y}`))),Y(v)};this._responseHandlers.set(D,(v)=>{var T;if((T=W===null||W===void 0?void 0:W.signal)===null||T===void 0?void 0:T.aborted)return;if(v instanceof Error)return Y(v);try{let y=X.parse(v.result);J(y)}catch(y){Y(y)}}),(w=W===null||W===void 0?void 0:W.signal)===null||w===void 0||w.addEventListener("abort",()=>{var v;R((v=W===null||W===void 0?void 0:W.signal)===null||v===void 0?void 0:v.reason)});let f=(B=W===null||W===void 0?void 0:W.timeout)!==null&&B!==void 0?B:Z$,b=()=>R(new m(h.RequestTimeout,"Request timed out",{timeout:f}));this._setupTimeout(D,f,W===null||W===void 0?void 0:W.maxTotalTimeout,b),this._transport.send(j).catch((v)=>{this._cleanupTimeout(D),Y(v)})})}async notification($){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability($.method);let X={...$,jsonrpc:"2.0"};await this._transport.send(X)}setRequestHandler($,X){let W=$.shape.method.value;this.assertRequestHandlerCapability(W),this._requestHandlers.set(W,(J,Y)=>Promise.resolve(X($.parse(J),Y)))}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw new Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,X){this._notificationHandlers.set($.shape.method.value,(W)=>Promise.resolve(X($.parse(W))))}removeNotificationHandler($){this._notificationHandlers.delete($)}}function v2($,X){return Object.entries(X).reduce((W,[J,Y])=>{if(Y&&typeof Y==="object")W[J]=W[J]?{...W[J],...Y}:Y;else W[J]=Y;return W},{...$})}class n1 extends l1{constructor($,X){var W;super(X);this._serverInfo=$,this._capabilities=(W=X===null||X===void 0?void 0:X.capabilities)!==null&&W!==void 0?W:{},this._instructions=X===null||X===void 0?void 0:X.instructions,this.setRequestHandler(g1,(J)=>this._oninitialize(J)),this.setNotificationHandler(y1,()=>{var J;return(J=this.oninitialized)===null||J===void 0?void 0:J.call(this)})}registerCapabilities($){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=v2(this._capabilities,$)}assertCapabilityForMethod($){var X,W;switch($){case"sampling/createMessage":if(!((X=this._clientCapabilities)===null||X===void 0?void 0:X.sampling))throw new Error(`Client does not support sampling (required for ${$})`);break;case"roots/list":if(!((W=this._clientCapabilities)===null||W===void 0?void 0:W.roots))throw new Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){switch($){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Server does not support sampling (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let X=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:S2.includes(X)?X:h1,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},w1)}async createMessage($,X){return this.request({method:"sampling/createMessage",params:$},Z1,X)}async listRoots($,X){return this.request({method:"roots/list",params:$},m1,X)}async sendLoggingMessage($){return this.notification({method:"notifications/message",params:$})}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var T2=Symbol("Let zodToJsonSchema decide on which parser to use");var P2={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"},k2=($)=>typeof $==="string"?{...P2,name:$}:{...P2,...$};var x2=($)=>{let X=k2($),W=X.name!==void 0?[...X.basePath,X.definitionPath,X.name]:X.basePath;return{...X,currentPath:W,propertyPath:void 0,seen:new Map(Object.entries(X.definitions).map(([J,Y])=>[Y._def,{def:Y._def,path:[...X.basePath,X.definitionPath,J],jsonSchema:void 0}]))}};function u1($,X,W,J){if(!J?.errorMessages)return;if(W)$.errorMessage={...$.errorMessage,[X]:W}}function L($,X,W,J,Y){$[X]=W,u1($,X,J,Y)}function h2(){return{}}function g2($,X){let W={type:"array"};if($.type?._def&&$.type?._def?.typeName!==V.ZodAny)W.items=F($.type._def,{...X,currentPath:[...X.currentPath,"items"]});if($.minLength)L(W,"minItems",$.minLength.value,$.minLength.message,X);if($.maxLength)L(W,"maxItems",$.maxLength.value,$.maxLength.message,X);if($.exactLength)L(W,"minItems",$.exactLength.value,$.exactLength.message,X),L(W,"maxItems",$.exactLength.value,$.exactLength.message,X);return W}function y2($,X){let W={type:"integer",format:"int64"};if(!$.checks)return W;for(let J of $.checks)switch(J.kind){case"min":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"minimum",J.value,J.message,X);else L(W,"exclusiveMinimum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMinimum=!0;L(W,"minimum",J.value,J.message,X)}break;case"max":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"maximum",J.value,J.message,X);else L(W,"exclusiveMaximum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMaximum=!0;L(W,"maximum",J.value,J.message,X)}break;case"multipleOf":L(W,"multipleOf",J.value,J.message,X);break}return W}function Z2(){return{type:"boolean"}}function L1($,X){return F($.type._def,X)}var m2=($,X)=>{return F($.innerType._def,X)};function c1($,X,W){let J=W??X.dateStrategy;if(Array.isArray(J))return{anyOf:J.map((Y,G)=>c1($,X,Y))};switch(J){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return m$($,X)}}var m$=($,X)=>{let W={type:"integer",format:"unix-time"};if(X.target==="openApi3")return W;for(let J of $.checks)switch(J.kind){case"min":L(W,"minimum",J.value,J.message,X);break;case"max":L(W,"maximum",J.value,J.message,X);break}return W};function l2($,X){return{...F($.innerType._def,X),default:$.defaultValue()}}function n2($,X){return X.effectStrategy==="input"?F($.schema._def,X):{}}function u2($){return{type:"string",enum:Array.from($.values)}}var l$=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function c2($,X){let W=[F($.left._def,{...X,currentPath:[...X.currentPath,"allOf","0"]}),F($.right._def,{...X,currentPath:[...X.currentPath,"allOf","1"]})].filter((G)=>!!G),J=X.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,Y=[];return W.forEach((G)=>{if(l$(G)){if(Y.push(...G.allOf),G.unevaluatedProperties===void 0)J=void 0}else{let H=G;if("additionalProperties"in G&&G.additionalProperties===!1){let{additionalProperties:w,...B}=G;H=B}else J=void 0;Y.push(H)}}),Y.length?{allOf:Y,...J}:void 0}function p2($,X){let W=typeof $.value;if(W!=="bigint"&&W!=="number"&&W!=="boolean"&&W!=="string")return{type:Array.isArray($.value)?"array":"object"};if(X.target==="openApi3")return{type:W==="bigint"?"integer":W,enum:[$.value]};return{type:W==="bigint"?"integer":W,const:$.value}}var p1=void 0,e={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:()=>{if(p1===void 0)p1=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return p1},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 _1($,X){let W={type:"string"};if($.checks)for(let J of $.checks)switch(J.kind){case"min":L(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,J.value):J.value,J.message,X);break;case"max":L(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,J.value):J.value,J.message,X);break;case"email":switch(X.emailStrategy){case"format:email":$0(W,"email",J.message,X);break;case"format:idn-email":$0(W,"idn-email",J.message,X);break;case"pattern:zod":l(W,e.email,J.message,X);break}break;case"url":$0(W,"uri",J.message,X);break;case"uuid":$0(W,"uuid",J.message,X);break;case"regex":l(W,J.regex,J.message,X);break;case"cuid":l(W,e.cuid,J.message,X);break;case"cuid2":l(W,e.cuid2,J.message,X);break;case"startsWith":l(W,RegExp(`^${i1(J.value,X)}`),J.message,X);break;case"endsWith":l(W,RegExp(`${i1(J.value,X)}$`),J.message,X);break;case"datetime":$0(W,"date-time",J.message,X);break;case"date":$0(W,"date",J.message,X);break;case"time":$0(W,"time",J.message,X);break;case"duration":$0(W,"duration",J.message,X);break;case"length":L(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,J.value):J.value,J.message,X),L(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,J.value):J.value,J.message,X);break;case"includes":{l(W,RegExp(i1(J.value,X)),J.message,X);break}case"ip":{if(J.version!=="v6")$0(W,"ipv4",J.message,X);if(J.version!=="v4")$0(W,"ipv6",J.message,X);break}case"base64url":l(W,e.base64url,J.message,X);break;case"jwt":l(W,e.jwt,J.message,X);break;case"cidr":{if(J.version!=="v6")l(W,e.ipv4Cidr,J.message,X);if(J.version!=="v4")l(W,e.ipv6Cidr,J.message,X);break}case"emoji":l(W,e.emoji(),J.message,X);break;case"ulid":{l(W,e.ulid,J.message,X);break}case"base64":{switch(X.base64Strategy){case"format:binary":{$0(W,"binary",J.message,X);break}case"contentEncoding:base64":{L(W,"contentEncoding","base64",J.message,X);break}case"pattern:zod":{l(W,e.base64,J.message,X);break}}break}case"nanoid":l(W,e.nanoid,J.message,X);case"toLowerCase":case"toUpperCase":case"trim":break;default:((Y)=>{})(J)}return W}function i1($,X){return X.patternStrategy==="escape"?u$($):$}var n$=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function u$($){let X="";for(let W=0;W<$.length;W++){if(!n$.has($[W]))X+="\\";X+=$[W]}return X}function $0($,X,W,J){if($.format||$.anyOf?.some((Y)=>Y.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&J.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:X,...W&&J.errorMessages&&{errorMessage:{format:W}}})}else L($,"format",X,W,J)}function l($,X,W,J){if($.pattern||$.allOf?.some((Y)=>Y.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&J.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:i2(X,J),...W&&J.errorMessages&&{errorMessage:{pattern:W}}})}else L($,"pattern",i2(X,J),W,J)}function i2($,X){if(!X.applyRegexFlags||!$.flags)return $.source;let W={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},J=W.i?$.source.toLowerCase():$.source,Y="",G=!1,H=!1,w=!1;for(let B=0;B<J.length;B++){if(G){Y+=J[B],G=!1;continue}if(W.i){if(H){if(J[B].match(/[a-z]/)){if(w)Y+=J[B],Y+=`${J[B-2]}-${J[B]}`.toUpperCase(),w=!1;else if(J[B+1]==="-"&&J[B+2]?.match(/[a-z]/))Y+=J[B],w=!0;else Y+=`${J[B]}${J[B].toUpperCase()}`;continue}}else if(J[B].match(/[a-z]/)){Y+=`[${J[B]}${J[B].toUpperCase()}]`;continue}}if(W.m){if(J[B]==="^"){Y+=`(^|(?<=[\r
|
|
5
|
-
|
|
6
|
-
]))`;continue}}if(W.s&&J[B]==="."){Y+=H?`${J[B]}\r
|
|
7
|
-
|
|
8
|
-
]`;continue}if(Y+=J[B],J[B]==="\\")G=!0;else if(H&&J[B]==="]")H=!1;else if(!H&&J[B]==="[")H=!0}try{new RegExp(Y)}catch{return console.warn(`Could not convert regex pattern at ${X.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return Y}function E1($,X){if(X.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(X.target==="openApi3"&&$.keyType?._def.typeName===V.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((J,Y)=>({...J,[Y]:F($.valueType._def,{...X,currentPath:[...X.currentPath,"properties",Y]})??{}}),{}),additionalProperties:X.rejectedAdditionalProperties};let W={type:"object",additionalProperties:F($.valueType._def,{...X,currentPath:[...X.currentPath,"additionalProperties"]})??X.allowedAdditionalProperties};if(X.target==="openApi3")return W;if($.keyType?._def.typeName===V.ZodString&&$.keyType._def.checks?.length){let{type:J,...Y}=_1($.keyType._def,X);return{...W,propertyNames:Y}}else if($.keyType?._def.typeName===V.ZodEnum)return{...W,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===V.ZodBranded&&$.keyType._def.type._def.typeName===V.ZodString&&$.keyType._def.type._def.checks?.length){let{type:J,...Y}=L1($.keyType._def,X);return{...W,propertyNames:Y}}return W}function d2($,X){if(X.mapStrategy==="record")return E1($,X);let W=F($.keyType._def,{...X,currentPath:[...X.currentPath,"items","items","0"]})||{},J=F($.valueType._def,{...X,currentPath:[...X.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[W,J],minItems:2,maxItems:2}}}function o2($){let X=$.values,J=Object.keys($.values).filter((G)=>{return typeof X[X[G]]!=="number"}).map((G)=>X[G]),Y=Array.from(new Set(J.map((G)=>typeof G)));return{type:Y.length===1?Y[0]==="string"?"string":"number":["string","number"],enum:J}}function r2(){return{not:{}}}function a2($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var d0={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function s2($,X){if(X.target==="openApi3")return t2($,X);let W=$.options instanceof Map?Array.from($.options.values()):$.options;if(W.every((J)=>(J._def.typeName in d0)&&(!J._def.checks||!J._def.checks.length))){let J=W.reduce((Y,G)=>{let H=d0[G._def.typeName];return H&&!Y.includes(H)?[...Y,H]:Y},[]);return{type:J.length>1?J:J[0]}}else if(W.every((J)=>J._def.typeName==="ZodLiteral"&&!J.description)){let J=W.reduce((Y,G)=>{let H=typeof G._def.value;switch(H){case"string":case"number":case"boolean":return[...Y,H];case"bigint":return[...Y,"integer"];case"object":if(G._def.value===null)return[...Y,"null"];case"symbol":case"undefined":case"function":default:return Y}},[]);if(J.length===W.length){let Y=J.filter((G,H,w)=>w.indexOf(G)===H);return{type:Y.length>1?Y:Y[0],enum:W.reduce((G,H)=>{return G.includes(H._def.value)?G:[...G,H._def.value]},[])}}}else if(W.every((J)=>J._def.typeName==="ZodEnum"))return{type:"string",enum:W.reduce((J,Y)=>[...J,...Y._def.values.filter((G)=>!J.includes(G))],[])};return t2($,X)}var t2=($,X)=>{let W=($.options instanceof Map?Array.from($.options.values()):$.options).map((J,Y)=>F(J._def,{...X,currentPath:[...X.currentPath,"anyOf",`${Y}`]})).filter((J)=>!!J&&(!X.strictUnions||typeof J==="object"&&Object.keys(J).length>0));return W.length?{anyOf:W}:void 0};function e2($,X){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(X.target==="openApi3")return{type:d0[$.innerType._def.typeName],nullable:!0};return{type:[d0[$.innerType._def.typeName],"null"]}}if(X.target==="openApi3"){let J=F($.innerType._def,{...X,currentPath:[...X.currentPath]});if(J&&"$ref"in J)return{allOf:[J],nullable:!0};return J&&{...J,nullable:!0}}let W=F($.innerType._def,{...X,currentPath:[...X.currentPath,"anyOf","0"]});return W&&{anyOf:[W,{type:"null"}]}}function $4($,X){let W={type:"number"};if(!$.checks)return W;for(let J of $.checks)switch(J.kind){case"int":W.type="integer",u1(W,"type",J.message,X);break;case"min":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"minimum",J.value,J.message,X);else L(W,"exclusiveMinimum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMinimum=!0;L(W,"minimum",J.value,J.message,X)}break;case"max":if(X.target==="jsonSchema7")if(J.inclusive)L(W,"maximum",J.value,J.message,X);else L(W,"exclusiveMaximum",J.value,J.message,X);else{if(!J.inclusive)W.exclusiveMaximum=!0;L(W,"maximum",J.value,J.message,X)}break;case"multipleOf":L(W,"multipleOf",J.value,J.message,X);break}return W}function X4($,X){let W=X.target==="openAi",J={type:"object",properties:{}},Y=[],G=$.shape();for(let w in G){let B=G[w];if(B===void 0||B._def===void 0)continue;let D=p$(B);if(D&&W){if(B instanceof u)B=B._def.innerType;if(!B.isNullable())B=B.nullable();D=!1}let j=F(B._def,{...X,currentPath:[...X.currentPath,"properties",w],propertyPath:[...X.currentPath,"properties",w]});if(j===void 0)continue;if(J.properties[w]=j,!D)Y.push(w)}if(Y.length)J.required=Y;let H=c$($,X);if(H!==void 0)J.additionalProperties=H;return J}function c$($,X){if($.catchall._def.typeName!=="ZodNever")return F($.catchall._def,{...X,currentPath:[...X.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return X.allowedAdditionalProperties;case"strict":return X.rejectedAdditionalProperties;case"strip":return X.removeAdditionalStrategy==="strict"?X.allowedAdditionalProperties:X.rejectedAdditionalProperties}}function p$($){try{return $.isOptional()}catch{return!0}}var W4=($,X)=>{if(X.currentPath.toString()===X.propertyPath?.toString())return F($.innerType._def,X);let W=F($.innerType._def,{...X,currentPath:[...X.currentPath,"anyOf","1"]});return W?{anyOf:[{not:{}},W]}:{}};var J4=($,X)=>{if(X.pipeStrategy==="input")return F($.in._def,X);else if(X.pipeStrategy==="output")return F($.out._def,X);let W=F($.in._def,{...X,currentPath:[...X.currentPath,"allOf","0"]}),J=F($.out._def,{...X,currentPath:[...X.currentPath,"allOf",W?"1":"0"]});return{allOf:[W,J].filter((Y)=>Y!==void 0)}};function Y4($,X){return F($.type._def,X)}function G4($,X){let J={type:"array",uniqueItems:!0,items:F($.valueType._def,{...X,currentPath:[...X.currentPath,"items"]})};if($.minSize)L(J,"minItems",$.minSize.value,$.minSize.message,X);if($.maxSize)L(J,"maxItems",$.maxSize.value,$.maxSize.message,X);return J}function Q4($,X){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((W,J)=>F(W._def,{...X,currentPath:[...X.currentPath,"items",`${J}`]})).reduce((W,J)=>J===void 0?W:[...W,J],[]),additionalItems:F($.rest._def,{...X,currentPath:[...X.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((W,J)=>F(W._def,{...X,currentPath:[...X.currentPath,"items",`${J}`]})).reduce((W,J)=>J===void 0?W:[...W,J],[])}}function H4(){return{not:{}}}function w4(){return{}}var B4=($,X)=>{return F($.innerType._def,X)};var D4=($,X,W)=>{switch(X){case V.ZodString:return _1($,W);case V.ZodNumber:return $4($,W);case V.ZodObject:return X4($,W);case V.ZodBigInt:return y2($,W);case V.ZodBoolean:return Z2();case V.ZodDate:return c1($,W);case V.ZodUndefined:return H4();case V.ZodNull:return a2(W);case V.ZodArray:return g2($,W);case V.ZodUnion:case V.ZodDiscriminatedUnion:return s2($,W);case V.ZodIntersection:return c2($,W);case V.ZodTuple:return Q4($,W);case V.ZodRecord:return E1($,W);case V.ZodLiteral:return p2($,W);case V.ZodEnum:return u2($);case V.ZodNativeEnum:return o2($);case V.ZodNullable:return e2($,W);case V.ZodOptional:return W4($,W);case V.ZodMap:return d2($,W);case V.ZodSet:return G4($,W);case V.ZodLazy:return()=>$.getter()._def;case V.ZodPromise:return Y4($,W);case V.ZodNaN:case V.ZodNever:return r2();case V.ZodEffects:return n2($,W);case V.ZodAny:return h2();case V.ZodUnknown:return w4();case V.ZodDefault:return l2($,W);case V.ZodBranded:return L1($,W);case V.ZodReadonly:return B4($,W);case V.ZodCatch:return m2($,W);case V.ZodPipeline:return J4($,W);case V.ZodFunction:case V.ZodVoid:case V.ZodSymbol:return;default:return((J)=>{return})(X)}};function F($,X,W=!1){let J=X.seen.get($);if(X.override){let w=X.override?.($,X,J,W);if(w!==T2)return w}if(J&&!W){let w=i$(J,X);if(w!==void 0)return w}let Y={def:$,path:X.currentPath,jsonSchema:void 0};X.seen.set($,Y);let G=D4($,$.typeName,X),H=typeof G==="function"?F(G(),X):G;if(H)o$($,X,H);if(X.postProcess){let w=X.postProcess(H,$,X);return Y.jsonSchema=H,w}return Y.jsonSchema=H,H}var i$=($,X)=>{switch(X.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:d$(X.currentPath,$.path)};case"none":case"seen":{if($.path.length<X.currentPath.length&&$.path.every((W,J)=>X.currentPath[J]===W))return console.warn(`Recursive reference detected at ${X.currentPath.join("/")}! Defaulting to any`),{};return X.$refStrategy==="seen"?{}:void 0}}},d$=($,X)=>{let W=0;for(;W<$.length&&W<X.length;W++)if($[W]!==X[W])break;return[($.length-W).toString(),...X.slice(W)].join("/")},o$=($,X,W)=>{if($.description){if(W.description=$.description,X.markdownDescription)W.markdownDescription=$.description}return W};var d1=($,X)=>{let W=x2(X),J=typeof X==="object"&&X.definitions?Object.entries(X.definitions).reduce((B,[D,j])=>({...B,[D]:F(j._def,{...W,currentPath:[...W.basePath,W.definitionPath,D]},!0)??{}}),{}):void 0,Y=typeof X==="string"?X:X?.nameStrategy==="title"?void 0:X?.name,G=F($._def,Y===void 0?W:{...W,currentPath:[...W.basePath,W.definitionPath,Y]},!1)??{},H=typeof X==="object"&&X.name!==void 0&&X.nameStrategy==="title"?X.name:void 0;if(H!==void 0)G.title=H;let w=Y===void 0?J?{...G,[W.definitionPath]:J}:G:{$ref:[...W.$refStrategy==="relative"?[]:W.basePath,W.definitionPath,Y].join("/"),[W.definitionPath]:{...J,[Y]:G}};if(W.target==="jsonSchema7")w.$schema="http://json-schema.org/draft-07/schema#";else if(W.target==="jsonSchema2019-09"||W.target==="openAi")w.$schema="https://json-schema.org/draft/2019-09/schema#";if(W.target==="openAi"&&(("anyOf"in w)||("oneOf"in w)||("allOf"in w)||("type"in w)&&Array.isArray(w.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return w};var o1;(function($){$.Completable="McpCompletable"})(o1||(o1={}));class o0 extends N{_parse($){let{ctx:X}=this._processInputParams($),W=X.data;return this._def.type._parse({data:W,path:X.path,parent:X})}unwrap(){return this._def.type}}o0.create=($,X)=>{return new o0({type:$,typeName:o1.Completable,complete:X.complete,...r$(X)})};function r$($){if(!$)return{};let{errorMap:X,invalid_type_error:W,required_error:J,description:Y}=$;if(X&&(W||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(X)return{errorMap:X,description:Y};return{errorMap:(H,w)=>{var B,D;let{message:j}=$;if(H.code==="invalid_enum_value")return{message:j!==null&&j!==void 0?j:w.defaultError};if(typeof w.data==="undefined")return{message:(B=j!==null&&j!==void 0?j:J)!==null&&B!==void 0?B:w.defaultError};if(H.code!=="invalid_type")return{message:w.defaultError};return{message:(D=j!==null&&j!==void 0?j:W)!==null&&D!==void 0?D:w.defaultError}},description:Y}}class w0{static isTemplate($){return/\{[^}\s]+\}/.test($)}static validateLength($,X,W){if($.length>X)throw new Error(`${W} exceeds maximum length of ${X} characters (got ${$.length})`)}constructor($){w0.validateLength($,1e6,"Template"),this.template=$,this.parts=this.parse($)}toString(){return this.template}parse($){let X=[],W="",J=0,Y=0;while(J<$.length)if($[J]==="{"){if(W)X.push(W),W="";let G=$.indexOf("}",J);if(G===-1)throw new Error("Unclosed template expression");if(Y++,Y>1e4)throw new Error("Template contains too many expressions (max 10000)");let H=$.slice(J+1,G),w=this.getOperator(H),B=H.includes("*"),D=this.getNames(H),j=D[0];for(let R of D)w0.validateLength(R,1e6,"Variable name");X.push({name:j,operator:w,names:D,exploded:B}),J=G+1}else W+=$[J],J++;if(W)X.push(W);return X}getOperator($){return["+","#",".","/","?","&"].find((W)=>$.startsWith(W))||""}getNames($){let X=this.getOperator($);return $.slice(X.length).split(",").map((W)=>W.replace("*","").trim()).filter((W)=>W.length>0)}encodeValue($,X){if(w0.validateLength($,1e6,"Variable value"),X==="+"||X==="#")return encodeURI($);return encodeURIComponent($)}expandPart($,X){if($.operator==="?"||$.operator==="&"){let G=$.names.map((w)=>{let B=X[w];if(B===void 0)return"";let D=Array.isArray(B)?B.map((j)=>this.encodeValue(j,$.operator)).join(","):this.encodeValue(B.toString(),$.operator);return`${w}=${D}`}).filter((w)=>w.length>0);if(G.length===0)return"";return($.operator==="?"?"?":"&")+G.join("&")}if($.names.length>1){let G=$.names.map((H)=>X[H]).filter((H)=>H!==void 0);if(G.length===0)return"";return G.map((H)=>Array.isArray(H)?H[0]:H).join(",")}let W=X[$.name];if(W===void 0)return"";let Y=(Array.isArray(W)?W:[W]).map((G)=>this.encodeValue(G,$.operator));switch($.operator){case"":return Y.join(",");case"+":return Y.join(",");case"#":return"#"+Y.join(",");case".":return"."+Y.join(".");case"/":return"/"+Y.join("/");default:return Y.join(",")}}expand($){let X="",W=!1;for(let J of this.parts){if(typeof J==="string"){X+=J;continue}let Y=this.expandPart(J,$);if(!Y)continue;if((J.operator==="?"||J.operator==="&")&&W)X+=Y.replace("?","&");else X+=Y;if(J.operator==="?"||J.operator==="&")W=!0}return X}escapeRegExp($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp($){let X=[];for(let Y of $.names)w0.validateLength(Y,1e6,"Variable name");if($.operator==="?"||$.operator==="&"){for(let Y=0;Y<$.names.length;Y++){let G=$.names[Y],H=Y===0?"\\"+$.operator:"&";X.push({pattern:H+this.escapeRegExp(G)+"=([^&]+)",name:G})}return X}let W,J=$.name;switch($.operator){case"":W=$.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)";break;case"+":case"#":W="(.+)";break;case".":W="\\.([^/,]+)";break;case"/":W="/"+($.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)");break;default:W="([^/]+)"}return X.push({pattern:W,name:J}),X}match($){w0.validateLength($,1e6,"URI");let X="^",W=[];for(let H of this.parts)if(typeof H==="string")X+=this.escapeRegExp(H);else{let w=this.partToRegExp(H);for(let{pattern:B,name:D}of w)X+=B,W.push({name:D,exploded:H.exploded})}X+="$",w0.validateLength(X,1e6,"Generated regex pattern");let J=new RegExp(X),Y=$.match(J);if(!Y)return null;let G={};for(let H=0;H<W.length;H++){let{name:w,exploded:B}=W[H],D=Y[H+1],j=w.replace("*","");if(B&&D.includes(","))G[j]=D.split(",");else G[j]=D}return G}}class r1{constructor($,X){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new n1($,X)}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(N1.shape.method.value),this.server.assertCanSetRequestHandler(q1.shape.method.value),this.server.registerCapabilities({tools:{}}),this.server.setRequestHandler(N1,()=>({tools:Object.entries(this._registeredTools).map(([$,X])=>{return{name:$,description:X.description,inputSchema:X.inputSchema?d1(X.inputSchema,{strictUnions:!0}):a$}})})),this.server.setRequestHandler(q1,async($,X)=>{let W=this._registeredTools[$.params.name];if(!W)throw new m(h.InvalidParams,`Tool ${$.params.name} not found`);if(W.inputSchema){let J=await W.inputSchema.safeParseAsync($.params.arguments);if(!J.success)throw new m(h.InvalidParams,`Invalid arguments for tool ${$.params.name}: ${J.error.message}`);let Y=J.data,G=W.callback;try{return await Promise.resolve(G(Y,X))}catch(H){return{content:[{type:"text",text:H instanceof Error?H.message:String(H)}],isError:!0}}}else{let J=W.callback;try{return await Promise.resolve(J(X))}catch(Y){return{content:[{type:"text",text:Y instanceof Error?Y.message:String(Y)}],isError:!0}}}}),this._toolHandlersInitialized=!0}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(R1.shape.method.value),this.server.setRequestHandler(R1,async($)=>{switch($.params.ref.type){case"ref/prompt":return this.handlePromptCompletion($,$.params.ref);case"ref/resource":return this.handleResourceCompletion($,$.params.ref);default:throw new m(h.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,X){let W=this._registeredPrompts[X.name];if(!W)throw new m(h.InvalidParams,`Prompt ${$.params.ref.name} not found`);if(!W.argsSchema)return f1;let J=W.argsSchema.shape[$.params.argument.name];if(!(J instanceof o0))return f1;let G=await J._def.complete($.params.argument.value);return M4(G)}async handleResourceCompletion($,X){let W=Object.values(this._registeredResourceTemplates).find((G)=>G.resourceTemplate.uriTemplate.toString()===X.uri);if(!W){if(this._registeredResources[X.uri])return f1;throw new m(h.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let J=W.resourceTemplate.completeCallback($.params.argument.name);if(!J)return f1;let Y=await J($.params.argument.value);return M4(Y)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(O1.shape.method.value),this.server.assertCanSetRequestHandler(A1.shape.method.value),this.server.assertCanSetRequestHandler(z1.shape.method.value),this.server.registerCapabilities({resources:{}}),this.server.setRequestHandler(O1,async($,X)=>{let W=Object.entries(this._registeredResources).map(([Y,G])=>({uri:Y,name:G.name,...G.metadata})),J=[];for(let Y of Object.values(this._registeredResourceTemplates)){if(!Y.resourceTemplate.listCallback)continue;let G=await Y.resourceTemplate.listCallback(X);for(let H of G.resources)J.push({...H,...Y.metadata})}return{resources:[...W,...J]}}),this.server.setRequestHandler(A1,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([X,W])=>({name:X,uriTemplate:W.resourceTemplate.uriTemplate.toString(),...W.metadata}))}}),this.server.setRequestHandler(z1,async($,X)=>{let W=new URL($.params.uri),J=this._registeredResources[W.toString()];if(J)return J.readCallback(W,X);for(let Y of Object.values(this._registeredResourceTemplates)){let G=Y.resourceTemplate.uriTemplate.match(W.toString());if(G)return Y.readCallback(W,G,X)}throw new m(h.InvalidParams,`Resource ${W} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(U1.shape.method.value),this.server.assertCanSetRequestHandler(K1.shape.method.value),this.server.registerCapabilities({prompts:{}}),this.server.setRequestHandler(U1,()=>({prompts:Object.entries(this._registeredPrompts).map(([$,X])=>{return{name:$,description:X.description,arguments:X.argsSchema?t$(X.argsSchema):void 0}})})),this.server.setRequestHandler(K1,async($,X)=>{let W=this._registeredPrompts[$.params.name];if(!W)throw new m(h.InvalidParams,`Prompt ${$.params.name} not found`);if(W.argsSchema){let J=await W.argsSchema.safeParseAsync($.params.arguments);if(!J.success)throw new m(h.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${J.error.message}`);let Y=J.data,G=W.callback;return await Promise.resolve(G(Y,X))}else{let J=W.callback;return await Promise.resolve(J(X))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource($,X,...W){let J;if(typeof W[0]==="object")J=W.shift();let Y=W[0];if(typeof X==="string"){if(this._registeredResources[X])throw new Error(`Resource ${X} is already registered`);this._registeredResources[X]={name:$,metadata:J,readCallback:Y}}else{if(this._registeredResourceTemplates[$])throw new Error(`Resource template ${$} is already registered`);this._registeredResourceTemplates[$]={resourceTemplate:X,metadata:J,readCallback:Y}}this.setResourceRequestHandlers()}tool($,...X){if(this._registeredTools[$])throw new Error(`Tool ${$} is already registered`);let W;if(typeof X[0]==="string")W=X.shift();let J;if(X.length>1)J=X.shift();let Y=X[0];this._registeredTools[$]={description:W,inputSchema:J===void 0?void 0:Q.object(J),callback:Y},this.setToolRequestHandlers()}prompt($,...X){if(this._registeredPrompts[$])throw new Error(`Prompt ${$} is already registered`);let W;if(typeof X[0]==="string")W=X.shift();let J;if(X.length>1)J=X.shift();let Y=X[0];this._registeredPrompts[$]={description:W,argsSchema:J===void 0?void 0:Q.object(J),callback:Y},this.setPromptRequestHandlers()}}class S0{constructor($,X){this._callbacks=X,this._uriTemplate=typeof $==="string"?new w0($):$}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback($){var X;return(X=this._callbacks.complete)===null||X===void 0?void 0:X[$]}}var a$={type:"object"};function t$($){return Object.entries($.shape).map(([X,W])=>({name:X,description:W.description,required:!W.isOptional()}))}function M4($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var f1={completion:{values:[],hasMore:!1}};import j4 from"node:process";class a1{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
|
|
9
|
-
`);if($===-1)return null;let X=this._buffer.toString("utf8",0,$);return this._buffer=this._buffer.subarray($+1),s$(X)}clear(){this._buffer=void 0}}function s$($){return R2.parse(JSON.parse($))}function V4($){return JSON.stringify($)+`
|
|
10
|
-
`}class t1{constructor($=j4.stdin,X=j4.stdout){this._stdin=$,this._stdout=X,this._readBuffer=new a1,this._started=!1,this._ondata=(W)=>{this._readBuffer.append(W),this.processReadBuffer()},this._onerror=(W)=>{var J;(J=this.onerror)===null||J===void 0||J.call(this,W)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var $,X;while(!0)try{let W=this._readBuffer.readMessage();if(W===null)break;($=this.onmessage)===null||$===void 0||$.call(this,W)}catch(W){(X=this.onerror)===null||X===void 0||X.call(this,W)}}async close(){var $;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),($=this.onclose)===null||$===void 0||$.call(this)}send($){return new Promise((X)=>{let W=V4($);if(this._stdout.write(W))X();else this._stdout.once("drain",X)})}}var F4=p4(K4(),1);F4.default.config();var N3=process.env.LOGSEQ_PORT||"12315",q3=process.env.LOGSEQ_HOST||"127.0.0.1",X2=process.env.LOGSEQ_TOKEN||"",S4=`http://${q3}:${N3}/api`;if(!X2&&process.env.TEST_TYPE!=="unit"&&process.env.MOCK_LOGSEQ_API!=="true")console.error("Error: LOGSEQ_TOKEN is required. Set it in a .env file or as an environment variable."),process.exit(1);var C=(...$)=>console.error(...$);var R3=process.env.MOCK_LOGSEQ_API==="true",I={pages:[{name:"MCP-Test-Page",uuid:"mock-page-1",properties:{"test-property":"test-value"}},{name:"Current-Test-Page",uuid:"mock-page-2",properties:{}},{name:"Reference-Test-Page",uuid:"mock-page-3",properties:{}},{name:"Recipe Page",uuid:"mock-page-4",properties:{tags:["recipe"]}},{name:"Tasks-Page",uuid:"mock-page-5",properties:{}}],blocks:[{uuid:"mock-block-uuid",content:"This is a test block created by MCP integration test",page:{id:"MCP-Test-Page"},parent:null},{uuid:"task-todo",content:"TODO This is a todo task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-doing",content:"DOING This is a doing task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-done",content:"DONE This is a done task",page:{id:"Tasks-Page"},parent:null},{uuid:"recipe-block",content:"This is a recipe block",page:{id:"Recipe Page"},properties:{tags:["recipe"]},parent:null}],currentPage:{name:"Current-Test-Page",uuid:"mock-page-2"}};async function K($,X=[]){if(R3)return L3($,X);try{C(`Calling Logseq API: ${$} with args:`,JSON.stringify(X));let W=await fetch(S4,{method:"POST",headers:{Authorization:`Bearer ${X2}`,"Content-Type":"application/json"},body:JSON.stringify({method:$,args:X})});if(!W.ok)throw new Error(`Logseq API error: ${W.status} ${W.statusText}`);let J;try{let Y=await W.text();if(!Y||Y.trim()==="")return C(`Empty response from Logseq API (${$})`),null;J=JSON.parse(Y)}catch(Y){if(C(`JSON parse error for ${$}:`,Y),$.includes("getBlockProperty")||$.includes("getProperty")||$.includes("removeBlockProperty"))return null;throw new Error(`Failed to parse JSON response: ${Y.message}`)}return C("Logseq API response:",JSON.stringify(J).substring(0,200)+"..."),J}catch(W){throw console.error(`Error calling Logseq API (${$}):`,W),W}}function L3($,X=[]){switch(C(`[MOCK] Calling Logseq API: ${$} with args:`,JSON.stringify(X)),$){case"logseq.Editor.createPage":let[W,J,Y]=X,G={name:W,uuid:`page-${Date.now()}`,properties:J||{}};if(I.pages.push(G),Y?.redirect)I.currentPage={name:W,uuid:G.uuid||"mock-page-2"};return{name:W,uuid:G.uuid||"mock-page-2",properties:J||{},id:Date.now()};case"logseq.Editor.getPage":let H=X[0],w=I.pages.find((z)=>z.name.toLowerCase()===H.toLowerCase());if(!w)return null;return{name:w.name.toLowerCase().replace(/\s/g,"-"),originalName:w.name,uuid:w.uuid||"mock-page-2",properties:w.properties,id:Date.now()};case"logseq.Editor.getCurrentPage":return{name:I.currentPage.name.toLowerCase().replace(/\s/g,"-"),originalName:I.currentPage.name,uuid:I.currentPage.uuid||"mock-page-2",id:Date.now()};case"logseq.Editor.getAllPages":return I.pages.map((z)=>({name:z.name.toLowerCase().replace(/\s/g,"-"),originalName:z.name,uuid:z.uuid||"mock-page-2",id:Date.now(),journal:!1}));case"logseq.Editor.getPageBlocksTree":let B=X[0];return I.blocks.filter((z)=>z.page.id.toLowerCase()===B.toLowerCase()||z.page.id.toLowerCase().replace(/\s/g,"-")===B.toLowerCase());case"logseq.Editor.getPageLinkedReferences":return[{from:{name:"Another-Page",uuid:"mock-page-ref"},to:{name:X[0],uuid:"mock-page-target"},content:"Reference content"}];case"logseq.Editor.createBlock":let[D,j,R]=X,f={uuid:`mock-block-${Date.now()}`,content:j,page:{id:D},properties:R?.properties||{},parent:null};return I.blocks.push(f),f;case"logseq.Editor.insertBlock":let[b,v,T]=X,E={uuid:`mock-block-${Date.now()}`,content:v,page:{id:typeof b==="string"&&!b.includes("-")?b:"MCP-Test-Page"},properties:T?.properties||{},parent:typeof b==="string"&&b.includes("-")?b:null};return I.blocks.push(E),E;case"logseq.Editor.getBlock":let[d,Y0]=X,N0=I.blocks.find((z)=>z.uuid===d);if(!N0)return null;if(Y0?.includeChildren)return{...N0,children:I.blocks.filter((z)=>z.parent===d)};return N0;case"logseq.Editor.updateBlock":let[O0,a0,W2]=X,t0=I.blocks.find((z)=>z.uuid===O0);if(t0){if(t0.content=a0,W2?.properties)t0.properties={...t0.properties,...W2.properties}}return null;case"logseq.Editor.removeBlock":let[h4]=X,J2=I.blocks.findIndex((z)=>z.uuid===h4);if(J2>=0)I.blocks.splice(J2,1);return null;case"logseq.Editor.getBlockProperty":let[g4,y4]=X,I1=I.blocks.find((z)=>z.uuid===g4);if(!I1||!I1.properties)return null;return I1.properties[y4]||null;case"logseq.Editor.getBlockProperties":let[Z4]=X,Y2=I.blocks.find((z)=>z.uuid===Z4);if(!Y2)return null;return Y2.properties||{};case"logseq.DB.datascriptQuery":let[p]=X;if(p&&typeof p==="string"&&p.includes(":block/marker")){let z=p&&typeof p==="string"&&p.includes("TODO")?["TODO"]:p&&typeof p==="string"&&p.includes("DOING")?["DOING"]:p&&typeof p==="string"&&p.includes("DONE")?["DONE"]:["TODO","DOING","DONE"];return I.blocks.filter((b1)=>{let m4=b1.content.split(" ")[0]||"";return z.includes(m4)}).map((b1)=>[b1])}return[[{uuid:"mock-query-result",content:"Mock query result",properties:{}}]];case"logseq.DB.q":let[s0]=X;if(s0&&typeof s0==="string"){let z=I.blocks.filter((e0)=>e0.content.includes(s0)).map((e0)=>[e0]);return z.length>0?z:[[{uuid:"search-result",content:`Content matching ${s0}`,page:{id:"MCP-Test-Page"}}]]}return[[{uuid:"search-result",content:"Default search result",page:{id:"MCP-Test-Page"}}]];case"logseq.Datascript.q":let[x]=X;if(x&&typeof x==="string"&&x.includes("block/marker"))return I.blocks.filter((z)=>z.content.startsWith("TODO")||z.content.startsWith("DOING")||z.content.startsWith("DONE")).map((z)=>[z.uuid,z.content.split(" ")[0]]);else if(x&&typeof x==="string"&&x.includes(":block/content"))return I.blocks.map((z)=>[[{uuid:z.uuid,content:z.content,":block/content":z.content,page:z.page}]]);else if(x&&typeof x==="string"&&x.includes(":block/_refs"))return[["mock-reference-uuid"]];else if(x&&typeof x==="string"&&x.includes(":block/properties")&&x.includes("recipe"))return I.blocks.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>[z.uuid]);else if(x&&typeof x==="string"&&x.includes(":page/properties")&&x.includes("recipe"))return I.pages.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>[z.name]);return I.blocks.map((z)=>[[{uuid:z.uuid,content:z.content}]]);case"logseq.Datascript.qUpsert":return{blocks:I.blocks.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>({uuid:z.uuid,content:z.content})),pages:I.pages.filter((z)=>z.properties&&z.properties.tags&&z.properties.tags.includes("recipe")).map((z)=>({name:z.name}))};default:return C(`[MOCK] Unhandled method: ${$}`),null}}function N4($){$.tool("query",`Search and query the Logseq graph using Datalog queries or text search. This is the most powerful way to retrieve specific information.
|
|
2
|
+
import{createRequire as VK}from"node:module";var NK=Object.create;var{getPrototypeOf:DK,defineProperty:DG,getOwnPropertyNames:BK}=Object;var wK=Object.prototype.hasOwnProperty;var BG=($,X,W)=>{W=$!=null?NK(DK($)):{};let Y=X||!$||!$.__esModule?DG(W,"default",{value:$,enumerable:!0}):W;for(let J of BK($))if(!wK.call(Y,J))DG(Y,J,{get:()=>$[J],enumerable:!0});return Y};var v=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var X1=($,X)=>{for(var W in X)DG($,W,{get:X[W],enumerable:!0,configurable:!0,set:(Y)=>X[W]=()=>Y})};var pW=VK(import.meta.url);var aX=v((nj)=>{Object.defineProperty(nj,"__esModule",{value:!0});nj.regexpCode=nj.getEsmExportName=nj.getProperty=nj.safeStringify=nj.stringify=nj.strConcat=nj.addCodeArg=nj.str=nj._=nj.nil=nj._Code=nj.Name=nj.IDENTIFIER=nj._CodeOrName=void 0;class cY{}nj._CodeOrName=cY;nj.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Y0 extends cY{constructor($){super();if(!nj.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}nj.Name=Y0;class f4 extends cY{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((X,W)=>`${X}${W}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((X,W)=>{if(W instanceof Y0)X[W.str]=(X[W.str]||0)+1;return X},{})}}nj._Code=f4;nj.nil=new f4("");function mj($,...X){let W=[$[0]],Y=0;while(Y<X.length)s7(W,X[Y]),W.push($[++Y]);return new f4(W)}nj._=mj;var a7=new f4("+");function ij($,...X){let W=[tX($[0])],Y=0;while(Y<X.length)W.push(a7),s7(W,X[Y]),W.push(a7,tX($[++Y]));return GS(W),new f4(W)}nj.str=ij;function s7($,X){if(X instanceof f4)$.push(...X._items);else if(X instanceof Y0)$.push(X);else $.push(zS(X))}nj.addCodeArg=s7;function GS($){let X=1;while(X<$.length-1){if($[X]===a7){let W=US($[X-1],$[X+1]);if(W!==void 0){$.splice(X-1,3,W);continue}$[X++]="+"}X++}}function US($,X){if(X==='""')return $;if($==='""')return X;if(typeof $=="string"){if(X instanceof Y0||$[$.length-1]!=='"')return;if(typeof X!="string")return`${$.slice(0,-1)}${X}"`;if(X[0]==='"')return $.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!($ instanceof Y0))return`"${$}${X.slice(1)}`;return}function QS($,X){return X.emptyStr()?$:$.emptyStr()?X:ij`${$}${X}`}nj.strConcat=QS;function zS($){return typeof $=="number"||typeof $=="boolean"||$===null?$:tX(Array.isArray($)?$.join(","):$)}function HS($){return new f4(tX($))}nj.stringify=HS;function tX($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}nj.safeStringify=tX;function jS($){return typeof $=="string"&&nj.IDENTIFIER.test($)?new f4(`.${$}`):mj`[${$}]`}nj.getProperty=jS;function IS($){if(typeof $=="string"&&nj.IDENTIFIER.test($))return new f4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}nj.getEsmExportName=IS;function OS($){return new f4($.toString())}nj.regexpCode=OS});var Wz=v((dj)=>{Object.defineProperty(dj,"__esModule",{value:!0});dj.ValueScope=dj.ValueScopeName=dj.Scope=dj.varKinds=dj.UsedValueState=void 0;var N4=aX();class rj extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var pY;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(pY||(dj.UsedValueState=pY={}));dj.varKinds={const:new N4.Name("const"),let:new N4.Name("let"),var:new N4.Name("var")};class $z{constructor({prefixes:$,parent:X}={}){this._names={},this._prefixes=$,this._parent=X}toName($){return $ instanceof N4.Name?$:this.name($)}name($){return new N4.Name(this._newName($))}_newName($){let X=this._names[$]||this._nameGroup($);return`${$}${X.index++}`}_nameGroup($){var X,W;if(((W=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||W===void 0?void 0:W.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}dj.Scope=$z;class Xz extends N4.Name{constructor($,X){super(X);this.prefix=$}setValue($,{property:X,itemIndex:W}){this.value=$,this.scopePath=N4._`.${new N4.Name(X)}[${W}]`}}dj.ValueScopeName=Xz;var MS=N4._`\n`;class pj extends $z{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?MS:N4.nil}}get(){return this._scope}name($){return new Xz($,this._newName($))}value($,X){var W;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Y=this.toName($),{prefix:J}=Y,G=(W=X.key)!==null&&W!==void 0?W:X.ref,U=this._values[J];if(U){let H=U.get(G);if(H)return H}else U=this._values[J]=new Map;U.set(G,Y);let Q=this._scope[J]||(this._scope[J]=[]),z=Q.length;return Q[z]=X.ref,Y.setValue(X,{property:J,itemIndex:z}),Y}getValue($,X){let W=this._values[$];if(!W)return;return W.get(X)}scopeRefs($,X=this._values){return this._reduceValues(X,(W)=>{if(W.scopePath===void 0)throw Error(`CodeGen: name "${W}" has no value`);return N4._`${$}${W.scopePath}`})}scopeCode($=this._values,X,W){return this._reduceValues($,(Y)=>{if(Y.value===void 0)throw Error(`CodeGen: name "${Y}" has no value`);return Y.value.code},X,W)}_reduceValues($,X,W={},Y){let J=N4.nil;for(let G in $){let U=$[G];if(!U)continue;let Q=W[G]=W[G]||new Map;U.forEach((z)=>{if(Q.has(z))return;Q.set(z,pY.Started);let H=X(z);if(H){let j=this.opts.es5?dj.varKinds.var:dj.varKinds.const;J=N4._`${J}${j} ${z} = ${H};${this.opts._n}`}else if(H=Y===null||Y===void 0?void 0:Y(z))J=N4._`${J}${H}${this.opts._n}`;else throw new rj(z);Q.set(z,pY.Completed)})}return J}}dj.ValueScope=pj});var X$=v((D4)=>{Object.defineProperty(D4,"__esModule",{value:!0});D4.or=D4.and=D4.not=D4.CodeGen=D4.operators=D4.varKinds=D4.ValueScopeName=D4.ValueScope=D4.Scope=D4.Name=D4.regexpCode=D4.stringify=D4.getProperty=D4.nil=D4.strConcat=D4.str=D4._=void 0;var U$=aX(),h4=Wz(),h6=aX();Object.defineProperty(D4,"_",{enumerable:!0,get:function(){return h6._}});Object.defineProperty(D4,"str",{enumerable:!0,get:function(){return h6.str}});Object.defineProperty(D4,"strConcat",{enumerable:!0,get:function(){return h6.strConcat}});Object.defineProperty(D4,"nil",{enumerable:!0,get:function(){return h6.nil}});Object.defineProperty(D4,"getProperty",{enumerable:!0,get:function(){return h6.getProperty}});Object.defineProperty(D4,"stringify",{enumerable:!0,get:function(){return h6.stringify}});Object.defineProperty(D4,"regexpCode",{enumerable:!0,get:function(){return h6.regexpCode}});Object.defineProperty(D4,"Name",{enumerable:!0,get:function(){return h6.Name}});var eY=Wz();Object.defineProperty(D4,"Scope",{enumerable:!0,get:function(){return eY.Scope}});Object.defineProperty(D4,"ValueScope",{enumerable:!0,get:function(){return eY.ValueScope}});Object.defineProperty(D4,"ValueScopeName",{enumerable:!0,get:function(){return eY.ValueScopeName}});Object.defineProperty(D4,"varKinds",{enumerable:!0,get:function(){return eY.varKinds}});D4.operators={GT:new U$._Code(">"),GTE:new U$._Code(">="),LT:new U$._Code("<"),LTE:new U$._Code("<="),EQ:new U$._Code("==="),NEQ:new U$._Code("!=="),NOT:new U$._Code("!"),OR:new U$._Code("||"),AND:new U$._Code("&&"),ADD:new U$._Code("+")};class l6{optimizeNodes(){return this}optimizeNames($,X){return this}}class tj extends l6{constructor($,X,W){super();this.varKind=$,this.name=X,this.rhs=W}render({es5:$,_n:X}){let W=$?h4.varKinds.var:this.varKind,Y=this.rhs===void 0?"":` = ${this.rhs}`;return`${W} ${this.name}${Y};`+X}optimizeNames($,X){if(!$[this.name.str])return;if(this.rhs)this.rhs=U0(this.rhs,$,X);return this}get names(){return this.rhs instanceof U$._CodeOrName?this.rhs.names:{}}}class Gz extends l6{constructor($,X,W){super();this.lhs=$,this.rhs=X,this.sideEffects=W}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,X){if(this.lhs instanceof U$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=U0(this.rhs,$,X),this}get names(){let $=this.lhs instanceof U$.Name?{}:{...this.lhs.names};return sY($,this.rhs)}}class aj extends Gz{constructor($,X,W,Y){super($,W,Y);this.op=X}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class sj extends l6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class ej extends l6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class $I extends l6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class XI extends l6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,X){return this.code=U0(this.code,$,X),this}get names(){return this.code instanceof U$._CodeOrName?this.code.names:{}}}class $8 extends l6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((X,W)=>X+W.render($),"")}optimizeNodes(){let{nodes:$}=this,X=$.length;while(X--){let W=$[X].optimizeNodes();if(Array.isArray(W))$.splice(X,1,...W);else if(W)$[X]=W;else $.splice(X,1)}return $.length>0?this:void 0}optimizeNames($,X){let{nodes:W}=this,Y=W.length;while(Y--){let J=W[Y];if(J.optimizeNames($,X))continue;RS($,J.names),W.splice(Y,1)}return W.length>0?this:void 0}get names(){return this.nodes.reduce(($,X)=>N1($,X.names),{})}}class m6 extends $8{render($){return"{"+$._n+super.render($)+"}"+$._n}}class WI extends $8{}class sX extends m6{}sX.kind="else";class A6 extends m6{constructor($,X){super(X);this.condition=$}render($){let X=`if(${this.condition})`+super.render($);if(this.else)X+="else "+this.else.render($);return X}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let X=this.else;if(X){let W=X.optimizeNodes();X=this.else=Array.isArray(W)?new sX(W):W}if(X){if($===!1)return X instanceof A6?X:X.nodes;if(this.nodes.length)return this;return new A6(QI($),X instanceof A6?[X]:X.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,X){var W;if(this.else=(W=this.else)===null||W===void 0?void 0:W.optimizeNames($,X),!(super.optimizeNames($,X)||this.else))return;return this.condition=U0(this.condition,$,X),this}get names(){let $=super.names;if(sY($,this.condition),this.else)N1($,this.else.names);return $}}A6.kind="if";class G0 extends m6{}G0.kind="for";class JI extends G0{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iteration=U0(this.iteration,$,X),this}get names(){return N1(super.names,this.iteration.names)}}class YI extends G0{constructor($,X,W,Y){super();this.varKind=$,this.name=X,this.from=W,this.to=Y}render($){let X=$.es5?h4.varKinds.var:this.varKind,{name:W,from:Y,to:J}=this;return`for(${X} ${W}=${Y}; ${W}<${J}; ${W}++)`+super.render($)}get names(){let $=sY(super.names,this.from);return sY($,this.to)}}class Jz extends G0{constructor($,X,W,Y){super();this.loop=$,this.varKind=X,this.name=W,this.iterable=Y}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iterable=U0(this.iterable,$,X),this}get names(){return N1(super.names,this.iterable.names)}}class dY extends m6{constructor($,X,W){super();this.name=$,this.args=X,this.async=W}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}dY.kind="func";class oY extends $8{render($){return"return "+super.render($)}}oY.kind="return";class GI extends m6{render($){let X="try"+super.render($);if(this.catch)X+=this.catch.render($);if(this.finally)X+=this.finally.render($);return X}optimizeNodes(){var $,X;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames($,X){var W,Y;return super.optimizeNames($,X),(W=this.catch)===null||W===void 0||W.optimizeNames($,X),(Y=this.finally)===null||Y===void 0||Y.optimizeNames($,X),this}get names(){let $=super.names;if(this.catch)N1($,this.catch.names);if(this.finally)N1($,this.finally.names);return $}}class tY extends m6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}tY.kind="catch";class aY extends m6{render($){return"finally"+super.render($)}}aY.kind="finally";class UI{constructor($,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
3
|
+
`:""},this._extScope=$,this._scope=new h4.Scope({parent:$}),this._nodes=[new WI]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,X){let W=this._extScope.value($,X);return(this._values[W.prefix]||(this._values[W.prefix]=new Set)).add(W),W}getScopeValue($,X){return this._extScope.getValue($,X)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,X,W,Y){let J=this._scope.toName(X);if(W!==void 0&&Y)this._constants[J.str]=W;return this._leafNode(new tj($,J,W)),J}const($,X,W){return this._def(h4.varKinds.const,$,X,W)}let($,X,W){return this._def(h4.varKinds.let,$,X,W)}var($,X,W){return this._def(h4.varKinds.var,$,X,W)}assign($,X,W){return this._leafNode(new Gz($,X,W))}add($,X){return this._leafNode(new aj($,D4.operators.ADD,X))}code($){if(typeof $=="function")$();else if($!==U$.nil)this._leafNode(new XI($));return this}object(...$){let X=["{"];for(let[W,Y]of $){if(X.length>1)X.push(",");if(X.push(W),W!==Y||this.opts.es5)X.push(":"),(0,U$.addCodeArg)(X,Y)}return X.push("}"),new U$._Code(X)}if($,X,W){if(this._blockNode(new A6($)),X&&W)this.code(X).else().code(W).endIf();else if(X)this.code(X).endIf();else if(W)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new A6($))}else(){return this._elseNode(new sX)}endIf(){return this._endBlockNode(A6,sX)}_for($,X){if(this._blockNode($),X)this.code(X).endFor();return this}for($,X){return this._for(new JI($),X)}forRange($,X,W,Y,J=this.opts.es5?h4.varKinds.var:h4.varKinds.let){let G=this._scope.toName($);return this._for(new YI(J,G,X,W),()=>Y(G))}forOf($,X,W,Y=h4.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let G=X instanceof U$.Name?X:this.var("_arr",X);return this.forRange("_i",0,U$._`${G}.length`,(U)=>{this.var(J,U$._`${G}[${U}]`),W(J)})}return this._for(new Jz("of",Y,J,X),()=>W(J))}forIn($,X,W,Y=this.opts.es5?h4.varKinds.var:h4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,U$._`Object.keys(${X})`,W);let J=this._scope.toName($);return this._for(new Jz("in",Y,J,X),()=>W(J))}endFor(){return this._endBlockNode(G0)}label($){return this._leafNode(new sj($))}break($){return this._leafNode(new ej($))}return($){let X=new oY;if(this._blockNode(X),this.code($),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(oY)}try($,X,W){if(!X&&!W)throw Error('CodeGen: "try" without "catch" and "finally"');let Y=new GI;if(this._blockNode(Y),this.code($),X){let J=this.name("e");this._currNode=Y.catch=new tY(J),X(J)}if(W)this._currNode=Y.finally=new aY,this.code(W);return this._endBlockNode(tY,aY)}throw($){return this._leafNode(new $I($))}block($,X){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(X);return this}endBlock($){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let W=this._nodes.length-X;if(W<0||$!==void 0&&W!==$)throw Error(`CodeGen: wrong number of nodes: ${W} vs ${$} expected`);return this._nodes.length=X,this}func($,X=U$.nil,W,Y){if(this._blockNode(new dY($,X,W)),Y)this.code(Y).endFunc();return this}endFunc(){return this._endBlockNode(dY)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,X){let W=this._currNode;if(W instanceof $||X&&W instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${$.kind}/${X.kind}`:$.kind}"`)}_elseNode($){let X=this._currNode;if(!(X instanceof A6))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let X=this._nodes;X[X.length-1]=$}}D4.CodeGen=UI;function N1($,X){for(let W in X)$[W]=($[W]||0)+(X[W]||0);return $}function sY($,X){return X instanceof U$._CodeOrName?N1($,X.names):$}function U0($,X,W){if($ instanceof U$.Name)return Y($);if(!J($))return $;return new U$._Code($._items.reduce((G,U)=>{if(U instanceof U$.Name)U=Y(U);if(U instanceof U$._Code)G.push(...U._items);else G.push(U);return G},[]));function Y(G){let U=W[G.str];if(U===void 0||X[G.str]!==1)return G;return delete X[G.str],U}function J(G){return G instanceof U$._Code&&G._items.some((U)=>U instanceof U$.Name&&X[U.str]===1&&W[U.str]!==void 0)}}function RS($,X){for(let W in X)$[W]=($[W]||0)-(X[W]||0)}function QI($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:U$._`!${Yz($)}`}D4.not=QI;var ZS=zI(D4.operators.AND);function kS(...$){return $.reduce(ZS)}D4.and=kS;var TS=zI(D4.operators.OR);function CS(...$){return $.reduce(TS)}D4.or=CS;function zI($){return(X,W)=>X===U$.nil?W:W===U$.nil?X:U$._`${Yz(X)} ${$} ${Yz(W)}`}function Yz($){return $ instanceof U$.Name?$:U$._`(${$})`}});var j$=v((VI)=>{Object.defineProperty(VI,"__esModule",{value:!0});VI.checkStrictMode=VI.getErrorPath=VI.Type=VI.useFunc=VI.setEvaluated=VI.evaluatedPropsToName=VI.mergeEvaluated=VI.eachItem=VI.unescapeJsonPointer=VI.escapeJsonPointer=VI.escapeFragment=VI.unescapeFragment=VI.schemaRefOrVal=VI.schemaHasRulesButRef=VI.schemaHasRules=VI.checkUnknownRules=VI.alwaysValidSchema=VI.toHash=void 0;var b$=X$(),yS=aX();function gS($){let X={};for(let W of $)X[W]=!0;return X}VI.toHash=gS;function fS($,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return OI($,X),!NI(X,$.self.RULES.all)}VI.alwaysValidSchema=fS;function OI($,X=$.schema){let{opts:W,self:Y}=$;if(!W.strictSchema)return;if(typeof X==="boolean")return;let J=Y.RULES.keywords;for(let G in X)if(!J[G])wI($,`unknown keyword: "${G}"`)}VI.checkUnknownRules=OI;function NI($,X){if(typeof $=="boolean")return!$;for(let W in $)if(X[W])return!0;return!1}VI.schemaHasRules=NI;function hS($,X){if(typeof $=="boolean")return!$;for(let W in $)if(W!=="$ref"&&X.all[W])return!0;return!1}VI.schemaHasRulesButRef=hS;function lS({topSchemaRef:$,schemaPath:X},W,Y,J){if(!J){if(typeof W=="number"||typeof W=="boolean")return W;if(typeof W=="string")return b$._`${W}`}return b$._`${$}${X}${(0,b$.getProperty)(Y)}`}VI.schemaRefOrVal=lS;function mS($){return DI(decodeURIComponent($))}VI.unescapeFragment=mS;function iS($){return encodeURIComponent(Qz($))}VI.escapeFragment=iS;function Qz($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}VI.escapeJsonPointer=Qz;function DI($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}VI.unescapeJsonPointer=DI;function nS($,X){if(Array.isArray($))for(let W of $)X(W);else X($)}VI.eachItem=nS;function jI({mergeNames:$,mergeToName:X,mergeValues:W,resultToName:Y}){return(J,G,U,Q)=>{let z=U===void 0?G:U instanceof b$.Name?(G instanceof b$.Name?$(J,G,U):X(J,G,U),U):G instanceof b$.Name?(X(J,U,G),G):W(G,U);return Q===b$.Name&&!(z instanceof b$.Name)?Y(J,z):z}}VI.mergeEvaluated={props:jI({mergeNames:($,X,W)=>$.if(b$._`${W} !== true && ${X} !== undefined`,()=>{$.if(b$._`${X} === true`,()=>$.assign(W,!0),()=>$.assign(W,b$._`${W} || {}`).code(b$._`Object.assign(${W}, ${X})`))}),mergeToName:($,X,W)=>$.if(b$._`${W} !== true`,()=>{if(X===!0)$.assign(W,!0);else $.assign(W,b$._`${W} || {}`),zz($,W,X)}),mergeValues:($,X)=>$===!0?!0:{...$,...X},resultToName:BI}),items:jI({mergeNames:($,X,W)=>$.if(b$._`${W} !== true && ${X} !== undefined`,()=>$.assign(W,b$._`${X} === true ? true : ${W} > ${X} ? ${W} : ${X}`)),mergeToName:($,X,W)=>$.if(b$._`${W} !== true`,()=>$.assign(W,X===!0?!0:b$._`${W} > ${X} ? ${W} : ${X}`)),mergeValues:($,X)=>$===!0?!0:Math.max($,X),resultToName:($,X)=>$.var("items",X)})};function BI($,X){if(X===!0)return $.var("props",!0);let W=$.var("props",b$._`{}`);if(X!==void 0)zz($,W,X);return W}VI.evaluatedPropsToName=BI;function zz($,X,W){Object.keys(W).forEach((Y)=>$.assign(b$._`${X}${(0,b$.getProperty)(Y)}`,!0))}VI.setEvaluated=zz;var II={};function cS($,X){return $.scopeValue("func",{ref:X,code:II[X.code]||(II[X.code]=new yS._Code(X.code))})}VI.useFunc=cS;var Uz;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(Uz||(VI.Type=Uz={}));function rS($,X,W){if($ instanceof b$.Name){let Y=X===Uz.Num;return W?Y?b$._`"[" + ${$} + "]"`:b$._`"['" + ${$} + "']"`:Y?b$._`"/" + ${$}`:b$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return W?(0,b$.getProperty)($).toString():"/"+Qz($)}VI.getErrorPath=rS;function wI($,X,W=$.opts.strictSchema){if(!W)return;if(X=`strict mode: ${X}`,W===!0)throw Error(X);$.self.logger.warn(X)}VI.checkStrictMode=wI});var b6=v((bI)=>{Object.defineProperty(bI,"__esModule",{value:!0});var o$=X$(),jE={data:new o$.Name("data"),valCxt:new o$.Name("valCxt"),instancePath:new o$.Name("instancePath"),parentData:new o$.Name("parentData"),parentDataProperty:new o$.Name("parentDataProperty"),rootData:new o$.Name("rootData"),dynamicAnchors:new o$.Name("dynamicAnchors"),vErrors:new o$.Name("vErrors"),errors:new o$.Name("errors"),this:new o$.Name("this"),self:new o$.Name("self"),scope:new o$.Name("scope"),json:new o$.Name("json"),jsonPos:new o$.Name("jsonPos"),jsonLen:new o$.Name("jsonLen"),jsonPart:new o$.Name("jsonPart")};bI.default=jE});var eX=v((LI)=>{Object.defineProperty(LI,"__esModule",{value:!0});LI.extendErrors=LI.resetErrorsCount=LI.reportExtraError=LI.reportError=LI.keyword$DataError=LI.keywordError=void 0;var z$=X$(),W8=j$(),W4=b6();LI.keywordError={message:({keyword:$})=>z$.str`must pass "${$}" keyword validation`};LI.keyword$DataError={message:({keyword:$,schemaType:X})=>X?z$.str`"${$}" keyword must be ${X} ($data)`:z$.str`"${$}" keyword is invalid ($data)`};function OE($,X=LI.keywordError,W,Y){let{it:J}=$,{gen:G,compositeRule:U,allErrors:Q}=J,z=qI($,X,W);if(Y!==null&&Y!==void 0?Y:U||Q)KI(G,z);else vI(J,z$._`[${z}]`)}LI.reportError=OE;function NE($,X=LI.keywordError,W){let{it:Y}=$,{gen:J,compositeRule:G,allErrors:U}=Y,Q=qI($,X,W);if(KI(J,Q),!(G||U))vI(Y,W4.default.vErrors)}LI.reportExtraError=NE;function DE($,X){$.assign(W4.default.errors,X),$.if(z$._`${W4.default.vErrors} !== null`,()=>$.if(X,()=>$.assign(z$._`${W4.default.vErrors}.length`,X),()=>$.assign(W4.default.vErrors,null)))}LI.resetErrorsCount=DE;function BE({gen:$,keyword:X,schemaValue:W,data:Y,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let U=$.name("err");$.forRange("i",J,W4.default.errors,(Q)=>{if($.const(U,z$._`${W4.default.vErrors}[${Q}]`),$.if(z$._`${U}.instancePath === undefined`,()=>$.assign(z$._`${U}.instancePath`,(0,z$.strConcat)(W4.default.instancePath,G.errorPath))),$.assign(z$._`${U}.schemaPath`,z$.str`${G.errSchemaPath}/${X}`),G.opts.verbose)$.assign(z$._`${U}.schema`,W),$.assign(z$._`${U}.data`,Y)})}LI.extendErrors=BE;function KI($,X){let W=$.const("err",X);$.if(z$._`${W4.default.vErrors} === null`,()=>$.assign(W4.default.vErrors,z$._`[${W}]`),z$._`${W4.default.vErrors}.push(${W})`),$.code(z$._`${W4.default.errors}++`)}function vI($,X){let{gen:W,validateName:Y,schemaEnv:J}=$;if(J.$async)W.throw(z$._`new ${$.ValidationError}(${X})`);else W.assign(z$._`${Y}.errors`,X),W.return(!1)}var D1={keyword:new z$.Name("keyword"),schemaPath:new z$.Name("schemaPath"),params:new z$.Name("params"),propertyName:new z$.Name("propertyName"),message:new z$.Name("message"),schema:new z$.Name("schema"),parentSchema:new z$.Name("parentSchema")};function qI($,X,W){let{createErrors:Y}=$.it;if(Y===!1)return z$._`{}`;return wE($,X,W)}function wE($,X,W={}){let{gen:Y,it:J}=$,G=[VE(J,W),AE($,W)];return bE($,X,G),Y.object(...G)}function VE({errorPath:$},{instancePath:X}){let W=X?z$.str`${$}${(0,W8.getErrorPath)(X,W8.Type.Str)}`:$;return[W4.default.instancePath,(0,z$.strConcat)(W4.default.instancePath,W)]}function AE({keyword:$,it:{errSchemaPath:X}},{schemaPath:W,parentSchema:Y}){let J=Y?X:z$.str`${X}/${$}`;if(W)J=z$.str`${J}${(0,W8.getErrorPath)(W,W8.Type.Str)}`;return[D1.schemaPath,J]}function bE($,{params:X,message:W},Y){let{keyword:J,data:G,schemaValue:U,it:Q}=$,{opts:z,propertyName:H,topSchemaRef:j,schemaPath:O}=Q;if(Y.push([D1.keyword,J],[D1.params,typeof X=="function"?X($):X||z$._`{}`]),z.messages)Y.push([D1.message,typeof W=="function"?W($):W]);if(z.verbose)Y.push([D1.schema,U],[D1.parentSchema,z$._`${j}${O}`],[W4.default.data,G]);if(H)Y.push([D1.propertyName,H])}});var PI=v((SI)=>{Object.defineProperty(SI,"__esModule",{value:!0});SI.boolOrEmptySchema=SI.topBoolOrEmptySchema=void 0;var FE=eX(),ME=X$(),SE=b6(),EE={message:"boolean schema is false"};function PE($){let{gen:X,schema:W,validateName:Y}=$;if(W===!1)MI($,!1);else if(typeof W=="object"&&W.$async===!0)X.return(SE.default.data);else X.assign(ME._`${Y}.errors`,null),X.return(!0)}SI.topBoolOrEmptySchema=PE;function RE($,X){let{gen:W,schema:Y}=$;if(Y===!1)W.var(X,!1),MI($);else W.var(X,!0)}SI.boolOrEmptySchema=RE;function MI($,X){let{gen:W,data:Y}=$,J={gen:W,keyword:"false schema",data:Y,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,FE.reportError)(J,EE,void 0,X)}});var jz=v((RI)=>{Object.defineProperty(RI,"__esModule",{value:!0});RI.getRules=RI.isJSONType=void 0;var kE=["string","number","integer","boolean","null","object","array"],TE=new Set(kE);function CE($){return typeof $=="string"&&TE.has($)}RI.isJSONType=CE;function _E(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}RI.getRules=_E});var Iz=v((CI)=>{Object.defineProperty(CI,"__esModule",{value:!0});CI.shouldUseRule=CI.shouldUseGroup=CI.schemaHasRulesForType=void 0;function uE({schema:$,self:X},W){let Y=X.RULES.types[W];return Y&&Y!==!0&&kI($,Y)}CI.schemaHasRulesForType=uE;function kI($,X){return X.rules.some((W)=>TI($,W))}CI.shouldUseGroup=kI;function TI($,X){var W;return $[X.keyword]!==void 0||((W=X.definition.implements)===null||W===void 0?void 0:W.some((Y)=>$[Y]!==void 0))}CI.shouldUseRule=TI});var $W=v((gI)=>{Object.defineProperty(gI,"__esModule",{value:!0});gI.reportTypeError=gI.checkDataTypes=gI.checkDataType=gI.coerceAndCheckDataType=gI.getJSONTypes=gI.getSchemaTypes=gI.DataType=void 0;var fE=jz(),hE=Iz(),lE=eX(),o=X$(),xI=j$(),Q0;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(Q0||(gI.DataType=Q0={}));function mE($){let X=uI($.type);if(X.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)X.push("null")}return X}gI.getSchemaTypes=mE;function uI($){let X=Array.isArray($)?$:$?[$]:[];if(X.every(fE.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}gI.getJSONTypes=uI;function iE($,X){let{gen:W,data:Y,opts:J}=$,G=nE(X,J.coerceTypes),U=X.length>0&&!(G.length===0&&X.length===1&&(0,hE.schemaHasRulesForType)($,X[0]));if(U){let Q=Nz(X,Y,J.strictNumbers,Q0.Wrong);W.if(Q,()=>{if(G.length)cE($,X,G);else Dz($)})}return U}gI.coerceAndCheckDataType=iE;var yI=new Set(["string","number","integer","boolean","null"]);function nE($,X){return X?$.filter((W)=>yI.has(W)||X==="array"&&W==="array"):[]}function cE($,X,W){let{gen:Y,data:J,opts:G}=$,U=Y.let("dataType",o._`typeof ${J}`),Q=Y.let("coerced",o._`undefined`);if(G.coerceTypes==="array")Y.if(o._`${U} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>Y.assign(J,o._`${J}[0]`).assign(U,o._`typeof ${J}`).if(Nz(X,J,G.strictNumbers),()=>Y.assign(Q,J)));Y.if(o._`${Q} !== undefined`);for(let H of W)if(yI.has(H)||H==="array"&&G.coerceTypes==="array")z(H);Y.else(),Dz($),Y.endIf(),Y.if(o._`${Q} !== undefined`,()=>{Y.assign(J,Q),rE($,Q)});function z(H){switch(H){case"string":Y.elseIf(o._`${U} == "number" || ${U} == "boolean"`).assign(Q,o._`"" + ${J}`).elseIf(o._`${J} === null`).assign(Q,o._`""`);return;case"number":Y.elseIf(o._`${U} == "boolean" || ${J} === null
|
|
4
|
+
|| (${U} == "string" && ${J} && ${J} == +${J})`).assign(Q,o._`+${J}`);return;case"integer":Y.elseIf(o._`${U} === "boolean" || ${J} === null
|
|
5
|
+
|| (${U} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(Q,o._`+${J}`);return;case"boolean":Y.elseIf(o._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(Q,!1).elseIf(o._`${J} === "true" || ${J} === 1`).assign(Q,!0);return;case"null":Y.elseIf(o._`${J} === "" || ${J} === 0 || ${J} === false`),Y.assign(Q,null);return;case"array":Y.elseIf(o._`${U} === "string" || ${U} === "number"
|
|
6
|
+
|| ${U} === "boolean" || ${J} === null`).assign(Q,o._`[${J}]`)}}}function rE({gen:$,parentData:X,parentDataProperty:W},Y){$.if(o._`${X} !== undefined`,()=>$.assign(o._`${X}[${W}]`,Y))}function Oz($,X,W,Y=Q0.Correct){let J=Y===Q0.Correct?o.operators.EQ:o.operators.NEQ,G;switch($){case"null":return o._`${X} ${J} null`;case"array":G=o._`Array.isArray(${X})`;break;case"object":G=o._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":G=U(o._`!(${X} % 1) && !isNaN(${X})`);break;case"number":G=U();break;default:return o._`typeof ${X} ${J} ${$}`}return Y===Q0.Correct?G:(0,o.not)(G);function U(Q=o.nil){return(0,o.and)(o._`typeof ${X} == "number"`,Q,W?o._`isFinite(${X})`:o.nil)}}gI.checkDataType=Oz;function Nz($,X,W,Y){if($.length===1)return Oz($[0],X,W,Y);let J,G=(0,xI.toHash)($);if(G.array&&G.object){let U=o._`typeof ${X} != "object"`;J=G.null?U:o._`!${X} || ${U}`,delete G.null,delete G.array,delete G.object}else J=o.nil;if(G.number)delete G.integer;for(let U in G)J=(0,o.and)(J,Oz(U,X,W,Y));return J}gI.checkDataTypes=Nz;var pE={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:X})=>typeof $=="string"?o._`{type: ${$}}`:o._`{type: ${X}}`};function Dz($){let X=dE($);(0,lE.reportError)(X,pE)}gI.reportTypeError=Dz;function dE($){let{gen:X,data:W,schema:Y}=$,J=(0,xI.schemaRefOrVal)($,Y,"type");return{gen:X,keyword:"type",data:W,schema:Y.type,schemaCode:J,schemaValue:J,parentSchema:Y,params:{},it:$}}});var iI=v((lI)=>{Object.defineProperty(lI,"__esModule",{value:!0});lI.assignDefaults=void 0;var z0=X$(),XP=j$();function WP($,X){let{properties:W,items:Y}=$.schema;if(X==="object"&&W)for(let J in W)hI($,J,W[J].default);else if(X==="array"&&Array.isArray(Y))Y.forEach((J,G)=>hI($,G,J.default))}lI.assignDefaults=WP;function hI($,X,W){let{gen:Y,compositeRule:J,data:G,opts:U}=$;if(W===void 0)return;let Q=z0._`${G}${(0,z0.getProperty)(X)}`;if(J){(0,XP.checkStrictMode)($,`default is ignored for: ${Q}`);return}let z=z0._`${Q} === undefined`;if(U.useDefaults==="empty")z=z0._`${z} || ${Q} === null || ${Q} === ""`;Y.if(z,z0._`${Q} = ${(0,z0.stringify)(W)}`)}});var P4=v((rI)=>{Object.defineProperty(rI,"__esModule",{value:!0});rI.validateUnion=rI.validateArray=rI.usePattern=rI.callValidateCode=rI.schemaProperties=rI.allSchemaProperties=rI.noPropertyInData=rI.propertyInData=rI.isOwnProperty=rI.hasPropFunc=rI.reportMissingProp=rI.checkMissingProp=rI.checkReportMissingProp=void 0;var L$=X$(),Bz=j$(),i6=b6(),JP=j$();function YP($,X){let{gen:W,data:Y,it:J}=$;W.if(Vz(W,Y,X,J.opts.ownProperties),()=>{$.setParams({missingProperty:L$._`${X}`},!0),$.error()})}rI.checkReportMissingProp=YP;function GP({gen:$,data:X,it:{opts:W}},Y,J){return(0,L$.or)(...Y.map((G)=>(0,L$.and)(Vz($,X,G,W.ownProperties),L$._`${J} = ${G}`)))}rI.checkMissingProp=GP;function UP($,X){$.setParams({missingProperty:X},!0),$.error()}rI.reportMissingProp=UP;function nI($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:L$._`Object.prototype.hasOwnProperty`})}rI.hasPropFunc=nI;function wz($,X,W){return L$._`${nI($)}.call(${X}, ${W})`}rI.isOwnProperty=wz;function QP($,X,W,Y){let J=L$._`${X}${(0,L$.getProperty)(W)} !== undefined`;return Y?L$._`${J} && ${wz($,X,W)}`:J}rI.propertyInData=QP;function Vz($,X,W,Y){let J=L$._`${X}${(0,L$.getProperty)(W)} === undefined`;return Y?(0,L$.or)(J,(0,L$.not)(wz($,X,W))):J}rI.noPropertyInData=Vz;function cI($){return $?Object.keys($).filter((X)=>X!=="__proto__"):[]}rI.allSchemaProperties=cI;function zP($,X){return cI(X).filter((W)=>!(0,Bz.alwaysValidSchema)($,X[W]))}rI.schemaProperties=zP;function HP({schemaCode:$,data:X,it:{gen:W,topSchemaRef:Y,schemaPath:J,errorPath:G},it:U},Q,z,H){let j=H?L$._`${$}, ${X}, ${Y}${J}`:X,O=[[i6.default.instancePath,(0,L$.strConcat)(i6.default.instancePath,G)],[i6.default.parentData,U.parentData],[i6.default.parentDataProperty,U.parentDataProperty],[i6.default.rootData,i6.default.rootData]];if(U.opts.dynamicRef)O.push([i6.default.dynamicAnchors,i6.default.dynamicAnchors]);let B=L$._`${j}, ${W.object(...O)}`;return z!==L$.nil?L$._`${Q}.call(${z}, ${B})`:L$._`${Q}(${B})`}rI.callValidateCode=HP;var jP=L$._`new RegExp`;function IP({gen:$,it:{opts:X}},W){let Y=X.unicodeRegExp?"u":"",{regExp:J}=X.code,G=J(W,Y);return $.scopeValue("pattern",{key:G.toString(),ref:G,code:L$._`${J.code==="new RegExp"?jP:(0,JP.useFunc)($,J)}(${W}, ${Y})`})}rI.usePattern=IP;function OP($){let{gen:X,data:W,keyword:Y,it:J}=$,G=X.name("valid");if(J.allErrors){let Q=X.let("valid",!0);return U(()=>X.assign(Q,!1)),Q}return X.var(G,!0),U(()=>X.break()),G;function U(Q){let z=X.const("len",L$._`${W}.length`);X.forRange("i",0,z,(H)=>{$.subschema({keyword:Y,dataProp:H,dataPropType:Bz.Type.Num},G),X.if((0,L$.not)(G),Q)})}}rI.validateArray=OP;function NP($){let{gen:X,schema:W,keyword:Y,it:J}=$;if(!Array.isArray(W))throw Error("ajv implementation error");if(W.some((z)=>(0,Bz.alwaysValidSchema)(J,z))&&!J.opts.unevaluated)return;let U=X.let("valid",!1),Q=X.name("_valid");X.block(()=>W.forEach((z,H)=>{let j=$.subschema({keyword:Y,schemaProp:H,compositeRule:!0},Q);if(X.assign(U,L$._`${U} || ${Q}`),!$.mergeValidEvaluated(j,Q))X.if((0,L$.not)(U))})),$.result(U,()=>$.reset(),()=>$.error(!0))}rI.validateUnion=NP});var sI=v((tI)=>{Object.defineProperty(tI,"__esModule",{value:!0});tI.validateKeywordUsage=tI.validSchemaType=tI.funcKeywordCode=tI.macroKeywordCode=void 0;var J4=X$(),B1=b6(),SP=P4(),EP=eX();function PP($,X){let{gen:W,keyword:Y,schema:J,parentSchema:G,it:U}=$,Q=X.macro.call(U.self,J,G,U),z=oI(W,Y,Q);if(U.opts.validateSchema!==!1)U.self.validateSchema(Q,!0);let H=W.name("valid");$.subschema({schema:Q,schemaPath:J4.nil,errSchemaPath:`${U.errSchemaPath}/${Y}`,topSchemaRef:z,compositeRule:!0},H),$.pass(H,()=>$.error(!0))}tI.macroKeywordCode=PP;function RP($,X){var W;let{gen:Y,keyword:J,schema:G,parentSchema:U,$data:Q,it:z}=$;kP(z,X);let H=!Q&&X.compile?X.compile.call(z.self,G,U,z):X.validate,j=oI(Y,J,H),O=Y.let("valid");$.block$data(O,B),$.ok((W=X.valid)!==null&&W!==void 0?W:O);function B(){if(X.errors===!1){if(D(),X.modifying)dI($);w(()=>$.error())}else{let V=X.async?I():N();if(X.modifying)dI($);w(()=>ZP($,V))}}function I(){let V=Y.let("ruleErrs",null);return Y.try(()=>D(J4._`await `),(K)=>Y.assign(O,!1).if(J4._`${K} instanceof ${z.ValidationError}`,()=>Y.assign(V,J4._`${K}.errors`),()=>Y.throw(K))),V}function N(){let V=J4._`${j}.errors`;return Y.assign(V,null),D(J4.nil),V}function D(V=X.async?J4._`await `:J4.nil){let K=z.opts.passContext?B1.default.this:B1.default.self,b=!(("compile"in X)&&!Q||X.schema===!1);Y.assign(O,J4._`${V}${(0,SP.callValidateCode)($,j,K,b)}`,X.modifying)}function w(V){var K;Y.if((0,J4.not)((K=X.valid)!==null&&K!==void 0?K:O),V)}}tI.funcKeywordCode=RP;function dI($){let{gen:X,data:W,it:Y}=$;X.if(Y.parentData,()=>X.assign(W,J4._`${Y.parentData}[${Y.parentDataProperty}]`))}function ZP($,X){let{gen:W}=$;W.if(J4._`Array.isArray(${X})`,()=>{W.assign(B1.default.vErrors,J4._`${B1.default.vErrors} === null ? ${X} : ${B1.default.vErrors}.concat(${X})`).assign(B1.default.errors,J4._`${B1.default.vErrors}.length`),(0,EP.extendErrors)($)},()=>$.error())}function kP({schemaEnv:$},X){if(X.async&&!$.$async)throw Error("async keyword in sync schema")}function oI($,X,W){if(W===void 0)throw Error(`keyword "${X}" failed to compile`);return $.scopeValue("keyword",typeof W=="function"?{ref:W}:{ref:W,code:(0,J4.stringify)(W)})}function TP($,X,W=!1){return!X.length||X.some((Y)=>Y==="array"?Array.isArray($):Y==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Y||W&&typeof $>"u")}tI.validSchemaType=TP;function CP({schema:$,opts:X,self:W,errSchemaPath:Y},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let U=J.dependencies;if(U===null||U===void 0?void 0:U.some((Q)=>!Object.prototype.hasOwnProperty.call($,Q)))throw Error(`parent schema must have dependencies of ${G}: ${U.join(",")}`);if(J.validateSchema){if(!J.validateSchema($[G])){let z=`keyword "${G}" value is invalid at path "${Y}": `+W.errorsText(J.validateSchema.errors);if(X.validateSchema==="log")W.logger.error(z);else throw Error(z)}}}tI.validateKeywordUsage=CP});var WO=v(($O)=>{Object.defineProperty($O,"__esModule",{value:!0});$O.extendSubschemaMode=$O.extendSubschemaData=$O.getSubschema=void 0;var Y6=X$(),eI=j$();function yP($,{keyword:X,schemaProp:W,schema:Y,schemaPath:J,errSchemaPath:G,topSchemaRef:U}){if(X!==void 0&&Y!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let Q=$.schema[X];return W===void 0?{schema:Q,schemaPath:Y6._`${$.schemaPath}${(0,Y6.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${X}`}:{schema:Q[W],schemaPath:Y6._`${$.schemaPath}${(0,Y6.getProperty)(X)}${(0,Y6.getProperty)(W)}`,errSchemaPath:`${$.errSchemaPath}/${X}/${(0,eI.escapeFragment)(W)}`}}if(Y!==void 0){if(J===void 0||G===void 0||U===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Y,schemaPath:J,topSchemaRef:U,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}$O.getSubschema=yP;function gP($,X,{dataProp:W,dataPropType:Y,data:J,dataTypes:G,propertyName:U}){if(J!==void 0&&W!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Q}=X;if(W!==void 0){let{errorPath:H,dataPathArr:j,opts:O}=X,B=Q.let("data",Y6._`${X.data}${(0,Y6.getProperty)(W)}`,!0);z(B),$.errorPath=Y6.str`${H}${(0,eI.getErrorPath)(W,Y,O.jsPropertySyntax)}`,$.parentDataProperty=Y6._`${W}`,$.dataPathArr=[...j,$.parentDataProperty]}if(J!==void 0){let H=J instanceof Y6.Name?J:Q.let("data",J,!0);if(z(H),U!==void 0)$.propertyName=U}if(G)$.dataTypes=G;function z(H){$.data=H,$.dataLevel=X.dataLevel+1,$.dataTypes=[],X.definedProperties=new Set,$.parentData=X.data,$.dataNames=[...X.dataNames,H]}}$O.extendSubschemaData=gP;function fP($,{jtdDiscriminator:X,jtdMetadata:W,compositeRule:Y,createErrors:J,allErrors:G}){if(Y!==void 0)$.compositeRule=Y;if(J!==void 0)$.createErrors=J;if(G!==void 0)$.allErrors=G;$.jtdDiscriminator=X,$.jtdMetadata=W}$O.extendSubschemaMode=fP});var XW=v((xd,JO)=>{JO.exports=function $(X,W){if(X===W)return!0;if(X&&W&&typeof X=="object"&&typeof W=="object"){if(X.constructor!==W.constructor)return!1;var Y,J,G;if(Array.isArray(X)){if(Y=X.length,Y!=W.length)return!1;for(J=Y;J--!==0;)if(!$(X[J],W[J]))return!1;return!0}if(X.constructor===RegExp)return X.source===W.source&&X.flags===W.flags;if(X.valueOf!==Object.prototype.valueOf)return X.valueOf()===W.valueOf();if(X.toString!==Object.prototype.toString)return X.toString()===W.toString();if(G=Object.keys(X),Y=G.length,Y!==Object.keys(W).length)return!1;for(J=Y;J--!==0;)if(!Object.prototype.hasOwnProperty.call(W,G[J]))return!1;for(J=Y;J--!==0;){var U=G[J];if(!$(X[U],W[U]))return!1}return!0}return X!==X&&W!==W}});var GO=v((ud,YO)=>{var n6=YO.exports=function($,X,W){if(typeof X=="function")W=X,X={};W=X.cb||W;var Y=typeof W=="function"?W:W.pre||function(){},J=W.post||function(){};J8(X,Y,J,$,"",$)};n6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};n6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};n6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};n6.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function J8($,X,W,Y,J,G,U,Q,z,H){if(Y&&typeof Y=="object"&&!Array.isArray(Y)){X(Y,J,G,U,Q,z,H);for(var j in Y){var O=Y[j];if(Array.isArray(O)){if(j in n6.arrayKeywords)for(var B=0;B<O.length;B++)J8($,X,W,O[B],J+"/"+j+"/"+B,G,J,j,Y,B)}else if(j in n6.propsKeywords){if(O&&typeof O=="object")for(var I in O)J8($,X,W,O[I],J+"/"+j+"/"+mP(I),G,J,j,Y,I)}else if(j in n6.keywords||$.allKeys&&!(j in n6.skipKeywords))J8($,X,W,O,J+"/"+j,G,J,j,Y)}W(Y,J,G,U,Q,z,H)}}function mP($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var WW=v((HO)=>{Object.defineProperty(HO,"__esModule",{value:!0});HO.getSchemaRefs=HO.resolveUrl=HO.normalizeId=HO._getFullPath=HO.getFullPath=HO.inlineRef=void 0;var iP=j$(),nP=XW(),cP=GO(),rP=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function pP($,X=!0){if(typeof $=="boolean")return!0;if(X===!0)return!Az($);if(!X)return!1;return UO($)<=X}HO.inlineRef=pP;var dP=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Az($){for(let X in $){if(dP.has(X))return!0;let W=$[X];if(Array.isArray(W)&&W.some(Az))return!0;if(typeof W=="object"&&Az(W))return!0}return!1}function UO($){let X=0;for(let W in $){if(W==="$ref")return 1/0;if(X++,rP.has(W))continue;if(typeof $[W]=="object")(0,iP.eachItem)($[W],(Y)=>X+=UO(Y));if(X===1/0)return 1/0}return X}function QO($,X="",W){if(W!==!1)X=H0(X);let Y=$.parse(X);return zO($,Y)}HO.getFullPath=QO;function zO($,X){return $.serialize(X).split("#")[0]+"#"}HO._getFullPath=zO;var oP=/#\/?$/;function H0($){return $?$.replace(oP,""):""}HO.normalizeId=H0;function tP($,X,W){return W=H0(W),$.resolve(X,W)}HO.resolveUrl=tP;var aP=/^[a-z_][-a-z0-9._]*$/i;function sP($,X){if(typeof $=="boolean")return{};let{schemaId:W,uriResolver:Y}=this.opts,J=H0($[W]||X),G={"":J},U=QO(Y,J,!1),Q={},z=new Set;return cP($,{allKeys:!0},(O,B,I,N)=>{if(N===void 0)return;let D=U+B,w=G[N];if(typeof O[W]=="string")w=V.call(this,O[W]);K.call(this,O.$anchor),K.call(this,O.$dynamicAnchor),G[B]=w;function V(b){let S=this.opts.uriResolver.resolve;if(b=H0(w?S(w,b):b),z.has(b))throw j(b);z.add(b);let L=this.refs[b];if(typeof L=="string")L=this.refs[L];if(typeof L=="object")H(O,L.schema,b);else if(b!==H0(D))if(b[0]==="#")H(O,Q[b],b),Q[b]=O;else this.refs[b]=D;return b}function K(b){if(typeof b=="string"){if(!aP.test(b))throw Error(`invalid anchor "${b}"`);V.call(this,`#${b}`)}}}),Q;function H(O,B,I){if(B!==void 0&&!nP(O,B))throw j(I)}function j(O){return Error(`reference "${O}" resolves to more than one schema`)}}HO.getSchemaRefs=sP});var GW=v((MO)=>{Object.defineProperty(MO,"__esModule",{value:!0});MO.getData=MO.KeywordCxt=MO.validateFunctionCode=void 0;var BO=PI(),IO=$W(),Kz=Iz(),Y8=$W(),YR=iI(),YW=sI(),bz=WO(),g=X$(),c=b6(),GR=WW(),K6=j$(),JW=eX();function UR($){if(AO($)){if(bO($),VO($)){HR($);return}}wO($,()=>(0,BO.topBoolOrEmptySchema)($))}MO.validateFunctionCode=UR;function wO({gen:$,validateName:X,schema:W,schemaEnv:Y,opts:J},G){if(J.code.es5)$.func(X,g._`${c.default.data}, ${c.default.valCxt}`,Y.$async,()=>{$.code(g._`"use strict"; ${OO(W,J)}`),zR($,J),$.code(G)});else $.func(X,g._`${c.default.data}, ${QR(J)}`,Y.$async,()=>$.code(OO(W,J)).code(G))}function QR($){return g._`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${$.dynamicRef?g._`, ${c.default.dynamicAnchors}={}`:g.nil}}={}`}function zR($,X){$.if(c.default.valCxt,()=>{if($.var(c.default.instancePath,g._`${c.default.valCxt}.${c.default.instancePath}`),$.var(c.default.parentData,g._`${c.default.valCxt}.${c.default.parentData}`),$.var(c.default.parentDataProperty,g._`${c.default.valCxt}.${c.default.parentDataProperty}`),$.var(c.default.rootData,g._`${c.default.valCxt}.${c.default.rootData}`),X.dynamicRef)$.var(c.default.dynamicAnchors,g._`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{if($.var(c.default.instancePath,g._`""`),$.var(c.default.parentData,g._`undefined`),$.var(c.default.parentDataProperty,g._`undefined`),$.var(c.default.rootData,c.default.data),X.dynamicRef)$.var(c.default.dynamicAnchors,g._`{}`)})}function HR($){let{schema:X,opts:W,gen:Y}=$;wO($,()=>{if(W.$comment&&X.$comment)vO($);if(DR($),Y.let(c.default.vErrors,null),Y.let(c.default.errors,0),W.unevaluated)jR($);KO($),VR($)});return}function jR($){let{gen:X,validateName:W}=$;$.evaluated=X.const("evaluated",g._`${W}.evaluated`),X.if(g._`${$.evaluated}.dynamicProps`,()=>X.assign(g._`${$.evaluated}.props`,g._`undefined`)),X.if(g._`${$.evaluated}.dynamicItems`,()=>X.assign(g._`${$.evaluated}.items`,g._`undefined`))}function OO($,X){let W=typeof $=="object"&&$[X.schemaId];return W&&(X.code.source||X.code.process)?g._`/*# sourceURL=${W} */`:g.nil}function IR($,X){if(AO($)){if(bO($),VO($)){OR($,X);return}}(0,BO.boolOrEmptySchema)($,X)}function VO({schema:$,self:X}){if(typeof $=="boolean")return!$;for(let W in $)if(X.RULES.all[W])return!0;return!1}function AO($){return typeof $.schema!="boolean"}function OR($,X){let{schema:W,gen:Y,opts:J}=$;if(J.$comment&&W.$comment)vO($);BR($),wR($);let G=Y.const("_errs",c.default.errors);KO($,G),Y.var(X,g._`${G} === ${c.default.errors}`)}function bO($){(0,K6.checkUnknownRules)($),NR($)}function KO($,X){if($.opts.jtd)return NO($,[],!1,X);let W=(0,IO.getSchemaTypes)($.schema),Y=(0,IO.coerceAndCheckDataType)($,W);NO($,W,!Y,X)}function NR($){let{schema:X,errSchemaPath:W,opts:Y,self:J}=$;if(X.$ref&&Y.ignoreKeywordsWithRef&&(0,K6.schemaHasRulesButRef)(X,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${W}"`)}function DR($){let{schema:X,opts:W}=$;if(X.default!==void 0&&W.useDefaults&&W.strictSchema)(0,K6.checkStrictMode)($,"default is ignored in the schema root")}function BR($){let X=$.schema[$.opts.schemaId];if(X)$.baseId=(0,GR.resolveUrl)($.opts.uriResolver,$.baseId,X)}function wR($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function vO({gen:$,schemaEnv:X,schema:W,errSchemaPath:Y,opts:J}){let G=W.$comment;if(J.$comment===!0)$.code(g._`${c.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let U=g.str`${Y}/$comment`,Q=$.scopeValue("root",{ref:X.root});$.code(g._`${c.default.self}.opts.$comment(${G}, ${U}, ${Q}.schema)`)}}function VR($){let{gen:X,schemaEnv:W,validateName:Y,ValidationError:J,opts:G}=$;if(W.$async)X.if(g._`${c.default.errors} === 0`,()=>X.return(c.default.data),()=>X.throw(g._`new ${J}(${c.default.vErrors})`));else{if(X.assign(g._`${Y}.errors`,c.default.vErrors),G.unevaluated)AR($);X.return(g._`${c.default.errors} === 0`)}}function AR({gen:$,evaluated:X,props:W,items:Y}){if(W instanceof g.Name)$.assign(g._`${X}.props`,W);if(Y instanceof g.Name)$.assign(g._`${X}.items`,Y)}function NO($,X,W,Y){let{gen:J,schema:G,data:U,allErrors:Q,opts:z,self:H}=$,{RULES:j}=H;if(G.$ref&&(z.ignoreKeywordsWithRef||!(0,K6.schemaHasRulesButRef)(G,j))){J.block(()=>LO($,"$ref",j.all.$ref.definition));return}if(!z.jtd)bR($,X);J.block(()=>{for(let B of j.rules)O(B);O(j.post)});function O(B){if(!(0,Kz.shouldUseGroup)(G,B))return;if(B.type){if(J.if((0,Y8.checkDataType)(B.type,U,z.strictNumbers)),DO($,B),X.length===1&&X[0]===B.type&&W)J.else(),(0,Y8.reportTypeError)($);J.endIf()}else DO($,B);if(!Q)J.if(g._`${c.default.errors} === ${Y||0}`)}}function DO($,X){let{gen:W,schema:Y,opts:{useDefaults:J}}=$;if(J)(0,YR.assignDefaults)($,X.type);W.block(()=>{for(let G of X.rules)if((0,Kz.shouldUseRule)(Y,G))LO($,G.keyword,G.definition,X.type)})}function bR($,X){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(KR($,X),!$.opts.allowUnionTypes)vR($,X);qR($,$.dataTypes)}function KR($,X){if(!X.length)return;if(!$.dataTypes.length){$.dataTypes=X;return}X.forEach((W)=>{if(!qO($.dataTypes,W))vz($,`type "${W}" not allowed by context "${$.dataTypes.join(",")}"`)}),FR($,X)}function vR($,X){if(X.length>1&&!(X.length===2&&X.includes("null")))vz($,"use allowUnionTypes to allow union type keyword")}function qR($,X){let W=$.self.RULES.all;for(let Y in W){let J=W[Y];if(typeof J=="object"&&(0,Kz.shouldUseRule)($.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((U)=>LR(X,U)))vz($,`missing type "${G.join(",")}" for keyword "${Y}"`)}}}function LR($,X){return $.includes(X)||X==="number"&&$.includes("integer")}function qO($,X){return $.includes(X)||X==="integer"&&$.includes("number")}function FR($,X){let W=[];for(let Y of $.dataTypes)if(qO(X,Y))W.push(Y);else if(X.includes("integer")&&Y==="number")W.push("integer");$.dataTypes=W}function vz($,X){let W=$.schemaEnv.baseId+$.errSchemaPath;X+=` at "${W}" (strictTypes)`,(0,K6.checkStrictMode)($,X,$.opts.strictTypes)}class qz{constructor($,X,W){if((0,YW.validateKeywordUsage)($,X,W),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=W,this.data=$.data,this.schema=$.schema[W],this.$data=X.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,K6.schemaRefOrVal)($,this.schema,W,this.$data),this.schemaType=X.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=X,this.$data)this.schemaCode=$.gen.const("vSchema",FO(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,YW.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${W} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=$.gen.const("_errs",c.default.errors)}result($,X,W){this.failResult((0,g.not)($),X,W)}failResult($,X,W){if(this.gen.if($),W)W();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,X){this.failResult((0,g.not)($),void 0,X)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:X}=this;this.fail(g._`${X} !== undefined && (${(0,g.or)(this.invalid$data(),$)})`)}error($,X,W){if(X){this.setParams(X),this._error($,W),this.setParams({});return}this._error($,W)}_error($,X){($?JW.reportExtraError:JW.reportError)(this,this.def.error,X)}$dataError(){(0,JW.reportError)(this,this.def.$dataError||JW.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,JW.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,X){if(X)Object.assign(this.params,$);else this.params=$}block$data($,X,W=g.nil){this.gen.block(()=>{this.check$data($,W),X()})}check$data($=g.nil,X=g.nil){if(!this.$data)return;let{gen:W,schemaCode:Y,schemaType:J,def:G}=this;if(W.if((0,g.or)(g._`${Y} === undefined`,X)),$!==g.nil)W.assign($,!0);if(J.length||G.validateSchema){if(W.elseIf(this.invalid$data()),this.$dataError(),$!==g.nil)W.assign($,!1)}W.else()}invalid$data(){let{gen:$,schemaCode:X,schemaType:W,def:Y,it:J}=this;return(0,g.or)(G(),U());function G(){if(W.length){if(!(X instanceof g.Name))throw Error("ajv implementation error");let Q=Array.isArray(W)?W:[W];return g._`${(0,Y8.checkDataTypes)(Q,X,J.opts.strictNumbers,Y8.DataType.Wrong)}`}return g.nil}function U(){if(Y.validateSchema){let Q=$.scopeValue("validate$data",{ref:Y.validateSchema});return g._`!${Q}(${X})`}return g.nil}}subschema($,X){let W=(0,bz.getSubschema)(this.it,$);(0,bz.extendSubschemaData)(W,this.it,$),(0,bz.extendSubschemaMode)(W,$);let Y={...this.it,...W,items:void 0,props:void 0};return IR(Y,X),Y}mergeEvaluated($,X){let{it:W,gen:Y}=this;if(!W.opts.unevaluated)return;if(W.props!==!0&&$.props!==void 0)W.props=K6.mergeEvaluated.props(Y,$.props,W.props,X);if(W.items!==!0&&$.items!==void 0)W.items=K6.mergeEvaluated.items(Y,$.items,W.items,X)}mergeValidEvaluated($,X){let{it:W,gen:Y}=this;if(W.opts.unevaluated&&(W.props!==!0||W.items!==!0))return Y.if(X,()=>this.mergeEvaluated($,g.Name)),!0}}MO.KeywordCxt=qz;function LO($,X,W,Y){let J=new qz($,W,X);if("code"in W)W.code(J,Y);else if(J.$data&&W.validate)(0,YW.funcKeywordCode)(J,W);else if("macro"in W)(0,YW.macroKeywordCode)(J,W);else if(W.compile||W.validate)(0,YW.funcKeywordCode)(J,W)}var MR=/^\/(?:[^~]|~0|~1)*$/,SR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function FO($,{dataLevel:X,dataNames:W,dataPathArr:Y}){let J,G;if($==="")return c.default.rootData;if($[0]==="/"){if(!MR.test($))throw Error(`Invalid JSON-pointer: ${$}`);J=$,G=c.default.rootData}else{let H=SR.exec($);if(!H)throw Error(`Invalid JSON-pointer: ${$}`);let j=+H[1];if(J=H[2],J==="#"){if(j>=X)throw Error(z("property/index",j));return Y[X-j]}if(j>X)throw Error(z("data",j));if(G=W[X-j],!J)return G}let U=G,Q=J.split("/");for(let H of Q)if(H)G=g._`${G}${(0,g.getProperty)((0,K6.unescapeJsonPointer)(H))}`,U=g._`${U} && ${G}`;return U;function z(H,j){return`Cannot access ${H} ${j} levels up, current level is ${X}`}}MO.getData=FO});var G8=v((PO)=>{Object.defineProperty(PO,"__esModule",{value:!0});class EO extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}PO.default=EO});var UW=v((ZO)=>{Object.defineProperty(ZO,"__esModule",{value:!0});var Lz=WW();class RO extends Error{constructor($,X,W,Y){super(Y||`can't resolve reference ${W} from id ${X}`);this.missingRef=(0,Lz.resolveUrl)($,X,W),this.missingSchema=(0,Lz.normalizeId)((0,Lz.getFullPath)($,this.missingRef))}}ZO.default=RO});var Q8=v((CO)=>{Object.defineProperty(CO,"__esModule",{value:!0});CO.resolveSchema=CO.getCompilingSchema=CO.resolveRef=CO.compileSchema=CO.SchemaEnv=void 0;var l4=X$(),kR=G8(),w1=b6(),m4=WW(),kO=j$(),TR=GW();class QW{constructor($){var X;this.refs={},this.dynamicAnchors={};let W;if(typeof $.schema=="object")W=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(X=$.baseId)!==null&&X!==void 0?X:(0,m4.normalizeId)(W===null||W===void 0?void 0:W[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=W===null||W===void 0?void 0:W.$async,this.refs={}}}CO.SchemaEnv=QW;function Mz($){let X=TO.call(this,$);if(X)return X;let W=(0,m4.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Y,lines:J}=this.opts.code,{ownProperties:G}=this.opts,U=new l4.CodeGen(this.scope,{es5:Y,lines:J,ownProperties:G}),Q;if($.$async)Q=U.scopeValue("Error",{ref:kR.default,code:l4._`require("ajv/dist/runtime/validation_error").default`});let z=U.scopeName("validate");$.validateName=z;let H={gen:U,allErrors:this.opts.allErrors,data:w1.default.data,parentData:w1.default.parentData,parentDataProperty:w1.default.parentDataProperty,dataNames:[w1.default.data],dataPathArr:[l4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:U.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,l4.stringify)($.schema)}:{ref:$.schema}),validateName:z,ValidationError:Q,schema:$.schema,schemaEnv:$,rootId:W,baseId:$.baseId||W,schemaPath:l4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:l4._`""`,opts:this.opts,self:this},j;try{this._compilations.add($),(0,TR.validateFunctionCode)(H),U.optimize(this.opts.code.optimize);let O=U.toString();if(j=`${U.scopeRefs(w1.default.scope)}return ${O}`,this.opts.code.process)j=this.opts.code.process(j,$);let I=Function(`${w1.default.self}`,`${w1.default.scope}`,j)(this,this.scope.get());if(this.scope.value(z,{ref:I}),I.errors=null,I.schema=$.schema,I.schemaEnv=$,$.$async)I.$async=!0;if(this.opts.code.source===!0)I.source={validateName:z,validateCode:O,scopeValues:U._values};if(this.opts.unevaluated){let{props:N,items:D}=H;if(I.evaluated={props:N instanceof l4.Name?void 0:N,items:D instanceof l4.Name?void 0:D,dynamicProps:N instanceof l4.Name,dynamicItems:D instanceof l4.Name},I.source)I.source.evaluated=(0,l4.stringify)(I.evaluated)}return $.validate=I,$}catch(O){if(delete $.validate,delete $.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw O}finally{this._compilations.delete($)}}CO.compileSchema=Mz;function CR($,X,W){var Y;W=(0,m4.resolveUrl)(this.opts.uriResolver,X,W);let J=$.refs[W];if(J)return J;let G=uR.call(this,$,W);if(G===void 0){let U=(Y=$.localRefs)===null||Y===void 0?void 0:Y[W],{schemaId:Q}=this.opts;if(U)G=new QW({schema:U,schemaId:Q,root:$,baseId:X})}if(G===void 0)return;return $.refs[W]=_R.call(this,G)}CO.resolveRef=CR;function _R($){if((0,m4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:Mz.call(this,$)}function TO($){for(let X of this._compilations)if(xR(X,$))return X}CO.getCompilingSchema=TO;function xR($,X){return $.schema===X.schema&&$.root===X.root&&$.baseId===X.baseId}function uR($,X){let W;while(typeof(W=this.refs[X])=="string")X=W;return W||this.schemas[X]||U8.call(this,$,X)}function U8($,X){let W=this.opts.uriResolver.parse(X),Y=(0,m4._getFullPath)(this.opts.uriResolver,W),J=(0,m4.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Y===J)return Fz.call(this,W,$);let G=(0,m4.normalizeId)(Y),U=this.refs[G]||this.schemas[G];if(typeof U=="string"){let Q=U8.call(this,$,U);if(typeof(Q===null||Q===void 0?void 0:Q.schema)!=="object")return;return Fz.call(this,W,Q)}if(typeof(U===null||U===void 0?void 0:U.schema)!=="object")return;if(!U.validate)Mz.call(this,U);if(G===(0,m4.normalizeId)(X)){let{schema:Q}=U,{schemaId:z}=this.opts,H=Q[z];if(H)J=(0,m4.resolveUrl)(this.opts.uriResolver,J,H);return new QW({schema:Q,schemaId:z,root:$,baseId:J})}return Fz.call(this,W,U)}CO.resolveSchema=U8;var yR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Fz($,{baseId:X,schema:W,root:Y}){var J;if(((J=$.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let Q of $.fragment.slice(1).split("/")){if(typeof W==="boolean")return;let z=W[(0,kO.unescapeFragment)(Q)];if(z===void 0)return;W=z;let H=typeof W==="object"&&W[this.opts.schemaId];if(!yR.has(Q)&&H)X=(0,m4.resolveUrl)(this.opts.uriResolver,X,H)}let G;if(typeof W!="boolean"&&W.$ref&&!(0,kO.schemaHasRulesButRef)(W,this.RULES)){let Q=(0,m4.resolveUrl)(this.opts.uriResolver,X,W.$ref);G=U8.call(this,Y,Q)}let{schemaId:U}=this.opts;if(G=G||new QW({schema:W,schemaId:U,root:Y,baseId:X}),G.schema!==G.root.schema)return G;return}});var xO=v((md,mR)=>{mR.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ez=v((id,fO)=>{var iR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),yO=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function Sz($){let X="",W=0,Y=0;for(Y=0;Y<$.length;Y++){if(W=$[Y].charCodeAt(0),W===48)continue;if(!(W>=48&&W<=57||W>=65&&W<=70||W>=97&&W<=102))return"";X+=$[Y];break}for(Y+=1;Y<$.length;Y++){if(W=$[Y].charCodeAt(0),!(W>=48&&W<=57||W>=65&&W<=70||W>=97&&W<=102))return"";X+=$[Y]}return X}var nR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function uO($){return $.length=0,!0}function cR($,X,W){if($.length){let Y=Sz($);if(Y!=="")X.push(Y);else return W.error=!0,!1;$.length=0}return!0}function rR($){let X=0,W={error:!1,address:"",zone:""},Y=[],J=[],G=!1,U=!1,Q=cR;for(let z=0;z<$.length;z++){let H=$[z];if(H==="["||H==="]")continue;if(H===":"){if(G===!0)U=!0;if(!Q(J,Y,W))break;if(++X>7){W.error=!0;break}if(z>0&&$[z-1]===":")G=!0;Y.push(":");continue}else if(H==="%"){if(!Q(J,Y,W))break;Q=uO}else{J.push(H);continue}}if(J.length)if(Q===uO)W.zone=J.join("");else if(U)Y.push(J.join(""));else Y.push(Sz(J));return W.address=Y.join(""),W}function gO($){if(pR($,":")<2)return{host:$,isIPV6:!1};let X=rR($);if(!X.error){let{address:W,address:Y}=X;if(X.zone)W+="%"+X.zone,Y+="%25"+X.zone;return{host:W,isIPV6:!0,escapedHost:Y}}else return{host:$,isIPV6:!1}}function pR($,X){let W=0;for(let Y=0;Y<$.length;Y++)if($[Y]===X)W++;return W}function dR($){let X=$,W=[],Y=-1,J=0;while(J=X.length){if(J===1)if(X===".")break;else if(X==="/"){W.push("/");break}else{W.push(X);break}else if(J===2){if(X[0]==="."){if(X[1]===".")break;else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."||X[1]==="/"){W.push("/");break}}}else if(J===3){if(X==="/.."){if(W.length!==0)W.pop();W.push("/");break}}if(X[0]==="."){if(X[1]==="."){if(X[2]==="/"){X=X.slice(3);continue}}else if(X[1]==="/"){X=X.slice(2);continue}}else if(X[0]==="/"){if(X[1]==="."){if(X[2]==="/"){X=X.slice(2);continue}else if(X[2]==="."){if(X[3]==="/"){if(X=X.slice(3),W.length!==0)W.pop();continue}}}}if((Y=X.indexOf("/",1))===-1){W.push(X);break}else W.push(X.slice(0,Y)),X=X.slice(Y)}return W.join("")}function oR($,X){let W=X!==!0?escape:unescape;if($.scheme!==void 0)$.scheme=W($.scheme);if($.userinfo!==void 0)$.userinfo=W($.userinfo);if($.host!==void 0)$.host=W($.host);if($.path!==void 0)$.path=W($.path);if($.query!==void 0)$.query=W($.query);if($.fragment!==void 0)$.fragment=W($.fragment);return $}function tR($){let X=[];if($.userinfo!==void 0)X.push($.userinfo),X.push("@");if($.host!==void 0){let W=unescape($.host);if(!yO(W)){let Y=gO(W);if(Y.isIPV6===!0)W=`[${Y.escapedHost}]`;else W=$.host}X.push(W)}if(typeof $.port==="number"||typeof $.port==="string")X.push(":"),X.push(String($.port));return X.length?X.join(""):void 0}fO.exports={nonSimpleDomain:nR,recomposeAuthority:tR,normalizeComponentEncoding:oR,removeDotSegments:dR,isIPv4:yO,isUUID:iR,normalizeIPv6:gO,stringArrayToHexStripped:Sz}});var nO=v((nd,iO)=>{var{isUUID:aR}=Ez(),sR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,eR=["http","https","ws","wss","urn","urn:uuid"];function $Z($){return eR.indexOf($)!==-1}function Pz($){if($.secure===!0)return!0;else if($.secure===!1)return!1;else if($.scheme)return $.scheme.length===3&&($.scheme[0]==="w"||$.scheme[0]==="W")&&($.scheme[1]==="s"||$.scheme[1]==="S")&&($.scheme[2]==="s"||$.scheme[2]==="S");else return!1}function hO($){if(!$.host)$.error=$.error||"HTTP URIs must have a host.";return $}function lO($){let X=String($.scheme).toLowerCase()==="https";if($.port===(X?443:80)||$.port==="")$.port=void 0;if(!$.path)$.path="/";return $}function XZ($){return $.secure=Pz($),$.resourceName=($.path||"/")+($.query?"?"+$.query:""),$.path=void 0,$.query=void 0,$}function WZ($){if($.port===(Pz($)?443:80)||$.port==="")$.port=void 0;if(typeof $.secure==="boolean")$.scheme=$.secure?"wss":"ws",$.secure=void 0;if($.resourceName){let[X,W]=$.resourceName.split("?");$.path=X&&X!=="/"?X:void 0,$.query=W,$.resourceName=void 0}return $.fragment=void 0,$}function JZ($,X){if(!$.path)return $.error="URN can not be parsed",$;let W=$.path.match(sR);if(W){let Y=X.scheme||$.scheme||"urn";$.nid=W[1].toLowerCase(),$.nss=W[2];let J=`${Y}:${X.nid||$.nid}`,G=Rz(J);if($.path=void 0,G)$=G.parse($,X)}else $.error=$.error||"URN can not be parsed.";return $}function YZ($,X){if($.nid===void 0)throw Error("URN without nid cannot be serialized");let W=X.scheme||$.scheme||"urn",Y=$.nid.toLowerCase(),J=`${W}:${X.nid||Y}`,G=Rz(J);if(G)$=G.serialize($,X);let U=$,Q=$.nss;return U.path=`${Y||X.nid}:${Q}`,X.skipEscape=!0,U}function GZ($,X){let W=$;if(W.uuid=W.nss,W.nss=void 0,!X.tolerant&&(!W.uuid||!aR(W.uuid)))W.error=W.error||"UUID is not valid.";return W}function UZ($){let X=$;return X.nss=($.uuid||"").toLowerCase(),X}var mO={scheme:"http",domainHost:!0,parse:hO,serialize:lO},QZ={scheme:"https",domainHost:mO.domainHost,parse:hO,serialize:lO},z8={scheme:"ws",domainHost:!0,parse:XZ,serialize:WZ},zZ={scheme:"wss",domainHost:z8.domainHost,parse:z8.parse,serialize:z8.serialize},HZ={scheme:"urn",parse:JZ,serialize:YZ,skipNormalize:!0},jZ={scheme:"urn:uuid",parse:GZ,serialize:UZ,skipNormalize:!0},H8={http:mO,https:QZ,ws:z8,wss:zZ,urn:HZ,"urn:uuid":jZ};Object.setPrototypeOf(H8,null);function Rz($){return $&&(H8[$]||H8[$.toLowerCase()])||void 0}iO.exports={wsIsSecure:Pz,SCHEMES:H8,isValidSchemeName:$Z,getSchemeHandler:Rz}});var kz=v((cd,I8)=>{var{normalizeIPv6:IZ,removeDotSegments:zW,recomposeAuthority:OZ,normalizeComponentEncoding:j8,isIPv4:NZ,nonSimpleDomain:DZ}=Ez(),{SCHEMES:BZ,getSchemeHandler:cO}=nO();function wZ($,X){if(typeof $==="string")$=G6(v6($,X),X);else if(typeof $==="object")$=v6(G6($,X),X);return $}function VZ($,X,W){let Y=W?Object.assign({scheme:"null"},W):{scheme:"null"},J=rO(v6($,Y),v6(X,Y),Y,!0);return Y.skipEscape=!0,G6(J,Y)}function rO($,X,W,Y){let J={};if(!Y)$=v6(G6($,W),W),X=v6(G6(X,W),W);if(W=W||{},!W.tolerant&&X.scheme)J.scheme=X.scheme,J.userinfo=X.userinfo,J.host=X.host,J.port=X.port,J.path=zW(X.path||""),J.query=X.query;else{if(X.userinfo!==void 0||X.host!==void 0||X.port!==void 0)J.userinfo=X.userinfo,J.host=X.host,J.port=X.port,J.path=zW(X.path||""),J.query=X.query;else{if(!X.path)if(J.path=$.path,X.query!==void 0)J.query=X.query;else J.query=$.query;else{if(X.path[0]==="/")J.path=zW(X.path);else{if(($.userinfo!==void 0||$.host!==void 0||$.port!==void 0)&&!$.path)J.path="/"+X.path;else if(!$.path)J.path=X.path;else J.path=$.path.slice(0,$.path.lastIndexOf("/")+1)+X.path;J.path=zW(J.path)}J.query=X.query}J.userinfo=$.userinfo,J.host=$.host,J.port=$.port}J.scheme=$.scheme}return J.fragment=X.fragment,J}function AZ($,X,W){if(typeof $==="string")$=unescape($),$=G6(j8(v6($,W),!0),{...W,skipEscape:!0});else if(typeof $==="object")$=G6(j8($,!0),{...W,skipEscape:!0});if(typeof X==="string")X=unescape(X),X=G6(j8(v6(X,W),!0),{...W,skipEscape:!0});else if(typeof X==="object")X=G6(j8(X,!0),{...W,skipEscape:!0});return $.toLowerCase()===X.toLowerCase()}function G6($,X){let W={host:$.host,scheme:$.scheme,userinfo:$.userinfo,port:$.port,path:$.path,query:$.query,nid:$.nid,nss:$.nss,uuid:$.uuid,fragment:$.fragment,reference:$.reference,resourceName:$.resourceName,secure:$.secure,error:""},Y=Object.assign({},X),J=[],G=cO(Y.scheme||W.scheme);if(G&&G.serialize)G.serialize(W,Y);if(W.path!==void 0)if(!Y.skipEscape){if(W.path=escape(W.path),W.scheme!==void 0)W.path=W.path.split("%3A").join(":")}else W.path=unescape(W.path);if(Y.reference!=="suffix"&&W.scheme)J.push(W.scheme,":");let U=OZ(W);if(U!==void 0){if(Y.reference!=="suffix")J.push("//");if(J.push(U),W.path&&W.path[0]!=="/")J.push("/")}if(W.path!==void 0){let Q=W.path;if(!Y.absolutePath&&(!G||!G.absolutePath))Q=zW(Q);if(U===void 0&&Q[0]==="/"&&Q[1]==="/")Q="/%2F"+Q.slice(2);J.push(Q)}if(W.query!==void 0)J.push("?",W.query);if(W.fragment!==void 0)J.push("#",W.fragment);return J.join("")}var bZ=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v6($,X){let W=Object.assign({},X),Y={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},J=!1;if(W.reference==="suffix")if(W.scheme)$=W.scheme+":"+$;else $="//"+$;let G=$.match(bZ);if(G){if(Y.scheme=G[1],Y.userinfo=G[3],Y.host=G[4],Y.port=parseInt(G[5],10),Y.path=G[6]||"",Y.query=G[7],Y.fragment=G[8],isNaN(Y.port))Y.port=G[5];if(Y.host)if(NZ(Y.host)===!1){let z=IZ(Y.host);Y.host=z.host.toLowerCase(),J=z.isIPV6}else J=!0;if(Y.scheme===void 0&&Y.userinfo===void 0&&Y.host===void 0&&Y.port===void 0&&Y.query===void 0&&!Y.path)Y.reference="same-document";else if(Y.scheme===void 0)Y.reference="relative";else if(Y.fragment===void 0)Y.reference="absolute";else Y.reference="uri";if(W.reference&&W.reference!=="suffix"&&W.reference!==Y.reference)Y.error=Y.error||"URI is not a "+W.reference+" reference.";let U=cO(W.scheme||Y.scheme);if(!W.unicodeSupport&&(!U||!U.unicodeSupport)){if(Y.host&&(W.domainHost||U&&U.domainHost)&&J===!1&&DZ(Y.host))try{Y.host=URL.domainToASCII(Y.host.toLowerCase())}catch(Q){Y.error=Y.error||"Host's domain name can not be converted to ASCII: "+Q}}if(!U||U&&!U.skipNormalize){if($.indexOf("%")!==-1){if(Y.scheme!==void 0)Y.scheme=unescape(Y.scheme);if(Y.host!==void 0)Y.host=unescape(Y.host)}if(Y.path)Y.path=escape(unescape(Y.path));if(Y.fragment)Y.fragment=encodeURI(decodeURIComponent(Y.fragment))}if(U&&U.parse)U.parse(Y,W)}else Y.error=Y.error||"URI can not be parsed.";return Y}var Zz={SCHEMES:BZ,normalize:wZ,resolve:VZ,resolveComponent:rO,equal:AZ,serialize:G6,parse:v6};I8.exports=Zz;I8.exports.default=Zz;I8.exports.fastUri=Zz});var oO=v((dO)=>{Object.defineProperty(dO,"__esModule",{value:!0});var pO=kz();pO.code='require("ajv/dist/runtime/uri").default';dO.default=pO});var JN=v((q6)=>{Object.defineProperty(q6,"__esModule",{value:!0});q6.CodeGen=q6.Name=q6.nil=q6.stringify=q6.str=q6._=q6.KeywordCxt=void 0;var vZ=GW();Object.defineProperty(q6,"KeywordCxt",{enumerable:!0,get:function(){return vZ.KeywordCxt}});var j0=X$();Object.defineProperty(q6,"_",{enumerable:!0,get:function(){return j0._}});Object.defineProperty(q6,"str",{enumerable:!0,get:function(){return j0.str}});Object.defineProperty(q6,"stringify",{enumerable:!0,get:function(){return j0.stringify}});Object.defineProperty(q6,"nil",{enumerable:!0,get:function(){return j0.nil}});Object.defineProperty(q6,"Name",{enumerable:!0,get:function(){return j0.Name}});Object.defineProperty(q6,"CodeGen",{enumerable:!0,get:function(){return j0.CodeGen}});var qZ=G8(),$N=UW(),LZ=jz(),HW=Q8(),FZ=X$(),jW=WW(),O8=$W(),Cz=j$(),tO=xO(),MZ=oO(),XN=($,X)=>new RegExp($,X);XN.code="new RegExp";var SZ=["removeAdditional","useDefaults","coerceTypes"],EZ=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),PZ={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},RZ={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},aO=200;function ZZ($){var X,W,Y,J,G,U,Q,z,H,j,O,B,I,N,D,w,V,K,b,S,L,l,V$,s$,t4;let U4=$.strict,z6=(X=$.code)===null||X===void 0?void 0:X.optimize,$1=z6===!0||z6===void 0?1:z6||0,H6=(Y=(W=$.code)===null||W===void 0?void 0:W.regExp)!==null&&Y!==void 0?Y:XN,S1=(J=$.uriResolver)!==null&&J!==void 0?J:MZ.default;return{strictSchema:(U=(G=$.strictSchema)!==null&&G!==void 0?G:U4)!==null&&U!==void 0?U:!0,strictNumbers:(z=(Q=$.strictNumbers)!==null&&Q!==void 0?Q:U4)!==null&&z!==void 0?z:!0,strictTypes:(j=(H=$.strictTypes)!==null&&H!==void 0?H:U4)!==null&&j!==void 0?j:"log",strictTuples:(B=(O=$.strictTuples)!==null&&O!==void 0?O:U4)!==null&&B!==void 0?B:"log",strictRequired:(N=(I=$.strictRequired)!==null&&I!==void 0?I:U4)!==null&&N!==void 0?N:!1,code:$.code?{...$.code,optimize:$1,regExp:H6}:{optimize:$1,regExp:H6},loopRequired:(D=$.loopRequired)!==null&&D!==void 0?D:aO,loopEnum:(w=$.loopEnum)!==null&&w!==void 0?w:aO,meta:(V=$.meta)!==null&&V!==void 0?V:!0,messages:(K=$.messages)!==null&&K!==void 0?K:!0,inlineRefs:(b=$.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(S=$.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(L=$.addUsedSchema)!==null&&L!==void 0?L:!0,validateSchema:(l=$.validateSchema)!==null&&l!==void 0?l:!0,validateFormats:(V$=$.validateFormats)!==null&&V$!==void 0?V$:!0,unicodeRegExp:(s$=$.unicodeRegExp)!==null&&s$!==void 0?s$:!0,int32range:(t4=$.int32range)!==null&&t4!==void 0?t4:!0,uriResolver:S1}}class N8{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...ZZ($)};let{es5:X,lines:W}=this.opts.code;this.scope=new FZ.ValueScope({scope:{},prefixes:EZ,es5:X,lines:W}),this.logger=uZ($.logger);let Y=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,LZ.getRules)(),sO.call(this,PZ,$,"NOT SUPPORTED"),sO.call(this,RZ,$,"DEPRECATED","warn"),this._metaOpts=_Z.call(this),$.formats)TZ.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)CZ.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);kZ.call(this),$.validateFormats=Y}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:X,schemaId:W}=this.opts,Y=tO;if(W==="id")Y={...tO},Y.id=Y.$id,delete Y.$id;if(X&&$)this.addMetaSchema(Y,Y[W],!1)}defaultMeta(){let{meta:$,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[X]||$:void 0}validate($,X){let W;if(typeof $=="string"){if(W=this.getSchema($),!W)throw Error(`no schema with key or ref "${$}"`)}else W=this.compile($);let Y=W(X);if(!("$async"in W))this.errors=W.errors;return Y}compile($,X){let W=this._addSchema($,X);return W.validate||this._compileSchemaEnv(W)}compileAsync($,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:W}=this.opts;return Y.call(this,$,X);async function Y(H,j){await J.call(this,H.$schema);let O=this._addSchema(H,j);return O.validate||G.call(this,O)}async function J(H){if(H&&!this.getSchema(H))await Y.call(this,{$ref:H},!0)}async function G(H){try{return this._compileSchemaEnv(H)}catch(j){if(!(j instanceof $N.default))throw j;return U.call(this,j),await Q.call(this,j.missingSchema),G.call(this,H)}}function U({missingSchema:H,missingRef:j}){if(this.refs[H])throw Error(`AnySchema ${H} is loaded but ${j} cannot be resolved`)}async function Q(H){let j=await z.call(this,H);if(!this.refs[H])await J.call(this,j.$schema);if(!this.refs[H])this.addSchema(j,H,X)}async function z(H){let j=this._loading[H];if(j)return j;try{return await(this._loading[H]=W(H))}finally{delete this._loading[H]}}}addSchema($,X,W,Y=this.opts.validateSchema){if(Array.isArray($)){for(let G of $)this.addSchema(G,void 0,W,Y);return this}let J;if(typeof $==="object"){let{schemaId:G}=this.opts;if(J=$[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return X=(0,jW.normalizeId)(X||J),this._checkUnique(X),this.schemas[X]=this._addSchema($,W,X,Y,!0),this}addMetaSchema($,X,W=this.opts.validateSchema){return this.addSchema($,X,!0,W),this}validateSchema($,X){if(typeof $=="boolean")return!0;let W;if(W=$.$schema,W!==void 0&&typeof W!="string")throw Error("$schema must be a string");if(W=W||this.opts.defaultMeta||this.defaultMeta(),!W)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Y=this.validate(W,$);if(!Y&&X){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return Y}getSchema($){let X;while(typeof(X=eO.call(this,$))=="string")$=X;if(X===void 0){let{schemaId:W}=this.opts,Y=new HW.SchemaEnv({schema:{},schemaId:W});if(X=HW.resolveSchema.call(this,Y,$),!X)return;this.refs[$]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=eO.call(this,$);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let X=$;this._cache.delete(X);let W=$[this.opts.schemaId];if(W)W=(0,jW.normalizeId)(W),delete this.schemas[W],delete this.refs[W];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let X of $)this.addKeyword(X);return this}addKeyword($,X){let W;if(typeof $=="string"){if(W=$,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=W}else if(typeof $=="object"&&X===void 0){if(X=$,W=X.keyword,Array.isArray(W)&&!W.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(gZ.call(this,W,X),!X)return(0,Cz.eachItem)(W,(J)=>Tz.call(this,J)),this;hZ.call(this,X);let Y={...X,type:(0,O8.getJSONTypes)(X.type),schemaType:(0,O8.getJSONTypes)(X.schemaType)};return(0,Cz.eachItem)(W,Y.type.length===0?(J)=>Tz.call(this,J,Y):(J)=>Y.type.forEach((G)=>Tz.call(this,J,Y,G))),this}getKeyword($){let X=this.RULES.all[$];return typeof X=="object"?X.definition:!!X}removeKeyword($){let{RULES:X}=this;delete X.keywords[$],delete X.all[$];for(let W of X.rules){let Y=W.rules.findIndex((J)=>J.keyword===$);if(Y>=0)W.rules.splice(Y,1)}return this}addFormat($,X){if(typeof X=="string")X=new RegExp(X);return this.formats[$]=X,this}errorsText($=this.errors,{separator:X=", ",dataVar:W="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Y)=>`${W}${Y.instancePath} ${Y.message}`).reduce((Y,J)=>Y+X+J)}$dataMetaSchema($,X){let W=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Y of X){let J=Y.split("/").slice(1),G=$;for(let U of J)G=G[U];for(let U in W){let Q=W[U];if(typeof Q!="object")continue;let{$data:z}=Q.definition,H=G[U];if(z&&H)G[U]=WN(H)}}return $}_removeAllSchemas($,X){for(let W in $){let Y=$[W];if(!X||X.test(W)){if(typeof Y=="string")delete $[W];else if(Y&&!Y.meta)this._cache.delete(Y.schema),delete $[W]}}}_addSchema($,X,W,Y=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:U}=this.opts;if(typeof $=="object")G=$[U];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Q=this._cache.get($);if(Q!==void 0)return Q;W=(0,jW.normalizeId)(G||W);let z=jW.getSchemaRefs.call(this,$,W);if(Q=new HW.SchemaEnv({schema:$,schemaId:U,meta:X,baseId:W,localRefs:z}),this._cache.set(Q.schema,Q),J&&!W.startsWith("#")){if(W)this._checkUnique(W);this.refs[W]=Q}if(Y)this.validateSchema($,!0);return Q}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else HW.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let X=this.opts;this.opts=this._metaOpts;try{HW.compileSchema.call(this,$)}finally{this.opts=X}}}N8.ValidationError=qZ.default;N8.MissingRefError=$N.default;q6.default=N8;function sO($,X,W,Y="error"){for(let J in $){let G=J;if(G in X)this.logger[Y](`${W}: option ${J}. ${$[G]}`)}}function eO($){return $=(0,jW.normalizeId)($),this.schemas[$]||this.refs[$]}function kZ(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let X in $)this.addSchema($[X],X)}function TZ(){for(let $ in this.opts.formats){let X=this.opts.formats[$];if(X)this.addFormat($,X)}}function CZ($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in $){let W=$[X];if(!W.keyword)W.keyword=X;this.addKeyword(W)}}function _Z(){let $={...this.opts};for(let X of SZ)delete $[X];return $}var xZ={log(){},warn(){},error(){}};function uZ($){if($===!1)return xZ;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var yZ=/^[a-z_$][a-z0-9_$:-]*$/i;function gZ($,X){let{RULES:W}=this;if((0,Cz.eachItem)($,(Y)=>{if(W.keywords[Y])throw Error(`Keyword ${Y} is already defined`);if(!yZ.test(Y))throw Error(`Keyword ${Y} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function Tz($,X,W){var Y;let J=X===null||X===void 0?void 0:X.post;if(W&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,U=J?G.post:G.rules.find(({type:z})=>z===W);if(!U)U={type:W,rules:[]},G.rules.push(U);if(G.keywords[$]=!0,!X)return;let Q={keyword:$,definition:{...X,type:(0,O8.getJSONTypes)(X.type),schemaType:(0,O8.getJSONTypes)(X.schemaType)}};if(X.before)fZ.call(this,U,Q,X.before);else U.rules.push(Q);G.all[$]=Q,(Y=X.implements)===null||Y===void 0||Y.forEach((z)=>this.addKeyword(z))}function fZ($,X,W){let Y=$.rules.findIndex((J)=>J.keyword===W);if(Y>=0)$.rules.splice(Y,0,X);else $.rules.push(X),this.logger.warn(`rule ${W} is not defined`)}function hZ($){let{metaSchema:X}=$;if(X===void 0)return;if($.$data&&this.opts.$data)X=WN(X);$.validateSchema=this.compile(X,!0)}var lZ={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function WN($){return{anyOf:[$,lZ]}}});var GN=v((YN)=>{Object.defineProperty(YN,"__esModule",{value:!0});var nZ={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};YN.default=nZ});var IN=v((HN)=>{Object.defineProperty(HN,"__esModule",{value:!0});HN.callRef=HN.getValidate=void 0;var rZ=UW(),UN=P4(),B4=X$(),I0=b6(),QN=Q8(),D8=j$(),pZ={keyword:"$ref",schemaType:"string",code($){let{gen:X,schema:W,it:Y}=$,{baseId:J,schemaEnv:G,validateName:U,opts:Q,self:z}=Y,{root:H}=G;if((W==="#"||W==="#/")&&J===H.baseId)return O();let j=QN.resolveRef.call(z,H,J,W);if(j===void 0)throw new rZ.default(Y.opts.uriResolver,J,W);if(j instanceof QN.SchemaEnv)return B(j);return I(j);function O(){if(G===H)return B8($,U,G,G.$async);let N=X.scopeValue("root",{ref:H});return B8($,B4._`${N}.validate`,H,H.$async)}function B(N){let D=zN($,N);B8($,D,N,N.$async)}function I(N){let D=X.scopeValue("schema",Q.code.source===!0?{ref:N,code:(0,B4.stringify)(N)}:{ref:N}),w=X.name("valid"),V=$.subschema({schema:N,dataTypes:[],schemaPath:B4.nil,topSchemaRef:D,errSchemaPath:W},w);$.mergeEvaluated(V),$.ok(w)}}};function zN($,X){let{gen:W}=$;return X.validate?W.scopeValue("validate",{ref:X.validate}):B4._`${W.scopeValue("wrapper",{ref:X})}.validate`}HN.getValidate=zN;function B8($,X,W,Y){let{gen:J,it:G}=$,{allErrors:U,schemaEnv:Q,opts:z}=G,H=z.passContext?I0.default.this:B4.nil;if(Y)j();else O();function j(){if(!Q.$async)throw Error("async schema referenced by sync schema");let N=J.let("valid");J.try(()=>{if(J.code(B4._`await ${(0,UN.callValidateCode)($,X,H)}`),I(X),!U)J.assign(N,!0)},(D)=>{if(J.if(B4._`!(${D} instanceof ${G.ValidationError})`,()=>J.throw(D)),B(D),!U)J.assign(N,!1)}),$.ok(N)}function O(){$.result((0,UN.callValidateCode)($,X,H),()=>I(X),()=>B(X))}function B(N){let D=B4._`${N}.errors`;J.assign(I0.default.vErrors,B4._`${I0.default.vErrors} === null ? ${D} : ${I0.default.vErrors}.concat(${D})`),J.assign(I0.default.errors,B4._`${I0.default.vErrors}.length`)}function I(N){var D;if(!G.opts.unevaluated)return;let w=(D=W===null||W===void 0?void 0:W.validate)===null||D===void 0?void 0:D.evaluated;if(G.props!==!0)if(w&&!w.dynamicProps){if(w.props!==void 0)G.props=D8.mergeEvaluated.props(J,w.props,G.props)}else{let V=J.var("props",B4._`${N}.evaluated.props`);G.props=D8.mergeEvaluated.props(J,V,G.props,B4.Name)}if(G.items!==!0)if(w&&!w.dynamicItems){if(w.items!==void 0)G.items=D8.mergeEvaluated.items(J,w.items,G.items)}else{let V=J.var("items",B4._`${N}.evaluated.items`);G.items=D8.mergeEvaluated.items(J,V,G.items,B4.Name)}}}HN.callRef=B8;HN.default=pZ});var NN=v((ON)=>{Object.defineProperty(ON,"__esModule",{value:!0});var tZ=GN(),aZ=IN(),sZ=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",tZ.default,aZ.default];ON.default=sZ});var BN=v((DN)=>{Object.defineProperty(DN,"__esModule",{value:!0});var w8=X$(),c6=w8.operators,V8={maximum:{okStr:"<=",ok:c6.LTE,fail:c6.GT},minimum:{okStr:">=",ok:c6.GTE,fail:c6.LT},exclusiveMaximum:{okStr:"<",ok:c6.LT,fail:c6.GTE},exclusiveMinimum:{okStr:">",ok:c6.GT,fail:c6.LTE}},$k={message:({keyword:$,schemaCode:X})=>w8.str`must be ${V8[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>w8._`{comparison: ${V8[$].okStr}, limit: ${X}}`},Xk={keyword:Object.keys(V8),type:"number",schemaType:"number",$data:!0,error:$k,code($){let{keyword:X,data:W,schemaCode:Y}=$;$.fail$data(w8._`${W} ${V8[X].fail} ${Y} || isNaN(${W})`)}};DN.default=Xk});var VN=v((wN)=>{Object.defineProperty(wN,"__esModule",{value:!0});var IW=X$(),Jk={message:({schemaCode:$})=>IW.str`must be multiple of ${$}`,params:({schemaCode:$})=>IW._`{multipleOf: ${$}}`},Yk={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Jk,code($){let{gen:X,data:W,schemaCode:Y,it:J}=$,G=J.opts.multipleOfPrecision,U=X.let("res"),Q=G?IW._`Math.abs(Math.round(${U}) - ${U}) > 1e-${G}`:IW._`${U} !== parseInt(${U})`;$.fail$data(IW._`(${Y} === 0 || (${U} = ${W}/${Y}, ${Q}))`)}};wN.default=Yk});var KN=v((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});function AN($){let X=$.length,W=0,Y=0,J;while(Y<X)if(W++,J=$.charCodeAt(Y++),J>=55296&&J<=56319&&Y<X){if(J=$.charCodeAt(Y),(J&64512)===56320)Y++}return W}bN.default=AN;AN.code='require("ajv/dist/runtime/ucs2length").default'});var qN=v((vN)=>{Object.defineProperty(vN,"__esModule",{value:!0});var V1=X$(),Qk=j$(),zk=KN(),Hk={message({keyword:$,schemaCode:X}){let W=$==="maxLength"?"more":"fewer";return V1.str`must NOT have ${W} than ${X} characters`},params:({schemaCode:$})=>V1._`{limit: ${$}}`},jk={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Hk,code($){let{keyword:X,data:W,schemaCode:Y,it:J}=$,G=X==="maxLength"?V1.operators.GT:V1.operators.LT,U=J.opts.unicode===!1?V1._`${W}.length`:V1._`${(0,Qk.useFunc)($.gen,zk.default)}(${W})`;$.fail$data(V1._`${U} ${G} ${Y}`)}};vN.default=jk});var FN=v((LN)=>{Object.defineProperty(LN,"__esModule",{value:!0});var Ok=P4(),A8=X$(),Nk={message:({schemaCode:$})=>A8.str`must match pattern "${$}"`,params:({schemaCode:$})=>A8._`{pattern: ${$}}`},Dk={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Nk,code($){let{data:X,$data:W,schema:Y,schemaCode:J,it:G}=$,U=G.opts.unicodeRegExp?"u":"",Q=W?A8._`(new RegExp(${J}, ${U}))`:(0,Ok.usePattern)($,Y);$.fail$data(A8._`!${Q}.test(${X})`)}};LN.default=Dk});var SN=v((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});var OW=X$(),wk={message({keyword:$,schemaCode:X}){let W=$==="maxProperties"?"more":"fewer";return OW.str`must NOT have ${W} than ${X} properties`},params:({schemaCode:$})=>OW._`{limit: ${$}}`},Vk={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:wk,code($){let{keyword:X,data:W,schemaCode:Y}=$,J=X==="maxProperties"?OW.operators.GT:OW.operators.LT;$.fail$data(OW._`Object.keys(${W}).length ${J} ${Y}`)}};MN.default=Vk});var PN=v((EN)=>{Object.defineProperty(EN,"__esModule",{value:!0});var NW=P4(),DW=X$(),bk=j$(),Kk={message:({params:{missingProperty:$}})=>DW.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>DW._`{missingProperty: ${$}}`},vk={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Kk,code($){let{gen:X,schema:W,schemaCode:Y,data:J,$data:G,it:U}=$,{opts:Q}=U;if(!G&&W.length===0)return;let z=W.length>=Q.loopRequired;if(U.allErrors)H();else j();if(Q.strictRequired){let I=$.parentSchema.properties,{definedProperties:N}=$.it;for(let D of W)if((I===null||I===void 0?void 0:I[D])===void 0&&!N.has(D)){let w=U.schemaEnv.baseId+U.errSchemaPath,V=`required property "${D}" is not defined at "${w}" (strictRequired)`;(0,bk.checkStrictMode)(U,V,U.opts.strictRequired)}}function H(){if(z||G)$.block$data(DW.nil,O);else for(let I of W)(0,NW.checkReportMissingProp)($,I)}function j(){let I=X.let("missing");if(z||G){let N=X.let("valid",!0);$.block$data(N,()=>B(I,N)),$.ok(N)}else X.if((0,NW.checkMissingProp)($,W,I)),(0,NW.reportMissingProp)($,I),X.else()}function O(){X.forOf("prop",Y,(I)=>{$.setParams({missingProperty:I}),X.if((0,NW.noPropertyInData)(X,J,I,Q.ownProperties),()=>$.error())})}function B(I,N){$.setParams({missingProperty:I}),X.forOf(I,Y,()=>{X.assign(N,(0,NW.propertyInData)(X,J,I,Q.ownProperties)),X.if((0,DW.not)(N),()=>{$.error(),X.break()})},DW.nil)}}};EN.default=vk});var ZN=v((RN)=>{Object.defineProperty(RN,"__esModule",{value:!0});var BW=X$(),Lk={message({keyword:$,schemaCode:X}){let W=$==="maxItems"?"more":"fewer";return BW.str`must NOT have ${W} than ${X} items`},params:({schemaCode:$})=>BW._`{limit: ${$}}`},Fk={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Lk,code($){let{keyword:X,data:W,schemaCode:Y}=$,J=X==="maxItems"?BW.operators.GT:BW.operators.LT;$.fail$data(BW._`${W}.length ${J} ${Y}`)}};RN.default=Fk});var b8=v((TN)=>{Object.defineProperty(TN,"__esModule",{value:!0});var kN=XW();kN.code='require("ajv/dist/runtime/equal").default';TN.default=kN});var _N=v((CN)=>{Object.defineProperty(CN,"__esModule",{value:!0});var _z=$W(),n$=X$(),Ek=j$(),Pk=b8(),Rk={message:({params:{i:$,j:X}})=>n$.str`must NOT have duplicate items (items ## ${X} and ${$} are identical)`,params:({params:{i:$,j:X}})=>n$._`{i: ${$}, j: ${X}}`},Zk={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Rk,code($){let{gen:X,data:W,$data:Y,schema:J,parentSchema:G,schemaCode:U,it:Q}=$;if(!Y&&!J)return;let z=X.let("valid"),H=G.items?(0,_z.getSchemaTypes)(G.items):[];$.block$data(z,j,n$._`${U} === false`),$.ok(z);function j(){let N=X.let("i",n$._`${W}.length`),D=X.let("j");$.setParams({i:N,j:D}),X.assign(z,!0),X.if(n$._`${N} > 1`,()=>(O()?B:I)(N,D))}function O(){return H.length>0&&!H.some((N)=>N==="object"||N==="array")}function B(N,D){let w=X.name("item"),V=(0,_z.checkDataTypes)(H,w,Q.opts.strictNumbers,_z.DataType.Wrong),K=X.const("indices",n$._`{}`);X.for(n$._`;${N}--;`,()=>{if(X.let(w,n$._`${W}[${N}]`),X.if(V,n$._`continue`),H.length>1)X.if(n$._`typeof ${w} == "string"`,n$._`${w} += "_"`);X.if(n$._`typeof ${K}[${w}] == "number"`,()=>{X.assign(D,n$._`${K}[${w}]`),$.error(),X.assign(z,!1).break()}).code(n$._`${K}[${w}] = ${N}`)})}function I(N,D){let w=(0,Ek.useFunc)(X,Pk.default),V=X.name("outer");X.label(V).for(n$._`;${N}--;`,()=>X.for(n$._`${D} = ${N}; ${D}--;`,()=>X.if(n$._`${w}(${W}[${N}], ${W}[${D}])`,()=>{$.error(),X.assign(z,!1).break(V)})))}}};CN.default=Zk});var uN=v((xN)=>{Object.defineProperty(xN,"__esModule",{value:!0});var xz=X$(),Tk=j$(),Ck=b8(),_k={message:"must be equal to constant",params:({schemaCode:$})=>xz._`{allowedValue: ${$}}`},xk={keyword:"const",$data:!0,error:_k,code($){let{gen:X,data:W,$data:Y,schemaCode:J,schema:G}=$;if(Y||G&&typeof G=="object")$.fail$data(xz._`!${(0,Tk.useFunc)(X,Ck.default)}(${W}, ${J})`);else $.fail(xz._`${G} !== ${W}`)}};xN.default=xk});var gN=v((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});var wW=X$(),yk=j$(),gk=b8(),fk={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>wW._`{allowedValues: ${$}}`},hk={keyword:"enum",schemaType:"array",$data:!0,error:fk,code($){let{gen:X,data:W,$data:Y,schema:J,schemaCode:G,it:U}=$;if(!Y&&J.length===0)throw Error("enum must have non-empty array");let Q=J.length>=U.opts.loopEnum,z,H=()=>z!==null&&z!==void 0?z:z=(0,yk.useFunc)(X,gk.default),j;if(Q||Y)j=X.let("valid"),$.block$data(j,O);else{if(!Array.isArray(J))throw Error("ajv implementation error");let I=X.const("vSchema",G);j=(0,wW.or)(...J.map((N,D)=>B(I,D)))}$.pass(j);function O(){X.assign(j,!1),X.forOf("v",G,(I)=>X.if(wW._`${H()}(${W}, ${I})`,()=>X.assign(j,!0).break()))}function B(I,N){let D=J[N];return typeof D==="object"&&D!==null?wW._`${H()}(${W}, ${I}[${N}])`:wW._`${W} === ${D}`}}};yN.default=hk});var hN=v((fN)=>{Object.defineProperty(fN,"__esModule",{value:!0});var mk=BN(),ik=VN(),nk=qN(),ck=FN(),rk=SN(),pk=PN(),dk=ZN(),ok=_N(),tk=uN(),ak=gN(),sk=[mk.default,ik.default,nk.default,ck.default,rk.default,pk.default,dk.default,ok.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},tk.default,ak.default];fN.default=sk});var yz=v((mN)=>{Object.defineProperty(mN,"__esModule",{value:!0});mN.validateAdditionalItems=void 0;var A1=X$(),uz=j$(),$T={message:({params:{len:$}})=>A1.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>A1._`{limit: ${$}}`},XT={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:$T,code($){let{parentSchema:X,it:W}=$,{items:Y}=X;if(!Array.isArray(Y)){(0,uz.checkStrictMode)(W,'"additionalItems" is ignored when "items" is not an array of schemas');return}lN($,Y)}};function lN($,X){let{gen:W,schema:Y,data:J,keyword:G,it:U}=$;U.items=!0;let Q=W.const("len",A1._`${J}.length`);if(Y===!1)$.setParams({len:X.length}),$.pass(A1._`${Q} <= ${X.length}`);else if(typeof Y=="object"&&!(0,uz.alwaysValidSchema)(U,Y)){let H=W.var("valid",A1._`${Q} <= ${X.length}`);W.if((0,A1.not)(H),()=>z(H)),$.ok(H)}function z(H){W.forRange("i",X.length,Q,(j)=>{if($.subschema({keyword:G,dataProp:j,dataPropType:uz.Type.Num},H),!U.allErrors)W.if((0,A1.not)(H),()=>W.break())})}}mN.validateAdditionalItems=lN;mN.default=XT});var gz=v((rN)=>{Object.defineProperty(rN,"__esModule",{value:!0});rN.validateTuple=void 0;var nN=X$(),K8=j$(),JT=P4(),YT={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:X,it:W}=$;if(Array.isArray(X))return cN($,"additionalItems",X);if(W.items=!0,(0,K8.alwaysValidSchema)(W,X))return;$.ok((0,JT.validateArray)($))}};function cN($,X,W=$.schema){let{gen:Y,parentSchema:J,data:G,keyword:U,it:Q}=$;if(j(J),Q.opts.unevaluated&&W.length&&Q.items!==!0)Q.items=K8.mergeEvaluated.items(Y,W.length,Q.items);let z=Y.name("valid"),H=Y.const("len",nN._`${G}.length`);W.forEach((O,B)=>{if((0,K8.alwaysValidSchema)(Q,O))return;Y.if(nN._`${H} > ${B}`,()=>$.subschema({keyword:U,schemaProp:B,dataProp:B},z)),$.ok(z)});function j(O){let{opts:B,errSchemaPath:I}=Q,N=W.length,D=N===O.minItems&&(N===O.maxItems||O[X]===!1);if(B.strictTuples&&!D){let w=`"${U}" is ${N}-tuple, but minItems or maxItems/${X} are not specified or different at path "${I}"`;(0,K8.checkStrictMode)(Q,w,B.strictTuples)}}}rN.validateTuple=cN;rN.default=YT});var oN=v((dN)=>{Object.defineProperty(dN,"__esModule",{value:!0});var UT=gz(),QT={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,UT.validateTuple)($,"items")};dN.default=QT});var sN=v((aN)=>{Object.defineProperty(aN,"__esModule",{value:!0});var tN=X$(),HT=j$(),jT=P4(),IT=yz(),OT={message:({params:{len:$}})=>tN.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>tN._`{limit: ${$}}`},NT={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:OT,code($){let{schema:X,parentSchema:W,it:Y}=$,{prefixItems:J}=W;if(Y.items=!0,(0,HT.alwaysValidSchema)(Y,X))return;if(J)(0,IT.validateAdditionalItems)($,J);else $.ok((0,jT.validateArray)($))}};aN.default=NT});var $D=v((eN)=>{Object.defineProperty(eN,"__esModule",{value:!0});var R4=X$(),v8=j$(),BT={message:({params:{min:$,max:X}})=>X===void 0?R4.str`must contain at least ${$} valid item(s)`:R4.str`must contain at least ${$} and no more than ${X} valid item(s)`,params:({params:{min:$,max:X}})=>X===void 0?R4._`{minContains: ${$}}`:R4._`{minContains: ${$}, maxContains: ${X}}`},wT={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:BT,code($){let{gen:X,schema:W,parentSchema:Y,data:J,it:G}=$,U,Q,{minContains:z,maxContains:H}=Y;if(G.opts.next)U=z===void 0?1:z,Q=H;else U=1;let j=X.const("len",R4._`${J}.length`);if($.setParams({min:U,max:Q}),Q===void 0&&U===0){(0,v8.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Q!==void 0&&U>Q){(0,v8.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,v8.alwaysValidSchema)(G,W)){let D=R4._`${j} >= ${U}`;if(Q!==void 0)D=R4._`${D} && ${j} <= ${Q}`;$.pass(D);return}G.items=!0;let O=X.name("valid");if(Q===void 0&&U===1)I(O,()=>X.if(O,()=>X.break()));else if(U===0){if(X.let(O,!0),Q!==void 0)X.if(R4._`${J}.length > 0`,B)}else X.let(O,!1),B();$.result(O,()=>$.reset());function B(){let D=X.name("_valid"),w=X.let("count",0);I(D,()=>X.if(D,()=>N(w)))}function I(D,w){X.forRange("i",0,j,(V)=>{$.subschema({keyword:"contains",dataProp:V,dataPropType:v8.Type.Num,compositeRule:!0},D),w()})}function N(D){if(X.code(R4._`${D}++`),Q===void 0)X.if(R4._`${D} >= ${U}`,()=>X.assign(O,!0).break());else if(X.if(R4._`${D} > ${Q}`,()=>X.assign(O,!1).break()),U===1)X.assign(O,!0);else X.if(R4._`${D} >= ${U}`,()=>X.assign(O,!0))}}};eN.default=wT});var UD=v((JD)=>{Object.defineProperty(JD,"__esModule",{value:!0});JD.validateSchemaDeps=JD.validatePropertyDeps=JD.error=void 0;var fz=X$(),AT=j$(),VW=P4();JD.error={message:({params:{property:$,depsCount:X,deps:W}})=>{let Y=X===1?"property":"properties";return fz.str`must have ${Y} ${W} when property ${$} is present`},params:({params:{property:$,depsCount:X,deps:W,missingProperty:Y}})=>fz._`{property: ${$},
|
|
7
|
+
missingProperty: ${Y},
|
|
8
|
+
depsCount: ${X},
|
|
9
|
+
deps: ${W}}`};var bT={keyword:"dependencies",type:"object",schemaType:"object",error:JD.error,code($){let[X,W]=KT($);XD($,X),WD($,W)}};function KT({schema:$}){let X={},W={};for(let Y in $){if(Y==="__proto__")continue;let J=Array.isArray($[Y])?X:W;J[Y]=$[Y]}return[X,W]}function XD($,X=$.schema){let{gen:W,data:Y,it:J}=$;if(Object.keys(X).length===0)return;let G=W.let("missing");for(let U in X){let Q=X[U];if(Q.length===0)continue;let z=(0,VW.propertyInData)(W,Y,U,J.opts.ownProperties);if($.setParams({property:U,depsCount:Q.length,deps:Q.join(", ")}),J.allErrors)W.if(z,()=>{for(let H of Q)(0,VW.checkReportMissingProp)($,H)});else W.if(fz._`${z} && (${(0,VW.checkMissingProp)($,Q,G)})`),(0,VW.reportMissingProp)($,G),W.else()}}JD.validatePropertyDeps=XD;function WD($,X=$.schema){let{gen:W,data:Y,keyword:J,it:G}=$,U=W.name("valid");for(let Q in X){if((0,AT.alwaysValidSchema)(G,X[Q]))continue;W.if((0,VW.propertyInData)(W,Y,Q,G.opts.ownProperties),()=>{let z=$.subschema({keyword:J,schemaProp:Q},U);$.mergeValidEvaluated(z,U)},()=>W.var(U,!0)),$.ok(U)}}JD.validateSchemaDeps=WD;JD.default=bT});var HD=v((zD)=>{Object.defineProperty(zD,"__esModule",{value:!0});var QD=X$(),LT=j$(),FT={message:"property name must be valid",params:({params:$})=>QD._`{propertyName: ${$.propertyName}}`},MT={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:FT,code($){let{gen:X,schema:W,data:Y,it:J}=$;if((0,LT.alwaysValidSchema)(J,W))return;let G=X.name("valid");X.forIn("key",Y,(U)=>{$.setParams({propertyName:U}),$.subschema({keyword:"propertyNames",data:U,dataTypes:["string"],propertyName:U,compositeRule:!0},G),X.if((0,QD.not)(G),()=>{if($.error(!0),!J.allErrors)X.break()})}),$.ok(G)}};zD.default=MT});var hz=v((jD)=>{Object.defineProperty(jD,"__esModule",{value:!0});var q8=P4(),i4=X$(),ET=b6(),L8=j$(),PT={message:"must NOT have additional properties",params:({params:$})=>i4._`{additionalProperty: ${$.additionalProperty}}`},RT={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:PT,code($){let{gen:X,schema:W,parentSchema:Y,data:J,errsCount:G,it:U}=$;if(!G)throw Error("ajv implementation error");let{allErrors:Q,opts:z}=U;if(U.props=!0,z.removeAdditional!=="all"&&(0,L8.alwaysValidSchema)(U,W))return;let H=(0,q8.allSchemaProperties)(Y.properties),j=(0,q8.allSchemaProperties)(Y.patternProperties);O(),$.ok(i4._`${G} === ${ET.default.errors}`);function O(){X.forIn("key",J,(w)=>{if(!H.length&&!j.length)N(w);else X.if(B(w),()=>N(w))})}function B(w){let V;if(H.length>8){let K=(0,L8.schemaRefOrVal)(U,Y.properties,"properties");V=(0,q8.isOwnProperty)(X,K,w)}else if(H.length)V=(0,i4.or)(...H.map((K)=>i4._`${w} === ${K}`));else V=i4.nil;if(j.length)V=(0,i4.or)(V,...j.map((K)=>i4._`${(0,q8.usePattern)($,K)}.test(${w})`));return(0,i4.not)(V)}function I(w){X.code(i4._`delete ${J}[${w}]`)}function N(w){if(z.removeAdditional==="all"||z.removeAdditional&&W===!1){I(w);return}if(W===!1){if($.setParams({additionalProperty:w}),$.error(),!Q)X.break();return}if(typeof W=="object"&&!(0,L8.alwaysValidSchema)(U,W)){let V=X.name("valid");if(z.removeAdditional==="failing")D(w,V,!1),X.if((0,i4.not)(V),()=>{$.reset(),I(w)});else if(D(w,V),!Q)X.if((0,i4.not)(V),()=>X.break())}}function D(w,V,K){let b={keyword:"additionalProperties",dataProp:w,dataPropType:L8.Type.Str};if(K===!1)Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(b,V)}}};jD.default=RT});var DD=v((ND)=>{Object.defineProperty(ND,"__esModule",{value:!0});var kT=GW(),ID=P4(),lz=j$(),OD=hz(),TT={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:X,schema:W,parentSchema:Y,data:J,it:G}=$;if(G.opts.removeAdditional==="all"&&Y.additionalProperties===void 0)OD.default.code(new kT.KeywordCxt(G,OD.default,"additionalProperties"));let U=(0,ID.allSchemaProperties)(W);for(let O of U)G.definedProperties.add(O);if(G.opts.unevaluated&&U.length&&G.props!==!0)G.props=lz.mergeEvaluated.props(X,(0,lz.toHash)(U),G.props);let Q=U.filter((O)=>!(0,lz.alwaysValidSchema)(G,W[O]));if(Q.length===0)return;let z=X.name("valid");for(let O of Q){if(H(O))j(O);else{if(X.if((0,ID.propertyInData)(X,J,O,G.opts.ownProperties)),j(O),!G.allErrors)X.else().var(z,!0);X.endIf()}$.it.definedProperties.add(O),$.ok(z)}function H(O){return G.opts.useDefaults&&!G.compositeRule&&W[O].default!==void 0}function j(O){$.subschema({keyword:"properties",schemaProp:O,dataProp:O},z)}}};ND.default=TT});var bD=v((AD)=>{Object.defineProperty(AD,"__esModule",{value:!0});var BD=P4(),F8=X$(),wD=j$(),VD=j$(),_T={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:X,schema:W,data:Y,parentSchema:J,it:G}=$,{opts:U}=G,Q=(0,BD.allSchemaProperties)(W),z=Q.filter((D)=>(0,wD.alwaysValidSchema)(G,W[D]));if(Q.length===0||z.length===Q.length&&(!G.opts.unevaluated||G.props===!0))return;let H=U.strictSchema&&!U.allowMatchingProperties&&J.properties,j=X.name("valid");if(G.props!==!0&&!(G.props instanceof F8.Name))G.props=(0,VD.evaluatedPropsToName)(X,G.props);let{props:O}=G;B();function B(){for(let D of Q){if(H)I(D);if(G.allErrors)N(D);else X.var(j,!0),N(D),X.if(j)}}function I(D){for(let w in H)if(new RegExp(D).test(w))(0,wD.checkStrictMode)(G,`property ${w} matches pattern ${D} (use allowMatchingProperties)`)}function N(D){X.forIn("key",Y,(w)=>{X.if(F8._`${(0,BD.usePattern)($,D)}.test(${w})`,()=>{let V=z.includes(D);if(!V)$.subschema({keyword:"patternProperties",schemaProp:D,dataProp:w,dataPropType:VD.Type.Str},j);if(G.opts.unevaluated&&O!==!0)X.assign(F8._`${O}[${w}]`,!0);else if(!V&&!G.allErrors)X.if((0,F8.not)(j),()=>X.break())})})}}};AD.default=_T});var vD=v((KD)=>{Object.defineProperty(KD,"__esModule",{value:!0});var uT=j$(),yT={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:X,schema:W,it:Y}=$;if((0,uT.alwaysValidSchema)(Y,W)){$.fail();return}let J=X.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),$.failResult(J,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};KD.default=yT});var LD=v((qD)=>{Object.defineProperty(qD,"__esModule",{value:!0});var fT=P4(),hT={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fT.validateUnion,error:{message:"must match a schema in anyOf"}};qD.default=hT});var MD=v((FD)=>{Object.defineProperty(FD,"__esModule",{value:!0});var M8=X$(),mT=j$(),iT={message:"must match exactly one schema in oneOf",params:({params:$})=>M8._`{passingSchemas: ${$.passing}}`},nT={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:iT,code($){let{gen:X,schema:W,parentSchema:Y,it:J}=$;if(!Array.isArray(W))throw Error("ajv implementation error");if(J.opts.discriminator&&Y.discriminator)return;let G=W,U=X.let("valid",!1),Q=X.let("passing",null),z=X.name("_valid");$.setParams({passing:Q}),X.block(H),$.result(U,()=>$.reset(),()=>$.error(!0));function H(){G.forEach((j,O)=>{let B;if((0,mT.alwaysValidSchema)(J,j))X.var(z,!0);else B=$.subschema({keyword:"oneOf",schemaProp:O,compositeRule:!0},z);if(O>0)X.if(M8._`${z} && ${U}`).assign(U,!1).assign(Q,M8._`[${Q}, ${O}]`).else();X.if(z,()=>{if(X.assign(U,!0),X.assign(Q,O),B)$.mergeEvaluated(B,M8.Name)})})}}};FD.default=nT});var ED=v((SD)=>{Object.defineProperty(SD,"__esModule",{value:!0});var rT=j$(),pT={keyword:"allOf",schemaType:"array",code($){let{gen:X,schema:W,it:Y}=$;if(!Array.isArray(W))throw Error("ajv implementation error");let J=X.name("valid");W.forEach((G,U)=>{if((0,rT.alwaysValidSchema)(Y,G))return;let Q=$.subschema({keyword:"allOf",schemaProp:U},J);$.ok(J),$.mergeEvaluated(Q)})}};SD.default=pT});var kD=v((ZD)=>{Object.defineProperty(ZD,"__esModule",{value:!0});var S8=X$(),RD=j$(),oT={message:({params:$})=>S8.str`must match "${$.ifClause}" schema`,params:({params:$})=>S8._`{failingKeyword: ${$.ifClause}}`},tT={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:oT,code($){let{gen:X,parentSchema:W,it:Y}=$;if(W.then===void 0&&W.else===void 0)(0,RD.checkStrictMode)(Y,'"if" without "then" and "else" is ignored');let J=PD(Y,"then"),G=PD(Y,"else");if(!J&&!G)return;let U=X.let("valid",!0),Q=X.name("_valid");if(z(),$.reset(),J&&G){let j=X.let("ifClause");$.setParams({ifClause:j}),X.if(Q,H("then",j),H("else",j))}else if(J)X.if(Q,H("then"));else X.if((0,S8.not)(Q),H("else"));$.pass(U,()=>$.error(!0));function z(){let j=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Q);$.mergeEvaluated(j)}function H(j,O){return()=>{let B=$.subschema({keyword:j},Q);if(X.assign(U,Q),$.mergeValidEvaluated(B,U),O)X.assign(O,S8._`${j}`);else $.setParams({ifClause:j})}}}};function PD($,X){let W=$.schema[X];return W!==void 0&&!(0,RD.alwaysValidSchema)($,W)}ZD.default=tT});var CD=v((TD)=>{Object.defineProperty(TD,"__esModule",{value:!0});var sT=j$(),eT={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:X,it:W}){if(X.if===void 0)(0,sT.checkStrictMode)(W,`"${$}" without "if" is ignored`)}};TD.default=eT});var xD=v((_D)=>{Object.defineProperty(_D,"__esModule",{value:!0});var XC=yz(),WC=oN(),JC=gz(),YC=sN(),GC=$D(),UC=UD(),QC=HD(),zC=hz(),HC=DD(),jC=bD(),IC=vD(),OC=LD(),NC=MD(),DC=ED(),BC=kD(),wC=CD();function VC($=!1){let X=[IC.default,OC.default,NC.default,DC.default,BC.default,wC.default,QC.default,zC.default,UC.default,HC.default,jC.default];if($)X.push(WC.default,YC.default);else X.push(XC.default,JC.default);return X.push(GC.default),X}_D.default=VC});var yD=v((uD)=>{Object.defineProperty(uD,"__esModule",{value:!0});var u$=X$(),bC={message:({schemaCode:$})=>u$.str`must match format "${$}"`,params:({schemaCode:$})=>u$._`{format: ${$}}`},KC={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bC,code($,X){let{gen:W,data:Y,$data:J,schema:G,schemaCode:U,it:Q}=$,{opts:z,errSchemaPath:H,schemaEnv:j,self:O}=Q;if(!z.validateFormats)return;if(J)B();else I();function B(){let N=W.scopeValue("formats",{ref:O.formats,code:z.code.formats}),D=W.const("fDef",u$._`${N}[${U}]`),w=W.let("fType"),V=W.let("format");W.if(u$._`typeof ${D} == "object" && !(${D} instanceof RegExp)`,()=>W.assign(w,u$._`${D}.type || "string"`).assign(V,u$._`${D}.validate`),()=>W.assign(w,u$._`"string"`).assign(V,D)),$.fail$data((0,u$.or)(K(),b()));function K(){if(z.strictSchema===!1)return u$.nil;return u$._`${U} && !${V}`}function b(){let S=j.$async?u$._`(${D}.async ? await ${V}(${Y}) : ${V}(${Y}))`:u$._`${V}(${Y})`,L=u$._`(typeof ${V} == "function" ? ${S} : ${V}.test(${Y}))`;return u$._`${V} && ${V} !== true && ${w} === ${X} && !${L}`}}function I(){let N=O.formats[G];if(!N){K();return}if(N===!0)return;let[D,w,V]=b(N);if(D===X)$.pass(S());function K(){if(z.strictSchema===!1){O.logger.warn(L());return}throw Error(L());function L(){return`unknown format "${G}" ignored in schema at path "${H}"`}}function b(L){let l=L instanceof RegExp?(0,u$.regexpCode)(L):z.code.formats?u$._`${z.code.formats}${(0,u$.getProperty)(G)}`:void 0,V$=W.scopeValue("formats",{key:G,ref:L,code:l});if(typeof L=="object"&&!(L instanceof RegExp))return[L.type||"string",L.validate,u$._`${V$}.validate`];return["string",L,V$]}function S(){if(typeof N=="object"&&!(N instanceof RegExp)&&N.async){if(!j.$async)throw Error("async format in sync schema");return u$._`await ${V}(${Y})`}return typeof w=="function"?u$._`${V}(${Y})`:u$._`${V}.test(${Y})`}}}};uD.default=KC});var fD=v((gD)=>{Object.defineProperty(gD,"__esModule",{value:!0});var qC=yD(),LC=[qC.default];gD.default=LC});var mD=v((hD)=>{Object.defineProperty(hD,"__esModule",{value:!0});hD.contentVocabulary=hD.metadataVocabulary=void 0;hD.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];hD.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var cD=v((nD)=>{Object.defineProperty(nD,"__esModule",{value:!0});var SC=NN(),EC=hN(),PC=xD(),RC=fD(),iD=mD(),ZC=[SC.default,EC.default,(0,PC.default)(),RC.default,iD.metadataVocabulary,iD.contentVocabulary];nD.default=ZC});var oD=v((pD)=>{Object.defineProperty(pD,"__esModule",{value:!0});pD.DiscrError=void 0;var rD;(function($){$.Tag="tag",$.Mapping="mapping"})(rD||(pD.DiscrError=rD={}))});var sD=v((aD)=>{Object.defineProperty(aD,"__esModule",{value:!0});var O0=X$(),mz=oD(),tD=Q8(),TC=UW(),CC=j$(),_C={message:({params:{discrError:$,tagName:X}})=>$===mz.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:$,tag:X,tagName:W}})=>O0._`{error: ${$}, tag: ${W}, tagValue: ${X}}`},xC={keyword:"discriminator",type:"object",schemaType:"object",error:_C,code($){let{gen:X,data:W,schema:Y,parentSchema:J,it:G}=$,{oneOf:U}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let Q=Y.propertyName;if(typeof Q!="string")throw Error("discriminator: requires propertyName");if(Y.mapping)throw Error("discriminator: mapping is not supported");if(!U)throw Error("discriminator: requires oneOf keyword");let z=X.let("valid",!1),H=X.const("tag",O0._`${W}${(0,O0.getProperty)(Q)}`);X.if(O0._`typeof ${H} == "string"`,()=>j(),()=>$.error(!1,{discrError:mz.DiscrError.Tag,tag:H,tagName:Q})),$.ok(z);function j(){let I=B();X.if(!1);for(let N in I)X.elseIf(O0._`${H} === ${N}`),X.assign(z,O(I[N]));X.else(),$.error(!1,{discrError:mz.DiscrError.Mapping,tag:H,tagName:Q}),X.endIf()}function O(I){let N=X.name("valid"),D=$.subschema({keyword:"oneOf",schemaProp:I},N);return $.mergeEvaluated(D,O0.Name),N}function B(){var I;let N={},D=V(J),w=!0;for(let S=0;S<U.length;S++){let L=U[S];if((L===null||L===void 0?void 0:L.$ref)&&!(0,CC.schemaHasRulesButRef)(L,G.self.RULES)){let V$=L.$ref;if(L=tD.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,V$),L instanceof tD.SchemaEnv)L=L.schema;if(L===void 0)throw new TC.default(G.opts.uriResolver,G.baseId,V$)}let l=(I=L===null||L===void 0?void 0:L.properties)===null||I===void 0?void 0:I[Q];if(typeof l!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Q}"`);w=w&&(D||V(L)),K(l,S)}if(!w)throw Error(`discriminator: "${Q}" must be required`);return N;function V({required:S}){return Array.isArray(S)&&S.includes(Q)}function K(S,L){if(S.const)b(S.const,L);else if(S.enum)for(let l of S.enum)b(l,L);else throw Error(`discriminator: "properties/${Q}" must have "const" or "enum"`)}function b(S,L){if(typeof S!="string"||S in N)throw Error(`discriminator: "${Q}" values must be unique strings`);N[S]=L}}}};aD.default=xC});var eD=v((fo,yC)=>{yC.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var XB=v((w4,iz)=>{Object.defineProperty(w4,"__esModule",{value:!0});w4.MissingRefError=w4.ValidationError=w4.CodeGen=w4.Name=w4.nil=w4.stringify=w4.str=w4._=w4.KeywordCxt=w4.Ajv=void 0;var gC=JN(),fC=cD(),hC=sD(),$B=eD(),lC=["/properties"],E8="http://json-schema.org/draft-07/schema";class AW extends gC.default{_addVocabularies(){if(super._addVocabularies(),fC.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(hC.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema($B,lC):$B;this.addMetaSchema($,E8,!1),this.refs["http://json-schema.org/schema"]=E8}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(E8)?E8:void 0)}}w4.Ajv=AW;iz.exports=w4=AW;iz.exports.Ajv=AW;Object.defineProperty(w4,"__esModule",{value:!0});w4.default=AW;var mC=GW();Object.defineProperty(w4,"KeywordCxt",{enumerable:!0,get:function(){return mC.KeywordCxt}});var N0=X$();Object.defineProperty(w4,"_",{enumerable:!0,get:function(){return N0._}});Object.defineProperty(w4,"str",{enumerable:!0,get:function(){return N0.str}});Object.defineProperty(w4,"stringify",{enumerable:!0,get:function(){return N0.stringify}});Object.defineProperty(w4,"nil",{enumerable:!0,get:function(){return N0.nil}});Object.defineProperty(w4,"Name",{enumerable:!0,get:function(){return N0.Name}});Object.defineProperty(w4,"CodeGen",{enumerable:!0,get:function(){return N0.CodeGen}});var iC=G8();Object.defineProperty(w4,"ValidationError",{enumerable:!0,get:function(){return iC.default}});var nC=UW();Object.defineProperty(w4,"MissingRefError",{enumerable:!0,get:function(){return nC.default}})});var IB=v((HB)=>{Object.defineProperty(HB,"__esModule",{value:!0});HB.formatNames=HB.fastFormats=HB.fullFormats=void 0;function U6($,X){return{validate:$,compare:X}}HB.fullFormats={date:U6(GB,pz),time:U6(cz(!0),dz),"date-time":U6(WB(!0),QB),"iso-time":U6(cz(),UB),"iso-date-time":U6(WB(),zB),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:sC,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:G2,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:eC,int32:{type:"number",validate:W2},int64:{type:"number",validate:J2},float:{type:"number",validate:YB},double:{type:"number",validate:YB},password:!0,binary:!0};HB.fastFormats={...HB.fullFormats,date:U6(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,pz),time:U6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,dz),"date-time":U6(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,QB),"iso-time":U6(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,UB),"iso-date-time":U6(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,zB),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};HB.formatNames=Object.keys(HB.fullFormats);function pC($){return $%4===0&&($%100!==0||$%400===0)}var dC=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,oC=[0,31,28,31,30,31,30,31,31,30,31,30,31];function GB($){let X=dC.exec($);if(!X)return!1;let W=+X[1],Y=+X[2],J=+X[3];return Y>=1&&Y<=12&&J>=1&&J<=(Y===2&&pC(W)?29:oC[Y])}function pz($,X){if(!($&&X))return;if($>X)return 1;if($<X)return-1;return 0}var nz=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function cz($){return function(W){let Y=nz.exec(W);if(!Y)return!1;let J=+Y[1],G=+Y[2],U=+Y[3],Q=Y[4],z=Y[5]==="-"?-1:1,H=+(Y[6]||0),j=+(Y[7]||0);if(H>23||j>59||$&&!Q)return!1;if(J<=23&&G<=59&&U<60)return!0;let O=G-j*z,B=J-H*z-(O<0?1:0);return(B===23||B===-1)&&(O===59||O===-1)&&U<61}}function dz($,X){if(!($&&X))return;let W=new Date("2020-01-01T"+$).valueOf(),Y=new Date("2020-01-01T"+X).valueOf();if(!(W&&Y))return;return W-Y}function UB($,X){if(!($&&X))return;let W=nz.exec($),Y=nz.exec(X);if(!(W&&Y))return;if($=W[1]+W[2]+W[3],X=Y[1]+Y[2]+Y[3],$>X)return 1;if($<X)return-1;return 0}var rz=/t|\s/i;function WB($){let X=cz($);return function(Y){let J=Y.split(rz);return J.length===2&&GB(J[0])&&X(J[1])}}function QB($,X){if(!($&&X))return;let W=new Date($).valueOf(),Y=new Date(X).valueOf();if(!(W&&Y))return;return W-Y}function zB($,X){if(!($&&X))return;let[W,Y]=$.split(rz),[J,G]=X.split(rz),U=pz(W,J);if(U===void 0)return;return U||dz(Y,G)}var tC=/\/|:/,aC=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function sC($){return tC.test($)&&aC.test($)}var JB=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function eC($){return JB.lastIndex=0,JB.test($)}var $2=-2147483648,X2=2147483647;function W2($){return Number.isInteger($)&&$<=X2&&$>=$2}function J2($){return Number.isInteger($)}function YB(){return!0}var Y2=/[^\\]\\Z/;function G2($){if(Y2.test($))return!1;try{return new RegExp($),!0}catch(X){return!1}}});var KW=v((DB)=>{Object.defineProperty(DB,"__esModule",{value:!0});DB.regexpCode=DB.getEsmExportName=DB.getProperty=DB.safeStringify=DB.stringify=DB.strConcat=DB.addCodeArg=DB.str=DB._=DB.nil=DB._Code=DB.Name=DB.IDENTIFIER=DB._CodeOrName=void 0;class P8{}DB._CodeOrName=P8;DB.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class D0 extends P8{constructor($){super();if(!DB.IDENTIFIER.test($))throw Error("CodeGen: name must be a valid identifier");this.str=$}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}DB.Name=D0;class n4 extends P8{constructor($){super();this._items=typeof $==="string"?[$]:$}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let $=this._items[0];return $===""||$==='""'}get str(){var $;return($=this._str)!==null&&$!==void 0?$:this._str=this._items.reduce((X,W)=>`${X}${W}`,"")}get names(){var $;return($=this._names)!==null&&$!==void 0?$:this._names=this._items.reduce((X,W)=>{if(W instanceof D0)X[W.str]=(X[W.str]||0)+1;return X},{})}}DB._Code=n4;DB.nil=new n4("");function OB($,...X){let W=[$[0]],Y=0;while(Y<X.length)az(W,X[Y]),W.push($[++Y]);return new n4(W)}DB._=OB;var tz=new n4("+");function NB($,...X){let W=[bW($[0])],Y=0;while(Y<X.length)W.push(tz),az(W,X[Y]),W.push(tz,bW($[++Y]));return Q2(W),new n4(W)}DB.str=NB;function az($,X){if(X instanceof n4)$.push(...X._items);else if(X instanceof D0)$.push(X);else $.push(j2(X))}DB.addCodeArg=az;function Q2($){let X=1;while(X<$.length-1){if($[X]===tz){let W=z2($[X-1],$[X+1]);if(W!==void 0){$.splice(X-1,3,W);continue}$[X++]="+"}X++}}function z2($,X){if(X==='""')return $;if($==='""')return X;if(typeof $=="string"){if(X instanceof D0||$[$.length-1]!=='"')return;if(typeof X!="string")return`${$.slice(0,-1)}${X}"`;if(X[0]==='"')return $.slice(0,-1)+X.slice(1);return}if(typeof X=="string"&&X[0]==='"'&&!($ instanceof D0))return`"${$}${X.slice(1)}`;return}function H2($,X){return X.emptyStr()?$:$.emptyStr()?X:NB`${$}${X}`}DB.strConcat=H2;function j2($){return typeof $=="number"||typeof $=="boolean"||$===null?$:bW(Array.isArray($)?$.join(","):$)}function I2($){return new n4(bW($))}DB.stringify=I2;function bW($){return JSON.stringify($).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}DB.safeStringify=bW;function O2($){return typeof $=="string"&&DB.IDENTIFIER.test($)?new n4(`.${$}`):OB`[${$}]`}DB.getProperty=O2;function N2($){if(typeof $=="string"&&DB.IDENTIFIER.test($))return new n4(`${$}`);throw Error(`CodeGen: invalid export name: ${$}, use explicit $id name mapping`)}DB.getEsmExportName=N2;function D2($){return new n4($.toString())}DB.regexpCode=D2});var X5=v((AB)=>{Object.defineProperty(AB,"__esModule",{value:!0});AB.ValueScope=AB.ValueScopeName=AB.Scope=AB.varKinds=AB.UsedValueState=void 0;var V4=KW();class wB extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`);this.value=$.value}}var Z8;(function($){$[$.Started=0]="Started",$[$.Completed=1]="Completed"})(Z8||(AB.UsedValueState=Z8={}));AB.varKinds={const:new V4.Name("const"),let:new V4.Name("let"),var:new V4.Name("var")};class ez{constructor({prefixes:$,parent:X}={}){this._names={},this._prefixes=$,this._parent=X}toName($){return $ instanceof V4.Name?$:this.name($)}name($){return new V4.Name(this._newName($))}_newName($){let X=this._names[$]||this._nameGroup($);return`${$}${X.index++}`}_nameGroup($){var X,W;if(((W=(X=this._parent)===null||X===void 0?void 0:X._prefixes)===null||W===void 0?void 0:W.has($))||this._prefixes&&!this._prefixes.has($))throw Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}AB.Scope=ez;class $5 extends V4.Name{constructor($,X){super(X);this.prefix=$}setValue($,{property:X,itemIndex:W}){this.value=$,this.scopePath=V4._`.${new V4.Name(X)}[${W}]`}}AB.ValueScopeName=$5;var E2=V4._`\n`;class VB extends ez{constructor($){super($);this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?E2:V4.nil}}get(){return this._scope}name($){return new $5($,this._newName($))}value($,X){var W;if(X.ref===void 0)throw Error("CodeGen: ref must be passed in value");let Y=this.toName($),{prefix:J}=Y,G=(W=X.key)!==null&&W!==void 0?W:X.ref,U=this._values[J];if(U){let H=U.get(G);if(H)return H}else U=this._values[J]=new Map;U.set(G,Y);let Q=this._scope[J]||(this._scope[J]=[]),z=Q.length;return Q[z]=X.ref,Y.setValue(X,{property:J,itemIndex:z}),Y}getValue($,X){let W=this._values[$];if(!W)return;return W.get(X)}scopeRefs($,X=this._values){return this._reduceValues(X,(W)=>{if(W.scopePath===void 0)throw Error(`CodeGen: name "${W}" has no value`);return V4._`${$}${W.scopePath}`})}scopeCode($=this._values,X,W){return this._reduceValues($,(Y)=>{if(Y.value===void 0)throw Error(`CodeGen: name "${Y}" has no value`);return Y.value.code},X,W)}_reduceValues($,X,W={},Y){let J=V4.nil;for(let G in $){let U=$[G];if(!U)continue;let Q=W[G]=W[G]||new Map;U.forEach((z)=>{if(Q.has(z))return;Q.set(z,Z8.Started);let H=X(z);if(H){let j=this.opts.es5?AB.varKinds.var:AB.varKinds.const;J=V4._`${J}${j} ${z} = ${H};${this.opts._n}`}else if(H=Y===null||Y===void 0?void 0:Y(z))J=V4._`${J}${H}${this.opts._n}`;else throw new wB(z);Q.set(z,Z8.Completed)})}return J}}AB.ValueScope=VB});var e=v((A4)=>{Object.defineProperty(A4,"__esModule",{value:!0});A4.or=A4.and=A4.not=A4.CodeGen=A4.operators=A4.varKinds=A4.ValueScopeName=A4.ValueScope=A4.Scope=A4.Name=A4.regexpCode=A4.stringify=A4.getProperty=A4.nil=A4.strConcat=A4.str=A4._=void 0;var Q$=KW(),c4=X5(),r6=KW();Object.defineProperty(A4,"_",{enumerable:!0,get:function(){return r6._}});Object.defineProperty(A4,"str",{enumerable:!0,get:function(){return r6.str}});Object.defineProperty(A4,"strConcat",{enumerable:!0,get:function(){return r6.strConcat}});Object.defineProperty(A4,"nil",{enumerable:!0,get:function(){return r6.nil}});Object.defineProperty(A4,"getProperty",{enumerable:!0,get:function(){return r6.getProperty}});Object.defineProperty(A4,"stringify",{enumerable:!0,get:function(){return r6.stringify}});Object.defineProperty(A4,"regexpCode",{enumerable:!0,get:function(){return r6.regexpCode}});Object.defineProperty(A4,"Name",{enumerable:!0,get:function(){return r6.Name}});var u8=X5();Object.defineProperty(A4,"Scope",{enumerable:!0,get:function(){return u8.Scope}});Object.defineProperty(A4,"ValueScope",{enumerable:!0,get:function(){return u8.ValueScope}});Object.defineProperty(A4,"ValueScopeName",{enumerable:!0,get:function(){return u8.ValueScopeName}});Object.defineProperty(A4,"varKinds",{enumerable:!0,get:function(){return u8.varKinds}});A4.operators={GT:new Q$._Code(">"),GTE:new Q$._Code(">="),LT:new Q$._Code("<"),LTE:new Q$._Code("<="),EQ:new Q$._Code("==="),NEQ:new Q$._Code("!=="),NOT:new Q$._Code("!"),OR:new Q$._Code("||"),AND:new Q$._Code("&&"),ADD:new Q$._Code("+")};class p6{optimizeNodes(){return this}optimizeNames($,X){return this}}class KB extends p6{constructor($,X,W){super();this.varKind=$,this.name=X,this.rhs=W}render({es5:$,_n:X}){let W=$?c4.varKinds.var:this.varKind,Y=this.rhs===void 0?"":` = ${this.rhs}`;return`${W} ${this.name}${Y};`+X}optimizeNames($,X){if(!$[this.name.str])return;if(this.rhs)this.rhs=w0(this.rhs,$,X);return this}get names(){return this.rhs instanceof Q$._CodeOrName?this.rhs.names:{}}}class Y5 extends p6{constructor($,X,W){super();this.lhs=$,this.rhs=X,this.sideEffects=W}render({_n:$}){return`${this.lhs} = ${this.rhs};`+$}optimizeNames($,X){if(this.lhs instanceof Q$.Name&&!$[this.lhs.str]&&!this.sideEffects)return;return this.rhs=w0(this.rhs,$,X),this}get names(){let $=this.lhs instanceof Q$.Name?{}:{...this.lhs.names};return x8($,this.rhs)}}class vB extends Y5{constructor($,X,W,Y){super($,W,Y);this.op=X}render({_n:$}){return`${this.lhs} ${this.op}= ${this.rhs};`+$}}class qB extends p6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`${this.label}:`+$}}class LB extends p6{constructor($){super();this.label=$,this.names={}}render({_n:$}){return`break${this.label?` ${this.label}`:""};`+$}}class FB extends p6{constructor($){super();this.error=$}render({_n:$}){return`throw ${this.error};`+$}get names(){return this.error.names}}class MB extends p6{constructor($){super();this.code=$}render({_n:$}){return`${this.code};`+$}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames($,X){return this.code=w0(this.code,$,X),this}get names(){return this.code instanceof Q$._CodeOrName?this.code.names:{}}}class y8 extends p6{constructor($=[]){super();this.nodes=$}render($){return this.nodes.reduce((X,W)=>X+W.render($),"")}optimizeNodes(){let{nodes:$}=this,X=$.length;while(X--){let W=$[X].optimizeNodes();if(Array.isArray(W))$.splice(X,1,...W);else if(W)$[X]=W;else $.splice(X,1)}return $.length>0?this:void 0}optimizeNames($,X){let{nodes:W}=this,Y=W.length;while(Y--){let J=W[Y];if(J.optimizeNames($,X))continue;k2($,J.names),W.splice(Y,1)}return W.length>0?this:void 0}get names(){return this.nodes.reduce(($,X)=>b1($,X.names),{})}}class d6 extends y8{render($){return"{"+$._n+super.render($)+"}"+$._n}}class SB extends y8{}class vW extends d6{}vW.kind="else";class L6 extends d6{constructor($,X){super(X);this.condition=$}render($){let X=`if(${this.condition})`+super.render($);if(this.else)X+="else "+this.else.render($);return X}optimizeNodes(){super.optimizeNodes();let $=this.condition;if($===!0)return this.nodes;let X=this.else;if(X){let W=X.optimizeNodes();X=this.else=Array.isArray(W)?new vW(W):W}if(X){if($===!1)return X instanceof L6?X:X.nodes;if(this.nodes.length)return this;return new L6(kB($),X instanceof L6?[X]:X.nodes)}if($===!1||!this.nodes.length)return;return this}optimizeNames($,X){var W;if(this.else=(W=this.else)===null||W===void 0?void 0:W.optimizeNames($,X),!(super.optimizeNames($,X)||this.else))return;return this.condition=w0(this.condition,$,X),this}get names(){let $=super.names;if(x8($,this.condition),this.else)b1($,this.else.names);return $}}L6.kind="if";class B0 extends d6{}B0.kind="for";class EB extends B0{constructor($){super();this.iteration=$}render($){return`for(${this.iteration})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iteration=w0(this.iteration,$,X),this}get names(){return b1(super.names,this.iteration.names)}}class PB extends B0{constructor($,X,W,Y){super();this.varKind=$,this.name=X,this.from=W,this.to=Y}render($){let X=$.es5?c4.varKinds.var:this.varKind,{name:W,from:Y,to:J}=this;return`for(${X} ${W}=${Y}; ${W}<${J}; ${W}++)`+super.render($)}get names(){let $=x8(super.names,this.from);return x8($,this.to)}}class W5 extends B0{constructor($,X,W,Y){super();this.loop=$,this.varKind=X,this.name=W,this.iterable=Y}render($){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render($)}optimizeNames($,X){if(!super.optimizeNames($,X))return;return this.iterable=w0(this.iterable,$,X),this}get names(){return b1(super.names,this.iterable.names)}}class k8 extends d6{constructor($,X,W){super();this.name=$,this.args=X,this.async=W}render($){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render($)}}k8.kind="func";class T8 extends y8{render($){return"return "+super.render($)}}T8.kind="return";class RB extends d6{render($){let X="try"+super.render($);if(this.catch)X+=this.catch.render($);if(this.finally)X+=this.finally.render($);return X}optimizeNodes(){var $,X;return super.optimizeNodes(),($=this.catch)===null||$===void 0||$.optimizeNodes(),(X=this.finally)===null||X===void 0||X.optimizeNodes(),this}optimizeNames($,X){var W,Y;return super.optimizeNames($,X),(W=this.catch)===null||W===void 0||W.optimizeNames($,X),(Y=this.finally)===null||Y===void 0||Y.optimizeNames($,X),this}get names(){let $=super.names;if(this.catch)b1($,this.catch.names);if(this.finally)b1($,this.finally.names);return $}}class C8 extends d6{constructor($){super();this.error=$}render($){return`catch(${this.error})`+super.render($)}}C8.kind="catch";class _8 extends d6{render($){return"finally"+super.render($)}}_8.kind="finally";class ZB{constructor($,X={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...X,_n:X.lines?`
|
|
10
|
+
`:""},this._extScope=$,this._scope=new c4.Scope({parent:$}),this._nodes=[new SB]}toString(){return this._root.render(this.opts)}name($){return this._scope.name($)}scopeName($){return this._extScope.name($)}scopeValue($,X){let W=this._extScope.value($,X);return(this._values[W.prefix]||(this._values[W.prefix]=new Set)).add(W),W}getScopeValue($,X){return this._extScope.getValue($,X)}scopeRefs($){return this._extScope.scopeRefs($,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def($,X,W,Y){let J=this._scope.toName(X);if(W!==void 0&&Y)this._constants[J.str]=W;return this._leafNode(new KB($,J,W)),J}const($,X,W){return this._def(c4.varKinds.const,$,X,W)}let($,X,W){return this._def(c4.varKinds.let,$,X,W)}var($,X,W){return this._def(c4.varKinds.var,$,X,W)}assign($,X,W){return this._leafNode(new Y5($,X,W))}add($,X){return this._leafNode(new vB($,A4.operators.ADD,X))}code($){if(typeof $=="function")$();else if($!==Q$.nil)this._leafNode(new MB($));return this}object(...$){let X=["{"];for(let[W,Y]of $){if(X.length>1)X.push(",");if(X.push(W),W!==Y||this.opts.es5)X.push(":"),(0,Q$.addCodeArg)(X,Y)}return X.push("}"),new Q$._Code(X)}if($,X,W){if(this._blockNode(new L6($)),X&&W)this.code(X).else().code(W).endIf();else if(X)this.code(X).endIf();else if(W)throw Error('CodeGen: "else" body without "then" body');return this}elseIf($){return this._elseNode(new L6($))}else(){return this._elseNode(new vW)}endIf(){return this._endBlockNode(L6,vW)}_for($,X){if(this._blockNode($),X)this.code(X).endFor();return this}for($,X){return this._for(new EB($),X)}forRange($,X,W,Y,J=this.opts.es5?c4.varKinds.var:c4.varKinds.let){let G=this._scope.toName($);return this._for(new PB(J,G,X,W),()=>Y(G))}forOf($,X,W,Y=c4.varKinds.const){let J=this._scope.toName($);if(this.opts.es5){let G=X instanceof Q$.Name?X:this.var("_arr",X);return this.forRange("_i",0,Q$._`${G}.length`,(U)=>{this.var(J,Q$._`${G}[${U}]`),W(J)})}return this._for(new W5("of",Y,J,X),()=>W(J))}forIn($,X,W,Y=this.opts.es5?c4.varKinds.var:c4.varKinds.const){if(this.opts.ownProperties)return this.forOf($,Q$._`Object.keys(${X})`,W);let J=this._scope.toName($);return this._for(new W5("in",Y,J,X),()=>W(J))}endFor(){return this._endBlockNode(B0)}label($){return this._leafNode(new qB($))}break($){return this._leafNode(new LB($))}return($){let X=new T8;if(this._blockNode(X),this.code($),X.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(T8)}try($,X,W){if(!X&&!W)throw Error('CodeGen: "try" without "catch" and "finally"');let Y=new RB;if(this._blockNode(Y),this.code($),X){let J=this.name("e");this._currNode=Y.catch=new C8(J),X(J)}if(W)this._currNode=Y.finally=new _8,this.code(W);return this._endBlockNode(C8,_8)}throw($){return this._leafNode(new FB($))}block($,X){if(this._blockStarts.push(this._nodes.length),$)this.code($).endBlock(X);return this}endBlock($){let X=this._blockStarts.pop();if(X===void 0)throw Error("CodeGen: not in self-balancing block");let W=this._nodes.length-X;if(W<0||$!==void 0&&W!==$)throw Error(`CodeGen: wrong number of nodes: ${W} vs ${$} expected`);return this._nodes.length=X,this}func($,X=Q$.nil,W,Y){if(this._blockNode(new k8($,X,W)),Y)this.code(Y).endFunc();return this}endFunc(){return this._endBlockNode(k8)}optimize($=1){while($-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode($){return this._currNode.nodes.push($),this}_blockNode($){this._currNode.nodes.push($),this._nodes.push($)}_endBlockNode($,X){let W=this._currNode;if(W instanceof $||X&&W instanceof X)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${X?`${$.kind}/${X.kind}`:$.kind}"`)}_elseNode($){let X=this._currNode;if(!(X instanceof L6))throw Error('CodeGen: "else" without "if"');return this._currNode=X.else=$,this}get _root(){return this._nodes[0]}get _currNode(){let $=this._nodes;return $[$.length-1]}set _currNode($){let X=this._nodes;X[X.length-1]=$}}A4.CodeGen=ZB;function b1($,X){for(let W in X)$[W]=($[W]||0)+(X[W]||0);return $}function x8($,X){return X instanceof Q$._CodeOrName?b1($,X.names):$}function w0($,X,W){if($ instanceof Q$.Name)return Y($);if(!J($))return $;return new Q$._Code($._items.reduce((G,U)=>{if(U instanceof Q$.Name)U=Y(U);if(U instanceof Q$._Code)G.push(...U._items);else G.push(U);return G},[]));function Y(G){let U=W[G.str];if(U===void 0||X[G.str]!==1)return G;return delete X[G.str],U}function J(G){return G instanceof Q$._Code&&G._items.some((U)=>U instanceof Q$.Name&&X[U.str]===1&&W[U.str]!==void 0)}}function k2($,X){for(let W in X)$[W]=($[W]||0)-(X[W]||0)}function kB($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:Q$._`!${J5($)}`}A4.not=kB;var T2=TB(A4.operators.AND);function C2(...$){return $.reduce(T2)}A4.and=C2;var _2=TB(A4.operators.OR);function x2(...$){return $.reduce(_2)}A4.or=x2;function TB($){return(X,W)=>X===Q$.nil?W:W===Q$.nil?X:Q$._`${J5(X)} ${$} ${J5(W)}`}function J5($){return $ instanceof Q$.Name?$:Q$._`(${$})`}});var I$=v((lB)=>{Object.defineProperty(lB,"__esModule",{value:!0});lB.checkStrictMode=lB.getErrorPath=lB.Type=lB.useFunc=lB.setEvaluated=lB.evaluatedPropsToName=lB.mergeEvaluated=lB.eachItem=lB.unescapeJsonPointer=lB.escapeJsonPointer=lB.escapeFragment=lB.unescapeFragment=lB.schemaRefOrVal=lB.schemaHasRulesButRef=lB.schemaHasRules=lB.checkUnknownRules=lB.alwaysValidSchema=lB.toHash=void 0;var K$=e(),f2=KW();function h2($){let X={};for(let W of $)X[W]=!0;return X}lB.toHash=h2;function l2($,X){if(typeof X=="boolean")return X;if(Object.keys(X).length===0)return!0;return uB($,X),!yB(X,$.self.RULES.all)}lB.alwaysValidSchema=l2;function uB($,X=$.schema){let{opts:W,self:Y}=$;if(!W.strictSchema)return;if(typeof X==="boolean")return;let J=Y.RULES.keywords;for(let G in X)if(!J[G])hB($,`unknown keyword: "${G}"`)}lB.checkUnknownRules=uB;function yB($,X){if(typeof $=="boolean")return!$;for(let W in $)if(X[W])return!0;return!1}lB.schemaHasRules=yB;function m2($,X){if(typeof $=="boolean")return!$;for(let W in $)if(W!=="$ref"&&X.all[W])return!0;return!1}lB.schemaHasRulesButRef=m2;function i2({topSchemaRef:$,schemaPath:X},W,Y,J){if(!J){if(typeof W=="number"||typeof W=="boolean")return W;if(typeof W=="string")return K$._`${W}`}return K$._`${$}${X}${(0,K$.getProperty)(Y)}`}lB.schemaRefOrVal=i2;function n2($){return gB(decodeURIComponent($))}lB.unescapeFragment=n2;function c2($){return encodeURIComponent(U5($))}lB.escapeFragment=c2;function U5($){if(typeof $=="number")return`${$}`;return $.replace(/~/g,"~0").replace(/\//g,"~1")}lB.escapeJsonPointer=U5;function gB($){return $.replace(/~1/g,"/").replace(/~0/g,"~")}lB.unescapeJsonPointer=gB;function r2($,X){if(Array.isArray($))for(let W of $)X(W);else X($)}lB.eachItem=r2;function _B({mergeNames:$,mergeToName:X,mergeValues:W,resultToName:Y}){return(J,G,U,Q)=>{let z=U===void 0?G:U instanceof K$.Name?(G instanceof K$.Name?$(J,G,U):X(J,G,U),U):G instanceof K$.Name?(X(J,U,G),G):W(G,U);return Q===K$.Name&&!(z instanceof K$.Name)?Y(J,z):z}}lB.mergeEvaluated={props:_B({mergeNames:($,X,W)=>$.if(K$._`${W} !== true && ${X} !== undefined`,()=>{$.if(K$._`${X} === true`,()=>$.assign(W,!0),()=>$.assign(W,K$._`${W} || {}`).code(K$._`Object.assign(${W}, ${X})`))}),mergeToName:($,X,W)=>$.if(K$._`${W} !== true`,()=>{if(X===!0)$.assign(W,!0);else $.assign(W,K$._`${W} || {}`),Q5($,W,X)}),mergeValues:($,X)=>$===!0?!0:{...$,...X},resultToName:fB}),items:_B({mergeNames:($,X,W)=>$.if(K$._`${W} !== true && ${X} !== undefined`,()=>$.assign(W,K$._`${X} === true ? true : ${W} > ${X} ? ${W} : ${X}`)),mergeToName:($,X,W)=>$.if(K$._`${W} !== true`,()=>$.assign(W,X===!0?!0:K$._`${W} > ${X} ? ${W} : ${X}`)),mergeValues:($,X)=>$===!0?!0:Math.max($,X),resultToName:($,X)=>$.var("items",X)})};function fB($,X){if(X===!0)return $.var("props",!0);let W=$.var("props",K$._`{}`);if(X!==void 0)Q5($,W,X);return W}lB.evaluatedPropsToName=fB;function Q5($,X,W){Object.keys(W).forEach((Y)=>$.assign(K$._`${X}${(0,K$.getProperty)(Y)}`,!0))}lB.setEvaluated=Q5;var xB={};function p2($,X){return $.scopeValue("func",{ref:X,code:xB[X.code]||(xB[X.code]=new f2._Code(X.code))})}lB.useFunc=p2;var G5;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(G5||(lB.Type=G5={}));function d2($,X,W){if($ instanceof K$.Name){let Y=X===G5.Num;return W?Y?K$._`"[" + ${$} + "]"`:K$._`"['" + ${$} + "']"`:Y?K$._`"/" + ${$}`:K$._`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return W?(0,K$.getProperty)($).toString():"/"+U5($)}lB.getErrorPath=d2;function hB($,X,W=$.opts.strictSchema){if(!W)return;if(X=`strict mode: ${X}`,W===!0)throw Error(X);$.self.logger.warn(X)}lB.checkStrictMode=hB});var F6=v((iB)=>{Object.defineProperty(iB,"__esModule",{value:!0});var t$=e(),O_={data:new t$.Name("data"),valCxt:new t$.Name("valCxt"),instancePath:new t$.Name("instancePath"),parentData:new t$.Name("parentData"),parentDataProperty:new t$.Name("parentDataProperty"),rootData:new t$.Name("rootData"),dynamicAnchors:new t$.Name("dynamicAnchors"),vErrors:new t$.Name("vErrors"),errors:new t$.Name("errors"),this:new t$.Name("this"),self:new t$.Name("self"),scope:new t$.Name("scope"),json:new t$.Name("json"),jsonPos:new t$.Name("jsonPos"),jsonLen:new t$.Name("jsonLen"),jsonPart:new t$.Name("jsonPart")};iB.default=O_});var qW=v((pB)=>{Object.defineProperty(pB,"__esModule",{value:!0});pB.extendErrors=pB.resetErrorsCount=pB.reportExtraError=pB.reportError=pB.keyword$DataError=pB.keywordError=void 0;var H$=e(),f8=I$(),Y4=F6();pB.keywordError={message:({keyword:$})=>H$.str`must pass "${$}" keyword validation`};pB.keyword$DataError={message:({keyword:$,schemaType:X})=>X?H$.str`"${$}" keyword must be ${X} ($data)`:H$.str`"${$}" keyword is invalid ($data)`};function D_($,X=pB.keywordError,W,Y){let{it:J}=$,{gen:G,compositeRule:U,allErrors:Q}=J,z=rB($,X,W);if(Y!==null&&Y!==void 0?Y:U||Q)nB(G,z);else cB(J,H$._`[${z}]`)}pB.reportError=D_;function B_($,X=pB.keywordError,W){let{it:Y}=$,{gen:J,compositeRule:G,allErrors:U}=Y,Q=rB($,X,W);if(nB(J,Q),!(G||U))cB(Y,Y4.default.vErrors)}pB.reportExtraError=B_;function w_($,X){$.assign(Y4.default.errors,X),$.if(H$._`${Y4.default.vErrors} !== null`,()=>$.if(X,()=>$.assign(H$._`${Y4.default.vErrors}.length`,X),()=>$.assign(Y4.default.vErrors,null)))}pB.resetErrorsCount=w_;function V_({gen:$,keyword:X,schemaValue:W,data:Y,errsCount:J,it:G}){if(J===void 0)throw Error("ajv implementation error");let U=$.name("err");$.forRange("i",J,Y4.default.errors,(Q)=>{if($.const(U,H$._`${Y4.default.vErrors}[${Q}]`),$.if(H$._`${U}.instancePath === undefined`,()=>$.assign(H$._`${U}.instancePath`,(0,H$.strConcat)(Y4.default.instancePath,G.errorPath))),$.assign(H$._`${U}.schemaPath`,H$.str`${G.errSchemaPath}/${X}`),G.opts.verbose)$.assign(H$._`${U}.schema`,W),$.assign(H$._`${U}.data`,Y)})}pB.extendErrors=V_;function nB($,X){let W=$.const("err",X);$.if(H$._`${Y4.default.vErrors} === null`,()=>$.assign(Y4.default.vErrors,H$._`[${W}]`),H$._`${Y4.default.vErrors}.push(${W})`),$.code(H$._`${Y4.default.errors}++`)}function cB($,X){let{gen:W,validateName:Y,schemaEnv:J}=$;if(J.$async)W.throw(H$._`new ${$.ValidationError}(${X})`);else W.assign(H$._`${Y}.errors`,X),W.return(!1)}var K1={keyword:new H$.Name("keyword"),schemaPath:new H$.Name("schemaPath"),params:new H$.Name("params"),propertyName:new H$.Name("propertyName"),message:new H$.Name("message"),schema:new H$.Name("schema"),parentSchema:new H$.Name("parentSchema")};function rB($,X,W){let{createErrors:Y}=$.it;if(Y===!1)return H$._`{}`;return A_($,X,W)}function A_($,X,W={}){let{gen:Y,it:J}=$,G=[b_(J,W),K_($,W)];return v_($,X,G),Y.object(...G)}function b_({errorPath:$},{instancePath:X}){let W=X?H$.str`${$}${(0,f8.getErrorPath)(X,f8.Type.Str)}`:$;return[Y4.default.instancePath,(0,H$.strConcat)(Y4.default.instancePath,W)]}function K_({keyword:$,it:{errSchemaPath:X}},{schemaPath:W,parentSchema:Y}){let J=Y?X:H$.str`${X}/${$}`;if(W)J=H$.str`${J}${(0,f8.getErrorPath)(W,f8.Type.Str)}`;return[K1.schemaPath,J]}function v_($,{params:X,message:W},Y){let{keyword:J,data:G,schemaValue:U,it:Q}=$,{opts:z,propertyName:H,topSchemaRef:j,schemaPath:O}=Q;if(Y.push([K1.keyword,J],[K1.params,typeof X=="function"?X($):X||H$._`{}`]),z.messages)Y.push([K1.message,typeof W=="function"?W($):W]);if(z.verbose)Y.push([K1.schema,U],[K1.parentSchema,H$._`${j}${O}`],[Y4.default.data,G]);if(H)Y.push([K1.propertyName,H])}});var sB=v((tB)=>{Object.defineProperty(tB,"__esModule",{value:!0});tB.boolOrEmptySchema=tB.topBoolOrEmptySchema=void 0;var S_=qW(),E_=e(),P_=F6(),R_={message:"boolean schema is false"};function Z_($){let{gen:X,schema:W,validateName:Y}=$;if(W===!1)oB($,!1);else if(typeof W=="object"&&W.$async===!0)X.return(P_.default.data);else X.assign(E_._`${Y}.errors`,null),X.return(!0)}tB.topBoolOrEmptySchema=Z_;function k_($,X){let{gen:W,schema:Y}=$;if(Y===!1)W.var(X,!1),oB($);else W.var(X,!0)}tB.boolOrEmptySchema=k_;function oB($,X){let{gen:W,data:Y}=$,J={gen:W,keyword:"false schema",data:Y,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:$};(0,S_.reportError)(J,R_,void 0,X)}});var H5=v((eB)=>{Object.defineProperty(eB,"__esModule",{value:!0});eB.getRules=eB.isJSONType=void 0;var C_=["string","number","integer","boolean","null","object","array"],__=new Set(C_);function x_($){return typeof $=="string"&&__.has($)}eB.isJSONType=x_;function u_(){let $={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...$,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},$.number,$.string,$.array,$.object],post:{rules:[]},all:{},keywords:{}}}eB.getRules=u_});var j5=v((Jw)=>{Object.defineProperty(Jw,"__esModule",{value:!0});Jw.shouldUseRule=Jw.shouldUseGroup=Jw.schemaHasRulesForType=void 0;function g_({schema:$,self:X},W){let Y=X.RULES.types[W];return Y&&Y!==!0&&Xw($,Y)}Jw.schemaHasRulesForType=g_;function Xw($,X){return X.rules.some((W)=>Ww($,W))}Jw.shouldUseGroup=Xw;function Ww($,X){var W;return $[X.keyword]!==void 0||((W=X.definition.implements)===null||W===void 0?void 0:W.some((Y)=>$[Y]!==void 0))}Jw.shouldUseRule=Ww});var LW=v((zw)=>{Object.defineProperty(zw,"__esModule",{value:!0});zw.reportTypeError=zw.checkDataTypes=zw.checkDataType=zw.coerceAndCheckDataType=zw.getJSONTypes=zw.getSchemaTypes=zw.DataType=void 0;var l_=H5(),m_=j5(),i_=qW(),t=e(),Gw=I$(),V0;(function($){$[$.Correct=0]="Correct",$[$.Wrong=1]="Wrong"})(V0||(zw.DataType=V0={}));function n_($){let X=Uw($.type);if(X.includes("null")){if($.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!X.length&&$.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if($.nullable===!0)X.push("null")}return X}zw.getSchemaTypes=n_;function Uw($){let X=Array.isArray($)?$:$?[$]:[];if(X.every(l_.isJSONType))return X;throw Error("type must be JSONType or JSONType[]: "+X.join(","))}zw.getJSONTypes=Uw;function c_($,X){let{gen:W,data:Y,opts:J}=$,G=r_(X,J.coerceTypes),U=X.length>0&&!(G.length===0&&X.length===1&&(0,m_.schemaHasRulesForType)($,X[0]));if(U){let Q=O5(X,Y,J.strictNumbers,V0.Wrong);W.if(Q,()=>{if(G.length)p_($,X,G);else N5($)})}return U}zw.coerceAndCheckDataType=c_;var Qw=new Set(["string","number","integer","boolean","null"]);function r_($,X){return X?$.filter((W)=>Qw.has(W)||X==="array"&&W==="array"):[]}function p_($,X,W){let{gen:Y,data:J,opts:G}=$,U=Y.let("dataType",t._`typeof ${J}`),Q=Y.let("coerced",t._`undefined`);if(G.coerceTypes==="array")Y.if(t._`${U} == 'object' && Array.isArray(${J}) && ${J}.length == 1`,()=>Y.assign(J,t._`${J}[0]`).assign(U,t._`typeof ${J}`).if(O5(X,J,G.strictNumbers),()=>Y.assign(Q,J)));Y.if(t._`${Q} !== undefined`);for(let H of W)if(Qw.has(H)||H==="array"&&G.coerceTypes==="array")z(H);Y.else(),N5($),Y.endIf(),Y.if(t._`${Q} !== undefined`,()=>{Y.assign(J,Q),d_($,Q)});function z(H){switch(H){case"string":Y.elseIf(t._`${U} == "number" || ${U} == "boolean"`).assign(Q,t._`"" + ${J}`).elseIf(t._`${J} === null`).assign(Q,t._`""`);return;case"number":Y.elseIf(t._`${U} == "boolean" || ${J} === null
|
|
11
|
+
|| (${U} == "string" && ${J} && ${J} == +${J})`).assign(Q,t._`+${J}`);return;case"integer":Y.elseIf(t._`${U} === "boolean" || ${J} === null
|
|
12
|
+
|| (${U} === "string" && ${J} && ${J} == +${J} && !(${J} % 1))`).assign(Q,t._`+${J}`);return;case"boolean":Y.elseIf(t._`${J} === "false" || ${J} === 0 || ${J} === null`).assign(Q,!1).elseIf(t._`${J} === "true" || ${J} === 1`).assign(Q,!0);return;case"null":Y.elseIf(t._`${J} === "" || ${J} === 0 || ${J} === false`),Y.assign(Q,null);return;case"array":Y.elseIf(t._`${U} === "string" || ${U} === "number"
|
|
13
|
+
|| ${U} === "boolean" || ${J} === null`).assign(Q,t._`[${J}]`)}}}function d_({gen:$,parentData:X,parentDataProperty:W},Y){$.if(t._`${X} !== undefined`,()=>$.assign(t._`${X}[${W}]`,Y))}function I5($,X,W,Y=V0.Correct){let J=Y===V0.Correct?t.operators.EQ:t.operators.NEQ,G;switch($){case"null":return t._`${X} ${J} null`;case"array":G=t._`Array.isArray(${X})`;break;case"object":G=t._`${X} && typeof ${X} == "object" && !Array.isArray(${X})`;break;case"integer":G=U(t._`!(${X} % 1) && !isNaN(${X})`);break;case"number":G=U();break;default:return t._`typeof ${X} ${J} ${$}`}return Y===V0.Correct?G:(0,t.not)(G);function U(Q=t.nil){return(0,t.and)(t._`typeof ${X} == "number"`,Q,W?t._`isFinite(${X})`:t.nil)}}zw.checkDataType=I5;function O5($,X,W,Y){if($.length===1)return I5($[0],X,W,Y);let J,G=(0,Gw.toHash)($);if(G.array&&G.object){let U=t._`typeof ${X} != "object"`;J=G.null?U:t._`!${X} || ${U}`,delete G.null,delete G.array,delete G.object}else J=t.nil;if(G.number)delete G.integer;for(let U in G)J=(0,t.and)(J,I5(U,X,W,Y));return J}zw.checkDataTypes=O5;var o_={message:({schema:$})=>`must be ${$}`,params:({schema:$,schemaValue:X})=>typeof $=="string"?t._`{type: ${$}}`:t._`{type: ${X}}`};function N5($){let X=t_($);(0,i_.reportError)(X,o_)}zw.reportTypeError=N5;function t_($){let{gen:X,data:W,schema:Y}=$,J=(0,Gw.schemaRefOrVal)($,Y,"type");return{gen:X,keyword:"type",data:W,schema:Y.type,schemaCode:J,schemaValue:J,parentSchema:Y,params:{},it:$}}});var Nw=v((Iw)=>{Object.defineProperty(Iw,"__esModule",{value:!0});Iw.assignDefaults=void 0;var A0=e(),Jx=I$();function Yx($,X){let{properties:W,items:Y}=$.schema;if(X==="object"&&W)for(let J in W)jw($,J,W[J].default);else if(X==="array"&&Array.isArray(Y))Y.forEach((J,G)=>jw($,G,J.default))}Iw.assignDefaults=Yx;function jw($,X,W){let{gen:Y,compositeRule:J,data:G,opts:U}=$;if(W===void 0)return;let Q=A0._`${G}${(0,A0.getProperty)(X)}`;if(J){(0,Jx.checkStrictMode)($,`default is ignored for: ${Q}`);return}let z=A0._`${Q} === undefined`;if(U.useDefaults==="empty")z=A0._`${z} || ${Q} === null || ${Q} === ""`;Y.if(z,A0._`${Q} = ${(0,A0.stringify)(W)}`)}});var Z4=v((ww)=>{Object.defineProperty(ww,"__esModule",{value:!0});ww.validateUnion=ww.validateArray=ww.usePattern=ww.callValidateCode=ww.schemaProperties=ww.allSchemaProperties=ww.noPropertyInData=ww.propertyInData=ww.isOwnProperty=ww.hasPropFunc=ww.reportMissingProp=ww.checkMissingProp=ww.checkReportMissingProp=void 0;var F$=e(),D5=I$(),o6=F6(),Gx=I$();function Ux($,X){let{gen:W,data:Y,it:J}=$;W.if(w5(W,Y,X,J.opts.ownProperties),()=>{$.setParams({missingProperty:F$._`${X}`},!0),$.error()})}ww.checkReportMissingProp=Ux;function Qx({gen:$,data:X,it:{opts:W}},Y,J){return(0,F$.or)(...Y.map((G)=>(0,F$.and)(w5($,X,G,W.ownProperties),F$._`${J} = ${G}`)))}ww.checkMissingProp=Qx;function zx($,X){$.setParams({missingProperty:X},!0),$.error()}ww.reportMissingProp=zx;function Dw($){return $.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:F$._`Object.prototype.hasOwnProperty`})}ww.hasPropFunc=Dw;function B5($,X,W){return F$._`${Dw($)}.call(${X}, ${W})`}ww.isOwnProperty=B5;function Hx($,X,W,Y){let J=F$._`${X}${(0,F$.getProperty)(W)} !== undefined`;return Y?F$._`${J} && ${B5($,X,W)}`:J}ww.propertyInData=Hx;function w5($,X,W,Y){let J=F$._`${X}${(0,F$.getProperty)(W)} === undefined`;return Y?(0,F$.or)(J,(0,F$.not)(B5($,X,W))):J}ww.noPropertyInData=w5;function Bw($){return $?Object.keys($).filter((X)=>X!=="__proto__"):[]}ww.allSchemaProperties=Bw;function jx($,X){return Bw(X).filter((W)=>!(0,D5.alwaysValidSchema)($,X[W]))}ww.schemaProperties=jx;function Ix({schemaCode:$,data:X,it:{gen:W,topSchemaRef:Y,schemaPath:J,errorPath:G},it:U},Q,z,H){let j=H?F$._`${$}, ${X}, ${Y}${J}`:X,O=[[o6.default.instancePath,(0,F$.strConcat)(o6.default.instancePath,G)],[o6.default.parentData,U.parentData],[o6.default.parentDataProperty,U.parentDataProperty],[o6.default.rootData,o6.default.rootData]];if(U.opts.dynamicRef)O.push([o6.default.dynamicAnchors,o6.default.dynamicAnchors]);let B=F$._`${j}, ${W.object(...O)}`;return z!==F$.nil?F$._`${Q}.call(${z}, ${B})`:F$._`${Q}(${B})`}ww.callValidateCode=Ix;var Ox=F$._`new RegExp`;function Nx({gen:$,it:{opts:X}},W){let Y=X.unicodeRegExp?"u":"",{regExp:J}=X.code,G=J(W,Y);return $.scopeValue("pattern",{key:G.toString(),ref:G,code:F$._`${J.code==="new RegExp"?Ox:(0,Gx.useFunc)($,J)}(${W}, ${Y})`})}ww.usePattern=Nx;function Dx($){let{gen:X,data:W,keyword:Y,it:J}=$,G=X.name("valid");if(J.allErrors){let Q=X.let("valid",!0);return U(()=>X.assign(Q,!1)),Q}return X.var(G,!0),U(()=>X.break()),G;function U(Q){let z=X.const("len",F$._`${W}.length`);X.forRange("i",0,z,(H)=>{$.subschema({keyword:Y,dataProp:H,dataPropType:D5.Type.Num},G),X.if((0,F$.not)(G),Q)})}}ww.validateArray=Dx;function Bx($){let{gen:X,schema:W,keyword:Y,it:J}=$;if(!Array.isArray(W))throw Error("ajv implementation error");if(W.some((z)=>(0,D5.alwaysValidSchema)(J,z))&&!J.opts.unevaluated)return;let U=X.let("valid",!1),Q=X.name("_valid");X.block(()=>W.forEach((z,H)=>{let j=$.subschema({keyword:Y,schemaProp:H,compositeRule:!0},Q);if(X.assign(U,F$._`${U} || ${Q}`),!$.mergeValidEvaluated(j,Q))X.if((0,F$.not)(U))})),$.result(U,()=>$.reset(),()=>$.error(!0))}ww.validateUnion=Bx});var qw=v((Kw)=>{Object.defineProperty(Kw,"__esModule",{value:!0});Kw.validateKeywordUsage=Kw.validSchemaType=Kw.funcKeywordCode=Kw.macroKeywordCode=void 0;var G4=e(),v1=F6(),Px=Z4(),Rx=qW();function Zx($,X){let{gen:W,keyword:Y,schema:J,parentSchema:G,it:U}=$,Q=X.macro.call(U.self,J,G,U),z=bw(W,Y,Q);if(U.opts.validateSchema!==!1)U.self.validateSchema(Q,!0);let H=W.name("valid");$.subschema({schema:Q,schemaPath:G4.nil,errSchemaPath:`${U.errSchemaPath}/${Y}`,topSchemaRef:z,compositeRule:!0},H),$.pass(H,()=>$.error(!0))}Kw.macroKeywordCode=Zx;function kx($,X){var W;let{gen:Y,keyword:J,schema:G,parentSchema:U,$data:Q,it:z}=$;Cx(z,X);let H=!Q&&X.compile?X.compile.call(z.self,G,U,z):X.validate,j=bw(Y,J,H),O=Y.let("valid");$.block$data(O,B),$.ok((W=X.valid)!==null&&W!==void 0?W:O);function B(){if(X.errors===!1){if(D(),X.modifying)Aw($);w(()=>$.error())}else{let V=X.async?I():N();if(X.modifying)Aw($);w(()=>Tx($,V))}}function I(){let V=Y.let("ruleErrs",null);return Y.try(()=>D(G4._`await `),(K)=>Y.assign(O,!1).if(G4._`${K} instanceof ${z.ValidationError}`,()=>Y.assign(V,G4._`${K}.errors`),()=>Y.throw(K))),V}function N(){let V=G4._`${j}.errors`;return Y.assign(V,null),D(G4.nil),V}function D(V=X.async?G4._`await `:G4.nil){let K=z.opts.passContext?v1.default.this:v1.default.self,b=!(("compile"in X)&&!Q||X.schema===!1);Y.assign(O,G4._`${V}${(0,Px.callValidateCode)($,j,K,b)}`,X.modifying)}function w(V){var K;Y.if((0,G4.not)((K=X.valid)!==null&&K!==void 0?K:O),V)}}Kw.funcKeywordCode=kx;function Aw($){let{gen:X,data:W,it:Y}=$;X.if(Y.parentData,()=>X.assign(W,G4._`${Y.parentData}[${Y.parentDataProperty}]`))}function Tx($,X){let{gen:W}=$;W.if(G4._`Array.isArray(${X})`,()=>{W.assign(v1.default.vErrors,G4._`${v1.default.vErrors} === null ? ${X} : ${v1.default.vErrors}.concat(${X})`).assign(v1.default.errors,G4._`${v1.default.vErrors}.length`),(0,Rx.extendErrors)($)},()=>$.error())}function Cx({schemaEnv:$},X){if(X.async&&!$.$async)throw Error("async keyword in sync schema")}function bw($,X,W){if(W===void 0)throw Error(`keyword "${X}" failed to compile`);return $.scopeValue("keyword",typeof W=="function"?{ref:W}:{ref:W,code:(0,G4.stringify)(W)})}function _x($,X,W=!1){return!X.length||X.some((Y)=>Y==="array"?Array.isArray($):Y==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==Y||W&&typeof $>"u")}Kw.validSchemaType=_x;function xx({schema:$,opts:X,self:W,errSchemaPath:Y},J,G){if(Array.isArray(J.keyword)?!J.keyword.includes(G):J.keyword!==G)throw Error("ajv implementation error");let U=J.dependencies;if(U===null||U===void 0?void 0:U.some((Q)=>!Object.prototype.hasOwnProperty.call($,Q)))throw Error(`parent schema must have dependencies of ${G}: ${U.join(",")}`);if(J.validateSchema){if(!J.validateSchema($[G])){let z=`keyword "${G}" value is invalid at path "${Y}": `+W.errorsText(J.validateSchema.errors);if(X.validateSchema==="log")W.logger.error(z);else throw Error(z)}}}Kw.validateKeywordUsage=xx});var Sw=v((Fw)=>{Object.defineProperty(Fw,"__esModule",{value:!0});Fw.extendSubschemaMode=Fw.extendSubschemaData=Fw.getSubschema=void 0;var Q6=e(),Lw=I$();function fx($,{keyword:X,schemaProp:W,schema:Y,schemaPath:J,errSchemaPath:G,topSchemaRef:U}){if(X!==void 0&&Y!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(X!==void 0){let Q=$.schema[X];return W===void 0?{schema:Q,schemaPath:Q6._`${$.schemaPath}${(0,Q6.getProperty)(X)}`,errSchemaPath:`${$.errSchemaPath}/${X}`}:{schema:Q[W],schemaPath:Q6._`${$.schemaPath}${(0,Q6.getProperty)(X)}${(0,Q6.getProperty)(W)}`,errSchemaPath:`${$.errSchemaPath}/${X}/${(0,Lw.escapeFragment)(W)}`}}if(Y!==void 0){if(J===void 0||G===void 0||U===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:Y,schemaPath:J,topSchemaRef:U,errSchemaPath:G}}throw Error('either "keyword" or "schema" must be passed')}Fw.getSubschema=fx;function hx($,X,{dataProp:W,dataPropType:Y,data:J,dataTypes:G,propertyName:U}){if(J!==void 0&&W!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:Q}=X;if(W!==void 0){let{errorPath:H,dataPathArr:j,opts:O}=X,B=Q.let("data",Q6._`${X.data}${(0,Q6.getProperty)(W)}`,!0);z(B),$.errorPath=Q6.str`${H}${(0,Lw.getErrorPath)(W,Y,O.jsPropertySyntax)}`,$.parentDataProperty=Q6._`${W}`,$.dataPathArr=[...j,$.parentDataProperty]}if(J!==void 0){let H=J instanceof Q6.Name?J:Q.let("data",J,!0);if(z(H),U!==void 0)$.propertyName=U}if(G)$.dataTypes=G;function z(H){$.data=H,$.dataLevel=X.dataLevel+1,$.dataTypes=[],X.definedProperties=new Set,$.parentData=X.data,$.dataNames=[...X.dataNames,H]}}Fw.extendSubschemaData=hx;function lx($,{jtdDiscriminator:X,jtdMetadata:W,compositeRule:Y,createErrors:J,allErrors:G}){if(Y!==void 0)$.compositeRule=Y;if(J!==void 0)$.createErrors=J;if(G!==void 0)$.allErrors=G;$.jtdDiscriminator=X,$.jtdMetadata=W}Fw.extendSubschemaMode=lx});var Pw=v((qt,Ew)=>{var t6=Ew.exports=function($,X,W){if(typeof X=="function")W=X,X={};W=X.cb||W;var Y=typeof W=="function"?W:W.pre||function(){},J=W.post||function(){};h8(X,Y,J,$,"",$)};t6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};t6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};t6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};t6.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function h8($,X,W,Y,J,G,U,Q,z,H){if(Y&&typeof Y=="object"&&!Array.isArray(Y)){X(Y,J,G,U,Q,z,H);for(var j in Y){var O=Y[j];if(Array.isArray(O)){if(j in t6.arrayKeywords)for(var B=0;B<O.length;B++)h8($,X,W,O[B],J+"/"+j+"/"+B,G,J,j,Y,B)}else if(j in t6.propsKeywords){if(O&&typeof O=="object")for(var I in O)h8($,X,W,O[I],J+"/"+j+"/"+nx(I),G,J,j,Y,I)}else if(j in t6.keywords||$.allKeys&&!(j in t6.skipKeywords))h8($,X,W,O,J+"/"+j,G,J,j,Y)}W(Y,J,G,U,Q,z,H)}}function nx($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}});var FW=v((Tw)=>{Object.defineProperty(Tw,"__esModule",{value:!0});Tw.getSchemaRefs=Tw.resolveUrl=Tw.normalizeId=Tw._getFullPath=Tw.getFullPath=Tw.inlineRef=void 0;var cx=I$(),rx=XW(),px=Pw(),dx=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function ox($,X=!0){if(typeof $=="boolean")return!0;if(X===!0)return!V5($);if(!X)return!1;return Rw($)<=X}Tw.inlineRef=ox;var tx=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function V5($){for(let X in $){if(tx.has(X))return!0;let W=$[X];if(Array.isArray(W)&&W.some(V5))return!0;if(typeof W=="object"&&V5(W))return!0}return!1}function Rw($){let X=0;for(let W in $){if(W==="$ref")return 1/0;if(X++,dx.has(W))continue;if(typeof $[W]=="object")(0,cx.eachItem)($[W],(Y)=>X+=Rw(Y));if(X===1/0)return 1/0}return X}function Zw($,X="",W){if(W!==!1)X=b0(X);let Y=$.parse(X);return kw($,Y)}Tw.getFullPath=Zw;function kw($,X){return $.serialize(X).split("#")[0]+"#"}Tw._getFullPath=kw;var ax=/#\/?$/;function b0($){return $?$.replace(ax,""):""}Tw.normalizeId=b0;function sx($,X,W){return W=b0(W),$.resolve(X,W)}Tw.resolveUrl=sx;var ex=/^[a-z_][-a-z0-9._]*$/i;function $u($,X){if(typeof $=="boolean")return{};let{schemaId:W,uriResolver:Y}=this.opts,J=b0($[W]||X),G={"":J},U=Zw(Y,J,!1),Q={},z=new Set;return px($,{allKeys:!0},(O,B,I,N)=>{if(N===void 0)return;let D=U+B,w=G[N];if(typeof O[W]=="string")w=V.call(this,O[W]);K.call(this,O.$anchor),K.call(this,O.$dynamicAnchor),G[B]=w;function V(b){let S=this.opts.uriResolver.resolve;if(b=b0(w?S(w,b):b),z.has(b))throw j(b);z.add(b);let L=this.refs[b];if(typeof L=="string")L=this.refs[L];if(typeof L=="object")H(O,L.schema,b);else if(b!==b0(D))if(b[0]==="#")H(O,Q[b],b),Q[b]=O;else this.refs[b]=D;return b}function K(b){if(typeof b=="string"){if(!ex.test(b))throw Error(`invalid anchor "${b}"`);V.call(this,`#${b}`)}}}),Q;function H(O,B,I){if(B!==void 0&&!rx(O,B))throw j(I)}function j(O){return Error(`reference "${O}" resolves to more than one schema`)}}Tw.getSchemaRefs=$u});var EW=v((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});dw.getData=dw.KeywordCxt=dw.validateFunctionCode=void 0;var gw=sB(),_w=LW(),b5=j5(),l8=LW(),Uu=Nw(),SW=qw(),A5=Sw(),f=e(),r=F6(),Qu=FW(),M6=I$(),MW=qW();function zu($){if(lw($)){if(mw($),hw($)){Iu($);return}}fw($,()=>(0,gw.topBoolOrEmptySchema)($))}dw.validateFunctionCode=zu;function fw({gen:$,validateName:X,schema:W,schemaEnv:Y,opts:J},G){if(J.code.es5)$.func(X,f._`${r.default.data}, ${r.default.valCxt}`,Y.$async,()=>{$.code(f._`"use strict"; ${xw(W,J)}`),ju($,J),$.code(G)});else $.func(X,f._`${r.default.data}, ${Hu(J)}`,Y.$async,()=>$.code(xw(W,J)).code(G))}function Hu($){return f._`{${r.default.instancePath}="", ${r.default.parentData}, ${r.default.parentDataProperty}, ${r.default.rootData}=${r.default.data}${$.dynamicRef?f._`, ${r.default.dynamicAnchors}={}`:f.nil}}={}`}function ju($,X){$.if(r.default.valCxt,()=>{if($.var(r.default.instancePath,f._`${r.default.valCxt}.${r.default.instancePath}`),$.var(r.default.parentData,f._`${r.default.valCxt}.${r.default.parentData}`),$.var(r.default.parentDataProperty,f._`${r.default.valCxt}.${r.default.parentDataProperty}`),$.var(r.default.rootData,f._`${r.default.valCxt}.${r.default.rootData}`),X.dynamicRef)$.var(r.default.dynamicAnchors,f._`${r.default.valCxt}.${r.default.dynamicAnchors}`)},()=>{if($.var(r.default.instancePath,f._`""`),$.var(r.default.parentData,f._`undefined`),$.var(r.default.parentDataProperty,f._`undefined`),$.var(r.default.rootData,r.default.data),X.dynamicRef)$.var(r.default.dynamicAnchors,f._`{}`)})}function Iu($){let{schema:X,opts:W,gen:Y}=$;fw($,()=>{if(W.$comment&&X.$comment)nw($);if(wu($),Y.let(r.default.vErrors,null),Y.let(r.default.errors,0),W.unevaluated)Ou($);iw($),bu($)});return}function Ou($){let{gen:X,validateName:W}=$;$.evaluated=X.const("evaluated",f._`${W}.evaluated`),X.if(f._`${$.evaluated}.dynamicProps`,()=>X.assign(f._`${$.evaluated}.props`,f._`undefined`)),X.if(f._`${$.evaluated}.dynamicItems`,()=>X.assign(f._`${$.evaluated}.items`,f._`undefined`))}function xw($,X){let W=typeof $=="object"&&$[X.schemaId];return W&&(X.code.source||X.code.process)?f._`/*# sourceURL=${W} */`:f.nil}function Nu($,X){if(lw($)){if(mw($),hw($)){Du($,X);return}}(0,gw.boolOrEmptySchema)($,X)}function hw({schema:$,self:X}){if(typeof $=="boolean")return!$;for(let W in $)if(X.RULES.all[W])return!0;return!1}function lw($){return typeof $.schema!="boolean"}function Du($,X){let{schema:W,gen:Y,opts:J}=$;if(J.$comment&&W.$comment)nw($);Vu($),Au($);let G=Y.const("_errs",r.default.errors);iw($,G),Y.var(X,f._`${G} === ${r.default.errors}`)}function mw($){(0,M6.checkUnknownRules)($),Bu($)}function iw($,X){if($.opts.jtd)return uw($,[],!1,X);let W=(0,_w.getSchemaTypes)($.schema),Y=(0,_w.coerceAndCheckDataType)($,W);uw($,W,!Y,X)}function Bu($){let{schema:X,errSchemaPath:W,opts:Y,self:J}=$;if(X.$ref&&Y.ignoreKeywordsWithRef&&(0,M6.schemaHasRulesButRef)(X,J.RULES))J.logger.warn(`$ref: keywords ignored in schema at path "${W}"`)}function wu($){let{schema:X,opts:W}=$;if(X.default!==void 0&&W.useDefaults&&W.strictSchema)(0,M6.checkStrictMode)($,"default is ignored in the schema root")}function Vu($){let X=$.schema[$.opts.schemaId];if(X)$.baseId=(0,Qu.resolveUrl)($.opts.uriResolver,$.baseId,X)}function Au($){if($.schema.$async&&!$.schemaEnv.$async)throw Error("async schema in sync schema")}function nw({gen:$,schemaEnv:X,schema:W,errSchemaPath:Y,opts:J}){let G=W.$comment;if(J.$comment===!0)$.code(f._`${r.default.self}.logger.log(${G})`);else if(typeof J.$comment=="function"){let U=f.str`${Y}/$comment`,Q=$.scopeValue("root",{ref:X.root});$.code(f._`${r.default.self}.opts.$comment(${G}, ${U}, ${Q}.schema)`)}}function bu($){let{gen:X,schemaEnv:W,validateName:Y,ValidationError:J,opts:G}=$;if(W.$async)X.if(f._`${r.default.errors} === 0`,()=>X.return(r.default.data),()=>X.throw(f._`new ${J}(${r.default.vErrors})`));else{if(X.assign(f._`${Y}.errors`,r.default.vErrors),G.unevaluated)Ku($);X.return(f._`${r.default.errors} === 0`)}}function Ku({gen:$,evaluated:X,props:W,items:Y}){if(W instanceof f.Name)$.assign(f._`${X}.props`,W);if(Y instanceof f.Name)$.assign(f._`${X}.items`,Y)}function uw($,X,W,Y){let{gen:J,schema:G,data:U,allErrors:Q,opts:z,self:H}=$,{RULES:j}=H;if(G.$ref&&(z.ignoreKeywordsWithRef||!(0,M6.schemaHasRulesButRef)(G,j))){J.block(()=>rw($,"$ref",j.all.$ref.definition));return}if(!z.jtd)vu($,X);J.block(()=>{for(let B of j.rules)O(B);O(j.post)});function O(B){if(!(0,b5.shouldUseGroup)(G,B))return;if(B.type){if(J.if((0,l8.checkDataType)(B.type,U,z.strictNumbers)),yw($,B),X.length===1&&X[0]===B.type&&W)J.else(),(0,l8.reportTypeError)($);J.endIf()}else yw($,B);if(!Q)J.if(f._`${r.default.errors} === ${Y||0}`)}}function yw($,X){let{gen:W,schema:Y,opts:{useDefaults:J}}=$;if(J)(0,Uu.assignDefaults)($,X.type);W.block(()=>{for(let G of X.rules)if((0,b5.shouldUseRule)(Y,G))rw($,G.keyword,G.definition,X.type)})}function vu($,X){if($.schemaEnv.meta||!$.opts.strictTypes)return;if(qu($,X),!$.opts.allowUnionTypes)Lu($,X);Fu($,$.dataTypes)}function qu($,X){if(!X.length)return;if(!$.dataTypes.length){$.dataTypes=X;return}X.forEach((W)=>{if(!cw($.dataTypes,W))K5($,`type "${W}" not allowed by context "${$.dataTypes.join(",")}"`)}),Su($,X)}function Lu($,X){if(X.length>1&&!(X.length===2&&X.includes("null")))K5($,"use allowUnionTypes to allow union type keyword")}function Fu($,X){let W=$.self.RULES.all;for(let Y in W){let J=W[Y];if(typeof J=="object"&&(0,b5.shouldUseRule)($.schema,J)){let{type:G}=J.definition;if(G.length&&!G.some((U)=>Mu(X,U)))K5($,`missing type "${G.join(",")}" for keyword "${Y}"`)}}}function Mu($,X){return $.includes(X)||X==="number"&&$.includes("integer")}function cw($,X){return $.includes(X)||X==="integer"&&$.includes("number")}function Su($,X){let W=[];for(let Y of $.dataTypes)if(cw(X,Y))W.push(Y);else if(X.includes("integer")&&Y==="number")W.push("integer");$.dataTypes=W}function K5($,X){let W=$.schemaEnv.baseId+$.errSchemaPath;X+=` at "${W}" (strictTypes)`,(0,M6.checkStrictMode)($,X,$.opts.strictTypes)}class v5{constructor($,X,W){if((0,SW.validateKeywordUsage)($,X,W),this.gen=$.gen,this.allErrors=$.allErrors,this.keyword=W,this.data=$.data,this.schema=$.schema[W],this.$data=X.$data&&$.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,M6.schemaRefOrVal)($,this.schema,W,this.$data),this.schemaType=X.schemaType,this.parentSchema=$.schema,this.params={},this.it=$,this.def=X,this.$data)this.schemaCode=$.gen.const("vSchema",pw(this.$data,$));else if(this.schemaCode=this.schemaValue,!(0,SW.validSchemaType)(this.schema,X.schemaType,X.allowUndefined))throw Error(`${W} value must be ${JSON.stringify(X.schemaType)}`);if("code"in X?X.trackErrors:X.errors!==!1)this.errsCount=$.gen.const("_errs",r.default.errors)}result($,X,W){this.failResult((0,f.not)($),X,W)}failResult($,X,W){if(this.gen.if($),W)W();else this.error();if(X){if(this.gen.else(),X(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass($,X){this.failResult((0,f.not)($),void 0,X)}fail($){if($===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if($),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data($){if(!this.$data)return this.fail($);let{schemaCode:X}=this;this.fail(f._`${X} !== undefined && (${(0,f.or)(this.invalid$data(),$)})`)}error($,X,W){if(X){this.setParams(X),this._error($,W),this.setParams({});return}this._error($,W)}_error($,X){($?MW.reportExtraError:MW.reportError)(this,this.def.error,X)}$dataError(){(0,MW.reportError)(this,this.def.$dataError||MW.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,MW.resetErrorsCount)(this.gen,this.errsCount)}ok($){if(!this.allErrors)this.gen.if($)}setParams($,X){if(X)Object.assign(this.params,$);else this.params=$}block$data($,X,W=f.nil){this.gen.block(()=>{this.check$data($,W),X()})}check$data($=f.nil,X=f.nil){if(!this.$data)return;let{gen:W,schemaCode:Y,schemaType:J,def:G}=this;if(W.if((0,f.or)(f._`${Y} === undefined`,X)),$!==f.nil)W.assign($,!0);if(J.length||G.validateSchema){if(W.elseIf(this.invalid$data()),this.$dataError(),$!==f.nil)W.assign($,!1)}W.else()}invalid$data(){let{gen:$,schemaCode:X,schemaType:W,def:Y,it:J}=this;return(0,f.or)(G(),U());function G(){if(W.length){if(!(X instanceof f.Name))throw Error("ajv implementation error");let Q=Array.isArray(W)?W:[W];return f._`${(0,l8.checkDataTypes)(Q,X,J.opts.strictNumbers,l8.DataType.Wrong)}`}return f.nil}function U(){if(Y.validateSchema){let Q=$.scopeValue("validate$data",{ref:Y.validateSchema});return f._`!${Q}(${X})`}return f.nil}}subschema($,X){let W=(0,A5.getSubschema)(this.it,$);(0,A5.extendSubschemaData)(W,this.it,$),(0,A5.extendSubschemaMode)(W,$);let Y={...this.it,...W,items:void 0,props:void 0};return Nu(Y,X),Y}mergeEvaluated($,X){let{it:W,gen:Y}=this;if(!W.opts.unevaluated)return;if(W.props!==!0&&$.props!==void 0)W.props=M6.mergeEvaluated.props(Y,$.props,W.props,X);if(W.items!==!0&&$.items!==void 0)W.items=M6.mergeEvaluated.items(Y,$.items,W.items,X)}mergeValidEvaluated($,X){let{it:W,gen:Y}=this;if(W.opts.unevaluated&&(W.props!==!0||W.items!==!0))return Y.if(X,()=>this.mergeEvaluated($,f.Name)),!0}}dw.KeywordCxt=v5;function rw($,X,W,Y){let J=new v5($,W,X);if("code"in W)W.code(J,Y);else if(J.$data&&W.validate)(0,SW.funcKeywordCode)(J,W);else if("macro"in W)(0,SW.macroKeywordCode)(J,W);else if(W.compile||W.validate)(0,SW.funcKeywordCode)(J,W)}var Eu=/^\/(?:[^~]|~0|~1)*$/,Pu=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pw($,{dataLevel:X,dataNames:W,dataPathArr:Y}){let J,G;if($==="")return r.default.rootData;if($[0]==="/"){if(!Eu.test($))throw Error(`Invalid JSON-pointer: ${$}`);J=$,G=r.default.rootData}else{let H=Pu.exec($);if(!H)throw Error(`Invalid JSON-pointer: ${$}`);let j=+H[1];if(J=H[2],J==="#"){if(j>=X)throw Error(z("property/index",j));return Y[X-j]}if(j>X)throw Error(z("data",j));if(G=W[X-j],!J)return G}let U=G,Q=J.split("/");for(let H of Q)if(H)G=f._`${G}${(0,f.getProperty)((0,M6.unescapeJsonPointer)(H))}`,U=f._`${U} && ${G}`;return U;function z(H,j){return`Cannot access ${H} ${j} levels up, current level is ${X}`}}dw.getData=pw});var m8=v((aw)=>{Object.defineProperty(aw,"__esModule",{value:!0});class tw extends Error{constructor($){super("validation failed");this.errors=$,this.ajv=this.validation=!0}}aw.default=tw});var PW=v((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});var q5=FW();class sw extends Error{constructor($,X,W,Y){super(Y||`can't resolve reference ${W} from id ${X}`);this.missingRef=(0,q5.resolveUrl)($,X,W),this.missingSchema=(0,q5.normalizeId)((0,q5.getFullPath)($,this.missingRef))}}ew.default=sw});var n8=v((WV)=>{Object.defineProperty(WV,"__esModule",{value:!0});WV.resolveSchema=WV.getCompilingSchema=WV.resolveRef=WV.compileSchema=WV.SchemaEnv=void 0;var r4=e(),Cu=m8(),q1=F6(),p4=FW(),$V=I$(),_u=EW();class RW{constructor($){var X;this.refs={},this.dynamicAnchors={};let W;if(typeof $.schema=="object")W=$.schema;this.schema=$.schema,this.schemaId=$.schemaId,this.root=$.root||this,this.baseId=(X=$.baseId)!==null&&X!==void 0?X:(0,p4.normalizeId)(W===null||W===void 0?void 0:W[$.schemaId||"$id"]),this.schemaPath=$.schemaPath,this.localRefs=$.localRefs,this.meta=$.meta,this.$async=W===null||W===void 0?void 0:W.$async,this.refs={}}}WV.SchemaEnv=RW;function F5($){let X=XV.call(this,$);if(X)return X;let W=(0,p4.getFullPath)(this.opts.uriResolver,$.root.baseId),{es5:Y,lines:J}=this.opts.code,{ownProperties:G}=this.opts,U=new r4.CodeGen(this.scope,{es5:Y,lines:J,ownProperties:G}),Q;if($.$async)Q=U.scopeValue("Error",{ref:Cu.default,code:r4._`require("ajv/dist/runtime/validation_error").default`});let z=U.scopeName("validate");$.validateName=z;let H={gen:U,allErrors:this.opts.allErrors,data:q1.default.data,parentData:q1.default.parentData,parentDataProperty:q1.default.parentDataProperty,dataNames:[q1.default.data],dataPathArr:[r4.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:U.scopeValue("schema",this.opts.code.source===!0?{ref:$.schema,code:(0,r4.stringify)($.schema)}:{ref:$.schema}),validateName:z,ValidationError:Q,schema:$.schema,schemaEnv:$,rootId:W,baseId:$.baseId||W,schemaPath:r4.nil,errSchemaPath:$.schemaPath||(this.opts.jtd?"":"#"),errorPath:r4._`""`,opts:this.opts,self:this},j;try{this._compilations.add($),(0,_u.validateFunctionCode)(H),U.optimize(this.opts.code.optimize);let O=U.toString();if(j=`${U.scopeRefs(q1.default.scope)}return ${O}`,this.opts.code.process)j=this.opts.code.process(j,$);let I=Function(`${q1.default.self}`,`${q1.default.scope}`,j)(this,this.scope.get());if(this.scope.value(z,{ref:I}),I.errors=null,I.schema=$.schema,I.schemaEnv=$,$.$async)I.$async=!0;if(this.opts.code.source===!0)I.source={validateName:z,validateCode:O,scopeValues:U._values};if(this.opts.unevaluated){let{props:N,items:D}=H;if(I.evaluated={props:N instanceof r4.Name?void 0:N,items:D instanceof r4.Name?void 0:D,dynamicProps:N instanceof r4.Name,dynamicItems:D instanceof r4.Name},I.source)I.source.evaluated=(0,r4.stringify)(I.evaluated)}return $.validate=I,$}catch(O){if(delete $.validate,delete $.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw O}finally{this._compilations.delete($)}}WV.compileSchema=F5;function xu($,X,W){var Y;W=(0,p4.resolveUrl)(this.opts.uriResolver,X,W);let J=$.refs[W];if(J)return J;let G=gu.call(this,$,W);if(G===void 0){let U=(Y=$.localRefs)===null||Y===void 0?void 0:Y[W],{schemaId:Q}=this.opts;if(U)G=new RW({schema:U,schemaId:Q,root:$,baseId:X})}if(G===void 0)return;return $.refs[W]=uu.call(this,G)}WV.resolveRef=xu;function uu($){if((0,p4.inlineRef)($.schema,this.opts.inlineRefs))return $.schema;return $.validate?$:F5.call(this,$)}function XV($){for(let X of this._compilations)if(yu(X,$))return X}WV.getCompilingSchema=XV;function yu($,X){return $.schema===X.schema&&$.root===X.root&&$.baseId===X.baseId}function gu($,X){let W;while(typeof(W=this.refs[X])=="string")X=W;return W||this.schemas[X]||i8.call(this,$,X)}function i8($,X){let W=this.opts.uriResolver.parse(X),Y=(0,p4._getFullPath)(this.opts.uriResolver,W),J=(0,p4.getFullPath)(this.opts.uriResolver,$.baseId,void 0);if(Object.keys($.schema).length>0&&Y===J)return L5.call(this,W,$);let G=(0,p4.normalizeId)(Y),U=this.refs[G]||this.schemas[G];if(typeof U=="string"){let Q=i8.call(this,$,U);if(typeof(Q===null||Q===void 0?void 0:Q.schema)!=="object")return;return L5.call(this,W,Q)}if(typeof(U===null||U===void 0?void 0:U.schema)!=="object")return;if(!U.validate)F5.call(this,U);if(G===(0,p4.normalizeId)(X)){let{schema:Q}=U,{schemaId:z}=this.opts,H=Q[z];if(H)J=(0,p4.resolveUrl)(this.opts.uriResolver,J,H);return new RW({schema:Q,schemaId:z,root:$,baseId:J})}return L5.call(this,W,U)}WV.resolveSchema=i8;var fu=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function L5($,{baseId:X,schema:W,root:Y}){var J;if(((J=$.fragment)===null||J===void 0?void 0:J[0])!=="/")return;for(let Q of $.fragment.slice(1).split("/")){if(typeof W==="boolean")return;let z=W[(0,$V.unescapeFragment)(Q)];if(z===void 0)return;W=z;let H=typeof W==="object"&&W[this.opts.schemaId];if(!fu.has(Q)&&H)X=(0,p4.resolveUrl)(this.opts.uriResolver,X,H)}let G;if(typeof W!="boolean"&&W.$ref&&!(0,$V.schemaHasRulesButRef)(W,this.RULES)){let Q=(0,p4.resolveUrl)(this.opts.uriResolver,X,W.$ref);G=i8.call(this,Y,Q)}let{schemaId:U}=this.opts;if(G=G||new RW({schema:W,schemaId:U,root:Y,baseId:X}),G.schema!==G.root.schema)return G;return}});var YV=v((Pt,nu)=>{nu.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var QV=v((UV)=>{Object.defineProperty(UV,"__esModule",{value:!0});var GV=kz();GV.code='require("ajv/dist/runtime/uri").default';UV.default=GV});var BV=v((S6)=>{Object.defineProperty(S6,"__esModule",{value:!0});S6.CodeGen=S6.Name=S6.nil=S6.stringify=S6.str=S6._=S6.KeywordCxt=void 0;var ru=EW();Object.defineProperty(S6,"KeywordCxt",{enumerable:!0,get:function(){return ru.KeywordCxt}});var K0=e();Object.defineProperty(S6,"_",{enumerable:!0,get:function(){return K0._}});Object.defineProperty(S6,"str",{enumerable:!0,get:function(){return K0.str}});Object.defineProperty(S6,"stringify",{enumerable:!0,get:function(){return K0.stringify}});Object.defineProperty(S6,"nil",{enumerable:!0,get:function(){return K0.nil}});Object.defineProperty(S6,"Name",{enumerable:!0,get:function(){return K0.Name}});Object.defineProperty(S6,"CodeGen",{enumerable:!0,get:function(){return K0.CodeGen}});var pu=m8(),OV=PW(),du=H5(),ZW=n8(),ou=e(),kW=FW(),c8=LW(),S5=I$(),zV=YV(),tu=QV(),NV=($,X)=>new RegExp($,X);NV.code="new RegExp";var au=["removeAdditional","useDefaults","coerceTypes"],su=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),eu={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},$y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},HV=200;function Xy($){var X,W,Y,J,G,U,Q,z,H,j,O,B,I,N,D,w,V,K,b,S,L,l,V$,s$,t4;let U4=$.strict,z6=(X=$.code)===null||X===void 0?void 0:X.optimize,$1=z6===!0||z6===void 0?1:z6||0,H6=(Y=(W=$.code)===null||W===void 0?void 0:W.regExp)!==null&&Y!==void 0?Y:NV,S1=(J=$.uriResolver)!==null&&J!==void 0?J:tu.default;return{strictSchema:(U=(G=$.strictSchema)!==null&&G!==void 0?G:U4)!==null&&U!==void 0?U:!0,strictNumbers:(z=(Q=$.strictNumbers)!==null&&Q!==void 0?Q:U4)!==null&&z!==void 0?z:!0,strictTypes:(j=(H=$.strictTypes)!==null&&H!==void 0?H:U4)!==null&&j!==void 0?j:"log",strictTuples:(B=(O=$.strictTuples)!==null&&O!==void 0?O:U4)!==null&&B!==void 0?B:"log",strictRequired:(N=(I=$.strictRequired)!==null&&I!==void 0?I:U4)!==null&&N!==void 0?N:!1,code:$.code?{...$.code,optimize:$1,regExp:H6}:{optimize:$1,regExp:H6},loopRequired:(D=$.loopRequired)!==null&&D!==void 0?D:HV,loopEnum:(w=$.loopEnum)!==null&&w!==void 0?w:HV,meta:(V=$.meta)!==null&&V!==void 0?V:!0,messages:(K=$.messages)!==null&&K!==void 0?K:!0,inlineRefs:(b=$.inlineRefs)!==null&&b!==void 0?b:!0,schemaId:(S=$.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(L=$.addUsedSchema)!==null&&L!==void 0?L:!0,validateSchema:(l=$.validateSchema)!==null&&l!==void 0?l:!0,validateFormats:(V$=$.validateFormats)!==null&&V$!==void 0?V$:!0,unicodeRegExp:(s$=$.unicodeRegExp)!==null&&s$!==void 0?s$:!0,int32range:(t4=$.int32range)!==null&&t4!==void 0?t4:!0,uriResolver:S1}}class r8{constructor($={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,$=this.opts={...$,...Xy($)};let{es5:X,lines:W}=this.opts.code;this.scope=new ou.ValueScope({scope:{},prefixes:su,es5:X,lines:W}),this.logger=Qy($.logger);let Y=$.validateFormats;if($.validateFormats=!1,this.RULES=(0,du.getRules)(),jV.call(this,eu,$,"NOT SUPPORTED"),jV.call(this,$y,$,"DEPRECATED","warn"),this._metaOpts=Gy.call(this),$.formats)Jy.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),$.keywords)Yy.call(this,$.keywords);if(typeof $.meta=="object")this.addMetaSchema($.meta);Wy.call(this),$.validateFormats=Y}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:$,meta:X,schemaId:W}=this.opts,Y=zV;if(W==="id")Y={...zV},Y.id=Y.$id,delete Y.$id;if(X&&$)this.addMetaSchema(Y,Y[W],!1)}defaultMeta(){let{meta:$,schemaId:X}=this.opts;return this.opts.defaultMeta=typeof $=="object"?$[X]||$:void 0}validate($,X){let W;if(typeof $=="string"){if(W=this.getSchema($),!W)throw Error(`no schema with key or ref "${$}"`)}else W=this.compile($);let Y=W(X);if(!("$async"in W))this.errors=W.errors;return Y}compile($,X){let W=this._addSchema($,X);return W.validate||this._compileSchemaEnv(W)}compileAsync($,X){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:W}=this.opts;return Y.call(this,$,X);async function Y(H,j){await J.call(this,H.$schema);let O=this._addSchema(H,j);return O.validate||G.call(this,O)}async function J(H){if(H&&!this.getSchema(H))await Y.call(this,{$ref:H},!0)}async function G(H){try{return this._compileSchemaEnv(H)}catch(j){if(!(j instanceof OV.default))throw j;return U.call(this,j),await Q.call(this,j.missingSchema),G.call(this,H)}}function U({missingSchema:H,missingRef:j}){if(this.refs[H])throw Error(`AnySchema ${H} is loaded but ${j} cannot be resolved`)}async function Q(H){let j=await z.call(this,H);if(!this.refs[H])await J.call(this,j.$schema);if(!this.refs[H])this.addSchema(j,H,X)}async function z(H){let j=this._loading[H];if(j)return j;try{return await(this._loading[H]=W(H))}finally{delete this._loading[H]}}}addSchema($,X,W,Y=this.opts.validateSchema){if(Array.isArray($)){for(let G of $)this.addSchema(G,void 0,W,Y);return this}let J;if(typeof $==="object"){let{schemaId:G}=this.opts;if(J=$[G],J!==void 0&&typeof J!="string")throw Error(`schema ${G} must be string`)}return X=(0,kW.normalizeId)(X||J),this._checkUnique(X),this.schemas[X]=this._addSchema($,W,X,Y,!0),this}addMetaSchema($,X,W=this.opts.validateSchema){return this.addSchema($,X,!0,W),this}validateSchema($,X){if(typeof $=="boolean")return!0;let W;if(W=$.$schema,W!==void 0&&typeof W!="string")throw Error("$schema must be a string");if(W=W||this.opts.defaultMeta||this.defaultMeta(),!W)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let Y=this.validate(W,$);if(!Y&&X){let J="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(J);else throw Error(J)}return Y}getSchema($){let X;while(typeof(X=IV.call(this,$))=="string")$=X;if(X===void 0){let{schemaId:W}=this.opts,Y=new ZW.SchemaEnv({schema:{},schemaId:W});if(X=ZW.resolveSchema.call(this,Y,$),!X)return;this.refs[$]=X}return X.validate||this._compileSchemaEnv(X)}removeSchema($){if($ instanceof RegExp)return this._removeAllSchemas(this.schemas,$),this._removeAllSchemas(this.refs,$),this;switch(typeof $){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let X=IV.call(this,$);if(typeof X=="object")this._cache.delete(X.schema);return delete this.schemas[$],delete this.refs[$],this}case"object":{let X=$;this._cache.delete(X);let W=$[this.opts.schemaId];if(W)W=(0,kW.normalizeId)(W),delete this.schemas[W],delete this.refs[W];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary($){for(let X of $)this.addKeyword(X);return this}addKeyword($,X){let W;if(typeof $=="string"){if(W=$,typeof X=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),X.keyword=W}else if(typeof $=="object"&&X===void 0){if(X=$,W=X.keyword,Array.isArray(W)&&!W.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Hy.call(this,W,X),!X)return(0,S5.eachItem)(W,(J)=>M5.call(this,J)),this;Iy.call(this,X);let Y={...X,type:(0,c8.getJSONTypes)(X.type),schemaType:(0,c8.getJSONTypes)(X.schemaType)};return(0,S5.eachItem)(W,Y.type.length===0?(J)=>M5.call(this,J,Y):(J)=>Y.type.forEach((G)=>M5.call(this,J,Y,G))),this}getKeyword($){let X=this.RULES.all[$];return typeof X=="object"?X.definition:!!X}removeKeyword($){let{RULES:X}=this;delete X.keywords[$],delete X.all[$];for(let W of X.rules){let Y=W.rules.findIndex((J)=>J.keyword===$);if(Y>=0)W.rules.splice(Y,1)}return this}addFormat($,X){if(typeof X=="string")X=new RegExp(X);return this.formats[$]=X,this}errorsText($=this.errors,{separator:X=", ",dataVar:W="data"}={}){if(!$||$.length===0)return"No errors";return $.map((Y)=>`${W}${Y.instancePath} ${Y.message}`).reduce((Y,J)=>Y+X+J)}$dataMetaSchema($,X){let W=this.RULES.all;$=JSON.parse(JSON.stringify($));for(let Y of X){let J=Y.split("/").slice(1),G=$;for(let U of J)G=G[U];for(let U in W){let Q=W[U];if(typeof Q!="object")continue;let{$data:z}=Q.definition,H=G[U];if(z&&H)G[U]=DV(H)}}return $}_removeAllSchemas($,X){for(let W in $){let Y=$[W];if(!X||X.test(W)){if(typeof Y=="string")delete $[W];else if(Y&&!Y.meta)this._cache.delete(Y.schema),delete $[W]}}}_addSchema($,X,W,Y=this.opts.validateSchema,J=this.opts.addUsedSchema){let G,{schemaId:U}=this.opts;if(typeof $=="object")G=$[U];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof $!="boolean")throw Error("schema must be object or boolean");let Q=this._cache.get($);if(Q!==void 0)return Q;W=(0,kW.normalizeId)(G||W);let z=kW.getSchemaRefs.call(this,$,W);if(Q=new ZW.SchemaEnv({schema:$,schemaId:U,meta:X,baseId:W,localRefs:z}),this._cache.set(Q.schema,Q),J&&!W.startsWith("#")){if(W)this._checkUnique(W);this.refs[W]=Q}if(Y)this.validateSchema($,!0);return Q}_checkUnique($){if(this.schemas[$]||this.refs[$])throw Error(`schema with key or id "${$}" already exists`)}_compileSchemaEnv($){if($.meta)this._compileMetaSchema($);else ZW.compileSchema.call(this,$);if(!$.validate)throw Error("ajv implementation error");return $.validate}_compileMetaSchema($){let X=this.opts;this.opts=this._metaOpts;try{ZW.compileSchema.call(this,$)}finally{this.opts=X}}}r8.ValidationError=pu.default;r8.MissingRefError=OV.default;S6.default=r8;function jV($,X,W,Y="error"){for(let J in $){let G=J;if(G in X)this.logger[Y](`${W}: option ${J}. ${$[G]}`)}}function IV($){return $=(0,kW.normalizeId)($),this.schemas[$]||this.refs[$]}function Wy(){let $=this.opts.schemas;if(!$)return;if(Array.isArray($))this.addSchema($);else for(let X in $)this.addSchema($[X],X)}function Jy(){for(let $ in this.opts.formats){let X=this.opts.formats[$];if(X)this.addFormat($,X)}}function Yy($){if(Array.isArray($)){this.addVocabulary($);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let X in $){let W=$[X];if(!W.keyword)W.keyword=X;this.addKeyword(W)}}function Gy(){let $={...this.opts};for(let X of au)delete $[X];return $}var Uy={log(){},warn(){},error(){}};function Qy($){if($===!1)return Uy;if($===void 0)return console;if($.log&&$.warn&&$.error)return $;throw Error("logger must implement log, warn and error methods")}var zy=/^[a-z_$][a-z0-9_$:-]*$/i;function Hy($,X){let{RULES:W}=this;if((0,S5.eachItem)($,(Y)=>{if(W.keywords[Y])throw Error(`Keyword ${Y} is already defined`);if(!zy.test(Y))throw Error(`Keyword ${Y} has invalid name`)}),!X)return;if(X.$data&&!(("code"in X)||("validate"in X)))throw Error('$data keyword must have "code" or "validate" function')}function M5($,X,W){var Y;let J=X===null||X===void 0?void 0:X.post;if(W&&J)throw Error('keyword with "post" flag cannot have "type"');let{RULES:G}=this,U=J?G.post:G.rules.find(({type:z})=>z===W);if(!U)U={type:W,rules:[]},G.rules.push(U);if(G.keywords[$]=!0,!X)return;let Q={keyword:$,definition:{...X,type:(0,c8.getJSONTypes)(X.type),schemaType:(0,c8.getJSONTypes)(X.schemaType)}};if(X.before)jy.call(this,U,Q,X.before);else U.rules.push(Q);G.all[$]=Q,(Y=X.implements)===null||Y===void 0||Y.forEach((z)=>this.addKeyword(z))}function jy($,X,W){let Y=$.rules.findIndex((J)=>J.keyword===W);if(Y>=0)$.rules.splice(Y,0,X);else $.rules.push(X),this.logger.warn(`rule ${W} is not defined`)}function Iy($){let{metaSchema:X}=$;if(X===void 0)return;if($.$data&&this.opts.$data)X=DV(X);$.validateSchema=this.compile(X,!0)}var Oy={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function DV($){return{anyOf:[$,Oy]}}});var VV=v((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});var By={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};wV.default=By});var LV=v((vV)=>{Object.defineProperty(vV,"__esModule",{value:!0});vV.callRef=vV.getValidate=void 0;var Vy=PW(),AV=Z4(),b4=e(),v0=F6(),bV=n8(),p8=I$(),Ay={keyword:"$ref",schemaType:"string",code($){let{gen:X,schema:W,it:Y}=$,{baseId:J,schemaEnv:G,validateName:U,opts:Q,self:z}=Y,{root:H}=G;if((W==="#"||W==="#/")&&J===H.baseId)return O();let j=bV.resolveRef.call(z,H,J,W);if(j===void 0)throw new Vy.default(Y.opts.uriResolver,J,W);if(j instanceof bV.SchemaEnv)return B(j);return I(j);function O(){if(G===H)return d8($,U,G,G.$async);let N=X.scopeValue("root",{ref:H});return d8($,b4._`${N}.validate`,H,H.$async)}function B(N){let D=KV($,N);d8($,D,N,N.$async)}function I(N){let D=X.scopeValue("schema",Q.code.source===!0?{ref:N,code:(0,b4.stringify)(N)}:{ref:N}),w=X.name("valid"),V=$.subschema({schema:N,dataTypes:[],schemaPath:b4.nil,topSchemaRef:D,errSchemaPath:W},w);$.mergeEvaluated(V),$.ok(w)}}};function KV($,X){let{gen:W}=$;return X.validate?W.scopeValue("validate",{ref:X.validate}):b4._`${W.scopeValue("wrapper",{ref:X})}.validate`}vV.getValidate=KV;function d8($,X,W,Y){let{gen:J,it:G}=$,{allErrors:U,schemaEnv:Q,opts:z}=G,H=z.passContext?v0.default.this:b4.nil;if(Y)j();else O();function j(){if(!Q.$async)throw Error("async schema referenced by sync schema");let N=J.let("valid");J.try(()=>{if(J.code(b4._`await ${(0,AV.callValidateCode)($,X,H)}`),I(X),!U)J.assign(N,!0)},(D)=>{if(J.if(b4._`!(${D} instanceof ${G.ValidationError})`,()=>J.throw(D)),B(D),!U)J.assign(N,!1)}),$.ok(N)}function O(){$.result((0,AV.callValidateCode)($,X,H),()=>I(X),()=>B(X))}function B(N){let D=b4._`${N}.errors`;J.assign(v0.default.vErrors,b4._`${v0.default.vErrors} === null ? ${D} : ${v0.default.vErrors}.concat(${D})`),J.assign(v0.default.errors,b4._`${v0.default.vErrors}.length`)}function I(N){var D;if(!G.opts.unevaluated)return;let w=(D=W===null||W===void 0?void 0:W.validate)===null||D===void 0?void 0:D.evaluated;if(G.props!==!0)if(w&&!w.dynamicProps){if(w.props!==void 0)G.props=p8.mergeEvaluated.props(J,w.props,G.props)}else{let V=J.var("props",b4._`${N}.evaluated.props`);G.props=p8.mergeEvaluated.props(J,V,G.props,b4.Name)}if(G.items!==!0)if(w&&!w.dynamicItems){if(w.items!==void 0)G.items=p8.mergeEvaluated.items(J,w.items,G.items)}else{let V=J.var("items",b4._`${N}.evaluated.items`);G.items=p8.mergeEvaluated.items(J,V,G.items,b4.Name)}}}vV.callRef=d8;vV.default=Ay});var MV=v((FV)=>{Object.defineProperty(FV,"__esModule",{value:!0});var vy=VV(),qy=LV(),Ly=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",vy.default,qy.default];FV.default=Ly});var EV=v((SV)=>{Object.defineProperty(SV,"__esModule",{value:!0});var o8=e(),a6=o8.operators,t8={maximum:{okStr:"<=",ok:a6.LTE,fail:a6.GT},minimum:{okStr:">=",ok:a6.GTE,fail:a6.LT},exclusiveMaximum:{okStr:"<",ok:a6.LT,fail:a6.GTE},exclusiveMinimum:{okStr:">",ok:a6.GT,fail:a6.LTE}},My={message:({keyword:$,schemaCode:X})=>o8.str`must be ${t8[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>o8._`{comparison: ${t8[$].okStr}, limit: ${X}}`},Sy={keyword:Object.keys(t8),type:"number",schemaType:"number",$data:!0,error:My,code($){let{keyword:X,data:W,schemaCode:Y}=$;$.fail$data(o8._`${W} ${t8[X].fail} ${Y} || isNaN(${W})`)}};SV.default=Sy});var RV=v((PV)=>{Object.defineProperty(PV,"__esModule",{value:!0});var TW=e(),Py={message:({schemaCode:$})=>TW.str`must be multiple of ${$}`,params:({schemaCode:$})=>TW._`{multipleOf: ${$}}`},Ry={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Py,code($){let{gen:X,data:W,schemaCode:Y,it:J}=$,G=J.opts.multipleOfPrecision,U=X.let("res"),Q=G?TW._`Math.abs(Math.round(${U}) - ${U}) > 1e-${G}`:TW._`${U} !== parseInt(${U})`;$.fail$data(TW._`(${Y} === 0 || (${U} = ${W}/${Y}, ${Q}))`)}};PV.default=Ry});var TV=v((kV)=>{Object.defineProperty(kV,"__esModule",{value:!0});function ZV($){let X=$.length,W=0,Y=0,J;while(Y<X)if(W++,J=$.charCodeAt(Y++),J>=55296&&J<=56319&&Y<X){if(J=$.charCodeAt(Y),(J&64512)===56320)Y++}return W}kV.default=ZV;ZV.code='require("ajv/dist/runtime/ucs2length").default'});var _V=v((CV)=>{Object.defineProperty(CV,"__esModule",{value:!0});var L1=e(),Ty=I$(),Cy=TV(),_y={message({keyword:$,schemaCode:X}){let W=$==="maxLength"?"more":"fewer";return L1.str`must NOT have ${W} than ${X} characters`},params:({schemaCode:$})=>L1._`{limit: ${$}}`},xy={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:_y,code($){let{keyword:X,data:W,schemaCode:Y,it:J}=$,G=X==="maxLength"?L1.operators.GT:L1.operators.LT,U=J.opts.unicode===!1?L1._`${W}.length`:L1._`${(0,Ty.useFunc)($.gen,Cy.default)}(${W})`;$.fail$data(L1._`${U} ${G} ${Y}`)}};CV.default=xy});var uV=v((xV)=>{Object.defineProperty(xV,"__esModule",{value:!0});var yy=Z4(),a8=e(),gy={message:({schemaCode:$})=>a8.str`must match pattern "${$}"`,params:({schemaCode:$})=>a8._`{pattern: ${$}}`},fy={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:gy,code($){let{data:X,$data:W,schema:Y,schemaCode:J,it:G}=$,U=G.opts.unicodeRegExp?"u":"",Q=W?a8._`(new RegExp(${J}, ${U}))`:(0,yy.usePattern)($,Y);$.fail$data(a8._`!${Q}.test(${X})`)}};xV.default=fy});var gV=v((yV)=>{Object.defineProperty(yV,"__esModule",{value:!0});var CW=e(),ly={message({keyword:$,schemaCode:X}){let W=$==="maxProperties"?"more":"fewer";return CW.str`must NOT have ${W} than ${X} properties`},params:({schemaCode:$})=>CW._`{limit: ${$}}`},my={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ly,code($){let{keyword:X,data:W,schemaCode:Y}=$,J=X==="maxProperties"?CW.operators.GT:CW.operators.LT;$.fail$data(CW._`Object.keys(${W}).length ${J} ${Y}`)}};yV.default=my});var hV=v((fV)=>{Object.defineProperty(fV,"__esModule",{value:!0});var _W=Z4(),xW=e(),ny=I$(),cy={message:({params:{missingProperty:$}})=>xW.str`must have required property '${$}'`,params:({params:{missingProperty:$}})=>xW._`{missingProperty: ${$}}`},ry={keyword:"required",type:"object",schemaType:"array",$data:!0,error:cy,code($){let{gen:X,schema:W,schemaCode:Y,data:J,$data:G,it:U}=$,{opts:Q}=U;if(!G&&W.length===0)return;let z=W.length>=Q.loopRequired;if(U.allErrors)H();else j();if(Q.strictRequired){let I=$.parentSchema.properties,{definedProperties:N}=$.it;for(let D of W)if((I===null||I===void 0?void 0:I[D])===void 0&&!N.has(D)){let w=U.schemaEnv.baseId+U.errSchemaPath,V=`required property "${D}" is not defined at "${w}" (strictRequired)`;(0,ny.checkStrictMode)(U,V,U.opts.strictRequired)}}function H(){if(z||G)$.block$data(xW.nil,O);else for(let I of W)(0,_W.checkReportMissingProp)($,I)}function j(){let I=X.let("missing");if(z||G){let N=X.let("valid",!0);$.block$data(N,()=>B(I,N)),$.ok(N)}else X.if((0,_W.checkMissingProp)($,W,I)),(0,_W.reportMissingProp)($,I),X.else()}function O(){X.forOf("prop",Y,(I)=>{$.setParams({missingProperty:I}),X.if((0,_W.noPropertyInData)(X,J,I,Q.ownProperties),()=>$.error())})}function B(I,N){$.setParams({missingProperty:I}),X.forOf(I,Y,()=>{X.assign(N,(0,_W.propertyInData)(X,J,I,Q.ownProperties)),X.if((0,xW.not)(N),()=>{$.error(),X.break()})},xW.nil)}}};fV.default=ry});var mV=v((lV)=>{Object.defineProperty(lV,"__esModule",{value:!0});var uW=e(),dy={message({keyword:$,schemaCode:X}){let W=$==="maxItems"?"more":"fewer";return uW.str`must NOT have ${W} than ${X} items`},params:({schemaCode:$})=>uW._`{limit: ${$}}`},oy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:dy,code($){let{keyword:X,data:W,schemaCode:Y}=$,J=X==="maxItems"?uW.operators.GT:uW.operators.LT;$.fail$data(uW._`${W}.length ${J} ${Y}`)}};lV.default=oy});var s8=v((nV)=>{Object.defineProperty(nV,"__esModule",{value:!0});var iV=XW();iV.code='require("ajv/dist/runtime/equal").default';nV.default=iV});var rV=v((cV)=>{Object.defineProperty(cV,"__esModule",{value:!0});var E5=LW(),c$=e(),sy=I$(),ey=s8(),$g={message:({params:{i:$,j:X}})=>c$.str`must NOT have duplicate items (items ## ${X} and ${$} are identical)`,params:({params:{i:$,j:X}})=>c$._`{i: ${$}, j: ${X}}`},Xg={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:$g,code($){let{gen:X,data:W,$data:Y,schema:J,parentSchema:G,schemaCode:U,it:Q}=$;if(!Y&&!J)return;let z=X.let("valid"),H=G.items?(0,E5.getSchemaTypes)(G.items):[];$.block$data(z,j,c$._`${U} === false`),$.ok(z);function j(){let N=X.let("i",c$._`${W}.length`),D=X.let("j");$.setParams({i:N,j:D}),X.assign(z,!0),X.if(c$._`${N} > 1`,()=>(O()?B:I)(N,D))}function O(){return H.length>0&&!H.some((N)=>N==="object"||N==="array")}function B(N,D){let w=X.name("item"),V=(0,E5.checkDataTypes)(H,w,Q.opts.strictNumbers,E5.DataType.Wrong),K=X.const("indices",c$._`{}`);X.for(c$._`;${N}--;`,()=>{if(X.let(w,c$._`${W}[${N}]`),X.if(V,c$._`continue`),H.length>1)X.if(c$._`typeof ${w} == "string"`,c$._`${w} += "_"`);X.if(c$._`typeof ${K}[${w}] == "number"`,()=>{X.assign(D,c$._`${K}[${w}]`),$.error(),X.assign(z,!1).break()}).code(c$._`${K}[${w}] = ${N}`)})}function I(N,D){let w=(0,sy.useFunc)(X,ey.default),V=X.name("outer");X.label(V).for(c$._`;${N}--;`,()=>X.for(c$._`${D} = ${N}; ${D}--;`,()=>X.if(c$._`${w}(${W}[${N}], ${W}[${D}])`,()=>{$.error(),X.assign(z,!1).break(V)})))}}};cV.default=Xg});var dV=v((pV)=>{Object.defineProperty(pV,"__esModule",{value:!0});var P5=e(),Jg=I$(),Yg=s8(),Gg={message:"must be equal to constant",params:({schemaCode:$})=>P5._`{allowedValue: ${$}}`},Ug={keyword:"const",$data:!0,error:Gg,code($){let{gen:X,data:W,$data:Y,schemaCode:J,schema:G}=$;if(Y||G&&typeof G=="object")$.fail$data(P5._`!${(0,Jg.useFunc)(X,Yg.default)}(${W}, ${J})`);else $.fail(P5._`${G} !== ${W}`)}};pV.default=Ug});var tV=v((oV)=>{Object.defineProperty(oV,"__esModule",{value:!0});var yW=e(),zg=I$(),Hg=s8(),jg={message:"must be equal to one of the allowed values",params:({schemaCode:$})=>yW._`{allowedValues: ${$}}`},Ig={keyword:"enum",schemaType:"array",$data:!0,error:jg,code($){let{gen:X,data:W,$data:Y,schema:J,schemaCode:G,it:U}=$;if(!Y&&J.length===0)throw Error("enum must have non-empty array");let Q=J.length>=U.opts.loopEnum,z,H=()=>z!==null&&z!==void 0?z:z=(0,zg.useFunc)(X,Hg.default),j;if(Q||Y)j=X.let("valid"),$.block$data(j,O);else{if(!Array.isArray(J))throw Error("ajv implementation error");let I=X.const("vSchema",G);j=(0,yW.or)(...J.map((N,D)=>B(I,D)))}$.pass(j);function O(){X.assign(j,!1),X.forOf("v",G,(I)=>X.if(yW._`${H()}(${W}, ${I})`,()=>X.assign(j,!0).break()))}function B(I,N){let D=J[N];return typeof D==="object"&&D!==null?yW._`${H()}(${W}, ${I}[${N}])`:yW._`${W} === ${D}`}}};oV.default=Ig});var sV=v((aV)=>{Object.defineProperty(aV,"__esModule",{value:!0});var Ng=EV(),Dg=RV(),Bg=_V(),wg=uV(),Vg=gV(),Ag=hV(),bg=mV(),Kg=rV(),vg=dV(),qg=tV(),Lg=[Ng.default,Dg.default,Bg.default,wg.default,Vg.default,Ag.default,bg.default,Kg.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},vg.default,qg.default];aV.default=Lg});var Z5=v(($A)=>{Object.defineProperty($A,"__esModule",{value:!0});$A.validateAdditionalItems=void 0;var F1=e(),R5=I$(),Mg={message:({params:{len:$}})=>F1.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>F1._`{limit: ${$}}`},Sg={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Mg,code($){let{parentSchema:X,it:W}=$,{items:Y}=X;if(!Array.isArray(Y)){(0,R5.checkStrictMode)(W,'"additionalItems" is ignored when "items" is not an array of schemas');return}eV($,Y)}};function eV($,X){let{gen:W,schema:Y,data:J,keyword:G,it:U}=$;U.items=!0;let Q=W.const("len",F1._`${J}.length`);if(Y===!1)$.setParams({len:X.length}),$.pass(F1._`${Q} <= ${X.length}`);else if(typeof Y=="object"&&!(0,R5.alwaysValidSchema)(U,Y)){let H=W.var("valid",F1._`${Q} <= ${X.length}`);W.if((0,F1.not)(H),()=>z(H)),$.ok(H)}function z(H){W.forRange("i",X.length,Q,(j)=>{if($.subschema({keyword:G,dataProp:j,dataPropType:R5.Type.Num},H),!U.allErrors)W.if((0,F1.not)(H),()=>W.break())})}}$A.validateAdditionalItems=eV;$A.default=Sg});var k5=v((YA)=>{Object.defineProperty(YA,"__esModule",{value:!0});YA.validateTuple=void 0;var WA=e(),e8=I$(),Pg=Z4(),Rg={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code($){let{schema:X,it:W}=$;if(Array.isArray(X))return JA($,"additionalItems",X);if(W.items=!0,(0,e8.alwaysValidSchema)(W,X))return;$.ok((0,Pg.validateArray)($))}};function JA($,X,W=$.schema){let{gen:Y,parentSchema:J,data:G,keyword:U,it:Q}=$;if(j(J),Q.opts.unevaluated&&W.length&&Q.items!==!0)Q.items=e8.mergeEvaluated.items(Y,W.length,Q.items);let z=Y.name("valid"),H=Y.const("len",WA._`${G}.length`);W.forEach((O,B)=>{if((0,e8.alwaysValidSchema)(Q,O))return;Y.if(WA._`${H} > ${B}`,()=>$.subschema({keyword:U,schemaProp:B,dataProp:B},z)),$.ok(z)});function j(O){let{opts:B,errSchemaPath:I}=Q,N=W.length,D=N===O.minItems&&(N===O.maxItems||O[X]===!1);if(B.strictTuples&&!D){let w=`"${U}" is ${N}-tuple, but minItems or maxItems/${X} are not specified or different at path "${I}"`;(0,e8.checkStrictMode)(Q,w,B.strictTuples)}}}YA.validateTuple=JA;YA.default=Rg});var QA=v((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});var kg=k5(),Tg={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:($)=>(0,kg.validateTuple)($,"items")};UA.default=Tg});var jA=v((HA)=>{Object.defineProperty(HA,"__esModule",{value:!0});var zA=e(),_g=I$(),xg=Z4(),ug=Z5(),yg={message:({params:{len:$}})=>zA.str`must NOT have more than ${$} items`,params:({params:{len:$}})=>zA._`{limit: ${$}}`},gg={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:yg,code($){let{schema:X,parentSchema:W,it:Y}=$,{prefixItems:J}=W;if(Y.items=!0,(0,_g.alwaysValidSchema)(Y,X))return;if(J)(0,ug.validateAdditionalItems)($,J);else $.ok((0,xg.validateArray)($))}};HA.default=gg});var OA=v((IA)=>{Object.defineProperty(IA,"__esModule",{value:!0});var k4=e(),$G=I$(),hg={message:({params:{min:$,max:X}})=>X===void 0?k4.str`must contain at least ${$} valid item(s)`:k4.str`must contain at least ${$} and no more than ${X} valid item(s)`,params:({params:{min:$,max:X}})=>X===void 0?k4._`{minContains: ${$}}`:k4._`{minContains: ${$}, maxContains: ${X}}`},lg={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:hg,code($){let{gen:X,schema:W,parentSchema:Y,data:J,it:G}=$,U,Q,{minContains:z,maxContains:H}=Y;if(G.opts.next)U=z===void 0?1:z,Q=H;else U=1;let j=X.const("len",k4._`${J}.length`);if($.setParams({min:U,max:Q}),Q===void 0&&U===0){(0,$G.checkStrictMode)(G,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(Q!==void 0&&U>Q){(0,$G.checkStrictMode)(G,'"minContains" > "maxContains" is always invalid'),$.fail();return}if((0,$G.alwaysValidSchema)(G,W)){let D=k4._`${j} >= ${U}`;if(Q!==void 0)D=k4._`${D} && ${j} <= ${Q}`;$.pass(D);return}G.items=!0;let O=X.name("valid");if(Q===void 0&&U===1)I(O,()=>X.if(O,()=>X.break()));else if(U===0){if(X.let(O,!0),Q!==void 0)X.if(k4._`${J}.length > 0`,B)}else X.let(O,!1),B();$.result(O,()=>$.reset());function B(){let D=X.name("_valid"),w=X.let("count",0);I(D,()=>X.if(D,()=>N(w)))}function I(D,w){X.forRange("i",0,j,(V)=>{$.subschema({keyword:"contains",dataProp:V,dataPropType:$G.Type.Num,compositeRule:!0},D),w()})}function N(D){if(X.code(k4._`${D}++`),Q===void 0)X.if(k4._`${D} >= ${U}`,()=>X.assign(O,!0).break());else if(X.if(k4._`${D} > ${Q}`,()=>X.assign(O,!1).break()),U===1)X.assign(O,!0);else X.if(k4._`${D} >= ${U}`,()=>X.assign(O,!0))}}};IA.default=lg});var AA=v((BA)=>{Object.defineProperty(BA,"__esModule",{value:!0});BA.validateSchemaDeps=BA.validatePropertyDeps=BA.error=void 0;var T5=e(),ig=I$(),gW=Z4();BA.error={message:({params:{property:$,depsCount:X,deps:W}})=>{let Y=X===1?"property":"properties";return T5.str`must have ${Y} ${W} when property ${$} is present`},params:({params:{property:$,depsCount:X,deps:W,missingProperty:Y}})=>T5._`{property: ${$},
|
|
14
|
+
missingProperty: ${Y},
|
|
15
|
+
depsCount: ${X},
|
|
16
|
+
deps: ${W}}`};var ng={keyword:"dependencies",type:"object",schemaType:"object",error:BA.error,code($){let[X,W]=cg($);NA($,X),DA($,W)}};function cg({schema:$}){let X={},W={};for(let Y in $){if(Y==="__proto__")continue;let J=Array.isArray($[Y])?X:W;J[Y]=$[Y]}return[X,W]}function NA($,X=$.schema){let{gen:W,data:Y,it:J}=$;if(Object.keys(X).length===0)return;let G=W.let("missing");for(let U in X){let Q=X[U];if(Q.length===0)continue;let z=(0,gW.propertyInData)(W,Y,U,J.opts.ownProperties);if($.setParams({property:U,depsCount:Q.length,deps:Q.join(", ")}),J.allErrors)W.if(z,()=>{for(let H of Q)(0,gW.checkReportMissingProp)($,H)});else W.if(T5._`${z} && (${(0,gW.checkMissingProp)($,Q,G)})`),(0,gW.reportMissingProp)($,G),W.else()}}BA.validatePropertyDeps=NA;function DA($,X=$.schema){let{gen:W,data:Y,keyword:J,it:G}=$,U=W.name("valid");for(let Q in X){if((0,ig.alwaysValidSchema)(G,X[Q]))continue;W.if((0,gW.propertyInData)(W,Y,Q,G.opts.ownProperties),()=>{let z=$.subschema({keyword:J,schemaProp:Q},U);$.mergeValidEvaluated(z,U)},()=>W.var(U,!0)),$.ok(U)}}BA.validateSchemaDeps=DA;BA.default=ng});var vA=v((KA)=>{Object.defineProperty(KA,"__esModule",{value:!0});var bA=e(),dg=I$(),og={message:"property name must be valid",params:({params:$})=>bA._`{propertyName: ${$.propertyName}}`},tg={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:og,code($){let{gen:X,schema:W,data:Y,it:J}=$;if((0,dg.alwaysValidSchema)(J,W))return;let G=X.name("valid");X.forIn("key",Y,(U)=>{$.setParams({propertyName:U}),$.subschema({keyword:"propertyNames",data:U,dataTypes:["string"],propertyName:U,compositeRule:!0},G),X.if((0,bA.not)(G),()=>{if($.error(!0),!J.allErrors)X.break()})}),$.ok(G)}};KA.default=tg});var C5=v((qA)=>{Object.defineProperty(qA,"__esModule",{value:!0});var XG=Z4(),d4=e(),sg=F6(),WG=I$(),eg={message:"must NOT have additional properties",params:({params:$})=>d4._`{additionalProperty: ${$.additionalProperty}}`},$f={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:eg,code($){let{gen:X,schema:W,parentSchema:Y,data:J,errsCount:G,it:U}=$;if(!G)throw Error("ajv implementation error");let{allErrors:Q,opts:z}=U;if(U.props=!0,z.removeAdditional!=="all"&&(0,WG.alwaysValidSchema)(U,W))return;let H=(0,XG.allSchemaProperties)(Y.properties),j=(0,XG.allSchemaProperties)(Y.patternProperties);O(),$.ok(d4._`${G} === ${sg.default.errors}`);function O(){X.forIn("key",J,(w)=>{if(!H.length&&!j.length)N(w);else X.if(B(w),()=>N(w))})}function B(w){let V;if(H.length>8){let K=(0,WG.schemaRefOrVal)(U,Y.properties,"properties");V=(0,XG.isOwnProperty)(X,K,w)}else if(H.length)V=(0,d4.or)(...H.map((K)=>d4._`${w} === ${K}`));else V=d4.nil;if(j.length)V=(0,d4.or)(V,...j.map((K)=>d4._`${(0,XG.usePattern)($,K)}.test(${w})`));return(0,d4.not)(V)}function I(w){X.code(d4._`delete ${J}[${w}]`)}function N(w){if(z.removeAdditional==="all"||z.removeAdditional&&W===!1){I(w);return}if(W===!1){if($.setParams({additionalProperty:w}),$.error(),!Q)X.break();return}if(typeof W=="object"&&!(0,WG.alwaysValidSchema)(U,W)){let V=X.name("valid");if(z.removeAdditional==="failing")D(w,V,!1),X.if((0,d4.not)(V),()=>{$.reset(),I(w)});else if(D(w,V),!Q)X.if((0,d4.not)(V),()=>X.break())}}function D(w,V,K){let b={keyword:"additionalProperties",dataProp:w,dataPropType:WG.Type.Str};if(K===!1)Object.assign(b,{compositeRule:!0,createErrors:!1,allErrors:!1});$.subschema(b,V)}}};qA.default=$f});var SA=v((MA)=>{Object.defineProperty(MA,"__esModule",{value:!0});var Wf=EW(),LA=Z4(),_5=I$(),FA=C5(),Jf={keyword:"properties",type:"object",schemaType:"object",code($){let{gen:X,schema:W,parentSchema:Y,data:J,it:G}=$;if(G.opts.removeAdditional==="all"&&Y.additionalProperties===void 0)FA.default.code(new Wf.KeywordCxt(G,FA.default,"additionalProperties"));let U=(0,LA.allSchemaProperties)(W);for(let O of U)G.definedProperties.add(O);if(G.opts.unevaluated&&U.length&&G.props!==!0)G.props=_5.mergeEvaluated.props(X,(0,_5.toHash)(U),G.props);let Q=U.filter((O)=>!(0,_5.alwaysValidSchema)(G,W[O]));if(Q.length===0)return;let z=X.name("valid");for(let O of Q){if(H(O))j(O);else{if(X.if((0,LA.propertyInData)(X,J,O,G.opts.ownProperties)),j(O),!G.allErrors)X.else().var(z,!0);X.endIf()}$.it.definedProperties.add(O),$.ok(z)}function H(O){return G.opts.useDefaults&&!G.compositeRule&&W[O].default!==void 0}function j(O){$.subschema({keyword:"properties",schemaProp:O,dataProp:O},z)}}};MA.default=Jf});var kA=v((ZA)=>{Object.defineProperty(ZA,"__esModule",{value:!0});var EA=Z4(),JG=e(),PA=I$(),RA=I$(),Gf={keyword:"patternProperties",type:"object",schemaType:"object",code($){let{gen:X,schema:W,data:Y,parentSchema:J,it:G}=$,{opts:U}=G,Q=(0,EA.allSchemaProperties)(W),z=Q.filter((D)=>(0,PA.alwaysValidSchema)(G,W[D]));if(Q.length===0||z.length===Q.length&&(!G.opts.unevaluated||G.props===!0))return;let H=U.strictSchema&&!U.allowMatchingProperties&&J.properties,j=X.name("valid");if(G.props!==!0&&!(G.props instanceof JG.Name))G.props=(0,RA.evaluatedPropsToName)(X,G.props);let{props:O}=G;B();function B(){for(let D of Q){if(H)I(D);if(G.allErrors)N(D);else X.var(j,!0),N(D),X.if(j)}}function I(D){for(let w in H)if(new RegExp(D).test(w))(0,PA.checkStrictMode)(G,`property ${w} matches pattern ${D} (use allowMatchingProperties)`)}function N(D){X.forIn("key",Y,(w)=>{X.if(JG._`${(0,EA.usePattern)($,D)}.test(${w})`,()=>{let V=z.includes(D);if(!V)$.subschema({keyword:"patternProperties",schemaProp:D,dataProp:w,dataPropType:RA.Type.Str},j);if(G.opts.unevaluated&&O!==!0)X.assign(JG._`${O}[${w}]`,!0);else if(!V&&!G.allErrors)X.if((0,JG.not)(j),()=>X.break())})})}}};ZA.default=Gf});var CA=v((TA)=>{Object.defineProperty(TA,"__esModule",{value:!0});var Qf=I$(),zf={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code($){let{gen:X,schema:W,it:Y}=$;if((0,Qf.alwaysValidSchema)(Y,W)){$.fail();return}let J=X.name("valid");$.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},J),$.failResult(J,()=>$.reset(),()=>$.error())},error:{message:"must NOT be valid"}};TA.default=zf});var xA=v((_A)=>{Object.defineProperty(_A,"__esModule",{value:!0});var jf=Z4(),If={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:jf.validateUnion,error:{message:"must match a schema in anyOf"}};_A.default=If});var yA=v((uA)=>{Object.defineProperty(uA,"__esModule",{value:!0});var YG=e(),Nf=I$(),Df={message:"must match exactly one schema in oneOf",params:({params:$})=>YG._`{passingSchemas: ${$.passing}}`},Bf={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Df,code($){let{gen:X,schema:W,parentSchema:Y,it:J}=$;if(!Array.isArray(W))throw Error("ajv implementation error");if(J.opts.discriminator&&Y.discriminator)return;let G=W,U=X.let("valid",!1),Q=X.let("passing",null),z=X.name("_valid");$.setParams({passing:Q}),X.block(H),$.result(U,()=>$.reset(),()=>$.error(!0));function H(){G.forEach((j,O)=>{let B;if((0,Nf.alwaysValidSchema)(J,j))X.var(z,!0);else B=$.subschema({keyword:"oneOf",schemaProp:O,compositeRule:!0},z);if(O>0)X.if(YG._`${z} && ${U}`).assign(U,!1).assign(Q,YG._`[${Q}, ${O}]`).else();X.if(z,()=>{if(X.assign(U,!0),X.assign(Q,O),B)$.mergeEvaluated(B,YG.Name)})})}}};uA.default=Bf});var fA=v((gA)=>{Object.defineProperty(gA,"__esModule",{value:!0});var Vf=I$(),Af={keyword:"allOf",schemaType:"array",code($){let{gen:X,schema:W,it:Y}=$;if(!Array.isArray(W))throw Error("ajv implementation error");let J=X.name("valid");W.forEach((G,U)=>{if((0,Vf.alwaysValidSchema)(Y,G))return;let Q=$.subschema({keyword:"allOf",schemaProp:U},J);$.ok(J),$.mergeEvaluated(Q)})}};gA.default=Af});var iA=v((mA)=>{Object.defineProperty(mA,"__esModule",{value:!0});var GG=e(),lA=I$(),Kf={message:({params:$})=>GG.str`must match "${$.ifClause}" schema`,params:({params:$})=>GG._`{failingKeyword: ${$.ifClause}}`},vf={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:Kf,code($){let{gen:X,parentSchema:W,it:Y}=$;if(W.then===void 0&&W.else===void 0)(0,lA.checkStrictMode)(Y,'"if" without "then" and "else" is ignored');let J=hA(Y,"then"),G=hA(Y,"else");if(!J&&!G)return;let U=X.let("valid",!0),Q=X.name("_valid");if(z(),$.reset(),J&&G){let j=X.let("ifClause");$.setParams({ifClause:j}),X.if(Q,H("then",j),H("else",j))}else if(J)X.if(Q,H("then"));else X.if((0,GG.not)(Q),H("else"));$.pass(U,()=>$.error(!0));function z(){let j=$.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},Q);$.mergeEvaluated(j)}function H(j,O){return()=>{let B=$.subschema({keyword:j},Q);if(X.assign(U,Q),$.mergeValidEvaluated(B,U),O)X.assign(O,GG._`${j}`);else $.setParams({ifClause:j})}}}};function hA($,X){let W=$.schema[X];return W!==void 0&&!(0,lA.alwaysValidSchema)($,W)}mA.default=vf});var cA=v((nA)=>{Object.defineProperty(nA,"__esModule",{value:!0});var Lf=I$(),Ff={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:$,parentSchema:X,it:W}){if(X.if===void 0)(0,Lf.checkStrictMode)(W,`"${$}" without "if" is ignored`)}};nA.default=Ff});var pA=v((rA)=>{Object.defineProperty(rA,"__esModule",{value:!0});var Sf=Z5(),Ef=QA(),Pf=k5(),Rf=jA(),Zf=OA(),kf=AA(),Tf=vA(),Cf=C5(),_f=SA(),xf=kA(),uf=CA(),yf=xA(),gf=yA(),ff=fA(),hf=iA(),lf=cA();function mf($=!1){let X=[uf.default,yf.default,gf.default,ff.default,hf.default,lf.default,Tf.default,Cf.default,kf.default,_f.default,xf.default];if($)X.push(Ef.default,Rf.default);else X.push(Sf.default,Pf.default);return X.push(Zf.default),X}rA.default=mf});var oA=v((dA)=>{Object.defineProperty(dA,"__esModule",{value:!0});var y$=e(),cf={message:({schemaCode:$})=>y$.str`must match format "${$}"`,params:({schemaCode:$})=>y$._`{format: ${$}}`},rf={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:cf,code($,X){let{gen:W,data:Y,$data:J,schema:G,schemaCode:U,it:Q}=$,{opts:z,errSchemaPath:H,schemaEnv:j,self:O}=Q;if(!z.validateFormats)return;if(J)B();else I();function B(){let N=W.scopeValue("formats",{ref:O.formats,code:z.code.formats}),D=W.const("fDef",y$._`${N}[${U}]`),w=W.let("fType"),V=W.let("format");W.if(y$._`typeof ${D} == "object" && !(${D} instanceof RegExp)`,()=>W.assign(w,y$._`${D}.type || "string"`).assign(V,y$._`${D}.validate`),()=>W.assign(w,y$._`"string"`).assign(V,D)),$.fail$data((0,y$.or)(K(),b()));function K(){if(z.strictSchema===!1)return y$.nil;return y$._`${U} && !${V}`}function b(){let S=j.$async?y$._`(${D}.async ? await ${V}(${Y}) : ${V}(${Y}))`:y$._`${V}(${Y})`,L=y$._`(typeof ${V} == "function" ? ${S} : ${V}.test(${Y}))`;return y$._`${V} && ${V} !== true && ${w} === ${X} && !${L}`}}function I(){let N=O.formats[G];if(!N){K();return}if(N===!0)return;let[D,w,V]=b(N);if(D===X)$.pass(S());function K(){if(z.strictSchema===!1){O.logger.warn(L());return}throw Error(L());function L(){return`unknown format "${G}" ignored in schema at path "${H}"`}}function b(L){let l=L instanceof RegExp?(0,y$.regexpCode)(L):z.code.formats?y$._`${z.code.formats}${(0,y$.getProperty)(G)}`:void 0,V$=W.scopeValue("formats",{key:G,ref:L,code:l});if(typeof L=="object"&&!(L instanceof RegExp))return[L.type||"string",L.validate,y$._`${V$}.validate`];return["string",L,V$]}function S(){if(typeof N=="object"&&!(N instanceof RegExp)&&N.async){if(!j.$async)throw Error("async format in sync schema");return y$._`await ${V}(${Y})`}return typeof w=="function"?y$._`${V}(${Y})`:y$._`${V}.test(${Y})`}}}};dA.default=rf});var aA=v((tA)=>{Object.defineProperty(tA,"__esModule",{value:!0});var df=oA(),of=[df.default];tA.default=of});var $b=v((sA)=>{Object.defineProperty(sA,"__esModule",{value:!0});sA.contentVocabulary=sA.metadataVocabulary=void 0;sA.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];sA.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Jb=v((Wb)=>{Object.defineProperty(Wb,"__esModule",{value:!0});var sf=MV(),ef=sV(),$h=pA(),Xh=aA(),Xb=$b(),Wh=[sf.default,ef.default,(0,$h.default)(),Xh.default,Xb.metadataVocabulary,Xb.contentVocabulary];Wb.default=Wh});var Qb=v((Gb)=>{Object.defineProperty(Gb,"__esModule",{value:!0});Gb.DiscrError=void 0;var Yb;(function($){$.Tag="tag",$.Mapping="mapping"})(Yb||(Gb.DiscrError=Yb={}))});var jb=v((Hb)=>{Object.defineProperty(Hb,"__esModule",{value:!0});var q0=e(),x5=Qb(),zb=n8(),Yh=PW(),Gh=I$(),Uh={message:({params:{discrError:$,tagName:X}})=>$===x5.DiscrError.Tag?`tag "${X}" must be string`:`value of tag "${X}" must be in oneOf`,params:({params:{discrError:$,tag:X,tagName:W}})=>q0._`{error: ${$}, tag: ${W}, tagValue: ${X}}`},Qh={keyword:"discriminator",type:"object",schemaType:"object",error:Uh,code($){let{gen:X,data:W,schema:Y,parentSchema:J,it:G}=$,{oneOf:U}=J;if(!G.opts.discriminator)throw Error("discriminator: requires discriminator option");let Q=Y.propertyName;if(typeof Q!="string")throw Error("discriminator: requires propertyName");if(Y.mapping)throw Error("discriminator: mapping is not supported");if(!U)throw Error("discriminator: requires oneOf keyword");let z=X.let("valid",!1),H=X.const("tag",q0._`${W}${(0,q0.getProperty)(Q)}`);X.if(q0._`typeof ${H} == "string"`,()=>j(),()=>$.error(!1,{discrError:x5.DiscrError.Tag,tag:H,tagName:Q})),$.ok(z);function j(){let I=B();X.if(!1);for(let N in I)X.elseIf(q0._`${H} === ${N}`),X.assign(z,O(I[N]));X.else(),$.error(!1,{discrError:x5.DiscrError.Mapping,tag:H,tagName:Q}),X.endIf()}function O(I){let N=X.name("valid"),D=$.subschema({keyword:"oneOf",schemaProp:I},N);return $.mergeEvaluated(D,q0.Name),N}function B(){var I;let N={},D=V(J),w=!0;for(let S=0;S<U.length;S++){let L=U[S];if((L===null||L===void 0?void 0:L.$ref)&&!(0,Gh.schemaHasRulesButRef)(L,G.self.RULES)){let V$=L.$ref;if(L=zb.resolveRef.call(G.self,G.schemaEnv.root,G.baseId,V$),L instanceof zb.SchemaEnv)L=L.schema;if(L===void 0)throw new Yh.default(G.opts.uriResolver,G.baseId,V$)}let l=(I=L===null||L===void 0?void 0:L.properties)===null||I===void 0?void 0:I[Q];if(typeof l!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${Q}"`);w=w&&(D||V(L)),K(l,S)}if(!w)throw Error(`discriminator: "${Q}" must be required`);return N;function V({required:S}){return Array.isArray(S)&&S.includes(Q)}function K(S,L){if(S.const)b(S.const,L);else if(S.enum)for(let l of S.enum)b(l,L);else throw Error(`discriminator: "properties/${Q}" must have "const" or "enum"`)}function b(S,L){if(typeof S!="string"||S in N)throw Error(`discriminator: "${Q}" values must be unique strings`);N[S]=L}}}};Hb.default=Qh});var Ib=v((qa,Hh)=>{Hh.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Nb=v((K4,u5)=>{Object.defineProperty(K4,"__esModule",{value:!0});K4.MissingRefError=K4.ValidationError=K4.CodeGen=K4.Name=K4.nil=K4.stringify=K4.str=K4._=K4.KeywordCxt=K4.Ajv=void 0;var jh=BV(),Ih=Jb(),Oh=jb(),Ob=Ib(),Nh=["/properties"],UG="http://json-schema.org/draft-07/schema";class fW extends jh.default{_addVocabularies(){if(super._addVocabularies(),Ih.default.forEach(($)=>this.addVocabulary($)),this.opts.discriminator)this.addKeyword(Oh.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let $=this.opts.$data?this.$dataMetaSchema(Ob,Nh):Ob;this.addMetaSchema($,UG,!1),this.refs["http://json-schema.org/schema"]=UG}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(UG)?UG:void 0)}}K4.Ajv=fW;u5.exports=K4=fW;u5.exports.Ajv=fW;Object.defineProperty(K4,"__esModule",{value:!0});K4.default=fW;var Dh=EW();Object.defineProperty(K4,"KeywordCxt",{enumerable:!0,get:function(){return Dh.KeywordCxt}});var L0=e();Object.defineProperty(K4,"_",{enumerable:!0,get:function(){return L0._}});Object.defineProperty(K4,"str",{enumerable:!0,get:function(){return L0.str}});Object.defineProperty(K4,"stringify",{enumerable:!0,get:function(){return L0.stringify}});Object.defineProperty(K4,"nil",{enumerable:!0,get:function(){return L0.nil}});Object.defineProperty(K4,"Name",{enumerable:!0,get:function(){return L0.Name}});Object.defineProperty(K4,"CodeGen",{enumerable:!0,get:function(){return L0.CodeGen}});var Bh=m8();Object.defineProperty(K4,"ValidationError",{enumerable:!0,get:function(){return Bh.default}});var wh=PW();Object.defineProperty(K4,"MissingRefError",{enumerable:!0,get:function(){return wh.default}})});var Bb=v((Db)=>{Object.defineProperty(Db,"__esModule",{value:!0});Db.formatLimitDefinition=void 0;var bh=Nb(),o4=e(),s6=o4.operators,QG={formatMaximum:{okStr:"<=",ok:s6.LTE,fail:s6.GT},formatMinimum:{okStr:">=",ok:s6.GTE,fail:s6.LT},formatExclusiveMaximum:{okStr:"<",ok:s6.LT,fail:s6.GTE},formatExclusiveMinimum:{okStr:">",ok:s6.GT,fail:s6.LTE}},Kh={message:({keyword:$,schemaCode:X})=>o4.str`should be ${QG[$].okStr} ${X}`,params:({keyword:$,schemaCode:X})=>o4._`{comparison: ${QG[$].okStr}, limit: ${X}}`};Db.formatLimitDefinition={keyword:Object.keys(QG),type:"string",schemaType:"string",$data:!0,error:Kh,code($){let{gen:X,data:W,schemaCode:Y,keyword:J,it:G}=$,{opts:U,self:Q}=G;if(!U.validateFormats)return;let z=new bh.KeywordCxt(G,Q.RULES.all.format.definition,"format");if(z.$data)H();else j();function H(){let B=X.scopeValue("formats",{ref:Q.formats,code:U.code.formats}),I=X.const("fmt",o4._`${B}[${z.schemaCode}]`);$.fail$data((0,o4.or)(o4._`typeof ${I} != "object"`,o4._`${I} instanceof RegExp`,o4._`typeof ${I}.compare != "function"`,O(I)))}function j(){let B=z.schema,I=Q.formats[B];if(!I||I===!0)return;if(typeof I!="object"||I instanceof RegExp||typeof I.compare!="function")throw Error(`"${J}": format "${B}" does not define "compare" function`);let N=X.scopeValue("formats",{key:B,ref:I,code:U.code.formats?o4._`${U.code.formats}${(0,o4.getProperty)(B)}`:void 0});$.fail$data(O(N))}function O(B){return o4._`${B}.compare(${W}, ${Y}) ${QG[J].fail} 0`}},dependencies:["format"]};var vh=($)=>{return $.addKeyword(Db.formatLimitDefinition),$};Db.default=vh});var bb=v((hW,Ab)=>{Object.defineProperty(hW,"__esModule",{value:!0});var F0=IB(),Lh=Bb(),g5=e(),wb=new g5.Name("fullFormats"),Fh=new g5.Name("fastFormats"),f5=($,X={keywords:!0})=>{if(Array.isArray(X))return Vb($,X,F0.fullFormats,wb),$;let[W,Y]=X.mode==="fast"?[F0.fastFormats,Fh]:[F0.fullFormats,wb],J=X.formats||F0.formatNames;if(Vb($,J,W,Y),X.keywords)(0,Lh.default)($);return $};f5.get=($,X="full")=>{let Y=(X==="fast"?F0.fastFormats:F0.fullFormats)[$];if(!Y)throw Error(`Unknown format "${$}"`);return Y};function Vb($,X,W,Y){var J,G;(J=(G=$.opts.code).formats)!==null&&J!==void 0||(G.formats=g5._`require("ajv-formats/dist/formats").${Y}`);for(let U of X)$.addFormat(U,W[U])}Ab.exports=hW=f5;Object.defineProperty(hW,"__esModule",{value:!0});hW.default=f5});var Zb=v((Xs,Ch)=>{Ch.exports={name:"dotenv",version:"16.6.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var xb=v((Ws,P6)=>{var p5=pW("fs"),zG=pW("path"),_h=pW("os"),xh=pW("crypto"),uh=Zb(),d5=uh.version,yh=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function gh($){let X={},W=$.toString();W=W.replace(/\r\n?/mg,`
|
|
17
|
+
`);let Y;while((Y=yh.exec(W))!=null){let J=Y[1],G=Y[2]||"";G=G.trim();let U=G[0];if(G=G.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),U==='"')G=G.replace(/\\n/g,`
|
|
18
|
+
`),G=G.replace(/\\r/g,"\r");X[J]=G}return X}function fh($){$=$||{};let X=_b($);$.path=X;let W=h$.configDotenv($);if(!W.parsed){let U=Error(`MISSING_DATA: Cannot parse ${X} for an unknown reason`);throw U.code="MISSING_DATA",U}let Y=Cb($).split(","),J=Y.length,G;for(let U=0;U<J;U++)try{let Q=Y[U].trim(),z=lh(W,Q);G=h$.decrypt(z.ciphertext,z.key);break}catch(Q){if(U+1>=J)throw Q}return h$.parse(G)}function hh($){console.log(`[dotenv@${d5}][WARN] ${$}`)}function mW($){console.log(`[dotenv@${d5}][DEBUG] ${$}`)}function Tb($){console.log(`[dotenv@${d5}] ${$}`)}function Cb($){if($&&$.DOTENV_KEY&&$.DOTENV_KEY.length>0)return $.DOTENV_KEY;if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0)return process.env.DOTENV_KEY;return""}function lh($,X){let W;try{W=new URL(X)}catch(Q){if(Q.code==="ERR_INVALID_URL"){let z=Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw z.code="INVALID_DOTENV_KEY",z}throw Q}let Y=W.password;if(!Y){let Q=Error("INVALID_DOTENV_KEY: Missing key part");throw Q.code="INVALID_DOTENV_KEY",Q}let J=W.searchParams.get("environment");if(!J){let Q=Error("INVALID_DOTENV_KEY: Missing environment part");throw Q.code="INVALID_DOTENV_KEY",Q}let G=`DOTENV_VAULT_${J.toUpperCase()}`,U=$.parsed[G];if(!U){let Q=Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${G} in your .env.vault file.`);throw Q.code="NOT_FOUND_DOTENV_ENVIRONMENT",Q}return{ciphertext:U,key:Y}}function _b($){let X=null;if($&&$.path&&$.path.length>0)if(Array.isArray($.path)){for(let W of $.path)if(p5.existsSync(W))X=W.endsWith(".vault")?W:`${W}.vault`}else X=$.path.endsWith(".vault")?$.path:`${$.path}.vault`;else X=zG.resolve(process.cwd(),".env.vault");if(p5.existsSync(X))return X;return null}function kb($){return $[0]==="~"?zG.join(_h.homedir(),$.slice(1)):$}function mh($){let X=Boolean($&&$.debug),W=$&&"quiet"in $?$.quiet:!0;if(X||!W)Tb("Loading env from encrypted .env.vault");let Y=h$._parseVault($),J=process.env;if($&&$.processEnv!=null)J=$.processEnv;return h$.populate(J,Y,$),{parsed:Y}}function ih($){let X=zG.resolve(process.cwd(),".env"),W="utf8",Y=Boolean($&&$.debug),J=$&&"quiet"in $?$.quiet:!0;if($&&$.encoding)W=$.encoding;else if(Y)mW("No encoding is specified. UTF-8 is used by default");let G=[X];if($&&$.path)if(!Array.isArray($.path))G=[kb($.path)];else{G=[];for(let H of $.path)G.push(kb(H))}let U,Q={};for(let H of G)try{let j=h$.parse(p5.readFileSync(H,{encoding:W}));h$.populate(Q,j,$)}catch(j){if(Y)mW(`Failed to load ${H} ${j.message}`);U=j}let z=process.env;if($&&$.processEnv!=null)z=$.processEnv;if(h$.populate(z,Q,$),Y||!J){let H=Object.keys(Q).length,j=[];for(let O of G)try{let B=zG.relative(process.cwd(),O);j.push(B)}catch(B){if(Y)mW(`Failed to load ${O} ${B.message}`);U=B}Tb(`injecting env (${H}) from ${j.join(",")}`)}if(U)return{parsed:Q,error:U};else return{parsed:Q}}function nh($){if(Cb($).length===0)return h$.configDotenv($);let X=_b($);if(!X)return hh(`You set DOTENV_KEY but you are missing a .env.vault file at ${X}. Did you forget to build it?`),h$.configDotenv($);return h$._configVault($)}function ch($,X){let W=Buffer.from(X.slice(-64),"hex"),Y=Buffer.from($,"base64"),J=Y.subarray(0,12),G=Y.subarray(-16);Y=Y.subarray(12,-16);try{let U=xh.createDecipheriv("aes-256-gcm",W,J);return U.setAuthTag(G),`${U.update(Y)}${U.final()}`}catch(U){let Q=U instanceof RangeError,z=U.message==="Invalid key length",H=U.message==="Unsupported state or unable to authenticate data";if(Q||z){let j=Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw j.code="INVALID_DOTENV_KEY",j}else if(H){let j=Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw j.code="DECRYPTION_FAILED",j}else throw U}}function rh($,X,W={}){let Y=Boolean(W&&W.debug),J=Boolean(W&&W.override);if(typeof X!=="object"){let G=Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw G.code="OBJECT_REQUIRED",G}for(let G of Object.keys(X))if(Object.prototype.hasOwnProperty.call($,G)){if(J===!0)$[G]=X[G];if(Y)if(J===!0)mW(`"${G}" is already defined and WAS overwritten`);else mW(`"${G}" is already defined and was NOT overwritten`)}else $[G]=X[G]}var h$={configDotenv:ih,_configVault:mh,_parseVault:fh,config:nh,decrypt:ch,parse:gh,populate:rh};Ws.configDotenv=h$.configDotenv;Ws._configVault=h$._configVault;Ws._parseVault=h$._parseVault;Ws.config=h$.config;Ws.decrypt=h$.decrypt;Ws.parse=h$.parse;Ws.populate=h$.populate;P6.exports=h$});var J$;(function($){$.assertEqual=(J)=>{};function X(J){}$.assertIs=X;function W(J){throw Error()}$.assertNever=W,$.arrayToEnum=(J)=>{let G={};for(let U of J)G[U]=U;return G},$.getValidEnumValues=(J)=>{let G=$.objectKeys(J).filter((Q)=>typeof J[J[Q]]!=="number"),U={};for(let Q of G)U[Q]=J[Q];return $.objectValues(U)},$.objectValues=(J)=>{return $.objectKeys(J).map(function(G){return J[G]})},$.objectKeys=typeof Object.keys==="function"?(J)=>Object.keys(J):(J)=>{let G=[];for(let U in J)if(Object.prototype.hasOwnProperty.call(J,U))G.push(U);return G},$.find=(J,G)=>{for(let U of J)if(G(U))return U;return},$.isInteger=typeof Number.isInteger==="function"?(J)=>Number.isInteger(J):(J)=>typeof J==="number"&&Number.isFinite(J)&&Math.floor(J)===J;function Y(J,G=" | "){return J.map((U)=>typeof U==="string"?`'${U}'`:U).join(G)}$.joinValues=Y,$.jsonStringifyReplacer=(J,G)=>{if(typeof G==="bigint")return G.toString();return G}})(J$||(J$={}));var YH;(function($){$.mergeShapes=(X,W)=>{return{...X,...W}}})(YH||(YH={}));var _=J$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),j6=($)=>{switch(typeof $){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN($)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":if(Array.isArray($))return _.array;if($===null)return _.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return _.promise;if(typeof Map<"u"&&$ instanceof Map)return _.map;if(typeof Set<"u"&&$ instanceof Set)return _.set;if(typeof Date<"u"&&$ instanceof Date)return _.date;return _.object;default:return _.unknown}};var E=J$.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"]);class q4 extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(W)=>{this.issues=[...this.issues,W]},this.addIssues=(W=[])=>{this.issues=[...this.issues,...W]};let X=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,X);else this.__proto__=X;this.name="ZodError",this.issues=$}format($){let X=$||function(J){return J.message},W={_errors:[]},Y=(J)=>{for(let G of J.issues)if(G.code==="invalid_union")G.unionErrors.map(Y);else if(G.code==="invalid_return_type")Y(G.returnTypeError);else if(G.code==="invalid_arguments")Y(G.argumentsError);else if(G.path.length===0)W._errors.push(X(G));else{let U=W,Q=0;while(Q<G.path.length){let z=G.path[Q];if(Q!==G.path.length-1)U[z]=U[z]||{_errors:[]};else U[z]=U[z]||{_errors:[]},U[z]._errors.push(X(G));U=U[z],Q++}}};return Y(this),W}static assert($){if(!($ instanceof q4))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,J$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(X)=>X.message){let X=Object.create(null),W=[];for(let Y of this.issues)if(Y.path.length>0){let J=Y.path[0];X[J]=X[J]||[],X[J].push($(Y))}else W.push($(Y));return{formErrors:W,fieldErrors:X}}get formErrors(){return this.flatten()}}q4.create=($)=>{return new q4($)};var AK=($,X)=>{let W;switch($.code){case E.invalid_type:if($.received===_.undefined)W="Required";else W=`Expected ${$.expected}, received ${$.received}`;break;case E.invalid_literal:W=`Invalid literal value, expected ${JSON.stringify($.expected,J$.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:W=`Unrecognized key(s) in object: ${J$.joinValues($.keys,", ")}`;break;case E.invalid_union:W="Invalid input";break;case E.invalid_union_discriminator:W=`Invalid discriminator value. Expected ${J$.joinValues($.options)}`;break;case E.invalid_enum_value:W=`Invalid enum value. Expected ${J$.joinValues($.options)}, received '${$.received}'`;break;case E.invalid_arguments:W="Invalid function arguments";break;case E.invalid_return_type:W="Invalid function return type";break;case E.invalid_date:W="Invalid date";break;case E.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(W=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")W=`${W} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)W=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)W=`Invalid input: must end with "${$.validation.endsWith}"`;else J$.assertNever($.validation);else if($.validation!=="regex")W=`Invalid ${$.validation}`;else W="Invalid";break;case E.too_small:if($.type==="array")W=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")W=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")W=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")W=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")W=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else W="Invalid input";break;case E.too_big:if($.type==="array")W=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")W=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")W=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")W=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")W=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else W="Invalid input";break;case E.custom:W="Invalid input";break;case E.invalid_intersection_types:W="Intersection results could not be merged";break;case E.not_multiple_of:W=`Number must be a multiple of ${$.multipleOf}`;break;case E.not_finite:W="Number must be finite";break;default:W=X.defaultError,J$.assertNever($)}return{message:W}},R6=AK;var bK=R6;function S0(){return bK}var dW=($)=>{let{data:X,path:W,errorMaps:Y,issueData:J}=$,G=[...W,...J.path||[]],U={...J,path:G};if(J.message!==void 0)return{...J,path:G,message:J.message};let Q="",z=Y.filter((H)=>!!H).slice().reverse();for(let H of z)Q=H(U,{data:X,defaultError:Q}).message;return{...J,path:G,message:Q}};function x($,X){let W=S0(),Y=dW({issueData:X,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,W,W===R6?void 0:R6].filter((J)=>!!J)});$.common.issues.push(Y)}class p${constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,X){let W=[];for(let Y of X){if(Y.status==="aborted")return m;if(Y.status==="dirty")$.dirty();W.push(Y.value)}return{status:$.value,value:W}}static async mergeObjectAsync($,X){let W=[];for(let Y of X){let J=await Y.key,G=await Y.value;W.push({key:J,value:G})}return p$.mergeObjectSync($,W)}static mergeObjectSync($,X){let W={};for(let Y of X){let{key:J,value:G}=Y;if(J.status==="aborted")return m;if(G.status==="aborted")return m;if(J.status==="dirty")$.dirty();if(G.status==="dirty")$.dirty();if(J.value!=="__proto__"&&(typeof G.value<"u"||Y.alwaysSet))W[J.value]=G.value}return{status:$.value,value:W}}}var m=Object.freeze({status:"aborted"}),E1=($)=>({status:"dirty",value:$}),e$=($)=>({status:"valid",value:$}),wG=($)=>$.status==="aborted",VG=($)=>$.status==="dirty",W1=($)=>$.status==="valid",E0=($)=>typeof Promise<"u"&&$ instanceof Promise;var y;(function($){$.errToObj=(X)=>typeof X==="string"?{message:X}:X||{},$.toString=(X)=>typeof X==="string"?X:X?.message})(y||(y={}));class T4{constructor($,X,W,Y){this._cachedPath=[],this.parent=$,this.data=X,this._path=W,this._key=Y}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var GH=($,X)=>{if(W1(X))return{success:!0,data:X.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let W=new q4($.common.issues);return this._error=W,this._error}}}};function p($){if(!$)return{};let{errorMap:X,invalid_type_error:W,required_error:Y,description:J}=$;if(X&&(W||Y))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(X)return{errorMap:X,description:J};return{errorMap:(U,Q)=>{let{message:z}=$;if(U.code==="invalid_enum_value")return{message:z??Q.defaultError};if(typeof Q.data>"u")return{message:z??Y??Q.defaultError};if(U.code!=="invalid_type")return{message:Q.defaultError};return{message:z??W??Q.defaultError}},description:J}}class $${get description(){return this._def.description}_getType($){return j6($.data)}_getOrReturnCtx($,X){return X||{common:$.parent.common,data:$.data,parsedType:j6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new p$,ctx:{common:$.parent.common,data:$.data,parsedType:j6($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let X=this._parse($);if(E0(X))throw Error("Synchronous parse encountered promise.");return X}_parseAsync($){let X=this._parse($);return Promise.resolve(X)}parse($,X){let W=this.safeParse($,X);if(W.success)return W.data;throw W.error}safeParse($,X){let W={common:{issues:[],async:X?.async??!1,contextualErrorMap:X?.errorMap},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:j6($)},Y=this._parseSync({data:$,path:W.path,parent:W});return GH(W,Y)}"~validate"($){let X={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:j6($)};if(!this["~standard"].async)try{let W=this._parseSync({data:$,path:[],parent:X});return W1(W)?{value:W.value}:{issues:X.common.issues}}catch(W){if(W?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;X.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:X}).then((W)=>W1(W)?{value:W.value}:{issues:X.common.issues})}async parseAsync($,X){let W=await this.safeParseAsync($,X);if(W.success)return W.data;throw W.error}async safeParseAsync($,X){let W={common:{issues:[],contextualErrorMap:X?.errorMap,async:!0},path:X?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:j6($)},Y=this._parse({data:$,path:W.path,parent:W}),J=await(E0(Y)?Y:Promise.resolve(Y));return GH(W,J)}refine($,X){let W=(Y)=>{if(typeof X==="string"||typeof X>"u")return{message:X};else if(typeof X==="function")return X(Y);else return X};return this._refinement((Y,J)=>{let G=$(Y),U=()=>J.addIssue({code:E.custom,...W(Y)});if(typeof Promise<"u"&&G instanceof Promise)return G.then((Q)=>{if(!Q)return U(),!1;else return!0});if(!G)return U(),!1;else return!0})}refinement($,X){return this._refinement((W,Y)=>{if(!$(W))return Y.addIssue(typeof X==="function"?X(W,Y):X),!1;else return!0})}_refinement($){return new e4({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,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:(X)=>this["~validate"](X)}}optional(){return s4.create(this,this._def)}nullable(){return Z6.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return a4.create(this)}promise(){return T1.create(this,this._def)}or($){return T0.create([this,$],this._def)}and($){return C0.create(this,$,this._def)}transform($){return new e4({...p(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:$}})}default($){let X=typeof $==="function"?$:()=>$;return new y0({...p(this._def),innerType:this,defaultValue:X,typeName:R.ZodDefault})}brand(){return new vG({typeName:R.ZodBranded,type:this,...p(this._def)})}catch($){let X=typeof $==="function"?$:()=>$;return new g0({...p(this._def),innerType:this,catchValue:X,typeName:R.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return WJ.create(this,$)}readonly(){return f0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var KK=/^c[^\s-]{8,}$/i,vK=/^[0-9a-z]+$/,qK=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LK=/^[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,FK=/^[a-z0-9_-]{21}$/i,MK=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,SK=/^[-+]?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)?)??$/,EK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",AG,RK=/^(?:(?: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])$/,ZK=/^(?:(?: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])$/,kK=/^(([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]))$/,TK=/^(([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])$/,CK=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_K=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,UH="((\\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])))",xK=new RegExp(`^${UH}$`);function QH($){let X="[0-5]\\d";if($.precision)X=`${X}\\.\\d{${$.precision}}`;else if($.precision==null)X=`${X}(\\.\\d+)?`;let W=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${X})${W}`}function uK($){return new RegExp(`^${QH($)}$`)}function yK($){let X=`${UH}T${QH($)}`,W=[];if(W.push($.local?"Z?":"Z"),$.offset)W.push("([+-]\\d{2}:?\\d{2})");return X=`${X}(${W.join("|")})`,new RegExp(`^${X}$`)}function gK($,X){if((X==="v4"||!X)&&RK.test($))return!0;if((X==="v6"||!X)&&kK.test($))return!0;return!1}function fK($,X){if(!MK.test($))return!1;try{let[W]=$.split(".");if(!W)return!1;let Y=W.replace(/-/g,"+").replace(/_/g,"/").padEnd(W.length+(4-W.length%4)%4,"="),J=JSON.parse(atob(Y));if(typeof J!=="object"||J===null)return!1;if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(X&&J.alg!==X)return!1;return!0}catch{return!1}}function hK($,X){if((X==="v4"||!X)&&ZK.test($))return!0;if((X==="v6"||!X)&&TK.test($))return!0;return!1}class O6 extends $${_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==_.string){let J=this._getOrReturnCtx($);return x(J,{code:E.invalid_type,expected:_.string,received:J.parsedType}),m}let W=new p$,Y=void 0;for(let J of this._def.checks)if(J.kind==="min"){if($.data.length<J.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:E.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),W.dirty()}else if(J.kind==="max"){if($.data.length>J.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:E.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!1,message:J.message}),W.dirty()}else if(J.kind==="length"){let G=$.data.length>J.value,U=$.data.length<J.value;if(G||U){if(Y=this._getOrReturnCtx($,Y),G)x(Y,{code:E.too_big,maximum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});else if(U)x(Y,{code:E.too_small,minimum:J.value,type:"string",inclusive:!0,exact:!0,message:J.message});W.dirty()}}else if(J.kind==="email"){if(!EK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"email",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="emoji"){if(!AG)AG=new RegExp(PK,"u");if(!AG.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"emoji",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="uuid"){if(!LK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"uuid",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="nanoid"){if(!FK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"nanoid",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="cuid"){if(!KK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cuid",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="cuid2"){if(!vK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cuid2",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="ulid"){if(!qK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"ulid",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="url")try{new URL($.data)}catch{Y=this._getOrReturnCtx($,Y),x(Y,{validation:"url",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="regex"){if(J.regex.lastIndex=0,!J.regex.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"regex",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="trim")$.data=$.data.trim();else if(J.kind==="includes"){if(!$.data.includes(J.value,J.position))Y=this._getOrReturnCtx($,Y),x(Y,{code:E.invalid_string,validation:{includes:J.value,position:J.position},message:J.message}),W.dirty()}else if(J.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(J.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(J.kind==="startsWith"){if(!$.data.startsWith(J.value))Y=this._getOrReturnCtx($,Y),x(Y,{code:E.invalid_string,validation:{startsWith:J.value},message:J.message}),W.dirty()}else if(J.kind==="endsWith"){if(!$.data.endsWith(J.value))Y=this._getOrReturnCtx($,Y),x(Y,{code:E.invalid_string,validation:{endsWith:J.value},message:J.message}),W.dirty()}else if(J.kind==="datetime"){if(!yK(J).test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:E.invalid_string,validation:"datetime",message:J.message}),W.dirty()}else if(J.kind==="date"){if(!xK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:E.invalid_string,validation:"date",message:J.message}),W.dirty()}else if(J.kind==="time"){if(!uK(J).test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{code:E.invalid_string,validation:"time",message:J.message}),W.dirty()}else if(J.kind==="duration"){if(!SK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"duration",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="ip"){if(!gK($.data,J.version))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"ip",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="jwt"){if(!fK($.data,J.alg))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"jwt",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="cidr"){if(!hK($.data,J.version))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"cidr",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="base64"){if(!CK.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"base64",code:E.invalid_string,message:J.message}),W.dirty()}else if(J.kind==="base64url"){if(!_K.test($.data))Y=this._getOrReturnCtx($,Y),x(Y,{validation:"base64url",code:E.invalid_string,message:J.message}),W.dirty()}else J$.assertNever(J);return{status:W.value,value:$.data}}_regex($,X,W){return this.refinement((Y)=>$.test(Y),{validation:X,code:E.invalid_string,...y.errToObj(W)})}_addCheck($){return new O6({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...y.errToObj($)})}url($){return this._addCheck({kind:"url",...y.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...y.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...y.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...y.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...y.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...y.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...y.errToObj($)})}base64($){return this._addCheck({kind:"base64",...y.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...y.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...y.errToObj($)})}ip($){return this._addCheck({kind:"ip",...y.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...y.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...y.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...y.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...y.errToObj($)})}regex($,X){return this._addCheck({kind:"regex",regex:$,...y.errToObj(X)})}includes($,X){return this._addCheck({kind:"includes",value:$,position:X?.position,...y.errToObj(X?.message)})}startsWith($,X){return this._addCheck({kind:"startsWith",value:$,...y.errToObj(X)})}endsWith($,X){return this._addCheck({kind:"endsWith",value:$,...y.errToObj(X)})}min($,X){return this._addCheck({kind:"min",value:$,...y.errToObj(X)})}max($,X){return this._addCheck({kind:"max",value:$,...y.errToObj(X)})}length($,X){return this._addCheck({kind:"length",value:$,...y.errToObj(X)})}nonempty($){return this.min(1,y.errToObj($))}trim(){return new O6({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new O6({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new O6({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxLength(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}O6.create=($)=>{return new O6({checks:[],typeName:R.ZodString,coerce:$?.coerce??!1,...p($)})};function lK($,X){let W=($.toString().split(".")[1]||"").length,Y=(X.toString().split(".")[1]||"").length,J=W>Y?W:Y,G=Number.parseInt($.toFixed(J).replace(".","")),U=Number.parseInt(X.toFixed(J).replace(".",""));return G%U/10**J}class R1 extends $${constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==_.number){let J=this._getOrReturnCtx($);return x(J,{code:E.invalid_type,expected:_.number,received:J.parsedType}),m}let W=void 0,Y=new p$;for(let J of this._def.checks)if(J.kind==="int"){if(!J$.isInteger($.data))W=this._getOrReturnCtx($,W),x(W,{code:E.invalid_type,expected:"integer",received:"float",message:J.message}),Y.dirty()}else if(J.kind==="min"){if(J.inclusive?$.data<J.value:$.data<=J.value)W=this._getOrReturnCtx($,W),x(W,{code:E.too_small,minimum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),Y.dirty()}else if(J.kind==="max"){if(J.inclusive?$.data>J.value:$.data>=J.value)W=this._getOrReturnCtx($,W),x(W,{code:E.too_big,maximum:J.value,type:"number",inclusive:J.inclusive,exact:!1,message:J.message}),Y.dirty()}else if(J.kind==="multipleOf"){if(lK($.data,J.value)!==0)W=this._getOrReturnCtx($,W),x(W,{code:E.not_multiple_of,multipleOf:J.value,message:J.message}),Y.dirty()}else if(J.kind==="finite"){if(!Number.isFinite($.data))W=this._getOrReturnCtx($,W),x(W,{code:E.not_finite,message:J.message}),Y.dirty()}else J$.assertNever(J);return{status:Y.value,value:$.data}}gte($,X){return this.setLimit("min",$,!0,y.toString(X))}gt($,X){return this.setLimit("min",$,!1,y.toString(X))}lte($,X){return this.setLimit("max",$,!0,y.toString(X))}lt($,X){return this.setLimit("max",$,!1,y.toString(X))}setLimit($,X,W,Y){return new R1({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:W,message:y.toString(Y)}]})}_addCheck($){return new R1({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:y.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:y.toString(X)})}finite($){return this._addCheck({kind:"finite",message:y.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString($)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&J$.isInteger($.value))}get isFinite(){let $=null,X=null;for(let W of this._def.checks)if(W.kind==="finite"||W.kind==="int"||W.kind==="multipleOf")return!0;else if(W.kind==="min"){if(X===null||W.value>X)X=W.value}else if(W.kind==="max"){if($===null||W.value<$)$=W.value}return Number.isFinite(X)&&Number.isFinite($)}}R1.create=($)=>{return new R1({checks:[],typeName:R.ZodNumber,coerce:$?.coerce||!1,...p($)})};class Z1 extends $${constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==_.bigint)return this._getInvalidInput($);let W=void 0,Y=new p$;for(let J of this._def.checks)if(J.kind==="min"){if(J.inclusive?$.data<J.value:$.data<=J.value)W=this._getOrReturnCtx($,W),x(W,{code:E.too_small,type:"bigint",minimum:J.value,inclusive:J.inclusive,message:J.message}),Y.dirty()}else if(J.kind==="max"){if(J.inclusive?$.data>J.value:$.data>=J.value)W=this._getOrReturnCtx($,W),x(W,{code:E.too_big,type:"bigint",maximum:J.value,inclusive:J.inclusive,message:J.message}),Y.dirty()}else if(J.kind==="multipleOf"){if($.data%J.value!==BigInt(0))W=this._getOrReturnCtx($,W),x(W,{code:E.not_multiple_of,multipleOf:J.value,message:J.message}),Y.dirty()}else J$.assertNever(J);return{status:Y.value,value:$.data}}_getInvalidInput($){let X=this._getOrReturnCtx($);return x(X,{code:E.invalid_type,expected:_.bigint,received:X.parsedType}),m}gte($,X){return this.setLimit("min",$,!0,y.toString(X))}gt($,X){return this.setLimit("min",$,!1,y.toString(X))}lte($,X){return this.setLimit("max",$,!0,y.toString(X))}lt($,X){return this.setLimit("max",$,!1,y.toString(X))}setLimit($,X,W,Y){return new Z1({...this._def,checks:[...this._def.checks,{kind:$,value:X,inclusive:W,message:y.toString(Y)}]})}_addCheck($){return new Z1({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString($)})}multipleOf($,X){return this._addCheck({kind:"multipleOf",value:$,message:y.toString(X)})}get minValue(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $}get maxValue(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $}}Z1.create=($)=>{return new Z1({checks:[],typeName:R.ZodBigInt,coerce:$?.coerce??!1,...p($)})};class oW extends $${_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==_.boolean){let W=this._getOrReturnCtx($);return x(W,{code:E.invalid_type,expected:_.boolean,received:W.parsedType}),m}return e$($.data)}}oW.create=($)=>{return new oW({typeName:R.ZodBoolean,coerce:$?.coerce||!1,...p($)})};class R0 extends $${_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==_.date){let J=this._getOrReturnCtx($);return x(J,{code:E.invalid_type,expected:_.date,received:J.parsedType}),m}if(Number.isNaN($.data.getTime())){let J=this._getOrReturnCtx($);return x(J,{code:E.invalid_date}),m}let W=new p$,Y=void 0;for(let J of this._def.checks)if(J.kind==="min"){if($.data.getTime()<J.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:E.too_small,message:J.message,inclusive:!0,exact:!1,minimum:J.value,type:"date"}),W.dirty()}else if(J.kind==="max"){if($.data.getTime()>J.value)Y=this._getOrReturnCtx($,Y),x(Y,{code:E.too_big,message:J.message,inclusive:!0,exact:!1,maximum:J.value,type:"date"}),W.dirty()}else J$.assertNever(J);return{status:W.value,value:new Date($.data.getTime())}}_addCheck($){return new R0({...this._def,checks:[...this._def.checks,$]})}min($,X){return this._addCheck({kind:"min",value:$.getTime(),message:y.toString(X)})}max($,X){return this._addCheck({kind:"max",value:$.getTime(),message:y.toString(X)})}get minDate(){let $=null;for(let X of this._def.checks)if(X.kind==="min"){if($===null||X.value>$)$=X.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let X of this._def.checks)if(X.kind==="max"){if($===null||X.value<$)$=X.value}return $!=null?new Date($):null}}R0.create=($)=>{return new R0({checks:[],coerce:$?.coerce||!1,typeName:R.ZodDate,...p($)})};class tW extends $${_parse($){if(this._getType($)!==_.symbol){let W=this._getOrReturnCtx($);return x(W,{code:E.invalid_type,expected:_.symbol,received:W.parsedType}),m}return e$($.data)}}tW.create=($)=>{return new tW({typeName:R.ZodSymbol,...p($)})};class Z0 extends $${_parse($){if(this._getType($)!==_.undefined){let W=this._getOrReturnCtx($);return x(W,{code:E.invalid_type,expected:_.undefined,received:W.parsedType}),m}return e$($.data)}}Z0.create=($)=>{return new Z0({typeName:R.ZodUndefined,...p($)})};class k0 extends $${_parse($){if(this._getType($)!==_.null){let W=this._getOrReturnCtx($);return x(W,{code:E.invalid_type,expected:_.null,received:W.parsedType}),m}return e$($.data)}}k0.create=($)=>{return new k0({typeName:R.ZodNull,...p($)})};class aW extends $${constructor(){super(...arguments);this._any=!0}_parse($){return e$($.data)}}aW.create=($)=>{return new aW({typeName:R.ZodAny,...p($)})};class J1 extends $${constructor(){super(...arguments);this._unknown=!0}_parse($){return e$($.data)}}J1.create=($)=>{return new J1({typeName:R.ZodUnknown,...p($)})};class N6 extends $${_parse($){let X=this._getOrReturnCtx($);return x(X,{code:E.invalid_type,expected:_.never,received:X.parsedType}),m}}N6.create=($)=>{return new N6({typeName:R.ZodNever,...p($)})};class sW extends $${_parse($){if(this._getType($)!==_.undefined){let W=this._getOrReturnCtx($);return x(W,{code:E.invalid_type,expected:_.void,received:W.parsedType}),m}return e$($.data)}}sW.create=($)=>{return new sW({typeName:R.ZodVoid,...p($)})};class a4 extends $${_parse($){let{ctx:X,status:W}=this._processInputParams($),Y=this._def;if(X.parsedType!==_.array)return x(X,{code:E.invalid_type,expected:_.array,received:X.parsedType}),m;if(Y.exactLength!==null){let G=X.data.length>Y.exactLength.value,U=X.data.length<Y.exactLength.value;if(G||U)x(X,{code:G?E.too_big:E.too_small,minimum:U?Y.exactLength.value:void 0,maximum:G?Y.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:Y.exactLength.message}),W.dirty()}if(Y.minLength!==null){if(X.data.length<Y.minLength.value)x(X,{code:E.too_small,minimum:Y.minLength.value,type:"array",inclusive:!0,exact:!1,message:Y.minLength.message}),W.dirty()}if(Y.maxLength!==null){if(X.data.length>Y.maxLength.value)x(X,{code:E.too_big,maximum:Y.maxLength.value,type:"array",inclusive:!0,exact:!1,message:Y.maxLength.message}),W.dirty()}if(X.common.async)return Promise.all([...X.data].map((G,U)=>{return Y.type._parseAsync(new T4(X,G,X.path,U))})).then((G)=>{return p$.mergeArray(W,G)});let J=[...X.data].map((G,U)=>{return Y.type._parseSync(new T4(X,G,X.path,U))});return p$.mergeArray(W,J)}get element(){return this._def.type}min($,X){return new a4({...this._def,minLength:{value:$,message:y.toString(X)}})}max($,X){return new a4({...this._def,maxLength:{value:$,message:y.toString(X)}})}length($,X){return new a4({...this._def,exactLength:{value:$,message:y.toString(X)}})}nonempty($){return this.min(1,$)}}a4.create=($,X)=>{return new a4({type:$,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...p(X)})};function P1($){if($ instanceof T$){let X={};for(let W in $.shape){let Y=$.shape[W];X[W]=s4.create(P1(Y))}return new T$({...$._def,shape:()=>X})}else if($ instanceof a4)return new a4({...$._def,type:P1($.element)});else if($ instanceof s4)return s4.create(P1($.unwrap()));else if($ instanceof Z6)return Z6.create(P1($.unwrap()));else if($ instanceof D6)return D6.create($.items.map((X)=>P1(X)));else return $}class T$ extends $${constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),X=J$.objectKeys($);return this._cached={shape:$,keys:X},this._cached}_parse($){if(this._getType($)!==_.object){let z=this._getOrReturnCtx($);return x(z,{code:E.invalid_type,expected:_.object,received:z.parsedType}),m}let{status:W,ctx:Y}=this._processInputParams($),{shape:J,keys:G}=this._getCached(),U=[];if(!(this._def.catchall instanceof N6&&this._def.unknownKeys==="strip")){for(let z in Y.data)if(!G.includes(z))U.push(z)}let Q=[];for(let z of G){let H=J[z],j=Y.data[z];Q.push({key:{status:"valid",value:z},value:H._parse(new T4(Y,j,Y.path,z)),alwaysSet:z in Y.data})}if(this._def.catchall instanceof N6){let z=this._def.unknownKeys;if(z==="passthrough")for(let H of U)Q.push({key:{status:"valid",value:H},value:{status:"valid",value:Y.data[H]}});else if(z==="strict"){if(U.length>0)x(Y,{code:E.unrecognized_keys,keys:U}),W.dirty()}else if(z==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let z=this._def.catchall;for(let H of U){let j=Y.data[H];Q.push({key:{status:"valid",value:H},value:z._parse(new T4(Y,j,Y.path,H)),alwaysSet:H in Y.data})}}if(Y.common.async)return Promise.resolve().then(async()=>{let z=[];for(let H of Q){let j=await H.key,O=await H.value;z.push({key:j,value:O,alwaysSet:H.alwaysSet})}return z}).then((z)=>{return p$.mergeObjectSync(W,z)});else return p$.mergeObjectSync(W,Q)}get shape(){return this._def.shape()}strict($){return y.errToObj,new T$({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(X,W)=>{let Y=this._def.errorMap?.(X,W).message??W.defaultError;if(X.code==="unrecognized_keys")return{message:y.errToObj($).message??Y};return{message:Y}}}:{}})}strip(){return new T$({...this._def,unknownKeys:"strip"})}passthrough(){return new T$({...this._def,unknownKeys:"passthrough"})}extend($){return new T$({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new T$({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:R.ZodObject})}setKey($,X){return this.augment({[$]:X})}catchall($){return new T$({...this._def,catchall:$})}pick($){let X={};for(let W of J$.objectKeys($))if($[W]&&this.shape[W])X[W]=this.shape[W];return new T$({...this._def,shape:()=>X})}omit($){let X={};for(let W of J$.objectKeys(this.shape))if(!$[W])X[W]=this.shape[W];return new T$({...this._def,shape:()=>X})}deepPartial(){return P1(this)}partial($){let X={};for(let W of J$.objectKeys(this.shape)){let Y=this.shape[W];if($&&!$[W])X[W]=Y;else X[W]=Y.optional()}return new T$({...this._def,shape:()=>X})}required($){let X={};for(let W of J$.objectKeys(this.shape))if($&&!$[W])X[W]=this.shape[W];else{let J=this.shape[W];while(J instanceof s4)J=J._def.innerType;X[W]=J}return new T$({...this._def,shape:()=>X})}keyof(){return zH(J$.objectKeys(this.shape))}}T$.create=($,X)=>{return new T$({shape:()=>$,unknownKeys:"strip",catchall:N6.create(),typeName:R.ZodObject,...p(X)})};T$.strictCreate=($,X)=>{return new T$({shape:()=>$,unknownKeys:"strict",catchall:N6.create(),typeName:R.ZodObject,...p(X)})};T$.lazycreate=($,X)=>{return new T$({shape:$,unknownKeys:"strip",catchall:N6.create(),typeName:R.ZodObject,...p(X)})};class T0 extends $${_parse($){let{ctx:X}=this._processInputParams($),W=this._def.options;function Y(J){for(let U of J)if(U.result.status==="valid")return U.result;for(let U of J)if(U.result.status==="dirty")return X.common.issues.push(...U.ctx.common.issues),U.result;let G=J.map((U)=>new q4(U.ctx.common.issues));return x(X,{code:E.invalid_union,unionErrors:G}),m}if(X.common.async)return Promise.all(W.map(async(J)=>{let G={...X,common:{...X.common,issues:[]},parent:null};return{result:await J._parseAsync({data:X.data,path:X.path,parent:G}),ctx:G}})).then(Y);else{let J=void 0,G=[];for(let Q of W){let z={...X,common:{...X.common,issues:[]},parent:null},H=Q._parseSync({data:X.data,path:X.path,parent:z});if(H.status==="valid")return H;else if(H.status==="dirty"&&!J)J={result:H,ctx:z};if(z.common.issues.length)G.push(z.common.issues)}if(J)return X.common.issues.push(...J.ctx.common.issues),J.result;let U=G.map((Q)=>new q4(Q));return x(X,{code:E.invalid_union,unionErrors:U}),m}}get options(){return this._def.options}}T0.create=($,X)=>{return new T0({options:$,typeName:R.ZodUnion,...p(X)})};var I6=($)=>{if($ instanceof _0)return I6($.schema);else if($ instanceof e4)return I6($.innerType());else if($ instanceof x0)return[$.value];else if($ instanceof Y1)return $.options;else if($ instanceof u0)return J$.objectValues($.enum);else if($ instanceof y0)return I6($._def.innerType);else if($ instanceof Z0)return[void 0];else if($ instanceof k0)return[null];else if($ instanceof s4)return[void 0,...I6($.unwrap())];else if($ instanceof Z6)return[null,...I6($.unwrap())];else if($ instanceof vG)return I6($.unwrap());else if($ instanceof f0)return I6($.unwrap());else if($ instanceof g0)return I6($._def.innerType);else return[]};class KG extends $${_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==_.object)return x(X,{code:E.invalid_type,expected:_.object,received:X.parsedType}),m;let W=this.discriminator,Y=X.data[W],J=this.optionsMap.get(Y);if(!J)return x(X,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[W]}),m;if(X.common.async)return J._parseAsync({data:X.data,path:X.path,parent:X});else return J._parseSync({data:X.data,path:X.path,parent:X})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,X,W){let Y=new Map;for(let J of X){let G=I6(J.shape[$]);if(!G.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let U of G){if(Y.has(U))throw Error(`Discriminator property ${String($)} has duplicate value ${String(U)}`);Y.set(U,J)}}return new KG({typeName:R.ZodDiscriminatedUnion,discriminator:$,options:X,optionsMap:Y,...p(W)})}}function bG($,X){let W=j6($),Y=j6(X);if($===X)return{valid:!0,data:$};else if(W===_.object&&Y===_.object){let J=J$.objectKeys(X),G=J$.objectKeys($).filter((Q)=>J.indexOf(Q)!==-1),U={...$,...X};for(let Q of G){let z=bG($[Q],X[Q]);if(!z.valid)return{valid:!1};U[Q]=z.data}return{valid:!0,data:U}}else if(W===_.array&&Y===_.array){if($.length!==X.length)return{valid:!1};let J=[];for(let G=0;G<$.length;G++){let U=$[G],Q=X[G],z=bG(U,Q);if(!z.valid)return{valid:!1};J.push(z.data)}return{valid:!0,data:J}}else if(W===_.date&&Y===_.date&&+$===+X)return{valid:!0,data:$};else return{valid:!1}}class C0 extends $${_parse($){let{status:X,ctx:W}=this._processInputParams($),Y=(J,G)=>{if(wG(J)||wG(G))return m;let U=bG(J.value,G.value);if(!U.valid)return x(W,{code:E.invalid_intersection_types}),m;if(VG(J)||VG(G))X.dirty();return{status:X.value,value:U.data}};if(W.common.async)return Promise.all([this._def.left._parseAsync({data:W.data,path:W.path,parent:W}),this._def.right._parseAsync({data:W.data,path:W.path,parent:W})]).then(([J,G])=>Y(J,G));else return Y(this._def.left._parseSync({data:W.data,path:W.path,parent:W}),this._def.right._parseSync({data:W.data,path:W.path,parent:W}))}}C0.create=($,X,W)=>{return new C0({left:$,right:X,typeName:R.ZodIntersection,...p(W)})};class D6 extends $${_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==_.array)return x(W,{code:E.invalid_type,expected:_.array,received:W.parsedType}),m;if(W.data.length<this._def.items.length)return x(W,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;if(!this._def.rest&&W.data.length>this._def.items.length)x(W,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X.dirty();let J=[...W.data].map((G,U)=>{let Q=this._def.items[U]||this._def.rest;if(!Q)return null;return Q._parse(new T4(W,G,W.path,U))}).filter((G)=>!!G);if(W.common.async)return Promise.all(J).then((G)=>{return p$.mergeArray(X,G)});else return p$.mergeArray(X,J)}get items(){return this._def.items}rest($){return new D6({...this._def,rest:$})}}D6.create=($,X)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new D6({items:$,typeName:R.ZodTuple,rest:null,...p(X)})};class eW extends $${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==_.object)return x(W,{code:E.invalid_type,expected:_.object,received:W.parsedType}),m;let Y=[],J=this._def.keyType,G=this._def.valueType;for(let U in W.data)Y.push({key:J._parse(new T4(W,U,W.path,U)),value:G._parse(new T4(W,W.data[U],W.path,U)),alwaysSet:U in W.data});if(W.common.async)return p$.mergeObjectAsync(X,Y);else return p$.mergeObjectSync(X,Y)}get element(){return this._def.valueType}static create($,X,W){if(X instanceof $$)return new eW({keyType:$,valueType:X,typeName:R.ZodRecord,...p(W)});return new eW({keyType:O6.create(),valueType:$,typeName:R.ZodRecord,...p(X)})}}class $J extends $${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==_.map)return x(W,{code:E.invalid_type,expected:_.map,received:W.parsedType}),m;let Y=this._def.keyType,J=this._def.valueType,G=[...W.data.entries()].map(([U,Q],z)=>{return{key:Y._parse(new T4(W,U,W.path,[z,"key"])),value:J._parse(new T4(W,Q,W.path,[z,"value"]))}});if(W.common.async){let U=new Map;return Promise.resolve().then(async()=>{for(let Q of G){let z=await Q.key,H=await Q.value;if(z.status==="aborted"||H.status==="aborted")return m;if(z.status==="dirty"||H.status==="dirty")X.dirty();U.set(z.value,H.value)}return{status:X.value,value:U}})}else{let U=new Map;for(let Q of G){let{key:z,value:H}=Q;if(z.status==="aborted"||H.status==="aborted")return m;if(z.status==="dirty"||H.status==="dirty")X.dirty();U.set(z.value,H.value)}return{status:X.value,value:U}}}}$J.create=($,X,W)=>{return new $J({valueType:X,keyType:$,typeName:R.ZodMap,...p(W)})};class k1 extends $${_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.parsedType!==_.set)return x(W,{code:E.invalid_type,expected:_.set,received:W.parsedType}),m;let Y=this._def;if(Y.minSize!==null){if(W.data.size<Y.minSize.value)x(W,{code:E.too_small,minimum:Y.minSize.value,type:"set",inclusive:!0,exact:!1,message:Y.minSize.message}),X.dirty()}if(Y.maxSize!==null){if(W.data.size>Y.maxSize.value)x(W,{code:E.too_big,maximum:Y.maxSize.value,type:"set",inclusive:!0,exact:!1,message:Y.maxSize.message}),X.dirty()}let J=this._def.valueType;function G(Q){let z=new Set;for(let H of Q){if(H.status==="aborted")return m;if(H.status==="dirty")X.dirty();z.add(H.value)}return{status:X.value,value:z}}let U=[...W.data.values()].map((Q,z)=>J._parse(new T4(W,Q,W.path,z)));if(W.common.async)return Promise.all(U).then((Q)=>G(Q));else return G(U)}min($,X){return new k1({...this._def,minSize:{value:$,message:y.toString(X)}})}max($,X){return new k1({...this._def,maxSize:{value:$,message:y.toString(X)}})}size($,X){return this.min($,X).max($,X)}nonempty($){return this.min(1,$)}}k1.create=($,X)=>{return new k1({valueType:$,minSize:null,maxSize:null,typeName:R.ZodSet,...p(X)})};class P0 extends $${constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==_.function)return x(X,{code:E.invalid_type,expected:_.function,received:X.parsedType}),m;function W(U,Q){return dW({data:U,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,S0(),R6].filter((z)=>!!z),issueData:{code:E.invalid_arguments,argumentsError:Q}})}function Y(U,Q){return dW({data:U,path:X.path,errorMaps:[X.common.contextualErrorMap,X.schemaErrorMap,S0(),R6].filter((z)=>!!z),issueData:{code:E.invalid_return_type,returnTypeError:Q}})}let J={errorMap:X.common.contextualErrorMap},G=X.data;if(this._def.returns instanceof T1){let U=this;return e$(async function(...Q){let z=new q4([]),H=await U._def.args.parseAsync(Q,J).catch((B)=>{throw z.addIssue(W(Q,B)),z}),j=await Reflect.apply(G,this,H);return await U._def.returns._def.type.parseAsync(j,J).catch((B)=>{throw z.addIssue(Y(j,B)),z})})}else{let U=this;return e$(function(...Q){let z=U._def.args.safeParse(Q,J);if(!z.success)throw new q4([W(Q,z.error)]);let H=Reflect.apply(G,this,z.data),j=U._def.returns.safeParse(H,J);if(!j.success)throw new q4([Y(H,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new P0({...this._def,args:D6.create($).rest(J1.create())})}returns($){return new P0({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,X,W){return new P0({args:$?$:D6.create([]).rest(J1.create()),returns:X||J1.create(),typeName:R.ZodFunction,...p(W)})}}class _0 extends $${get schema(){return this._def.getter()}_parse($){let{ctx:X}=this._processInputParams($);return this._def.getter()._parse({data:X.data,path:X.path,parent:X})}}_0.create=($,X)=>{return new _0({getter:$,typeName:R.ZodLazy,...p(X)})};class x0 extends $${_parse($){if($.data!==this._def.value){let X=this._getOrReturnCtx($);return x(X,{received:X.data,code:E.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:$.data}}get value(){return this._def.value}}x0.create=($,X)=>{return new x0({value:$,typeName:R.ZodLiteral,...p(X)})};function zH($,X){return new Y1({values:$,typeName:R.ZodEnum,...p(X)})}class Y1 extends $${_parse($){if(typeof $.data!=="string"){let X=this._getOrReturnCtx($),W=this._def.values;return x(X,{expected:J$.joinValues(W),received:X.parsedType,code:E.invalid_type}),m}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let X=this._getOrReturnCtx($),W=this._def.values;return x(X,{received:X.data,code:E.invalid_enum_value,options:W}),m}return e$($.data)}get options(){return this._def.values}get enum(){let $={};for(let X of this._def.values)$[X]=X;return $}get Values(){let $={};for(let X of this._def.values)$[X]=X;return $}get Enum(){let $={};for(let X of this._def.values)$[X]=X;return $}extract($,X=this._def){return Y1.create($,{...this._def,...X})}exclude($,X=this._def){return Y1.create(this.options.filter((W)=>!$.includes(W)),{...this._def,...X})}}Y1.create=zH;class u0 extends $${_parse($){let X=J$.getValidEnumValues(this._def.values),W=this._getOrReturnCtx($);if(W.parsedType!==_.string&&W.parsedType!==_.number){let Y=J$.objectValues(X);return x(W,{expected:J$.joinValues(Y),received:W.parsedType,code:E.invalid_type}),m}if(!this._cache)this._cache=new Set(J$.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let Y=J$.objectValues(X);return x(W,{received:W.data,code:E.invalid_enum_value,options:Y}),m}return e$($.data)}get enum(){return this._def.values}}u0.create=($,X)=>{return new u0({values:$,typeName:R.ZodNativeEnum,...p(X)})};class T1 extends $${unwrap(){return this._def.type}_parse($){let{ctx:X}=this._processInputParams($);if(X.parsedType!==_.promise&&X.common.async===!1)return x(X,{code:E.invalid_type,expected:_.promise,received:X.parsedType}),m;let W=X.parsedType===_.promise?X.data:Promise.resolve(X.data);return e$(W.then((Y)=>{return this._def.type.parseAsync(Y,{path:X.path,errorMap:X.common.contextualErrorMap})}))}}T1.create=($,X)=>{return new T1({type:$,typeName:R.ZodPromise,...p(X)})};class e4 extends $${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:X,ctx:W}=this._processInputParams($),Y=this._def.effect||null,J={addIssue:(G)=>{if(x(W,G),G.fatal)X.abort();else X.dirty()},get path(){return W.path}};if(J.addIssue=J.addIssue.bind(J),Y.type==="preprocess"){let G=Y.transform(W.data,J);if(W.common.async)return Promise.resolve(G).then(async(U)=>{if(X.value==="aborted")return m;let Q=await this._def.schema._parseAsync({data:U,path:W.path,parent:W});if(Q.status==="aborted")return m;if(Q.status==="dirty")return E1(Q.value);if(X.value==="dirty")return E1(Q.value);return Q});else{if(X.value==="aborted")return m;let U=this._def.schema._parseSync({data:G,path:W.path,parent:W});if(U.status==="aborted")return m;if(U.status==="dirty")return E1(U.value);if(X.value==="dirty")return E1(U.value);return U}}if(Y.type==="refinement"){let G=(U)=>{let Q=Y.refinement(U,J);if(W.common.async)return Promise.resolve(Q);if(Q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return U};if(W.common.async===!1){let U=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(U.status==="aborted")return m;if(U.status==="dirty")X.dirty();return G(U.value),{status:X.value,value:U.value}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((U)=>{if(U.status==="aborted")return m;if(U.status==="dirty")X.dirty();return G(U.value).then(()=>{return{status:X.value,value:U.value}})})}if(Y.type==="transform")if(W.common.async===!1){let G=this._def.schema._parseSync({data:W.data,path:W.path,parent:W});if(!W1(G))return m;let U=Y.transform(G.value,J);if(U instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:X.value,value:U}}else return this._def.schema._parseAsync({data:W.data,path:W.path,parent:W}).then((G)=>{if(!W1(G))return m;return Promise.resolve(Y.transform(G.value,J)).then((U)=>({status:X.value,value:U}))});J$.assertNever(Y)}}e4.create=($,X,W)=>{return new e4({schema:$,typeName:R.ZodEffects,effect:X,...p(W)})};e4.createWithPreprocess=($,X,W)=>{return new e4({schema:X,effect:{type:"preprocess",transform:$},typeName:R.ZodEffects,...p(W)})};class s4 extends $${_parse($){if(this._getType($)===_.undefined)return e$(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}s4.create=($,X)=>{return new s4({innerType:$,typeName:R.ZodOptional,...p(X)})};class Z6 extends $${_parse($){if(this._getType($)===_.null)return e$(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}Z6.create=($,X)=>{return new Z6({innerType:$,typeName:R.ZodNullable,...p(X)})};class y0 extends $${_parse($){let{ctx:X}=this._processInputParams($),W=X.data;if(X.parsedType===_.undefined)W=this._def.defaultValue();return this._def.innerType._parse({data:W,path:X.path,parent:X})}removeDefault(){return this._def.innerType}}y0.create=($,X)=>{return new y0({innerType:$,typeName:R.ZodDefault,defaultValue:typeof X.default==="function"?X.default:()=>X.default,...p(X)})};class g0 extends $${_parse($){let{ctx:X}=this._processInputParams($),W={...X,common:{...X.common,issues:[]}},Y=this._def.innerType._parse({data:W.data,path:W.path,parent:{...W}});if(E0(Y))return Y.then((J)=>{return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new q4(W.common.issues)},input:W.data})}});else return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new q4(W.common.issues)},input:W.data})}}removeCatch(){return this._def.innerType}}g0.create=($,X)=>{return new g0({innerType:$,typeName:R.ZodCatch,catchValue:typeof X.catch==="function"?X.catch:()=>X.catch,...p(X)})};class XJ extends $${_parse($){if(this._getType($)!==_.nan){let W=this._getOrReturnCtx($);return x(W,{code:E.invalid_type,expected:_.nan,received:W.parsedType}),m}return{status:"valid",value:$.data}}}XJ.create=($)=>{return new XJ({typeName:R.ZodNaN,...p($)})};var ul=Symbol("zod_brand");class vG extends $${_parse($){let{ctx:X}=this._processInputParams($),W=X.data;return this._def.type._parse({data:W,path:X.path,parent:X})}unwrap(){return this._def.type}}class WJ extends $${_parse($){let{status:X,ctx:W}=this._processInputParams($);if(W.common.async)return(async()=>{let J=await this._def.in._parseAsync({data:W.data,path:W.path,parent:W});if(J.status==="aborted")return m;if(J.status==="dirty")return X.dirty(),E1(J.value);else return this._def.out._parseAsync({data:J.value,path:W.path,parent:W})})();else{let Y=this._def.in._parseSync({data:W.data,path:W.path,parent:W});if(Y.status==="aborted")return m;if(Y.status==="dirty")return X.dirty(),{status:"dirty",value:Y.value};else return this._def.out._parseSync({data:Y.value,path:W.path,parent:W})}}static create($,X){return new WJ({in:$,out:X,typeName:R.ZodPipeline})}}class f0 extends $${_parse($){let X=this._def.innerType._parse($),W=(Y)=>{if(W1(Y))Y.value=Object.freeze(Y.value);return Y};return E0(X)?X.then((Y)=>W(Y)):W(X)}unwrap(){return this._def.innerType}}f0.create=($,X)=>{return new f0({innerType:$,typeName:R.ZodReadonly,...p(X)})};var yl={object:T$.lazycreate},R;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(R||(R={}));var gl=O6.create,fl=R1.create,hl=XJ.create,ll=Z1.create,ml=oW.create,il=R0.create,nl=tW.create,cl=Z0.create,rl=k0.create,pl=aW.create,dl=J1.create,ol=N6.create,tl=sW.create,al=a4.create,HH=T$.create,sl=T$.strictCreate,el=T0.create,$m=KG.create,Xm=C0.create,Wm=D6.create,Jm=eW.create,Ym=$J.create,Gm=k1.create,Um=P0.create,Qm=_0.create,zm=x0.create,Hm=Y1.create,jm=u0.create,Im=T1.create,Om=e4.create,Nm=s4.create,Dm=Z6.create,Bm=e4.createWithPreprocess,wm=WJ.create;var C4={};X1(C4,{version:()=>FU,util:()=>P,treeifyError:()=>QJ,toJSONSchema:()=>a1,toDotPath:()=>BH,safeParseAsync:()=>y6,safeParse:()=>u6,safeEncodeAsync:()=>qH,safeEncode:()=>KH,safeDecodeAsync:()=>LH,safeDecode:()=>vH,registry:()=>UX,regexes:()=>z4,prettifyError:()=>zJ,parseAsync:()=>z1,parse:()=>Q1,meta:()=>YY,locales:()=>c1,isValidJWT:()=>lH,isValidBase64URL:()=>hH,isValidBase64:()=>ZU,globalRegistry:()=>d$,globalConfig:()=>h0,formatError:()=>y1,flattenError:()=>u1,encodeAsync:()=>AH,encode:()=>wH,describe:()=>JY,decodeAsync:()=>bH,decode:()=>VH,config:()=>x$,clone:()=>m$,_xid:()=>VX,_void:()=>t9,_uuidv7:()=>IX,_uuidv6:()=>jX,_uuidv4:()=>HX,_uuid:()=>zX,_url:()=>p1,_uppercase:()=>ZX,_unknown:()=>d9,_union:()=>lq,_undefined:()=>c9,_ulid:()=>wX,_uint64:()=>i9,_uint32:()=>f9,_tuple:()=>nq,_trim:()=>uX,_transform:()=>aq,_toUpperCase:()=>gX,_toLowerCase:()=>yX,_templateLiteral:()=>UL,_symbol:()=>n9,_superRefine:()=>WY,_success:()=>WL,_stringbool:()=>GY,_stringFormat:()=>O1,_string:()=>k9,_startsWith:()=>TX,_slugify:()=>fX,_size:()=>EX,_set:()=>pq,_safeParseAsync:()=>l1,_safeParse:()=>h1,_safeEncodeAsync:()=>BJ,_safeEncode:()=>NJ,_safeDecodeAsync:()=>wJ,_safeDecode:()=>DJ,_regex:()=>PX,_refine:()=>XY,_record:()=>cq,_readonly:()=>GL,_property:()=>xQ,_promise:()=>zL,_positive:()=>kQ,_pipe:()=>YL,_parseAsync:()=>f1,_parse:()=>g1,_overwrite:()=>X6,_optional:()=>sq,_number:()=>_9,_nullable:()=>eq,_null:()=>r9,_normalize:()=>xX,_nonpositive:()=>CQ,_nonoptional:()=>XL,_nonnegative:()=>_Q,_never:()=>o9,_negative:()=>TQ,_nativeEnum:()=>oq,_nanoid:()=>NX,_nan:()=>s9,_multipleOf:()=>j1,_minSize:()=>I1,_minLength:()=>f6,_min:()=>H4,_mime:()=>_X,_maxSize:()=>d1,_maxLength:()=>o1,_max:()=>S4,_map:()=>rq,_mac:()=>T9,_lte:()=>S4,_lt:()=>B6,_lowercase:()=>RX,_literal:()=>tq,_length:()=>t1,_lazy:()=>QL,_ksuid:()=>AX,_jwt:()=>SX,_isoTime:()=>MQ,_isoDuration:()=>SQ,_isoDateTime:()=>LQ,_isoDate:()=>FQ,_ipv6:()=>KX,_ipv4:()=>bX,_intersection:()=>iq,_int64:()=>m9,_int32:()=>g9,_int:()=>x9,_includes:()=>kX,_guid:()=>r1,_gte:()=>H4,_gt:()=>w6,_float64:()=>y9,_float32:()=>u9,_file:()=>e9,_enum:()=>dq,_endsWith:()=>CX,_encodeAsync:()=>IJ,_encode:()=>HJ,_emoji:()=>OX,_email:()=>QX,_e164:()=>MX,_discriminatedUnion:()=>mq,_default:()=>$L,_decodeAsync:()=>OJ,_decode:()=>jJ,_date:()=>a9,_custom:()=>$Y,_cuid2:()=>BX,_cuid:()=>DX,_coercedString:()=>qQ,_coercedNumber:()=>EQ,_coercedDate:()=>ZQ,_coercedBoolean:()=>PQ,_coercedBigint:()=>RQ,_cidrv6:()=>qX,_cidrv4:()=>vX,_check:()=>dH,_catch:()=>JL,_boolean:()=>h9,_bigint:()=>l9,_base64url:()=>FX,_base64:()=>LX,_array:()=>uQ,_any:()=>p9,TimePrecision:()=>C9,NEVER:()=>JJ,JSONSchemaGenerator:()=>UY,JSONSchema:()=>oH,Doc:()=>KJ,$output:()=>R9,$input:()=>Z9,$constructor:()=>A,$brand:()=>YJ,$ZodXID:()=>xJ,$ZodVoid:()=>X9,$ZodUnknown:()=>eJ,$ZodUnion:()=>s0,$ZodUndefined:()=>tJ,$ZodUUID:()=>EJ,$ZodURL:()=>RJ,$ZodULID:()=>_J,$ZodType:()=>n,$ZodTuple:()=>e0,$ZodTransform:()=>N9,$ZodTemplateLiteral:()=>F9,$ZodSymbol:()=>oJ,$ZodSuccess:()=>b9,$ZodStringFormat:()=>O$,$ZodString:()=>g6,$ZodSet:()=>H9,$ZodRegistry:()=>GX,$ZodRecord:()=>Q9,$ZodRealError:()=>Q4,$ZodReadonly:()=>L9,$ZodPromise:()=>S9,$ZodPrefault:()=>V9,$ZodPipe:()=>q9,$ZodOptional:()=>D9,$ZodObjectJIT:()=>kU,$ZodObject:()=>Y9,$ZodNumberFormat:()=>pJ,$ZodNumber:()=>t0,$ZodNullable:()=>B9,$ZodNull:()=>aJ,$ZodNonOptional:()=>A9,$ZodNever:()=>$9,$ZodNanoID:()=>kJ,$ZodNaN:()=>v9,$ZodMap:()=>z9,$ZodMAC:()=>fJ,$ZodLiteral:()=>I9,$ZodLazy:()=>E9,$ZodKSUID:()=>uJ,$ZodJWT:()=>cJ,$ZodIntersection:()=>U9,$ZodISOTime:()=>PU,$ZodISODuration:()=>RU,$ZodISODateTime:()=>SU,$ZodISODate:()=>EU,$ZodIPv6:()=>gJ,$ZodIPv4:()=>yJ,$ZodGUID:()=>SJ,$ZodFunction:()=>M9,$ZodFile:()=>O9,$ZodError:()=>p0,$ZodEnum:()=>j9,$ZodEncodeError:()=>G1,$ZodEmoji:()=>ZJ,$ZodEmail:()=>PJ,$ZodE164:()=>nJ,$ZodDiscriminatedUnion:()=>G9,$ZodDefault:()=>w9,$ZodDate:()=>W9,$ZodCustomStringFormat:()=>rJ,$ZodCustom:()=>P9,$ZodCodec:()=>n1,$ZodCheckUpperCase:()=>VU,$ZodCheckStringFormat:()=>m1,$ZodCheckStartsWith:()=>bU,$ZodCheckSizeEquals:()=>IU,$ZodCheckRegex:()=>BU,$ZodCheckProperty:()=>vU,$ZodCheckOverwrite:()=>LU,$ZodCheckNumberFormat:()=>QU,$ZodCheckMultipleOf:()=>UU,$ZodCheckMinSize:()=>jU,$ZodCheckMinLength:()=>NU,$ZodCheckMimeType:()=>qU,$ZodCheckMaxSize:()=>HU,$ZodCheckMaxLength:()=>OU,$ZodCheckLowerCase:()=>wU,$ZodCheckLessThan:()=>AJ,$ZodCheckLengthEquals:()=>DU,$ZodCheckIncludes:()=>AU,$ZodCheckGreaterThan:()=>bJ,$ZodCheckEndsWith:()=>KU,$ZodCheckBigIntFormat:()=>zU,$ZodCheck:()=>B$,$ZodCatch:()=>K9,$ZodCUID2:()=>CJ,$ZodCUID:()=>TJ,$ZodCIDRv6:()=>lJ,$ZodCIDRv4:()=>hJ,$ZodBoolean:()=>i1,$ZodBigIntFormat:()=>dJ,$ZodBigInt:()=>a0,$ZodBase64URL:()=>iJ,$ZodBase64:()=>mJ,$ZodAsyncError:()=>$6,$ZodArray:()=>J9,$ZodAny:()=>sJ});var JJ=Object.freeze({status:"aborted"});function A($,X,W){function Y(Q,z){if(!Q._zod)Object.defineProperty(Q,"_zod",{value:{def:z,constr:U,traits:new Set},enumerable:!1});if(Q._zod.traits.has($))return;Q._zod.traits.add($),X(Q,z);let H=U.prototype,j=Object.keys(H);for(let O=0;O<j.length;O++){let B=j[O];if(!(B in Q))Q[B]=H[B].bind(Q)}}let J=W?.Parent??Object;class G extends J{}Object.defineProperty(G,"name",{value:$});function U(Q){var z;let H=W?.Parent?new G:this;Y(H,Q),(z=H._zod).deferred??(z.deferred=[]);for(let j of H._zod.deferred)j();return H}return Object.defineProperty(U,"init",{value:Y}),Object.defineProperty(U,Symbol.hasInstance,{value:(Q)=>{if(W?.Parent&&Q instanceof W.Parent)return!0;return Q?._zod?.traits?.has($)}}),Object.defineProperty(U,"name",{value:$}),U}var YJ=Symbol("zod_brand");class $6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class G1 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var h0={};function x$($){if($)Object.assign(h0,$);return h0}var P={};X1(P,{unwrapMessage:()=>l0,uint8ArrayToHex:()=>Ov,uint8ArrayToBase64url:()=>jv,uint8ArrayToBase64:()=>OH,stringifyPrimitive:()=>Z,slugify:()=>FG,shallowClone:()=>SG,safeExtend:()=>Yv,required:()=>Qv,randomString:()=>aK,propertyKeyTypes:()=>n0,promiseAllObject:()=>tK,primitiveTypes:()=>EG,prefixIssues:()=>L4,pick:()=>Xv,partial:()=>Uv,optionalKeys:()=>PG,omit:()=>Wv,objectClone:()=>pK,numKeys:()=>sK,nullish:()=>k6,normalizeParams:()=>k,mergeDefs:()=>C6,merge:()=>Gv,jsonStringifyReplacer:()=>C1,joinValues:()=>q,issue:()=>x1,isPlainObject:()=>_6,isObject:()=>U1,hexToUint8Array:()=>Iv,getSizableOrigin:()=>c0,getParsedType:()=>eK,getLengthableOrigin:()=>r0,getEnumValues:()=>m0,getElementAtPath:()=>oK,floatSafeRemainder:()=>LG,finalizeIssue:()=>F4,extend:()=>Jv,escapeRegex:()=>M4,esc:()=>GJ,defineLazy:()=>W$,createTransparentProxy:()=>$v,cloneDef:()=>dK,clone:()=>m$,cleanRegex:()=>i0,cleanEnum:()=>zv,captureStackTrace:()=>UJ,cached:()=>_1,base64urlToUint8Array:()=>Hv,base64ToUint8Array:()=>IH,assignProp:()=>T6,assertNotEqual:()=>iK,assertNever:()=>cK,assertIs:()=>nK,assertEqual:()=>mK,assert:()=>rK,allowsEval:()=>MG,aborted:()=>x6,NUMBER_FORMAT_RANGES:()=>RG,Class:()=>NH,BIGINT_FORMAT_RANGES:()=>ZG});function mK($){return $}function iK($){return $}function nK($){}function cK($){throw Error()}function rK($){}function m0($){let X=Object.values($).filter((Y)=>typeof Y==="number");return Object.entries($).filter(([Y,J])=>X.indexOf(+Y)===-1).map(([Y,J])=>J)}function q($,X="|"){return $.map((W)=>Z(W)).join(X)}function C1($,X){if(typeof X==="bigint")return X.toString();return X}function _1($){return{get value(){{let W=$();return Object.defineProperty(this,"value",{value:W}),W}throw Error("cached value already set")}}}function k6($){return $===null||$===void 0}function i0($){let X=$.startsWith("^")?1:0,W=$.endsWith("$")?$.length-1:$.length;return $.slice(X,W)}function LG($,X){let W=($.toString().split(".")[1]||"").length,Y=X.toString(),J=(Y.split(".")[1]||"").length;if(J===0&&/\d?e-\d?/.test(Y)){let z=Y.match(/\d?e-(\d?)/);if(z?.[1])J=Number.parseInt(z[1])}let G=W>J?W:J,U=Number.parseInt($.toFixed(G).replace(".","")),Q=Number.parseInt(X.toFixed(G).replace(".",""));return U%Q/10**G}var jH=Symbol("evaluating");function W$($,X,W){let Y=void 0;Object.defineProperty($,X,{get(){if(Y===jH)return;if(Y===void 0)Y=jH,Y=W();return Y},set(J){Object.defineProperty($,X,{value:J})},configurable:!0})}function pK($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function T6($,X,W){Object.defineProperty($,X,{value:W,writable:!0,enumerable:!0,configurable:!0})}function C6(...$){let X={};for(let W of $){let Y=Object.getOwnPropertyDescriptors(W);Object.assign(X,Y)}return Object.defineProperties({},X)}function dK($){return C6($._zod.def)}function oK($,X){if(!X)return $;return X.reduce((W,Y)=>W?.[Y],$)}function tK($){let X=Object.keys($),W=X.map((Y)=>$[Y]);return Promise.all(W).then((Y)=>{let J={};for(let G=0;G<X.length;G++)J[X[G]]=Y[G];return J})}function aK($=10){let W="";for(let Y=0;Y<$;Y++)W+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return W}function GJ($){return JSON.stringify($)}function FG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var UJ="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function U1($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var MG=_1(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function _6($){if(U1($)===!1)return!1;let X=$.constructor;if(X===void 0)return!0;if(typeof X!=="function")return!0;let W=X.prototype;if(U1(W)===!1)return!1;if(Object.prototype.hasOwnProperty.call(W,"isPrototypeOf")===!1)return!1;return!0}function SG($){if(_6($))return{...$};if(Array.isArray($))return[...$];return $}function sK($){let X=0;for(let W in $)if(Object.prototype.hasOwnProperty.call($,W))X++;return X}var eK=($)=>{let X=typeof $;switch(X){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${X}`)}},n0=new Set(["string","number","symbol"]),EG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function M4($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m$($,X,W){let Y=new $._zod.constr(X??$._zod.def);if(!X||W?.parent)Y._zod.parent=$;return Y}function k($){let X=$;if(!X)return{};if(typeof X==="string")return{error:()=>X};if(X?.message!==void 0){if(X?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");X.error=X.message}if(delete X.message,typeof X.error==="string")return{...X,error:()=>X.error};return X}function $v($){let X;return new Proxy({},{get(W,Y,J){return X??(X=$()),Reflect.get(X,Y,J)},set(W,Y,J,G){return X??(X=$()),Reflect.set(X,Y,J,G)},has(W,Y){return X??(X=$()),Reflect.has(X,Y)},deleteProperty(W,Y){return X??(X=$()),Reflect.deleteProperty(X,Y)},ownKeys(W){return X??(X=$()),Reflect.ownKeys(X)},getOwnPropertyDescriptor(W,Y){return X??(X=$()),Reflect.getOwnPropertyDescriptor(X,Y)},defineProperty(W,Y,J){return X??(X=$()),Reflect.defineProperty(X,Y,J)}})}function Z($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function PG($){return Object.keys($).filter((X)=>{return $[X]._zod.optin==="optional"&&$[X]._zod.optout==="optional"})}var RG={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ZG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Xv($,X){let W=$._zod.def,Y=C6($._zod.def,{get shape(){let J={};for(let G in X){if(!(G in W.shape))throw Error(`Unrecognized key: "${G}"`);if(!X[G])continue;J[G]=W.shape[G]}return T6(this,"shape",J),J},checks:[]});return m$($,Y)}function Wv($,X){let W=$._zod.def,Y=C6($._zod.def,{get shape(){let J={...$._zod.def.shape};for(let G in X){if(!(G in W.shape))throw Error(`Unrecognized key: "${G}"`);if(!X[G])continue;delete J[G]}return T6(this,"shape",J),J},checks:[]});return m$($,Y)}function Jv($,X){if(!_6(X))throw Error("Invalid input to extend: expected a plain object");let W=$._zod.def.checks;if(W&&W.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let J=C6($._zod.def,{get shape(){let G={...$._zod.def.shape,...X};return T6(this,"shape",G),G},checks:[]});return m$($,J)}function Yv($,X){if(!_6(X))throw Error("Invalid input to safeExtend: expected a plain object");let W={...$._zod.def,get shape(){let Y={...$._zod.def.shape,...X};return T6(this,"shape",Y),Y},checks:$._zod.def.checks};return m$($,W)}function Gv($,X){let W=C6($._zod.def,{get shape(){let Y={...$._zod.def.shape,...X._zod.def.shape};return T6(this,"shape",Y),Y},get catchall(){return X._zod.def.catchall},checks:[]});return m$($,W)}function Uv($,X,W){let Y=C6(X._zod.def,{get shape(){let J=X._zod.def.shape,G={...J};if(W)for(let U in W){if(!(U in J))throw Error(`Unrecognized key: "${U}"`);if(!W[U])continue;G[U]=$?new $({type:"optional",innerType:J[U]}):J[U]}else for(let U in J)G[U]=$?new $({type:"optional",innerType:J[U]}):J[U];return T6(this,"shape",G),G},checks:[]});return m$(X,Y)}function Qv($,X,W){let Y=C6(X._zod.def,{get shape(){let J=X._zod.def.shape,G={...J};if(W)for(let U in W){if(!(U in G))throw Error(`Unrecognized key: "${U}"`);if(!W[U])continue;G[U]=new $({type:"nonoptional",innerType:J[U]})}else for(let U in J)G[U]=new $({type:"nonoptional",innerType:J[U]});return T6(this,"shape",G),G},checks:[]});return m$(X,Y)}function x6($,X=0){if($.aborted===!0)return!0;for(let W=X;W<$.issues.length;W++)if($.issues[W]?.continue!==!0)return!0;return!1}function L4($,X){return X.map((W)=>{var Y;return(Y=W).path??(Y.path=[]),W.path.unshift($),W})}function l0($){return typeof $==="string"?$:$?.message}function F4($,X,W){let Y={...$,path:$.path??[]};if(!$.message){let J=l0($.inst?._zod.def?.error?.($))??l0(X?.error?.($))??l0(W.customError?.($))??l0(W.localeError?.($))??"Invalid input";Y.message=J}if(delete Y.inst,delete Y.continue,!X?.reportInput)delete Y.input;return Y}function c0($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function r0($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function x1(...$){let[X,W,Y]=$;if(typeof X==="string")return{message:X,code:"custom",input:W,inst:Y};return{...X}}function zv($){return Object.entries($).filter(([X,W])=>{return Number.isNaN(Number.parseInt(X,10))}).map((X)=>X[1])}function IH($){let X=atob($),W=new Uint8Array(X.length);for(let Y=0;Y<X.length;Y++)W[Y]=X.charCodeAt(Y);return W}function OH($){let X="";for(let W=0;W<$.length;W++)X+=String.fromCharCode($[W]);return btoa(X)}function Hv($){let X=$.replace(/-/g,"+").replace(/_/g,"/"),W="=".repeat((4-X.length%4)%4);return IH(X+W)}function jv($){return OH($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Iv($){let X=$.replace(/^0x/,"");if(X.length%2!==0)throw Error("Invalid hex string length");let W=new Uint8Array(X.length/2);for(let Y=0;Y<X.length;Y+=2)W[Y/2]=Number.parseInt(X.slice(Y,Y+2),16);return W}function Ov($){return Array.from($).map((X)=>X.toString(16).padStart(2,"0")).join("")}class NH{constructor(...$){}}var DH=($,X)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:X,enumerable:!1}),$.message=JSON.stringify(X,C1,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},p0=A("$ZodError",DH),Q4=A("$ZodError",DH,{Parent:Error});function u1($,X=(W)=>W.message){let W={},Y=[];for(let J of $.issues)if(J.path.length>0)W[J.path[0]]=W[J.path[0]]||[],W[J.path[0]].push(X(J));else Y.push(X(J));return{formErrors:Y,fieldErrors:W}}function y1($,X=(W)=>W.message){let W={_errors:[]},Y=(J)=>{for(let G of J.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((U)=>Y({issues:U}));else if(G.code==="invalid_key")Y({issues:G.issues});else if(G.code==="invalid_element")Y({issues:G.issues});else if(G.path.length===0)W._errors.push(X(G));else{let U=W,Q=0;while(Q<G.path.length){let z=G.path[Q];if(Q!==G.path.length-1)U[z]=U[z]||{_errors:[]};else U[z]=U[z]||{_errors:[]},U[z]._errors.push(X(G));U=U[z],Q++}}};return Y($),W}function QJ($,X=(W)=>W.message){let W={errors:[]},Y=(J,G=[])=>{var U,Q;for(let z of J.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map((H)=>Y({issues:H},z.path));else if(z.code==="invalid_key")Y({issues:z.issues},z.path);else if(z.code==="invalid_element")Y({issues:z.issues},z.path);else{let H=[...G,...z.path];if(H.length===0){W.errors.push(X(z));continue}let j=W,O=0;while(O<H.length){let B=H[O],I=O===H.length-1;if(typeof B==="string")j.properties??(j.properties={}),(U=j.properties)[B]??(U[B]={errors:[]}),j=j.properties[B];else j.items??(j.items=[]),(Q=j.items)[B]??(Q[B]={errors:[]}),j=j.items[B];if(I)j.errors.push(X(z));O++}}};return Y($),W}function BH($){let X=[],W=$.map((Y)=>typeof Y==="object"?Y.key:Y);for(let Y of W)if(typeof Y==="number")X.push(`[${Y}]`);else if(typeof Y==="symbol")X.push(`[${JSON.stringify(String(Y))}]`);else if(/[^\w$]/.test(Y))X.push(`[${JSON.stringify(Y)}]`);else{if(X.length)X.push(".");X.push(Y)}return X.join("")}function zJ($){let X=[],W=[...$.issues].sort((Y,J)=>(Y.path??[]).length-(J.path??[]).length);for(let Y of W)if(X.push(`✖ ${Y.message}`),Y.path?.length)X.push(` → at ${BH(Y.path)}`);return X.join(`
|
|
19
|
+
`)}var g1=($)=>(X,W,Y,J)=>{let G=Y?Object.assign(Y,{async:!1}):{async:!1},U=X._zod.run({value:W,issues:[]},G);if(U instanceof Promise)throw new $6;if(U.issues.length){let Q=new(J?.Err??$)(U.issues.map((z)=>F4(z,G,x$())));throw UJ(Q,J?.callee),Q}return U.value},Q1=g1(Q4),f1=($)=>async(X,W,Y,J)=>{let G=Y?Object.assign(Y,{async:!0}):{async:!0},U=X._zod.run({value:W,issues:[]},G);if(U instanceof Promise)U=await U;if(U.issues.length){let Q=new(J?.Err??$)(U.issues.map((z)=>F4(z,G,x$())));throw UJ(Q,J?.callee),Q}return U.value},z1=f1(Q4),h1=($)=>(X,W,Y)=>{let J=Y?{...Y,async:!1}:{async:!1},G=X._zod.run({value:W,issues:[]},J);if(G instanceof Promise)throw new $6;return G.issues.length?{success:!1,error:new($??p0)(G.issues.map((U)=>F4(U,J,x$())))}:{success:!0,data:G.value}},u6=h1(Q4),l1=($)=>async(X,W,Y)=>{let J=Y?Object.assign(Y,{async:!0}):{async:!0},G=X._zod.run({value:W,issues:[]},J);if(G instanceof Promise)G=await G;return G.issues.length?{success:!1,error:new $(G.issues.map((U)=>F4(U,J,x$())))}:{success:!0,data:G.value}},y6=l1(Q4),HJ=($)=>(X,W,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return g1($)(X,W,J)},wH=HJ(Q4),jJ=($)=>(X,W,Y)=>{return g1($)(X,W,Y)},VH=jJ(Q4),IJ=($)=>async(X,W,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return f1($)(X,W,J)},AH=IJ(Q4),OJ=($)=>async(X,W,Y)=>{return f1($)(X,W,Y)},bH=OJ(Q4),NJ=($)=>(X,W,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return h1($)(X,W,J)},KH=NJ(Q4),DJ=($)=>(X,W,Y)=>{return h1($)(X,W,Y)},vH=DJ(Q4),BJ=($)=>async(X,W,Y)=>{let J=Y?Object.assign(Y,{direction:"backward"}):{direction:"backward"};return l1($)(X,W,J)},qH=BJ(Q4),wJ=($)=>async(X,W,Y)=>{return l1($)(X,W,Y)},LH=wJ(Q4);var z4={};X1(z4,{xid:()=>_G,uuid7:()=>Vv,uuid6:()=>wv,uuid4:()=>Bv,uuid:()=>H1,uppercase:()=>GU,unicodeEmail:()=>FH,undefined:()=>JU,ulid:()=>CG,time:()=>oG,string:()=>aG,sha512_hex:()=>gv,sha512_base64url:()=>hv,sha512_base64:()=>fv,sha384_hex:()=>xv,sha384_base64url:()=>yv,sha384_base64:()=>uv,sha256_hex:()=>Tv,sha256_base64url:()=>_v,sha256_base64:()=>Cv,sha1_hex:()=>Rv,sha1_base64url:()=>kv,sha1_base64:()=>Zv,rfc5322Email:()=>bv,number:()=>$U,null:()=>WU,nanoid:()=>uG,md5_hex:()=>Sv,md5_base64url:()=>Pv,md5_base64:()=>Ev,mac:()=>iG,lowercase:()=>YU,ksuid:()=>xG,ipv6:()=>mG,ipv4:()=>lG,integer:()=>eG,idnEmail:()=>Kv,html5Email:()=>Av,hostname:()=>Lv,hex:()=>Mv,guid:()=>gG,extendedDuration:()=>Dv,emoji:()=>hG,email:()=>fG,e164:()=>pG,duration:()=>yG,domain:()=>Fv,datetime:()=>tG,date:()=>dG,cuid2:()=>TG,cuid:()=>kG,cidrv6:()=>cG,cidrv4:()=>nG,browserEmail:()=>vv,boolean:()=>XU,bigint:()=>sG,base64url:()=>VJ,base64:()=>rG});var kG=/^[cC][^\s-]{8,}$/,TG=/^[0-9a-z]+$/,CG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_G=/^[0-9a-vA-V]{20}$/,xG=/^[A-Za-z0-9]{27}$/,uG=/^[a-zA-Z0-9_-]{21}$/,yG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dv=/^[-+]?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)?)??$/,gG=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,H1=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Bv=H1(4),wv=H1(6),Vv=H1(7),fG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Av=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,bv=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,FH=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Kv=FH,vv=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function hG(){return new RegExp(qv,"u")}var lG=/^(?:(?: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])$/,mG=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,iG=($)=>{let X=M4($??":");return new RegExp(`^(?:[0-9A-F]{2}${X}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${X}){5}[0-9a-f]{2}$`)},nG=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,VJ=/^[A-Za-z0-9_-]*$/,Lv=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Fv=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,pG=/^\+(?:[0-9]){6,14}[0-9]$/,MH="(?:(?:\\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])))",dG=new RegExp(`^${MH}$`);function SH($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function oG($){return new RegExp(`^${SH($)}$`)}function tG($){let X=SH({precision:$.precision}),W=["Z"];if($.local)W.push("");if($.offset)W.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let Y=`${X}(?:${W.join("|")})`;return new RegExp(`^${MH}T(?:${Y})$`)}var aG=($)=>{let X=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${X}$`)},sG=/^-?\d+n?$/,eG=/^-?\d+$/,$U=/^-?\d+(?:\.\d+)?/,XU=/^(?:true|false)$/i,WU=/^null$/i;var JU=/^undefined$/i;var YU=/^[^A-Z]*$/,GU=/^[^a-z]*$/,Mv=/^[0-9a-fA-F]*$/;function d0($,X){return new RegExp(`^[A-Za-z0-9+/]{${$}}${X}$`)}function o0($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Sv=/^[0-9a-fA-F]{32}$/,Ev=d0(22,"=="),Pv=o0(22),Rv=/^[0-9a-fA-F]{40}$/,Zv=d0(27,"="),kv=o0(27),Tv=/^[0-9a-fA-F]{64}$/,Cv=d0(43,"="),_v=o0(43),xv=/^[0-9a-fA-F]{96}$/,uv=d0(64,""),yv=o0(64),gv=/^[0-9a-fA-F]{128}$/,fv=d0(86,"=="),hv=o0(86);var B$=A("$ZodCheck",($,X)=>{var W;$._zod??($._zod={}),$._zod.def=X,(W=$._zod).onattach??(W.onattach=[])}),PH={number:"number",bigint:"bigint",object:"date"},AJ=A("$ZodCheckLessThan",($,X)=>{B$.init($,X);let W=PH[typeof X.value];$._zod.onattach.push((Y)=>{let J=Y._zod.bag,G=(X.inclusive?J.maximum:J.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(X.value<G)if(X.inclusive)J.maximum=X.value;else J.exclusiveMaximum=X.value}),$._zod.check=(Y)=>{if(X.inclusive?Y.value<=X.value:Y.value<X.value)return;Y.issues.push({origin:W,code:"too_big",maximum:X.value,input:Y.value,inclusive:X.inclusive,inst:$,continue:!X.abort})}}),bJ=A("$ZodCheckGreaterThan",($,X)=>{B$.init($,X);let W=PH[typeof X.value];$._zod.onattach.push((Y)=>{let J=Y._zod.bag,G=(X.inclusive?J.minimum:J.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(X.value>G)if(X.inclusive)J.minimum=X.value;else J.exclusiveMinimum=X.value}),$._zod.check=(Y)=>{if(X.inclusive?Y.value>=X.value:Y.value>X.value)return;Y.issues.push({origin:W,code:"too_small",minimum:X.value,input:Y.value,inclusive:X.inclusive,inst:$,continue:!X.abort})}}),UU=A("$ZodCheckMultipleOf",($,X)=>{B$.init($,X),$._zod.onattach.push((W)=>{var Y;(Y=W._zod.bag).multipleOf??(Y.multipleOf=X.value)}),$._zod.check=(W)=>{if(typeof W.value!==typeof X.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof W.value==="bigint"?W.value%X.value===BigInt(0):LG(W.value,X.value)===0)return;W.issues.push({origin:typeof W.value,code:"not_multiple_of",divisor:X.value,input:W.value,inst:$,continue:!X.abort})}}),QU=A("$ZodCheckNumberFormat",($,X)=>{B$.init($,X),X.format=X.format||"float64";let W=X.format?.includes("int"),Y=W?"int":"number",[J,G]=RG[X.format];$._zod.onattach.push((U)=>{let Q=U._zod.bag;if(Q.format=X.format,Q.minimum=J,Q.maximum=G,W)Q.pattern=eG}),$._zod.check=(U)=>{let Q=U.value;if(W){if(!Number.isInteger(Q)){U.issues.push({expected:Y,format:X.format,code:"invalid_type",continue:!1,input:Q,inst:$});return}if(!Number.isSafeInteger(Q)){if(Q>0)U.issues.push({input:Q,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Y,continue:!X.abort});else U.issues.push({input:Q,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:Y,continue:!X.abort});return}}if(Q<J)U.issues.push({origin:"number",input:Q,code:"too_small",minimum:J,inclusive:!0,inst:$,continue:!X.abort});if(Q>G)U.issues.push({origin:"number",input:Q,code:"too_big",maximum:G,inst:$})}}),zU=A("$ZodCheckBigIntFormat",($,X)=>{B$.init($,X);let[W,Y]=ZG[X.format];$._zod.onattach.push((J)=>{let G=J._zod.bag;G.format=X.format,G.minimum=W,G.maximum=Y}),$._zod.check=(J)=>{let G=J.value;if(G<W)J.issues.push({origin:"bigint",input:G,code:"too_small",minimum:W,inclusive:!0,inst:$,continue:!X.abort});if(G>Y)J.issues.push({origin:"bigint",input:G,code:"too_big",maximum:Y,inst:$})}}),HU=A("$ZodCheckMaxSize",($,X)=>{var W;B$.init($,X),(W=$._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!k6(J)&&J.size!==void 0}),$._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if(X.maximum<J)Y._zod.bag.maximum=X.maximum}),$._zod.check=(Y)=>{let J=Y.value;if(J.size<=X.maximum)return;Y.issues.push({origin:c0(J),code:"too_big",maximum:X.maximum,inclusive:!0,input:J,inst:$,continue:!X.abort})}}),jU=A("$ZodCheckMinSize",($,X)=>{var W;B$.init($,X),(W=$._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!k6(J)&&J.size!==void 0}),$._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(X.minimum>J)Y._zod.bag.minimum=X.minimum}),$._zod.check=(Y)=>{let J=Y.value;if(J.size>=X.minimum)return;Y.issues.push({origin:c0(J),code:"too_small",minimum:X.minimum,inclusive:!0,input:J,inst:$,continue:!X.abort})}}),IU=A("$ZodCheckSizeEquals",($,X)=>{var W;B$.init($,X),(W=$._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!k6(J)&&J.size!==void 0}),$._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=X.size,J.maximum=X.size,J.size=X.size}),$._zod.check=(Y)=>{let J=Y.value,G=J.size;if(G===X.size)return;let U=G>X.size;Y.issues.push({origin:c0(J),...U?{code:"too_big",maximum:X.size}:{code:"too_small",minimum:X.size},inclusive:!0,exact:!0,input:Y.value,inst:$,continue:!X.abort})}}),OU=A("$ZodCheckMaxLength",($,X)=>{var W;B$.init($,X),(W=$._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!k6(J)&&J.length!==void 0}),$._zod.onattach.push((Y)=>{let J=Y._zod.bag.maximum??Number.POSITIVE_INFINITY;if(X.maximum<J)Y._zod.bag.maximum=X.maximum}),$._zod.check=(Y)=>{let J=Y.value;if(J.length<=X.maximum)return;let U=r0(J);Y.issues.push({origin:U,code:"too_big",maximum:X.maximum,inclusive:!0,input:J,inst:$,continue:!X.abort})}}),NU=A("$ZodCheckMinLength",($,X)=>{var W;B$.init($,X),(W=$._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!k6(J)&&J.length!==void 0}),$._zod.onattach.push((Y)=>{let J=Y._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(X.minimum>J)Y._zod.bag.minimum=X.minimum}),$._zod.check=(Y)=>{let J=Y.value;if(J.length>=X.minimum)return;let U=r0(J);Y.issues.push({origin:U,code:"too_small",minimum:X.minimum,inclusive:!0,input:J,inst:$,continue:!X.abort})}}),DU=A("$ZodCheckLengthEquals",($,X)=>{var W;B$.init($,X),(W=$._zod.def).when??(W.when=(Y)=>{let J=Y.value;return!k6(J)&&J.length!==void 0}),$._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.minimum=X.length,J.maximum=X.length,J.length=X.length}),$._zod.check=(Y)=>{let J=Y.value,G=J.length;if(G===X.length)return;let U=r0(J),Q=G>X.length;Y.issues.push({origin:U,...Q?{code:"too_big",maximum:X.length}:{code:"too_small",minimum:X.length},inclusive:!0,exact:!0,input:Y.value,inst:$,continue:!X.abort})}}),m1=A("$ZodCheckStringFormat",($,X)=>{var W,Y;if(B$.init($,X),$._zod.onattach.push((J)=>{let G=J._zod.bag;if(G.format=X.format,X.pattern)G.patterns??(G.patterns=new Set),G.patterns.add(X.pattern)}),X.pattern)(W=$._zod).check??(W.check=(J)=>{if(X.pattern.lastIndex=0,X.pattern.test(J.value))return;J.issues.push({origin:"string",code:"invalid_format",format:X.format,input:J.value,...X.pattern?{pattern:X.pattern.toString()}:{},inst:$,continue:!X.abort})});else(Y=$._zod).check??(Y.check=()=>{})}),BU=A("$ZodCheckRegex",($,X)=>{m1.init($,X),$._zod.check=(W)=>{if(X.pattern.lastIndex=0,X.pattern.test(W.value))return;W.issues.push({origin:"string",code:"invalid_format",format:"regex",input:W.value,pattern:X.pattern.toString(),inst:$,continue:!X.abort})}}),wU=A("$ZodCheckLowerCase",($,X)=>{X.pattern??(X.pattern=YU),m1.init($,X)}),VU=A("$ZodCheckUpperCase",($,X)=>{X.pattern??(X.pattern=GU),m1.init($,X)}),AU=A("$ZodCheckIncludes",($,X)=>{B$.init($,X);let W=M4(X.includes),Y=new RegExp(typeof X.position==="number"?`^.{${X.position}}${W}`:W);X.pattern=Y,$._zod.onattach.push((J)=>{let G=J._zod.bag;G.patterns??(G.patterns=new Set),G.patterns.add(Y)}),$._zod.check=(J)=>{if(J.value.includes(X.includes,X.position))return;J.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:X.includes,input:J.value,inst:$,continue:!X.abort})}}),bU=A("$ZodCheckStartsWith",($,X)=>{B$.init($,X);let W=new RegExp(`^${M4(X.prefix)}.*`);X.pattern??(X.pattern=W),$._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),$._zod.check=(Y)=>{if(Y.value.startsWith(X.prefix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:X.prefix,input:Y.value,inst:$,continue:!X.abort})}}),KU=A("$ZodCheckEndsWith",($,X)=>{B$.init($,X);let W=new RegExp(`.*${M4(X.suffix)}$`);X.pattern??(X.pattern=W),$._zod.onattach.push((Y)=>{let J=Y._zod.bag;J.patterns??(J.patterns=new Set),J.patterns.add(W)}),$._zod.check=(Y)=>{if(Y.value.endsWith(X.suffix))return;Y.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:X.suffix,input:Y.value,inst:$,continue:!X.abort})}});function EH($,X,W){if($.issues.length)X.issues.push(...L4(W,$.issues))}var vU=A("$ZodCheckProperty",($,X)=>{B$.init($,X),$._zod.check=(W)=>{let Y=X.schema._zod.run({value:W.value[X.property],issues:[]},{});if(Y instanceof Promise)return Y.then((J)=>EH(J,W,X.property));EH(Y,W,X.property);return}}),qU=A("$ZodCheckMimeType",($,X)=>{B$.init($,X);let W=new Set(X.mime);$._zod.onattach.push((Y)=>{Y._zod.bag.mime=X.mime}),$._zod.check=(Y)=>{if(W.has(Y.value.type))return;Y.issues.push({code:"invalid_value",values:X.mime,input:Y.value.type,inst:$,continue:!X.abort})}}),LU=A("$ZodCheckOverwrite",($,X)=>{B$.init($,X),$._zod.check=(W)=>{W.value=X.tx(W.value)}});class KJ{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let W=$.split(`
|
|
20
|
+
`).filter((G)=>G),Y=Math.min(...W.map((G)=>G.length-G.trimStart().length)),J=W.map((G)=>G.slice(Y)).map((G)=>" ".repeat(this.indent*2)+G);for(let G of J)this.content.push(G)}compile(){let $=Function,X=this?.args,Y=[...(this?.content??[""]).map((J)=>` ${J}`)];return new $(...X,Y.join(`
|
|
21
|
+
`))}}var FU={major:4,minor:1,patch:13};var n=A("$ZodType",($,X)=>{var W;$??($={}),$._zod.def=X,$._zod.bag=$._zod.bag||{},$._zod.version=FU;let Y=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))Y.unshift($);for(let J of Y)for(let G of J._zod.onattach)G($);if(Y.length===0)(W=$._zod).deferred??(W.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let J=(U,Q,z)=>{let H=x6(U),j;for(let O of Q){if(O._zod.def.when){if(!O._zod.def.when(U))continue}else if(H)continue;let B=U.issues.length,I=O._zod.check(U);if(I instanceof Promise&&z?.async===!1)throw new $6;if(j||I instanceof Promise)j=(j??Promise.resolve()).then(async()=>{if(await I,U.issues.length===B)return;if(!H)H=x6(U,B)});else{if(U.issues.length===B)continue;if(!H)H=x6(U,B)}}if(j)return j.then(()=>{return U});return U},G=(U,Q,z)=>{if(x6(U))return U.aborted=!0,U;let H=J(Q,Y,z);if(H instanceof Promise){if(z.async===!1)throw new $6;return H.then((j)=>$._zod.parse(j,z))}return $._zod.parse(H,z)};$._zod.run=(U,Q)=>{if(Q.skipChecks)return $._zod.parse(U,Q);if(Q.direction==="backward"){let H=$._zod.parse({value:U.value,issues:[]},{...Q,skipChecks:!0});if(H instanceof Promise)return H.then((j)=>{return G(j,U,Q)});return G(H,U,Q)}let z=$._zod.parse(U,Q);if(z instanceof Promise){if(Q.async===!1)throw new $6;return z.then((H)=>J(H,Y,Q))}return J(z,Y,Q)}}$["~standard"]={validate:(J)=>{try{let G=u6($,J);return G.success?{value:G.data}:{issues:G.error?.issues}}catch(G){return y6($,J).then((U)=>U.success?{value:U.data}:{issues:U.error?.issues})}},vendor:"zod",version:1}}),g6=A("$ZodString",($,X)=>{n.init($,X),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??aG($._zod.bag),$._zod.parse=(W,Y)=>{if(X.coerce)try{W.value=String(W.value)}catch(J){}if(typeof W.value==="string")return W;return W.issues.push({expected:"string",code:"invalid_type",input:W.value,inst:$}),W}}),O$=A("$ZodStringFormat",($,X)=>{m1.init($,X),g6.init($,X)}),SJ=A("$ZodGUID",($,X)=>{X.pattern??(X.pattern=gG),O$.init($,X)}),EJ=A("$ZodUUID",($,X)=>{if(X.version){let Y={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[X.version];if(Y===void 0)throw Error(`Invalid UUID version: "${X.version}"`);X.pattern??(X.pattern=H1(Y))}else X.pattern??(X.pattern=H1());O$.init($,X)}),PJ=A("$ZodEmail",($,X)=>{X.pattern??(X.pattern=fG),O$.init($,X)}),RJ=A("$ZodURL",($,X)=>{O$.init($,X),$._zod.check=(W)=>{try{let Y=W.value.trim(),J=new URL(Y);if(X.hostname){if(X.hostname.lastIndex=0,!X.hostname.test(J.hostname))W.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.hostname.source,input:W.value,inst:$,continue:!X.abort})}if(X.protocol){if(X.protocol.lastIndex=0,!X.protocol.test(J.protocol.endsWith(":")?J.protocol.slice(0,-1):J.protocol))W.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:X.protocol.source,input:W.value,inst:$,continue:!X.abort})}if(X.normalize)W.value=J.href;else W.value=Y;return}catch(Y){W.issues.push({code:"invalid_format",format:"url",input:W.value,inst:$,continue:!X.abort})}}}),ZJ=A("$ZodEmoji",($,X)=>{X.pattern??(X.pattern=hG()),O$.init($,X)}),kJ=A("$ZodNanoID",($,X)=>{X.pattern??(X.pattern=uG),O$.init($,X)}),TJ=A("$ZodCUID",($,X)=>{X.pattern??(X.pattern=kG),O$.init($,X)}),CJ=A("$ZodCUID2",($,X)=>{X.pattern??(X.pattern=TG),O$.init($,X)}),_J=A("$ZodULID",($,X)=>{X.pattern??(X.pattern=CG),O$.init($,X)}),xJ=A("$ZodXID",($,X)=>{X.pattern??(X.pattern=_G),O$.init($,X)}),uJ=A("$ZodKSUID",($,X)=>{X.pattern??(X.pattern=xG),O$.init($,X)}),SU=A("$ZodISODateTime",($,X)=>{X.pattern??(X.pattern=tG(X)),O$.init($,X)}),EU=A("$ZodISODate",($,X)=>{X.pattern??(X.pattern=dG),O$.init($,X)}),PU=A("$ZodISOTime",($,X)=>{X.pattern??(X.pattern=oG(X)),O$.init($,X)}),RU=A("$ZodISODuration",($,X)=>{X.pattern??(X.pattern=yG),O$.init($,X)}),yJ=A("$ZodIPv4",($,X)=>{X.pattern??(X.pattern=lG),O$.init($,X),$._zod.bag.format="ipv4"}),gJ=A("$ZodIPv6",($,X)=>{X.pattern??(X.pattern=mG),O$.init($,X),$._zod.bag.format="ipv6",$._zod.check=(W)=>{try{new URL(`http://[${W.value}]`)}catch{W.issues.push({code:"invalid_format",format:"ipv6",input:W.value,inst:$,continue:!X.abort})}}}),fJ=A("$ZodMAC",($,X)=>{X.pattern??(X.pattern=iG(X.delimiter)),O$.init($,X),$._zod.bag.format="mac"}),hJ=A("$ZodCIDRv4",($,X)=>{X.pattern??(X.pattern=nG),O$.init($,X)}),lJ=A("$ZodCIDRv6",($,X)=>{X.pattern??(X.pattern=cG),O$.init($,X),$._zod.check=(W)=>{let Y=W.value.split("/");try{if(Y.length!==2)throw Error();let[J,G]=Y;if(!G)throw Error();let U=Number(G);if(`${U}`!==G)throw Error();if(U<0||U>128)throw Error();new URL(`http://[${J}]`)}catch{W.issues.push({code:"invalid_format",format:"cidrv6",input:W.value,inst:$,continue:!X.abort})}}});function ZU($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var mJ=A("$ZodBase64",($,X)=>{X.pattern??(X.pattern=rG),O$.init($,X),$._zod.bag.contentEncoding="base64",$._zod.check=(W)=>{if(ZU(W.value))return;W.issues.push({code:"invalid_format",format:"base64",input:W.value,inst:$,continue:!X.abort})}});function hH($){if(!VJ.test($))return!1;let X=$.replace(/[-_]/g,(Y)=>Y==="-"?"+":"/"),W=X.padEnd(Math.ceil(X.length/4)*4,"=");return ZU(W)}var iJ=A("$ZodBase64URL",($,X)=>{X.pattern??(X.pattern=VJ),O$.init($,X),$._zod.bag.contentEncoding="base64url",$._zod.check=(W)=>{if(hH(W.value))return;W.issues.push({code:"invalid_format",format:"base64url",input:W.value,inst:$,continue:!X.abort})}}),nJ=A("$ZodE164",($,X)=>{X.pattern??(X.pattern=pG),O$.init($,X)});function lH($,X=null){try{let W=$.split(".");if(W.length!==3)return!1;let[Y]=W;if(!Y)return!1;let J=JSON.parse(atob(Y));if("typ"in J&&J?.typ!=="JWT")return!1;if(!J.alg)return!1;if(X&&(!("alg"in J)||J.alg!==X))return!1;return!0}catch{return!1}}var cJ=A("$ZodJWT",($,X)=>{O$.init($,X),$._zod.check=(W)=>{if(lH(W.value,X.alg))return;W.issues.push({code:"invalid_format",format:"jwt",input:W.value,inst:$,continue:!X.abort})}}),rJ=A("$ZodCustomStringFormat",($,X)=>{O$.init($,X),$._zod.check=(W)=>{if(X.fn(W.value))return;W.issues.push({code:"invalid_format",format:X.format,input:W.value,inst:$,continue:!X.abort})}}),t0=A("$ZodNumber",($,X)=>{n.init($,X),$._zod.pattern=$._zod.bag.pattern??$U,$._zod.parse=(W,Y)=>{if(X.coerce)try{W.value=Number(W.value)}catch(U){}let J=W.value;if(typeof J==="number"&&!Number.isNaN(J)&&Number.isFinite(J))return W;let G=typeof J==="number"?Number.isNaN(J)?"NaN":!Number.isFinite(J)?"Infinity":void 0:void 0;return W.issues.push({expected:"number",code:"invalid_type",input:J,inst:$,...G?{received:G}:{}}),W}}),pJ=A("$ZodNumberFormat",($,X)=>{QU.init($,X),t0.init($,X)}),i1=A("$ZodBoolean",($,X)=>{n.init($,X),$._zod.pattern=XU,$._zod.parse=(W,Y)=>{if(X.coerce)try{W.value=Boolean(W.value)}catch(G){}let J=W.value;if(typeof J==="boolean")return W;return W.issues.push({expected:"boolean",code:"invalid_type",input:J,inst:$}),W}}),a0=A("$ZodBigInt",($,X)=>{n.init($,X),$._zod.pattern=sG,$._zod.parse=(W,Y)=>{if(X.coerce)try{W.value=BigInt(W.value)}catch(J){}if(typeof W.value==="bigint")return W;return W.issues.push({expected:"bigint",code:"invalid_type",input:W.value,inst:$}),W}}),dJ=A("$ZodBigIntFormat",($,X)=>{zU.init($,X),a0.init($,X)}),oJ=A("$ZodSymbol",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value;if(typeof J==="symbol")return W;return W.issues.push({expected:"symbol",code:"invalid_type",input:J,inst:$}),W}}),tJ=A("$ZodUndefined",($,X)=>{n.init($,X),$._zod.pattern=JU,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(W,Y)=>{let J=W.value;if(typeof J>"u")return W;return W.issues.push({expected:"undefined",code:"invalid_type",input:J,inst:$}),W}}),aJ=A("$ZodNull",($,X)=>{n.init($,X),$._zod.pattern=WU,$._zod.values=new Set([null]),$._zod.parse=(W,Y)=>{let J=W.value;if(J===null)return W;return W.issues.push({expected:"null",code:"invalid_type",input:J,inst:$}),W}}),sJ=A("$ZodAny",($,X)=>{n.init($,X),$._zod.parse=(W)=>W}),eJ=A("$ZodUnknown",($,X)=>{n.init($,X),$._zod.parse=(W)=>W}),$9=A("$ZodNever",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{return W.issues.push({expected:"never",code:"invalid_type",input:W.value,inst:$}),W}}),X9=A("$ZodVoid",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value;if(typeof J>"u")return W;return W.issues.push({expected:"void",code:"invalid_type",input:J,inst:$}),W}}),W9=A("$ZodDate",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{if(X.coerce)try{W.value=new Date(W.value)}catch(Q){}let J=W.value,G=J instanceof Date;if(G&&!Number.isNaN(J.getTime()))return W;return W.issues.push({expected:"date",code:"invalid_type",input:J,...G?{received:"Invalid Date"}:{},inst:$}),W}});function ZH($,X,W){if($.issues.length)X.issues.push(...L4(W,$.issues));X.value[W]=$.value}var J9=A("$ZodArray",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value;if(!Array.isArray(J))return W.issues.push({expected:"array",code:"invalid_type",input:J,inst:$}),W;W.value=Array(J.length);let G=[];for(let U=0;U<J.length;U++){let Q=J[U],z=X.element._zod.run({value:Q,issues:[]},Y);if(z instanceof Promise)G.push(z.then((H)=>ZH(H,W,U)));else ZH(z,W,U)}if(G.length)return Promise.all(G).then(()=>W);return W}});function MJ($,X,W,Y){if($.issues.length)X.issues.push(...L4(W,$.issues));if($.value===void 0){if(W in Y)X.value[W]=void 0}else X.value[W]=$.value}function mH($){let X=Object.keys($.shape);for(let Y of X)if(!$.shape?.[Y]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${Y}": expected a Zod schema`);let W=PG($.shape);return{...$,keys:X,keySet:new Set(X),numKeys:X.length,optionalKeys:new Set(W)}}function iH($,X,W,Y,J,G){let U=[],Q=J.keySet,z=J.catchall._zod,H=z.def.type;for(let j in X){if(Q.has(j))continue;if(H==="never"){U.push(j);continue}let O=z.run({value:X[j],issues:[]},Y);if(O instanceof Promise)$.push(O.then((B)=>MJ(B,W,j,X)));else MJ(O,W,j,X)}if(U.length)W.issues.push({code:"unrecognized_keys",keys:U,input:X,inst:G});if(!$.length)return W;return Promise.all($).then(()=>{return W})}var Y9=A("$ZodObject",($,X)=>{if(n.init($,X),!Object.getOwnPropertyDescriptor(X,"shape")?.get){let Q=X.shape;Object.defineProperty(X,"shape",{get:()=>{let z={...Q};return Object.defineProperty(X,"shape",{value:z}),z}})}let Y=_1(()=>mH(X));W$($._zod,"propValues",()=>{let Q=X.shape,z={};for(let H in Q){let j=Q[H]._zod;if(j.values){z[H]??(z[H]=new Set);for(let O of j.values)z[H].add(O)}}return z});let J=U1,G=X.catchall,U;$._zod.parse=(Q,z)=>{U??(U=Y.value);let H=Q.value;if(!J(H))return Q.issues.push({expected:"object",code:"invalid_type",input:H,inst:$}),Q;Q.value={};let j=[],O=U.shape;for(let B of U.keys){let N=O[B]._zod.run({value:H[B],issues:[]},z);if(N instanceof Promise)j.push(N.then((D)=>MJ(D,Q,B,H)));else MJ(N,Q,B,H)}if(!G)return j.length?Promise.all(j).then(()=>Q):Q;return iH(j,H,Q,z,Y.value,$)}}),kU=A("$ZodObjectJIT",($,X)=>{Y9.init($,X);let W=$._zod.parse,Y=_1(()=>mH(X)),J=(B)=>{let I=new KJ(["shape","payload","ctx"]),N=Y.value,D=(b)=>{let S=GJ(b);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};I.write("const input = payload.value;");let w=Object.create(null),V=0;for(let b of N.keys)w[b]=`key_${V++}`;I.write("const newResult = {};");for(let b of N.keys){let S=w[b],L=GJ(b);I.write(`const ${S} = ${D(b)};`),I.write(`
|
|
22
|
+
if (${S}.issues.length) {
|
|
23
|
+
payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
|
|
24
|
+
...iss,
|
|
25
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
if (${S}.value === undefined) {
|
|
31
|
+
if (${L} in input) {
|
|
32
|
+
newResult[${L}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${L}] = ${S}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`)}I.write("payload.value = newResult;"),I.write("return payload;");let K=I.compile();return(b,S)=>K(B,b,S)},G,U=U1,Q=!h0.jitless,H=Q&&MG.value,j=X.catchall,O;$._zod.parse=(B,I)=>{O??(O=Y.value);let N=B.value;if(!U(N))return B.issues.push({expected:"object",code:"invalid_type",input:N,inst:$}),B;if(Q&&H&&I?.async===!1&&I.jitless!==!0){if(!G)G=J(X.shape);if(B=G(B,I),!j)return B;return iH([],N,B,I,O,$)}return W(B,I)}});function kH($,X,W,Y){for(let G of $)if(G.issues.length===0)return X.value=G.value,X;let J=$.filter((G)=>!x6(G));if(J.length===1)return X.value=J[0].value,J[0];return X.issues.push({code:"invalid_union",input:X.value,inst:W,errors:$.map((G)=>G.issues.map((U)=>F4(U,Y,x$())))}),X}var s0=A("$ZodUnion",($,X)=>{n.init($,X),W$($._zod,"optin",()=>X.options.some((J)=>J._zod.optin==="optional")?"optional":void 0),W$($._zod,"optout",()=>X.options.some((J)=>J._zod.optout==="optional")?"optional":void 0),W$($._zod,"values",()=>{if(X.options.every((J)=>J._zod.values))return new Set(X.options.flatMap((J)=>Array.from(J._zod.values)));return}),W$($._zod,"pattern",()=>{if(X.options.every((J)=>J._zod.pattern)){let J=X.options.map((G)=>G._zod.pattern);return new RegExp(`^(${J.map((G)=>i0(G.source)).join("|")})$`)}return});let W=X.options.length===1,Y=X.options[0]._zod.run;$._zod.parse=(J,G)=>{if(W)return Y(J,G);let U=!1,Q=[];for(let z of X.options){let H=z._zod.run({value:J.value,issues:[]},G);if(H instanceof Promise)Q.push(H),U=!0;else{if(H.issues.length===0)return H;Q.push(H)}}if(!U)return kH(Q,J,$,G);return Promise.all(Q).then((z)=>{return kH(z,J,$,G)})}}),G9=A("$ZodDiscriminatedUnion",($,X)=>{s0.init($,X);let W=$._zod.parse;W$($._zod,"propValues",()=>{let J={};for(let G of X.options){let U=G._zod.propValues;if(!U||Object.keys(U).length===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf(G)}"`);for(let[Q,z]of Object.entries(U)){if(!J[Q])J[Q]=new Set;for(let H of z)J[Q].add(H)}}return J});let Y=_1(()=>{let J=X.options,G=new Map;for(let U of J){let Q=U._zod.propValues?.[X.discriminator];if(!Q||Q.size===0)throw Error(`Invalid discriminated union option at index "${X.options.indexOf(U)}"`);for(let z of Q){if(G.has(z))throw Error(`Duplicate discriminator value "${String(z)}"`);G.set(z,U)}}return G});$._zod.parse=(J,G)=>{let U=J.value;if(!U1(U))return J.issues.push({code:"invalid_type",expected:"object",input:U,inst:$}),J;let Q=Y.value.get(U?.[X.discriminator]);if(Q)return Q._zod.run(J,G);if(X.unionFallback)return W(J,G);return J.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:X.discriminator,input:U,path:[X.discriminator],inst:$}),J}}),U9=A("$ZodIntersection",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value,G=X.left._zod.run({value:J,issues:[]},Y),U=X.right._zod.run({value:J,issues:[]},Y);if(G instanceof Promise||U instanceof Promise)return Promise.all([G,U]).then(([z,H])=>{return TH(W,z,H)});return TH(W,G,U)}});function MU($,X){if($===X)return{valid:!0,data:$};if($ instanceof Date&&X instanceof Date&&+$===+X)return{valid:!0,data:$};if(_6($)&&_6(X)){let W=Object.keys(X),Y=Object.keys($).filter((G)=>W.indexOf(G)!==-1),J={...$,...X};for(let G of Y){let U=MU($[G],X[G]);if(!U.valid)return{valid:!1,mergeErrorPath:[G,...U.mergeErrorPath]};J[G]=U.data}return{valid:!0,data:J}}if(Array.isArray($)&&Array.isArray(X)){if($.length!==X.length)return{valid:!1,mergeErrorPath:[]};let W=[];for(let Y=0;Y<$.length;Y++){let J=$[Y],G=X[Y],U=MU(J,G);if(!U.valid)return{valid:!1,mergeErrorPath:[Y,...U.mergeErrorPath]};W.push(U.data)}return{valid:!0,data:W}}return{valid:!1,mergeErrorPath:[]}}function TH($,X,W){if(X.issues.length)$.issues.push(...X.issues);if(W.issues.length)$.issues.push(...W.issues);if(x6($))return $;let Y=MU(X.value,W.value);if(!Y.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(Y.mergeErrorPath)}`);return $.value=Y.data,$}var e0=A("$ZodTuple",($,X)=>{n.init($,X);let W=X.items;$._zod.parse=(Y,J)=>{let G=Y.value;if(!Array.isArray(G))return Y.issues.push({input:G,inst:$,expected:"tuple",code:"invalid_type"}),Y;Y.value=[];let U=[],Q=[...W].reverse().findIndex((j)=>j._zod.optin!=="optional"),z=Q===-1?0:W.length-Q;if(!X.rest){let j=G.length>W.length,O=G.length<z-1;if(j||O)return Y.issues.push({...j?{code:"too_big",maximum:W.length}:{code:"too_small",minimum:W.length},input:G,inst:$,origin:"array"}),Y}let H=-1;for(let j of W){if(H++,H>=G.length){if(H>=z)continue}let O=j._zod.run({value:G[H],issues:[]},J);if(O instanceof Promise)U.push(O.then((B)=>vJ(B,Y,H)));else vJ(O,Y,H)}if(X.rest){let j=G.slice(W.length);for(let O of j){H++;let B=X.rest._zod.run({value:O,issues:[]},J);if(B instanceof Promise)U.push(B.then((I)=>vJ(I,Y,H)));else vJ(B,Y,H)}}if(U.length)return Promise.all(U).then(()=>Y);return Y}});function vJ($,X,W){if($.issues.length)X.issues.push(...L4(W,$.issues));X.value[W]=$.value}var Q9=A("$ZodRecord",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value;if(!_6(J))return W.issues.push({expected:"record",code:"invalid_type",input:J,inst:$}),W;let G=[],U=X.keyType._zod.values;if(U){W.value={};let Q=new Set;for(let H of U)if(typeof H==="string"||typeof H==="number"||typeof H==="symbol"){Q.add(typeof H==="number"?H.toString():H);let j=X.valueType._zod.run({value:J[H],issues:[]},Y);if(j instanceof Promise)G.push(j.then((O)=>{if(O.issues.length)W.issues.push(...L4(H,O.issues));W.value[H]=O.value}));else{if(j.issues.length)W.issues.push(...L4(H,j.issues));W.value[H]=j.value}}let z;for(let H in J)if(!Q.has(H))z=z??[],z.push(H);if(z&&z.length>0)W.issues.push({code:"unrecognized_keys",input:J,inst:$,keys:z})}else{W.value={};for(let Q of Reflect.ownKeys(J)){if(Q==="__proto__")continue;let z=X.keyType._zod.run({value:Q,issues:[]},Y);if(z instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(z.issues.length){W.issues.push({code:"invalid_key",origin:"record",issues:z.issues.map((j)=>F4(j,Y,x$())),input:Q,path:[Q],inst:$}),W.value[z.value]=z.value;continue}let H=X.valueType._zod.run({value:J[Q],issues:[]},Y);if(H instanceof Promise)G.push(H.then((j)=>{if(j.issues.length)W.issues.push(...L4(Q,j.issues));W.value[z.value]=j.value}));else{if(H.issues.length)W.issues.push(...L4(Q,H.issues));W.value[z.value]=H.value}}}if(G.length)return Promise.all(G).then(()=>W);return W}}),z9=A("$ZodMap",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value;if(!(J instanceof Map))return W.issues.push({expected:"map",code:"invalid_type",input:J,inst:$}),W;let G=[];W.value=new Map;for(let[U,Q]of J){let z=X.keyType._zod.run({value:U,issues:[]},Y),H=X.valueType._zod.run({value:Q,issues:[]},Y);if(z instanceof Promise||H instanceof Promise)G.push(Promise.all([z,H]).then(([j,O])=>{CH(j,O,W,U,J,$,Y)}));else CH(z,H,W,U,J,$,Y)}if(G.length)return Promise.all(G).then(()=>W);return W}});function CH($,X,W,Y,J,G,U){if($.issues.length)if(n0.has(typeof Y))W.issues.push(...L4(Y,$.issues));else W.issues.push({code:"invalid_key",origin:"map",input:J,inst:G,issues:$.issues.map((Q)=>F4(Q,U,x$()))});if(X.issues.length)if(n0.has(typeof Y))W.issues.push(...L4(Y,X.issues));else W.issues.push({origin:"map",code:"invalid_element",input:J,inst:G,key:Y,issues:X.issues.map((Q)=>F4(Q,U,x$()))});W.value.set($.value,X.value)}var H9=A("$ZodSet",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value;if(!(J instanceof Set))return W.issues.push({input:J,inst:$,expected:"set",code:"invalid_type"}),W;let G=[];W.value=new Set;for(let U of J){let Q=X.valueType._zod.run({value:U,issues:[]},Y);if(Q instanceof Promise)G.push(Q.then((z)=>_H(z,W)));else _H(Q,W)}if(G.length)return Promise.all(G).then(()=>W);return W}});function _H($,X){if($.issues.length)X.issues.push(...$.issues);X.value.add($.value)}var j9=A("$ZodEnum",($,X)=>{n.init($,X);let W=m0(X.entries),Y=new Set(W);$._zod.values=Y,$._zod.pattern=new RegExp(`^(${W.filter((J)=>n0.has(typeof J)).map((J)=>typeof J==="string"?M4(J):J.toString()).join("|")})$`),$._zod.parse=(J,G)=>{let U=J.value;if(Y.has(U))return J;return J.issues.push({code:"invalid_value",values:W,input:U,inst:$}),J}}),I9=A("$ZodLiteral",($,X)=>{if(n.init($,X),X.values.length===0)throw Error("Cannot create literal schema with no valid values");let W=new Set(X.values);$._zod.values=W,$._zod.pattern=new RegExp(`^(${X.values.map((Y)=>typeof Y==="string"?M4(Y):Y?M4(Y.toString()):String(Y)).join("|")})$`),$._zod.parse=(Y,J)=>{let G=Y.value;if(W.has(G))return Y;return Y.issues.push({code:"invalid_value",values:X.values,input:G,inst:$}),Y}}),O9=A("$ZodFile",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{let J=W.value;if(J instanceof File)return W;return W.issues.push({expected:"file",code:"invalid_type",input:J,inst:$}),W}}),N9=A("$ZodTransform",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new G1($.constructor.name);let J=X.transform(W.value,W);if(Y.async)return(J instanceof Promise?J:Promise.resolve(J)).then((U)=>{return W.value=U,W});if(J instanceof Promise)throw new $6;return W.value=J,W}});function xH($,X){if($.issues.length&&X===void 0)return{issues:[],value:void 0};return $}var D9=A("$ZodOptional",($,X)=>{n.init($,X),$._zod.optin="optional",$._zod.optout="optional",W$($._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,void 0]):void 0}),W$($._zod,"pattern",()=>{let W=X.innerType._zod.pattern;return W?new RegExp(`^(${i0(W.source)})?$`):void 0}),$._zod.parse=(W,Y)=>{if(X.innerType._zod.optin==="optional"){let J=X.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>xH(G,W.value));return xH(J,W.value)}if(W.value===void 0)return W;return X.innerType._zod.run(W,Y)}}),B9=A("$ZodNullable",($,X)=>{n.init($,X),W$($._zod,"optin",()=>X.innerType._zod.optin),W$($._zod,"optout",()=>X.innerType._zod.optout),W$($._zod,"pattern",()=>{let W=X.innerType._zod.pattern;return W?new RegExp(`^(${i0(W.source)}|null)$`):void 0}),W$($._zod,"values",()=>{return X.innerType._zod.values?new Set([...X.innerType._zod.values,null]):void 0}),$._zod.parse=(W,Y)=>{if(W.value===null)return W;return X.innerType._zod.run(W,Y)}}),w9=A("$ZodDefault",($,X)=>{n.init($,X),$._zod.optin="optional",W$($._zod,"values",()=>X.innerType._zod.values),$._zod.parse=(W,Y)=>{if(Y.direction==="backward")return X.innerType._zod.run(W,Y);if(W.value===void 0)return W.value=X.defaultValue,W;let J=X.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>uH(G,X));return uH(J,X)}});function uH($,X){if($.value===void 0)$.value=X.defaultValue;return $}var V9=A("$ZodPrefault",($,X)=>{n.init($,X),$._zod.optin="optional",W$($._zod,"values",()=>X.innerType._zod.values),$._zod.parse=(W,Y)=>{if(Y.direction==="backward")return X.innerType._zod.run(W,Y);if(W.value===void 0)W.value=X.defaultValue;return X.innerType._zod.run(W,Y)}}),A9=A("$ZodNonOptional",($,X)=>{n.init($,X),W$($._zod,"values",()=>{let W=X.innerType._zod.values;return W?new Set([...W].filter((Y)=>Y!==void 0)):void 0}),$._zod.parse=(W,Y)=>{let J=X.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>yH(G,$));return yH(J,$)}});function yH($,X){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:X});return $}var b9=A("$ZodSuccess",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new G1("ZodSuccess");let J=X.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>{return W.value=G.issues.length===0,W});return W.value=J.issues.length===0,W}}),K9=A("$ZodCatch",($,X)=>{n.init($,X),W$($._zod,"optin",()=>X.innerType._zod.optin),W$($._zod,"optout",()=>X.innerType._zod.optout),W$($._zod,"values",()=>X.innerType._zod.values),$._zod.parse=(W,Y)=>{if(Y.direction==="backward")return X.innerType._zod.run(W,Y);let J=X.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>{if(W.value=G.value,G.issues.length)W.value=X.catchValue({...W,error:{issues:G.issues.map((U)=>F4(U,Y,x$()))},input:W.value}),W.issues=[];return W});if(W.value=J.value,J.issues.length)W.value=X.catchValue({...W,error:{issues:J.issues.map((G)=>F4(G,Y,x$()))},input:W.value}),W.issues=[];return W}}),v9=A("$ZodNaN",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{if(typeof W.value!=="number"||!Number.isNaN(W.value))return W.issues.push({input:W.value,inst:$,expected:"nan",code:"invalid_type"}),W;return W}}),q9=A("$ZodPipe",($,X)=>{n.init($,X),W$($._zod,"values",()=>X.in._zod.values),W$($._zod,"optin",()=>X.in._zod.optin),W$($._zod,"optout",()=>X.out._zod.optout),W$($._zod,"propValues",()=>X.in._zod.propValues),$._zod.parse=(W,Y)=>{if(Y.direction==="backward"){let G=X.out._zod.run(W,Y);if(G instanceof Promise)return G.then((U)=>qJ(U,X.in,Y));return qJ(G,X.in,Y)}let J=X.in._zod.run(W,Y);if(J instanceof Promise)return J.then((G)=>qJ(G,X.out,Y));return qJ(J,X.out,Y)}});function qJ($,X,W){if($.issues.length)return $.aborted=!0,$;return X._zod.run({value:$.value,issues:$.issues},W)}var n1=A("$ZodCodec",($,X)=>{n.init($,X),W$($._zod,"values",()=>X.in._zod.values),W$($._zod,"optin",()=>X.in._zod.optin),W$($._zod,"optout",()=>X.out._zod.optout),W$($._zod,"propValues",()=>X.in._zod.propValues),$._zod.parse=(W,Y)=>{if((Y.direction||"forward")==="forward"){let G=X.in._zod.run(W,Y);if(G instanceof Promise)return G.then((U)=>LJ(U,X,Y));return LJ(G,X,Y)}else{let G=X.out._zod.run(W,Y);if(G instanceof Promise)return G.then((U)=>LJ(U,X,Y));return LJ(G,X,Y)}}});function LJ($,X,W){if($.issues.length)return $.aborted=!0,$;if((W.direction||"forward")==="forward"){let J=X.transform($.value,$);if(J instanceof Promise)return J.then((G)=>FJ($,G,X.out,W));return FJ($,J,X.out,W)}else{let J=X.reverseTransform($.value,$);if(J instanceof Promise)return J.then((G)=>FJ($,G,X.in,W));return FJ($,J,X.in,W)}}function FJ($,X,W,Y){if($.issues.length)return $.aborted=!0,$;return W._zod.run({value:X,issues:$.issues},Y)}var L9=A("$ZodReadonly",($,X)=>{n.init($,X),W$($._zod,"propValues",()=>X.innerType._zod.propValues),W$($._zod,"values",()=>X.innerType._zod.values),W$($._zod,"optin",()=>X.innerType?._zod?.optin),W$($._zod,"optout",()=>X.innerType?._zod?.optout),$._zod.parse=(W,Y)=>{if(Y.direction==="backward")return X.innerType._zod.run(W,Y);let J=X.innerType._zod.run(W,Y);if(J instanceof Promise)return J.then(gH);return gH(J)}});function gH($){return $.value=Object.freeze($.value),$}var F9=A("$ZodTemplateLiteral",($,X)=>{n.init($,X);let W=[];for(let Y of X.parts)if(typeof Y==="object"&&Y!==null){if(!Y._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...Y._zod.traits].shift()}`);let J=Y._zod.pattern instanceof RegExp?Y._zod.pattern.source:Y._zod.pattern;if(!J)throw Error(`Invalid template literal part: ${Y._zod.traits}`);let G=J.startsWith("^")?1:0,U=J.endsWith("$")?J.length-1:J.length;W.push(J.slice(G,U))}else if(Y===null||EG.has(typeof Y))W.push(M4(`${Y}`));else throw Error(`Invalid template literal part: ${Y}`);$._zod.pattern=new RegExp(`^${W.join("")}$`),$._zod.parse=(Y,J)=>{if(typeof Y.value!=="string")return Y.issues.push({input:Y.value,inst:$,expected:"template_literal",code:"invalid_type"}),Y;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(Y.value))return Y.issues.push({input:Y.value,inst:$,code:"invalid_format",format:X.format??"template_literal",pattern:$._zod.pattern.source}),Y;return Y}}),M9=A("$ZodFunction",($,X)=>{return n.init($,X),$._def=X,$._zod.def=X,$.implement=(W)=>{if(typeof W!=="function")throw Error("implement() must be called with a function");return function(...Y){let J=$._def.input?Q1($._def.input,Y):Y,G=Reflect.apply(W,this,J);if($._def.output)return Q1($._def.output,G);return G}},$.implementAsync=(W)=>{if(typeof W!=="function")throw Error("implementAsync() must be called with a function");return async function(...Y){let J=$._def.input?await z1($._def.input,Y):Y,G=await Reflect.apply(W,this,J);if($._def.output)return await z1($._def.output,G);return G}},$._zod.parse=(W,Y)=>{if(typeof W.value!=="function")return W.issues.push({code:"invalid_type",expected:"function",input:W.value,inst:$}),W;if($._def.output&&$._def.output._zod.def.type==="promise")W.value=$.implementAsync(W.value);else W.value=$.implement(W.value);return W},$.input=(...W)=>{let Y=$.constructor;if(Array.isArray(W[0]))return new Y({type:"function",input:new e0({type:"tuple",items:W[0],rest:W[1]}),output:$._def.output});return new Y({type:"function",input:W[0],output:$._def.output})},$.output=(W)=>{return new $.constructor({type:"function",input:$._def.input,output:W})},$}),S9=A("$ZodPromise",($,X)=>{n.init($,X),$._zod.parse=(W,Y)=>{return Promise.resolve(W.value).then((J)=>X.innerType._zod.run({value:J,issues:[]},Y))}}),E9=A("$ZodLazy",($,X)=>{n.init($,X),W$($._zod,"innerType",()=>X.getter()),W$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),W$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),W$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),W$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(W,Y)=>{return $._zod.innerType._zod.run(W,Y)}}),P9=A("$ZodCustom",($,X)=>{B$.init($,X),n.init($,X),$._zod.parse=(W,Y)=>{return W},$._zod.check=(W)=>{let Y=W.value,J=X.fn(Y);if(J instanceof Promise)return J.then((G)=>fH(G,W,Y,$));fH(J,W,Y,$);return}});function fH($,X,W,Y){if(!$){let J={code:"custom",input:W,inst:Y,path:[...Y._zod.def.path??[]],continue:!Y._zod.def.abort};if(Y._zod.def.params)J.params=Y._zod.def.params;X.issues.push(x1(J))}}var c1={};X1(c1,{zhTW:()=>KQ,zhCN:()=>bQ,yo:()=>vQ,vi:()=>AQ,ur:()=>VQ,uk:()=>YX,ua:()=>wQ,tr:()=>BQ,th:()=>DQ,ta:()=>NQ,sv:()=>OQ,sl:()=>IQ,ru:()=>jQ,pt:()=>HQ,ps:()=>QQ,pl:()=>zQ,ota:()=>UQ,no:()=>GQ,nl:()=>YQ,ms:()=>JQ,mk:()=>WQ,lt:()=>XQ,ko:()=>$Q,km:()=>XX,kh:()=>eU,ka:()=>sU,ja:()=>aU,it:()=>tU,is:()=>oU,id:()=>dU,hu:()=>pU,he:()=>rU,frCA:()=>cU,fr:()=>nU,fi:()=>iU,fa:()=>mU,es:()=>lU,eo:()=>hU,en:()=>$X,de:()=>fU,da:()=>gU,cs:()=>yU,ca:()=>uU,bg:()=>xU,be:()=>_U,az:()=>CU,ar:()=>TU});var mv=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return(J)=>{switch(J.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${J.expected}، ولكن تم إدخال ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${Z(J.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return` أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${G} ${J.maximum.toString()} ${U.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${J.origin??"القيمة"} ${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${G} ${J.minimum.toString()} ${U.unit}`;return`أصغر من اللازم: يفترض لـ ${J.origin} أن يكون ${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${J.prefix}"`;if(G.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${G.suffix}"`;if(G.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${G.includes}"`;if(G.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${G.pattern}`;return`${Y[G.format]??J.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${J.divisor}`;case"unrecognized_keys":return`معرف${J.keys.length>1?"ات":""} غريب${J.keys.length>1?"ة":""}: ${q(J.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${J.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${J.origin}`;default:return"مدخل غير مقبول"}}};function TU(){return{localeError:mv()}}var iv=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${J.expected}, daxil olan ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Yanlış dəyər: gözlənilən ${Z(J.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${G}${J.maximum.toString()} ${U.unit??"element"}`;return`Çox böyük: gözlənilən ${J.origin??"dəyər"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Çox kiçik: gözlənilən ${J.origin} ${G}${J.minimum.toString()} ${U.unit}`;return`Çox kiçik: gözlənilən ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Yanlış mətn: "${G.prefix}" ilə başlamalıdır`;if(G.format==="ends_with")return`Yanlış mətn: "${G.suffix}" ilə bitməlidir`;if(G.format==="includes")return`Yanlış mətn: "${G.includes}" daxil olmalıdır`;if(G.format==="regex")return`Yanlış mətn: ${G.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${Y[G.format]??J.format}`}case"not_multiple_of":return`Yanlış ədəd: ${J.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${J.keys.length>1?"lar":""}: ${q(J.keys,", ")}`;case"invalid_key":return`${J.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${J.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function CU(){return{localeError:iv()}}function nH($,X,W,Y){let J=Math.abs($),G=J%10,U=J%100;if(U>=11&&U<=19)return Y;if(G===1)return X;if(G>=2&&G<=4)return W;return Y}var nv=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"лік";case"object":{if(Array.isArray(J))return"масіў";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return(J)=>{switch(J.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${J.expected}, атрымана ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Няправільны ўвод: чакалася ${Z(J.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U){let Q=Number(J.maximum),z=nH(Q,U.unit.one,U.unit.few,U.unit.many);return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна ${U.verb} ${G}${J.maximum.toString()} ${z}`}return`Занадта вялікі: чакалася, што ${J.origin??"значэнне"} павінна быць ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U){let Q=Number(J.minimum),z=nH(Q,U.unit.one,U.unit.few,U.unit.many);return`Занадта малы: чакалася, што ${J.origin} павінна ${U.verb} ${G}${J.minimum.toString()} ${z}`}return`Занадта малы: чакалася, што ${J.origin} павінна быць ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${G.prefix}"`;if(G.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${G.suffix}"`;if(G.format==="includes")return`Няправільны радок: павінен змяшчаць "${G.includes}"`;if(G.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${G.pattern}`;return`Няправільны ${Y[G.format]??J.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${J.keys.length>1?"ключы":"ключ"}: ${q(J.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${J.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${J.origin}`;default:return"Няправільны ўвод"}}};function _U(){return{localeError:nv()}}var cv=($)=>{let X=typeof $;switch(X){case"number":return Number.isNaN($)?"NaN":"число";case"object":{if(Array.isArray($))return"масив";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return X},rv=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function X(Y){return $[Y]??null}let W={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"};return(Y)=>{switch(Y.code){case"invalid_type":return`Невалиден вход: очакван ${Y.expected}, получен ${cv(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Невалиден вход: очакван ${Z(Y.values[0])}`;return`Невалидна опция: очаквано едно от ${q(Y.values,"|")}`;case"too_big":{let J=Y.inclusive?"<=":"<",G=X(Y.origin);if(G)return`Твърде голямо: очаква се ${Y.origin??"стойност"} да съдържа ${J}${Y.maximum.toString()} ${G.unit??"елемента"}`;return`Твърде голямо: очаква се ${Y.origin??"стойност"} да бъде ${J}${Y.maximum.toString()}`}case"too_small":{let J=Y.inclusive?">=":">",G=X(Y.origin);if(G)return`Твърде малко: очаква се ${Y.origin} да съдържа ${J}${Y.minimum.toString()} ${G.unit}`;return`Твърде малко: очаква се ${Y.origin} да бъде ${J}${Y.minimum.toString()}`}case"invalid_format":{let J=Y;if(J.format==="starts_with")return`Невалиден низ: трябва да започва с "${J.prefix}"`;if(J.format==="ends_with")return`Невалиден низ: трябва да завършва с "${J.suffix}"`;if(J.format==="includes")return`Невалиден низ: трябва да включва "${J.includes}"`;if(J.format==="regex")return`Невалиден низ: трябва да съвпада с ${J.pattern}`;let G="Невалиден";if(J.format==="emoji")G="Невалидно";if(J.format==="datetime")G="Невалидно";if(J.format==="date")G="Невалидна";if(J.format==="time")G="Невалидно";if(J.format==="duration")G="Невалидна";return`${G} ${W[J.format]??Y.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${Y.divisor}`;case"unrecognized_keys":return`Неразпознат${Y.keys.length>1?"и":""} ключ${Y.keys.length>1?"ове":""}: ${q(Y.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${Y.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${Y.origin}`;default:return"Невалиден вход"}}};function xU(){return{localeError:rv()}}var pv=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(J)=>{switch(J.code){case"invalid_type":return`Tipus invàlid: s'esperava ${J.expected}, s'ha rebut ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Valor invàlid: s'esperava ${Z(J.values[0])}`;return`Opció invàlida: s'esperava una de ${q(J.values," o ")}`;case"too_big":{let G=J.inclusive?"com a màxim":"menys de",U=X(J.origin);if(U)return`Massa gran: s'esperava que ${J.origin??"el valor"} contingués ${G} ${J.maximum.toString()} ${U.unit??"elements"}`;return`Massa gran: s'esperava que ${J.origin??"el valor"} fos ${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?"com a mínim":"més de",U=X(J.origin);if(U)return`Massa petit: s'esperava que ${J.origin} contingués ${G} ${J.minimum.toString()} ${U.unit}`;return`Massa petit: s'esperava que ${J.origin} fos ${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Format invàlid: ha de començar amb "${G.prefix}"`;if(G.format==="ends_with")return`Format invàlid: ha d'acabar amb "${G.suffix}"`;if(G.format==="includes")return`Format invàlid: ha d'incloure "${G.includes}"`;if(G.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${G.pattern}`;return`Format invàlid per a ${Y[G.format]??J.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${J.divisor}`;case"unrecognized_keys":return`Clau${J.keys.length>1?"s":""} no reconeguda${J.keys.length>1?"s":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${J.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${J.origin}`;default:return"Entrada invàlida"}}};function uU(){return{localeError:pv()}}var dv=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(J))return"pole";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return(J)=>{switch(J.code){case"invalid_type":return`Neplatný vstup: očekáváno ${J.expected}, obdrženo ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Neplatný vstup: očekáváno ${Z(J.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí mít ${G}${J.maximum.toString()} ${U.unit??"prvků"}`;return`Hodnota je příliš velká: ${J.origin??"hodnota"} musí být ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí mít ${G}${J.minimum.toString()} ${U.unit??"prvků"}`;return`Hodnota je příliš malá: ${J.origin??"hodnota"} musí být ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Neplatný řetězec: musí začínat na "${G.prefix}"`;if(G.format==="ends_with")return`Neplatný řetězec: musí končit na "${G.suffix}"`;if(G.format==="includes")return`Neplatný řetězec: musí obsahovat "${G.includes}"`;if(G.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${G.pattern}`;return`Neplatný formát ${Y[G.format]??J.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${J.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${q(J.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${J.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${J.origin}`;default:return"Neplatný vstup"}}};function yU(){return{localeError:dv()}}var ov=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},X={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function W(U){return $[U]??null}function Y(U){return X[U]??U}let J=(U)=>{let Q=typeof U;switch(Q){case"number":return Number.isNaN(U)?"NaN":"tal";case"object":{if(Array.isArray(U))return"liste";if(U===null)return"null";if(Object.getPrototypeOf(U)!==Object.prototype&&U.constructor)return U.constructor.name;return"objekt"}}return Q},G={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(U)=>{switch(U.code){case"invalid_type":return`Ugyldigt input: forventede ${Y(U.expected)}, fik ${Y(J(U.input))}`;case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${Z(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${q(U.values,"|")}`;case"too_big":{let Q=U.inclusive?"<=":"<",z=W(U.origin),H=Y(U.origin);if(z)return`For stor: forventede ${H??"value"} ${z.verb} ${Q} ${U.maximum.toString()} ${z.unit??"elementer"}`;return`For stor: forventede ${H??"value"} havde ${Q} ${U.maximum.toString()}`}case"too_small":{let Q=U.inclusive?">=":">",z=W(U.origin),H=Y(U.origin);if(z)return`For lille: forventede ${H} ${z.verb} ${Q} ${U.minimum.toString()} ${z.unit}`;return`For lille: forventede ${H} havde ${Q} ${U.minimum.toString()}`}case"invalid_format":{let Q=U;if(Q.format==="starts_with")return`Ugyldig streng: skal starte med "${Q.prefix}"`;if(Q.format==="ends_with")return`Ugyldig streng: skal ende med "${Q.suffix}"`;if(Q.format==="includes")return`Ugyldig streng: skal indeholde "${Q.includes}"`;if(Q.format==="regex")return`Ugyldig streng: skal matche mønsteret ${Q.pattern}`;return`Ugyldig ${G[Q.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${q(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function gU(){return{localeError:ov()}}var tv=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"Zahl";case"object":{if(Array.isArray(J))return"Array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return(J)=>{switch(J.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${J.expected}, erhalten ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ungültige Eingabe: erwartet ${Z(J.values[0])}`;return`Ungültige Option: erwartet eine von ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${G}${J.maximum.toString()} ${U.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${J.origin??"Wert"} ${G}${J.maximum.toString()} ist`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Zu klein: erwartet, dass ${J.origin} ${G}${J.minimum.toString()} ${U.unit} hat`;return`Zu klein: erwartet, dass ${J.origin} ${G}${J.minimum.toString()} ist`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ungültiger String: muss mit "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ungültiger String: muss mit "${G.suffix}" enden`;if(G.format==="includes")return`Ungültiger String: muss "${G.includes}" enthalten`;if(G.format==="regex")return`Ungültiger String: muss dem Muster ${G.pattern} entsprechen`;return`Ungültig: ${Y[G.format]??J.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${J.divisor} sein`;case"unrecognized_keys":return`${J.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${q(J.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${J.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${J.origin}`;default:return"Ungültige Eingabe"}}};function fU(){return{localeError:tv()}}var av=($)=>{let X=typeof $;switch(X){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return X},sv=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function X(Y){return $[Y]??null}let W={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return(Y)=>{switch(Y.code){case"invalid_type":return`Invalid input: expected ${Y.expected}, received ${av(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Invalid input: expected ${Z(Y.values[0])}`;return`Invalid option: expected one of ${q(Y.values,"|")}`;case"too_big":{let J=Y.inclusive?"<=":"<",G=X(Y.origin);if(G)return`Too big: expected ${Y.origin??"value"} to have ${J}${Y.maximum.toString()} ${G.unit??"elements"}`;return`Too big: expected ${Y.origin??"value"} to be ${J}${Y.maximum.toString()}`}case"too_small":{let J=Y.inclusive?">=":">",G=X(Y.origin);if(G)return`Too small: expected ${Y.origin} to have ${J}${Y.minimum.toString()} ${G.unit}`;return`Too small: expected ${Y.origin} to be ${J}${Y.minimum.toString()}`}case"invalid_format":{let J=Y;if(J.format==="starts_with")return`Invalid string: must start with "${J.prefix}"`;if(J.format==="ends_with")return`Invalid string: must end with "${J.suffix}"`;if(J.format==="includes")return`Invalid string: must include "${J.includes}"`;if(J.format==="regex")return`Invalid string: must match pattern ${J.pattern}`;return`Invalid ${W[J.format]??Y.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${Y.divisor}`;case"unrecognized_keys":return`Unrecognized key${Y.keys.length>1?"s":""}: ${q(Y.keys,", ")}`;case"invalid_key":return`Invalid key in ${Y.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${Y.origin}`;default:return"Invalid input"}}};function $X(){return{localeError:sv()}}var ev=($)=>{let X=typeof $;switch(X){case"number":return Number.isNaN($)?"NaN":"nombro";case"object":{if(Array.isArray($))return"tabelo";if($===null)return"senvalora";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return X},$q=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function X(Y){return $[Y]??null}let W={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return(Y)=>{switch(Y.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${Y.expected}, riceviĝis ${ev(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Nevalida enigo: atendiĝis ${Z(Y.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${q(Y.values,"|")}`;case"too_big":{let J=Y.inclusive?"<=":"<",G=X(Y.origin);if(G)return`Tro granda: atendiĝis ke ${Y.origin??"valoro"} havu ${J}${Y.maximum.toString()} ${G.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${Y.origin??"valoro"} havu ${J}${Y.maximum.toString()}`}case"too_small":{let J=Y.inclusive?">=":">",G=X(Y.origin);if(G)return`Tro malgranda: atendiĝis ke ${Y.origin} havu ${J}${Y.minimum.toString()} ${G.unit}`;return`Tro malgranda: atendiĝis ke ${Y.origin} estu ${J}${Y.minimum.toString()}`}case"invalid_format":{let J=Y;if(J.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${J.prefix}"`;if(J.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${J.suffix}"`;if(J.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${J.includes}"`;if(J.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${J.pattern}`;return`Nevalida ${W[J.format]??Y.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${Y.divisor}`;case"unrecognized_keys":return`Nekonata${Y.keys.length>1?"j":""} ŝlosilo${Y.keys.length>1?"j":""}: ${q(Y.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${Y.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${Y.origin}`;default:return"Nevalida enigo"}}};function hU(){return{localeError:$q()}}var Xq=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},X={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function W(U){return $[U]??null}function Y(U){return X[U]??U}let J=(U)=>{let Q=typeof U;switch(Q){case"number":return Number.isNaN(U)?"NaN":"number";case"object":{if(Array.isArray(U))return"array";if(U===null)return"null";if(Object.getPrototypeOf(U)!==Object.prototype)return U.constructor.name;return"object"}}return Q},G={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(U)=>{switch(U.code){case"invalid_type":return`Entrada inválida: se esperaba ${Y(U.expected)}, recibido ${Y(J(U.input))}`;case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${Z(U.values[0])}`;return`Opción inválida: se esperaba una de ${q(U.values,"|")}`;case"too_big":{let Q=U.inclusive?"<=":"<",z=W(U.origin),H=Y(U.origin);if(z)return`Demasiado grande: se esperaba que ${H??"valor"} tuviera ${Q}${U.maximum.toString()} ${z.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${H??"valor"} fuera ${Q}${U.maximum.toString()}`}case"too_small":{let Q=U.inclusive?">=":">",z=W(U.origin),H=Y(U.origin);if(z)return`Demasiado pequeño: se esperaba que ${H} tuviera ${Q}${U.minimum.toString()} ${z.unit}`;return`Demasiado pequeño: se esperaba que ${H} fuera ${Q}${U.minimum.toString()}`}case"invalid_format":{let Q=U;if(Q.format==="starts_with")return`Cadena inválida: debe comenzar con "${Q.prefix}"`;if(Q.format==="ends_with")return`Cadena inválida: debe terminar en "${Q.suffix}"`;if(Q.format==="includes")return`Cadena inválida: debe incluir "${Q.includes}"`;if(Q.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${Q.pattern}`;return`Inválido ${G[Q.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${q(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${Y(U.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${Y(U.origin)}`;default:return"Entrada inválida"}}};function lU(){return{localeError:Xq()}}var Wq=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"عدد";case"object":{if(Array.isArray(J))return"آرایه";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return(J)=>{switch(J.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${J.expected} میبود، ${W(J.input)} دریافت شد`;case"invalid_value":if(J.values.length===1)return`ورودی نامعتبر: میبایست ${Z(J.values[0])} میبود`;return`گزینه نامعتبر: میبایست یکی از ${q(J.values,"|")} میبود`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${G}${J.maximum.toString()} ${U.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${J.origin??"مقدار"} باید ${G}${J.maximum.toString()} باشد`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`خیلی کوچک: ${J.origin} باید ${G}${J.minimum.toString()} ${U.unit} باشد`;return`خیلی کوچک: ${J.origin} باید ${G}${J.minimum.toString()} باشد`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`رشته نامعتبر: باید با "${G.prefix}" شروع شود`;if(G.format==="ends_with")return`رشته نامعتبر: باید با "${G.suffix}" تمام شود`;if(G.format==="includes")return`رشته نامعتبر: باید شامل "${G.includes}" باشد`;if(G.format==="regex")return`رشته نامعتبر: باید با الگوی ${G.pattern} مطابقت داشته باشد`;return`${Y[G.format]??J.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${J.divisor} باشد`;case"unrecognized_keys":return`کلید${J.keys.length>1?"های":""} ناشناس: ${q(J.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${J.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${J.origin}`;default:return"ورودی نامعتبر"}}};function mU(){return{localeError:Wq()}}var Jq=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return(J)=>{switch(J.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${J.expected}, oli ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Virheellinen syöte: täytyy olla ${Z(J.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Liian suuri: ${U.subject} täytyy olla ${G}${J.maximum.toString()} ${U.unit}`.trim();return`Liian suuri: arvon täytyy olla ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Liian pieni: ${U.subject} täytyy olla ${G}${J.minimum.toString()} ${U.unit}`.trim();return`Liian pieni: arvon täytyy olla ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${G.prefix}"`;if(G.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${G.suffix}"`;if(G.format==="includes")return`Virheellinen syöte: täytyy sisältää "${G.includes}"`;if(G.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${G.pattern}`;return`Virheellinen ${Y[G.format]??J.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${J.divisor} monikerta`;case"unrecognized_keys":return`${J.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${q(J.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function iU(){return{localeError:Jq()}}var Yq=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"nombre";case"object":{if(Array.isArray(J))return"tableau";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(J)=>{switch(J.code){case"invalid_type":return`Entrée invalide : ${J.expected} attendu, ${W(J.input)} reçu`;case"invalid_value":if(J.values.length===1)return`Entrée invalide : ${Z(J.values[0])} attendu`;return`Option invalide : une valeur parmi ${q(J.values,"|")} attendue`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Trop grand : ${J.origin??"valeur"} doit ${U.verb} ${G}${J.maximum.toString()} ${U.unit??"élément(s)"}`;return`Trop grand : ${J.origin??"valeur"} doit être ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Trop petit : ${J.origin} doit ${U.verb} ${G}${J.minimum.toString()} ${U.unit}`;return`Trop petit : ${J.origin} doit être ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${G.pattern}`;return`${Y[G.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${q(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function nU(){return{localeError:Yq()}}var Gq=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return(J)=>{switch(J.code){case"invalid_type":return`Entrée invalide : attendu ${J.expected}, reçu ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Entrée invalide : attendu ${Z(J.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"≤":"<",U=X(J.origin);if(U)return`Trop grand : attendu que ${J.origin??"la valeur"} ait ${G}${J.maximum.toString()} ${U.unit}`;return`Trop grand : attendu que ${J.origin??"la valeur"} soit ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?"≥":">",U=X(J.origin);if(U)return`Trop petit : attendu que ${J.origin} ait ${G}${J.minimum.toString()} ${U.unit}`;return`Trop petit : attendu que ${J.origin} soit ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Chaîne invalide : doit commencer par "${G.prefix}"`;if(G.format==="ends_with")return`Chaîne invalide : doit se terminer par "${G.suffix}"`;if(G.format==="includes")return`Chaîne invalide : doit inclure "${G.includes}"`;if(G.format==="regex")return`Chaîne invalide : doit correspondre au motif ${G.pattern}`;return`${Y[G.format]??J.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${J.divisor}`;case"unrecognized_keys":return`Clé${J.keys.length>1?"s":""} non reconnue${J.keys.length>1?"s":""} : ${q(J.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${J.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${J.origin}`;default:return"Entrée invalide"}}};function cU(){return{localeError:Gq()}}var Uq=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},X={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},W=(H)=>H?$[H]:void 0,Y=(H)=>{let j=W(H);if(j)return j.label;return H??$.unknown.label},J=(H)=>`ה${Y(H)}`,G=(H)=>{return(W(H)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},U=(H)=>{if(!H)return null;return X[H]??null},Q=(H)=>{let j=typeof H;switch(j){case"number":return Number.isNaN(H)?"NaN":"number";case"object":{if(Array.isArray(H))return"array";if(H===null)return"null";if(Object.getPrototypeOf(H)!==Object.prototype&&H.constructor)return H.constructor.name;return"object"}default:return j}},z={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}};return(H)=>{switch(H.code){case"invalid_type":{let j=H.expected,O=Y(j),B=Q(H.input),I=$[B]?.label??B;return`קלט לא תקין: צריך להיות ${O}, התקבל ${I}`}case"invalid_value":{if(H.values.length===1)return`ערך לא תקין: הערך חייב להיות ${Z(H.values[0])}`;let j=H.values.map((I)=>Z(I));if(H.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${j[0]} או ${j[1]}`;let O=j[j.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${j.slice(0,-1).join(", ")} או ${O}`}case"too_big":{let j=U(H.origin),O=J(H.origin??"value");if(H.origin==="string")return`${j?.longLabel??"ארוך"} מדי: ${O} צריכה להכיל ${H.maximum.toString()} ${j?.unit??""} ${H.inclusive?"או פחות":"לכל היותר"}`.trim();if(H.origin==="number"){let N=H.inclusive?`קטן או שווה ל-${H.maximum}`:`קטן מ-${H.maximum}`;return`גדול מדי: ${O} צריך להיות ${N}`}if(H.origin==="array"||H.origin==="set"){let N=H.origin==="set"?"צריכה":"צריך",D=H.inclusive?`${H.maximum} ${j?.unit??""} או פחות`:`פחות מ-${H.maximum} ${j?.unit??""}`;return`גדול מדי: ${O} ${N} להכיל ${D}`.trim()}let B=H.inclusive?"<=":"<",I=G(H.origin??"value");if(j?.unit)return`${j.longLabel} מדי: ${O} ${I} ${B}${H.maximum.toString()} ${j.unit}`;return`${j?.longLabel??"גדול"} מדי: ${O} ${I} ${B}${H.maximum.toString()}`}case"too_small":{let j=U(H.origin),O=J(H.origin??"value");if(H.origin==="string")return`${j?.shortLabel??"קצר"} מדי: ${O} צריכה להכיל ${H.minimum.toString()} ${j?.unit??""} ${H.inclusive?"או יותר":"לפחות"}`.trim();if(H.origin==="number"){let N=H.inclusive?`גדול או שווה ל-${H.minimum}`:`גדול מ-${H.minimum}`;return`קטן מדי: ${O} צריך להיות ${N}`}if(H.origin==="array"||H.origin==="set"){let N=H.origin==="set"?"צריכה":"צריך";if(H.minimum===1&&H.inclusive){let w=H.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${O} ${N} להכיל ${w}`}let D=H.inclusive?`${H.minimum} ${j?.unit??""} או יותר`:`יותר מ-${H.minimum} ${j?.unit??""}`;return`קטן מדי: ${O} ${N} להכיל ${D}`.trim()}let B=H.inclusive?">=":">",I=G(H.origin??"value");if(j?.unit)return`${j.shortLabel} מדי: ${O} ${I} ${B}${H.minimum.toString()} ${j.unit}`;return`${j?.shortLabel??"קטן"} מדי: ${O} ${I} ${B}${H.minimum.toString()}`}case"invalid_format":{let j=H;if(j.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${j.prefix}"`;if(j.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${j.suffix}"`;if(j.format==="includes")return`המחרוזת חייבת לכלול "${j.includes}"`;if(j.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${j.pattern}`;let O=z[j.format],B=O?.label??j.format,N=(O?.gender??"m")==="f"?"תקינה":"תקין";return`${B} לא ${N}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${H.divisor}`;case"unrecognized_keys":return`מפתח${H.keys.length>1?"ות":""} לא מזוה${H.keys.length>1?"ים":"ה"}: ${q(H.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${J(H.origin??"array")}`;default:return"קלט לא תקין"}}};function rU(){return{localeError:Uq()}}var Qq=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"szám";case"object":{if(Array.isArray(J))return"tömb";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return(J)=>{switch(J.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${J.expected}, a kapott érték ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Érvénytelen bemenet: a várt érték ${Z(J.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Túl nagy: ${J.origin??"érték"} mérete túl nagy ${G}${J.maximum.toString()} ${U.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${J.origin??"érték"} túl nagy: ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Túl kicsi: a bemeneti érték ${J.origin} mérete túl kicsi ${G}${J.minimum.toString()} ${U.unit}`;return`Túl kicsi: a bemeneti érték ${J.origin} túl kicsi ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Érvénytelen string: "${G.prefix}" értékkel kell kezdődnie`;if(G.format==="ends_with")return`Érvénytelen string: "${G.suffix}" értékkel kell végződnie`;if(G.format==="includes")return`Érvénytelen string: "${G.includes}" értéket kell tartalmaznia`;if(G.format==="regex")return`Érvénytelen string: ${G.pattern} mintának kell megfelelnie`;return`Érvénytelen ${Y[G.format]??J.format}`}case"not_multiple_of":return`Érvénytelen szám: ${J.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${J.keys.length>1?"s":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${J.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${J.origin}`;default:return"Érvénytelen bemenet"}}};function pU(){return{localeError:Qq()}}var zq=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Input tidak valid: diharapkan ${J.expected}, diterima ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Input tidak valid: diharapkan ${Z(J.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Terlalu besar: diharapkan ${J.origin??"value"} memiliki ${G}${J.maximum.toString()} ${U.unit??"elemen"}`;return`Terlalu besar: diharapkan ${J.origin??"value"} menjadi ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Terlalu kecil: diharapkan ${J.origin} memiliki ${G}${J.minimum.toString()} ${U.unit}`;return`Terlalu kecil: diharapkan ${J.origin} menjadi ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`String tidak valid: harus dimulai dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak valid: harus berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak valid: harus menyertakan "${G.includes}"`;if(G.format==="regex")return`String tidak valid: harus sesuai pola ${G.pattern}`;return`${Y[G.format]??J.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${J.keys.length>1?"s":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${J.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${J.origin}`;default:return"Input tidak valid"}}};function dU(){return{localeError:zq()}}var Hq=($)=>{let X=typeof $;switch(X){case"number":return Number.isNaN($)?"NaN":"númer";case"object":{if(Array.isArray($))return"fylki";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return X},jq=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function X(Y){return $[Y]??null}let W={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return(Y)=>{switch(Y.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${Hq(Y.input)} þar sem á að vera ${Y.expected}`;case"invalid_value":if(Y.values.length===1)return`Rangt gildi: gert ráð fyrir ${Z(Y.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${q(Y.values,"|")}`;case"too_big":{let J=Y.inclusive?"<=":"<",G=X(Y.origin);if(G)return`Of stórt: gert er ráð fyrir að ${Y.origin??"gildi"} hafi ${J}${Y.maximum.toString()} ${G.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${Y.origin??"gildi"} sé ${J}${Y.maximum.toString()}`}case"too_small":{let J=Y.inclusive?">=":">",G=X(Y.origin);if(G)return`Of lítið: gert er ráð fyrir að ${Y.origin} hafi ${J}${Y.minimum.toString()} ${G.unit}`;return`Of lítið: gert er ráð fyrir að ${Y.origin} sé ${J}${Y.minimum.toString()}`}case"invalid_format":{let J=Y;if(J.format==="starts_with")return`Ógildur strengur: verður að byrja á "${J.prefix}"`;if(J.format==="ends_with")return`Ógildur strengur: verður að enda á "${J.suffix}"`;if(J.format==="includes")return`Ógildur strengur: verður að innihalda "${J.includes}"`;if(J.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${J.pattern}`;return`Rangt ${W[J.format]??Y.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${Y.divisor}`;case"unrecognized_keys":return`Óþekkt ${Y.keys.length>1?"ir lyklar":"ur lykill"}: ${q(Y.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${Y.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${Y.origin}`;default:return"Rangt gildi"}}};function oU(){return{localeError:jq()}}var Iq=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"numero";case"object":{if(Array.isArray(J))return"vettore";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Input non valido: atteso ${J.expected}, ricevuto ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Input non valido: atteso ${Z(J.values[0])}`;return`Opzione non valida: atteso uno tra ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Troppo grande: ${J.origin??"valore"} deve avere ${G}${J.maximum.toString()} ${U.unit??"elementi"}`;return`Troppo grande: ${J.origin??"valore"} deve essere ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Troppo piccolo: ${J.origin} deve avere ${G}${J.minimum.toString()} ${U.unit}`;return`Troppo piccolo: ${J.origin} deve essere ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Stringa non valida: deve iniziare con "${G.prefix}"`;if(G.format==="ends_with")return`Stringa non valida: deve terminare con "${G.suffix}"`;if(G.format==="includes")return`Stringa non valida: deve includere "${G.includes}"`;if(G.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${G.pattern}`;return`Invalid ${Y[G.format]??J.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${J.divisor}`;case"unrecognized_keys":return`Chiav${J.keys.length>1?"i":"e"} non riconosciut${J.keys.length>1?"e":"a"}: ${q(J.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${J.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${J.origin}`;default:return"Input non valido"}}};function tU(){return{localeError:Iq()}}var Oq=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"数値";case"object":{if(Array.isArray(J))return"配列";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return(J)=>{switch(J.code){case"invalid_type":return`無効な入力: ${J.expected}が期待されましたが、${W(J.input)}が入力されました`;case"invalid_value":if(J.values.length===1)return`無効な入力: ${Z(J.values[0])}が期待されました`;return`無効な選択: ${q(J.values,"、")}のいずれかである必要があります`;case"too_big":{let G=J.inclusive?"以下である":"より小さい",U=X(J.origin);if(U)return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${U.unit??"要素"}${G}必要があります`;return`大きすぎる値: ${J.origin??"値"}は${J.maximum.toString()}${G}必要があります`}case"too_small":{let G=J.inclusive?"以上である":"より大きい",U=X(J.origin);if(U)return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${U.unit}${G}必要があります`;return`小さすぎる値: ${J.origin}は${J.minimum.toString()}${G}必要があります`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`無効な文字列: "${G.prefix}"で始まる必要があります`;if(G.format==="ends_with")return`無効な文字列: "${G.suffix}"で終わる必要があります`;if(G.format==="includes")return`無効な文字列: "${G.includes}"を含む必要があります`;if(G.format==="regex")return`無効な文字列: パターン${G.pattern}に一致する必要があります`;return`無効な${Y[G.format]??J.format}`}case"not_multiple_of":return`無効な数値: ${J.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${J.keys.length>1?"群":""}: ${q(J.keys,"、")}`;case"invalid_key":return`${J.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${J.origin}内の無効な値`;default:return"無効な入力"}}};function aU(){return{localeError:Oq()}}var Nq=($)=>{let X=typeof $;switch(X){case"number":return Number.isNaN($)?"NaN":"რიცხვი";case"object":{if(Array.isArray($))return"მასივი";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[X]??X},Dq=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function X(Y){return $[Y]??null}let W={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return(Y)=>{switch(Y.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${Y.expected}, მიღებული ${Nq(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${Z(Y.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${q(Y.values,"|")}-დან`;case"too_big":{let J=Y.inclusive?"<=":"<",G=X(Y.origin);if(G)return`ზედმეტად დიდი: მოსალოდნელი ${Y.origin??"მნიშვნელობა"} ${G.verb} ${J}${Y.maximum.toString()} ${G.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${Y.origin??"მნიშვნელობა"} იყოს ${J}${Y.maximum.toString()}`}case"too_small":{let J=Y.inclusive?">=":">",G=X(Y.origin);if(G)return`ზედმეტად პატარა: მოსალოდნელი ${Y.origin} ${G.verb} ${J}${Y.minimum.toString()} ${G.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${Y.origin} იყოს ${J}${Y.minimum.toString()}`}case"invalid_format":{let J=Y;if(J.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${J.prefix}"-ით`;if(J.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${J.suffix}"-ით`;if(J.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${J.includes}"-ს`;if(J.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${J.pattern}`;return`არასწორი ${W[J.format]??Y.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${Y.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${Y.keys.length>1?"ები":"ი"}: ${q(Y.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${Y.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${Y.origin}-ში`;default:return"არასწორი შეყვანა"}}};function sU(){return{localeError:Dq()}}var Bq=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(J))return"អារេ (Array)";if(J===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return(J)=>{switch(J.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${J.expected} ប៉ុន្តែទទួលបាន ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Z(J.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${G} ${J.maximum.toString()} ${U.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${J.origin??"តម្លៃ"} ${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`តូចពេក៖ ត្រូវការ ${J.origin} ${G} ${J.minimum.toString()} ${U.unit}`;return`តូចពេក៖ ត្រូវការ ${J.origin} ${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${G.prefix}"`;if(G.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${G.suffix}"`;if(G.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${G.includes}"`;if(G.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${G.pattern}`;return`មិនត្រឹមត្រូវ៖ ${Y[G.format]??J.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${J.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${q(J.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${J.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function XX(){return{localeError:Bq()}}function eU(){return XX()}var wq=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return(J)=>{switch(J.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${J.expected}, 받은 타입은 ${W(J.input)}입니다`;case"invalid_value":if(J.values.length===1)return`잘못된 입력: 값은 ${Z(J.values[0])} 이어야 합니다`;return`잘못된 옵션: ${q(J.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let G=J.inclusive?"이하":"미만",U=G==="미만"?"이어야 합니다":"여야 합니다",Q=X(J.origin),z=Q?.unit??"요소";if(Q)return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()}${z} ${G}${U}`;return`${J.origin??"값"}이 너무 큽니다: ${J.maximum.toString()} ${G}${U}`}case"too_small":{let G=J.inclusive?"이상":"초과",U=G==="이상"?"이어야 합니다":"여야 합니다",Q=X(J.origin),z=Q?.unit??"요소";if(Q)return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()}${z} ${G}${U}`;return`${J.origin??"값"}이 너무 작습니다: ${J.minimum.toString()} ${G}${U}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`잘못된 문자열: "${G.prefix}"(으)로 시작해야 합니다`;if(G.format==="ends_with")return`잘못된 문자열: "${G.suffix}"(으)로 끝나야 합니다`;if(G.format==="includes")return`잘못된 문자열: "${G.includes}"을(를) 포함해야 합니다`;if(G.format==="regex")return`잘못된 문자열: 정규식 ${G.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${Y[G.format]??J.format}`}case"not_multiple_of":return`잘못된 숫자: ${J.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${q(J.keys,", ")}`;case"invalid_key":return`잘못된 키: ${J.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${J.origin}`;default:return"잘못된 입력"}}};function $Q(){return{localeError:wq()}}var Vq=($)=>{return JX(typeof $,$)},JX=($,X=void 0)=>{switch($){case"number":return Number.isNaN(X)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":{if(X===void 0)return"nežinomas objektas";if(X===null)return"nulinė reikšmė";if(Array.isArray(X))return"masyvas";if(Object.getPrototypeOf(X)!==Object.prototype&&X.constructor)return X.constructor.name;return"objektas"}case"null":return"nulinė reikšmė"}return $},WX=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function cH($){let X=Math.abs($),W=X%10,Y=X%100;if(Y>=11&&Y<=19||W===0)return"many";if(W===1)return"one";return"few"}var Aq=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function X(Y,J,G,U){let Q=$[Y]??null;if(Q===null)return Q;return{unit:Q.unit[J],verb:Q.verb[U][G?"inclusive":"notInclusive"]}}let W={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return(Y)=>{switch(Y.code){case"invalid_type":return`Gautas tipas ${Vq(Y.input)}, o tikėtasi - ${JX(Y.expected)}`;case"invalid_value":if(Y.values.length===1)return`Privalo būti ${Z(Y.values[0])}`;return`Privalo būti vienas iš ${q(Y.values,"|")} pasirinkimų`;case"too_big":{let J=JX(Y.origin),G=X(Y.origin,cH(Number(Y.maximum)),Y.inclusive??!1,"smaller");if(G?.verb)return`${WX(J??Y.origin??"reikšmė")} ${G.verb} ${Y.maximum.toString()} ${G.unit??"elementų"}`;let U=Y.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${WX(J??Y.origin??"reikšmė")} turi būti ${U} ${Y.maximum.toString()} ${G?.unit}`}case"too_small":{let J=JX(Y.origin),G=X(Y.origin,cH(Number(Y.minimum)),Y.inclusive??!1,"bigger");if(G?.verb)return`${WX(J??Y.origin??"reikšmė")} ${G.verb} ${Y.minimum.toString()} ${G.unit??"elementų"}`;let U=Y.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${WX(J??Y.origin??"reikšmė")} turi būti ${U} ${Y.minimum.toString()} ${G?.unit}`}case"invalid_format":{let J=Y;if(J.format==="starts_with")return`Eilutė privalo prasidėti "${J.prefix}"`;if(J.format==="ends_with")return`Eilutė privalo pasibaigti "${J.suffix}"`;if(J.format==="includes")return`Eilutė privalo įtraukti "${J.includes}"`;if(J.format==="regex")return`Eilutė privalo atitikti ${J.pattern}`;return`Neteisingas ${W[J.format]??Y.format}`}case"not_multiple_of":return`Skaičius privalo būti ${Y.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${Y.keys.length>1?"i":"as"} rakt${Y.keys.length>1?"ai":"as"}: ${q(Y.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let J=JX(Y.origin);return`${WX(J??Y.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function XQ(){return{localeError:Aq()}}var bq=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"број";case"object":{if(Array.isArray(J))return"низа";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return(J)=>{switch(J.code){case"invalid_type":return`Грешен внес: се очекува ${J.expected}, примено ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Invalid input: expected ${Z(J.values[0])}`;return`Грешана опција: се очекува една ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Премногу голем: се очекува ${J.origin??"вредноста"} да има ${G}${J.maximum.toString()} ${U.unit??"елементи"}`;return`Премногу голем: се очекува ${J.origin??"вредноста"} да биде ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Премногу мал: се очекува ${J.origin} да има ${G}${J.minimum.toString()} ${U.unit}`;return`Премногу мал: се очекува ${J.origin} да биде ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Неважечка низа: мора да започнува со "${G.prefix}"`;if(G.format==="ends_with")return`Неважечка низа: мора да завршува со "${G.suffix}"`;if(G.format==="includes")return`Неважечка низа: мора да вклучува "${G.includes}"`;if(G.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${G.pattern}`;return`Invalid ${Y[G.format]??J.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${q(J.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${J.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${J.origin}`;default:return"Грешен внес"}}};function WQ(){return{localeError:bq()}}var Kq=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"nombor";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Input tidak sah: dijangka ${J.expected}, diterima ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Input tidak sah: dijangka ${Z(J.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Terlalu besar: dijangka ${J.origin??"nilai"} ${U.verb} ${G}${J.maximum.toString()} ${U.unit??"elemen"}`;return`Terlalu besar: dijangka ${J.origin??"nilai"} adalah ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Terlalu kecil: dijangka ${J.origin} ${U.verb} ${G}${J.minimum.toString()} ${U.unit}`;return`Terlalu kecil: dijangka ${J.origin} adalah ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`String tidak sah: mesti bermula dengan "${G.prefix}"`;if(G.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${G.suffix}"`;if(G.format==="includes")return`String tidak sah: mesti mengandungi "${G.includes}"`;if(G.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${G.pattern}`;return`${Y[G.format]??J.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${J.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${q(J.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${J.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${J.origin}`;default:return"Input tidak sah"}}};function JQ(){return{localeError:Kq()}}var vq=()=>{let $={string:{unit:"tekens",verb:"te hebben"},file:{unit:"bytes",verb:"te hebben"},array:{unit:"elementen",verb:"te hebben"},set:{unit:"elementen",verb:"te hebben"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"getal";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return(J)=>{switch(J.code){case"invalid_type":return`Ongeldige invoer: verwacht ${J.expected}, ontving ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ongeldige invoer: verwacht ${Z(J.values[0])}`;return`Ongeldige optie: verwacht één van ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Te groot: verwacht dat ${J.origin??"waarde"} ${U.verb} ${G}${J.maximum.toString()} ${U.unit??"elementen"}`;return`Te groot: verwacht dat ${J.origin??"waarde"} ${G}${J.maximum.toString()} is`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Te klein: verwacht dat ${J.origin} ${U.verb} ${G}${J.minimum.toString()} ${U.unit}`;return`Te klein: verwacht dat ${J.origin} ${G}${J.minimum.toString()} is`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ongeldige tekst: moet met "${G.prefix}" beginnen`;if(G.format==="ends_with")return`Ongeldige tekst: moet op "${G.suffix}" eindigen`;if(G.format==="includes")return`Ongeldige tekst: moet "${G.includes}" bevatten`;if(G.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${G.pattern}`;return`Ongeldig: ${Y[G.format]??J.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${J.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${J.keys.length>1?"s":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${J.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${J.origin}`;default:return"Ongeldige invoer"}}};function YQ(){return{localeError:vq()}}var qq=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"tall";case"object":{if(Array.isArray(J))return"liste";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`Ugyldig input: forventet ${J.expected}, fikk ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ugyldig verdi: forventet ${Z(J.values[0])}`;return`Ugyldig valg: forventet en av ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`For stor(t): forventet ${J.origin??"value"} til å ha ${G}${J.maximum.toString()} ${U.unit??"elementer"}`;return`For stor(t): forventet ${J.origin??"value"} til å ha ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`For lite(n): forventet ${J.origin} til å ha ${G}${J.minimum.toString()} ${U.unit}`;return`For lite(n): forventet ${J.origin} til å ha ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ugyldig streng: må starte med "${G.prefix}"`;if(G.format==="ends_with")return`Ugyldig streng: må ende med "${G.suffix}"`;if(G.format==="includes")return`Ugyldig streng: må inneholde "${G.includes}"`;if(G.format==="regex")return`Ugyldig streng: må matche mønsteret ${G.pattern}`;return`Ugyldig ${Y[G.format]??J.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${q(J.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${J.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${J.origin}`;default:return"Ugyldig input"}}};function GQ(){return{localeError:qq()}}var Lq=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"numara";case"object":{if(Array.isArray(J))return"saf";if(J===null)return"gayb";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return(J)=>{switch(J.code){case"invalid_type":return`Fâsit giren: umulan ${J.expected}, alınan ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Fâsit giren: umulan ${Z(J.values[0])}`;return`Fâsit tercih: mûteberler ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Fazla büyük: ${J.origin??"value"}, ${G}${J.maximum.toString()} ${U.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${J.origin??"value"}, ${G}${J.maximum.toString()} olmalıydı.`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Fazla küçük: ${J.origin}, ${G}${J.minimum.toString()} ${U.unit} sahip olmalıydı.`;return`Fazla küçük: ${J.origin}, ${G}${J.minimum.toString()} olmalıydı.`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Fâsit metin: "${G.prefix}" ile başlamalı.`;if(G.format==="ends_with")return`Fâsit metin: "${G.suffix}" ile bitmeli.`;if(G.format==="includes")return`Fâsit metin: "${G.includes}" ihtivâ etmeli.`;if(G.format==="regex")return`Fâsit metin: ${G.pattern} nakşına uymalı.`;return`Fâsit ${Y[G.format]??J.format}`}case"not_multiple_of":return`Fâsit sayı: ${J.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${J.keys.length>1?"s":""}: ${q(J.keys,", ")}`;case"invalid_key":return`${J.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${J.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function UQ(){return{localeError:Lq()}}var Fq=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"عدد";case"object":{if(Array.isArray(J))return"ارې";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return(J)=>{switch(J.code){case"invalid_type":return`ناسم ورودي: باید ${J.expected} وای, مګر ${W(J.input)} ترلاسه شو`;case"invalid_value":if(J.values.length===1)return`ناسم ورودي: باید ${Z(J.values[0])} وای`;return`ناسم انتخاب: باید یو له ${q(J.values,"|")} څخه وای`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`ډیر لوی: ${J.origin??"ارزښت"} باید ${G}${J.maximum.toString()} ${U.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${J.origin??"ارزښت"} باید ${G}${J.maximum.toString()} وي`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`ډیر کوچنی: ${J.origin} باید ${G}${J.minimum.toString()} ${U.unit} ولري`;return`ډیر کوچنی: ${J.origin} باید ${G}${J.minimum.toString()} وي`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`ناسم متن: باید د "${G.prefix}" سره پیل شي`;if(G.format==="ends_with")return`ناسم متن: باید د "${G.suffix}" سره پای ته ورسيږي`;if(G.format==="includes")return`ناسم متن: باید "${G.includes}" ولري`;if(G.format==="regex")return`ناسم متن: باید د ${G.pattern} سره مطابقت ولري`;return`${Y[G.format]??J.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${J.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${J.keys.length>1?"کلیډونه":"کلیډ"}: ${q(J.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${J.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${J.origin} کې`;default:return"ناسمه ورودي"}}};function QQ(){return{localeError:Fq()}}var Mq=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"liczba";case"object":{if(Array.isArray(J))return"tablica";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return(J)=>{switch(J.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${J.expected}, otrzymano ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${Z(J.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Za duża wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${G}${J.maximum.toString()} ${U.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Za mała wartość: oczekiwano, że ${J.origin??"wartość"} będzie mieć ${G}${J.minimum.toString()} ${U.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${J.origin??"wartość"} będzie wynosić ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${G.prefix}"`;if(G.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${G.suffix}"`;if(G.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${G.includes}"`;if(G.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${G.pattern}`;return`Nieprawidłow(y/a/e) ${Y[G.format]??J.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${J.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${J.keys.length>1?"s":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${J.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${J.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function zQ(){return{localeError:Mq()}}var Sq=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"número";case"object":{if(Array.isArray(J))return"array";if(J===null)return"nulo";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return(J)=>{switch(J.code){case"invalid_type":return`Tipo inválido: esperado ${J.expected}, recebido ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Entrada inválida: esperado ${Z(J.values[0])}`;return`Opção inválida: esperada uma das ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Muito grande: esperado que ${J.origin??"valor"} tivesse ${G}${J.maximum.toString()} ${U.unit??"elementos"}`;return`Muito grande: esperado que ${J.origin??"valor"} fosse ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Muito pequeno: esperado que ${J.origin} tivesse ${G}${J.minimum.toString()} ${U.unit}`;return`Muito pequeno: esperado que ${J.origin} fosse ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Texto inválido: deve começar com "${G.prefix}"`;if(G.format==="ends_with")return`Texto inválido: deve terminar com "${G.suffix}"`;if(G.format==="includes")return`Texto inválido: deve incluir "${G.includes}"`;if(G.format==="regex")return`Texto inválido: deve corresponder ao padrão ${G.pattern}`;return`${Y[G.format]??J.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${J.divisor}`;case"unrecognized_keys":return`Chave${J.keys.length>1?"s":""} desconhecida${J.keys.length>1?"s":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Chave inválida em ${J.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${J.origin}`;default:return"Campo inválido"}}};function HQ(){return{localeError:Sq()}}function rH($,X,W,Y){let J=Math.abs($),G=J%10,U=J%100;if(U>=11&&U<=19)return Y;if(G===1)return X;if(G>=2&&G<=4)return W;return Y}var Eq=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"число";case"object":{if(Array.isArray(J))return"массив";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return(J)=>{switch(J.code){case"invalid_type":return`Неверный ввод: ожидалось ${J.expected}, получено ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Неверный ввод: ожидалось ${Z(J.values[0])}`;return`Неверный вариант: ожидалось одно из ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U){let Q=Number(J.maximum),z=rH(Q,U.unit.one,U.unit.few,U.unit.many);return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет иметь ${G}${J.maximum.toString()} ${z}`}return`Слишком большое значение: ожидалось, что ${J.origin??"значение"} будет ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U){let Q=Number(J.minimum),z=rH(Q,U.unit.one,U.unit.few,U.unit.many);return`Слишком маленькое значение: ожидалось, что ${J.origin} будет иметь ${G}${J.minimum.toString()} ${z}`}return`Слишком маленькое значение: ожидалось, что ${J.origin} будет ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Неверная строка: должна начинаться с "${G.prefix}"`;if(G.format==="ends_with")return`Неверная строка: должна заканчиваться на "${G.suffix}"`;if(G.format==="includes")return`Неверная строка: должна содержать "${G.includes}"`;if(G.format==="regex")return`Неверная строка: должна соответствовать шаблону ${G.pattern}`;return`Неверный ${Y[G.format]??J.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${J.divisor}`;case"unrecognized_keys":return`Нераспознанн${J.keys.length>1?"ые":"ый"} ключ${J.keys.length>1?"и":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${J.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${J.origin}`;default:return"Неверные входные данные"}}};function jQ(){return{localeError:Eq()}}var Pq=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"število";case"object":{if(Array.isArray(J))return"tabela";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return(J)=>{switch(J.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${J.expected}, prejeto ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Neveljaven vnos: pričakovano ${Z(J.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} imelo ${G}${J.maximum.toString()} ${U.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${J.origin??"vrednost"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Premajhno: pričakovano, da bo ${J.origin} imelo ${G}${J.minimum.toString()} ${U.unit}`;return`Premajhno: pričakovano, da bo ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Neveljaven niz: mora se začeti z "${G.prefix}"`;if(G.format==="ends_with")return`Neveljaven niz: mora se končati z "${G.suffix}"`;if(G.format==="includes")return`Neveljaven niz: mora vsebovati "${G.includes}"`;if(G.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${G.pattern}`;return`Neveljaven ${Y[G.format]??J.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${J.divisor}`;case"unrecognized_keys":return`Neprepoznan${J.keys.length>1?"i ključi":" ključ"}: ${q(J.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${J.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${J.origin}`;default:return"Neveljaven vnos"}}};function IQ(){return{localeError:Pq()}}var Rq=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"antal";case"object":{if(Array.isArray(J))return"lista";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return(J)=>{switch(J.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${J.expected}, fick ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ogiltig inmatning: förväntat ${Z(J.values[0])}`;return`Ogiltigt val: förväntade en av ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`För stor(t): förväntade ${J.origin??"värdet"} att ha ${G}${J.maximum.toString()} ${U.unit??"element"}`;return`För stor(t): förväntat ${J.origin??"värdet"} att ha ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${G}${J.minimum.toString()} ${U.unit}`;return`För lite(t): förväntade ${J.origin??"värdet"} att ha ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ogiltig sträng: måste börja med "${G.prefix}"`;if(G.format==="ends_with")return`Ogiltig sträng: måste sluta med "${G.suffix}"`;if(G.format==="includes")return`Ogiltig sträng: måste innehålla "${G.includes}"`;if(G.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${G.pattern}"`;return`Ogiltig(t) ${Y[G.format]??J.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${J.divisor}`;case"unrecognized_keys":return`${J.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${q(J.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${J.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${J.origin??"värdet"}`;default:return"Ogiltig input"}}};function OQ(){return{localeError:Rq()}}var Zq=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(J))return"அணி";if(J===null)return"வெறுமை";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return(J)=>{switch(J.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${J.expected}, பெறப்பட்டது ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Z(J.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${q(J.values,"|")} இல் ஒன்று`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${G}${J.maximum.toString()} ${U.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${J.origin??"மதிப்பு"} ${G}${J.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${G}${J.minimum.toString()} ${U.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${J.origin} ${G}${J.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`தவறான சரம்: "${G.prefix}" இல் தொடங்க வேண்டும்`;if(G.format==="ends_with")return`தவறான சரம்: "${G.suffix}" இல் முடிவடைய வேண்டும்`;if(G.format==="includes")return`தவறான சரம்: "${G.includes}" ஐ உள்ளடக்க வேண்டும்`;if(G.format==="regex")return`தவறான சரம்: ${G.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${Y[G.format]??J.format}`}case"not_multiple_of":return`தவறான எண்: ${J.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${J.keys.length>1?"கள்":""}: ${q(J.keys,", ")}`;case"invalid_key":return`${J.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${J.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function NQ(){return{localeError:Zq()}}var kq=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(J))return"อาร์เรย์ (Array)";if(J===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return(J)=>{switch(J.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${J.expected} แต่ได้รับ ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${Z(J.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"ไม่เกิน":"น้อยกว่า",U=X(J.origin);if(U)return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${G} ${J.maximum.toString()} ${U.unit??"รายการ"}`;return`เกินกำหนด: ${J.origin??"ค่า"} ควรมี${G} ${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?"อย่างน้อย":"มากกว่า",U=X(J.origin);if(U)return`น้อยกว่ากำหนด: ${J.origin} ควรมี${G} ${J.minimum.toString()} ${U.unit}`;return`น้อยกว่ากำหนด: ${J.origin} ควรมี${G} ${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${G.prefix}"`;if(G.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${G.suffix}"`;if(G.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${G.includes}" อยู่ในข้อความ`;if(G.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${G.pattern}`;return`รูปแบบไม่ถูกต้อง: ${Y[G.format]??J.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${J.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${q(J.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${J.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${J.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function DQ(){return{localeError:kq()}}var Tq=($)=>{let X=typeof $;switch(X){case"number":return Number.isNaN($)?"NaN":"number";case"object":{if(Array.isArray($))return"array";if($===null)return"null";if(Object.getPrototypeOf($)!==Object.prototype&&$.constructor)return $.constructor.name}}return X},Cq=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function X(Y){return $[Y]??null}let W={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return(Y)=>{switch(Y.code){case"invalid_type":return`Geçersiz değer: beklenen ${Y.expected}, alınan ${Tq(Y.input)}`;case"invalid_value":if(Y.values.length===1)return`Geçersiz değer: beklenen ${Z(Y.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${q(Y.values,"|")}`;case"too_big":{let J=Y.inclusive?"<=":"<",G=X(Y.origin);if(G)return`Çok büyük: beklenen ${Y.origin??"değer"} ${J}${Y.maximum.toString()} ${G.unit??"öğe"}`;return`Çok büyük: beklenen ${Y.origin??"değer"} ${J}${Y.maximum.toString()}`}case"too_small":{let J=Y.inclusive?">=":">",G=X(Y.origin);if(G)return`Çok küçük: beklenen ${Y.origin} ${J}${Y.minimum.toString()} ${G.unit}`;return`Çok küçük: beklenen ${Y.origin} ${J}${Y.minimum.toString()}`}case"invalid_format":{let J=Y;if(J.format==="starts_with")return`Geçersiz metin: "${J.prefix}" ile başlamalı`;if(J.format==="ends_with")return`Geçersiz metin: "${J.suffix}" ile bitmeli`;if(J.format==="includes")return`Geçersiz metin: "${J.includes}" içermeli`;if(J.format==="regex")return`Geçersiz metin: ${J.pattern} desenine uymalı`;return`Geçersiz ${W[J.format]??Y.format}`}case"not_multiple_of":return`Geçersiz sayı: ${Y.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${Y.keys.length>1?"lar":""}: ${q(Y.keys,", ")}`;case"invalid_key":return`${Y.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${Y.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function BQ(){return{localeError:Cq()}}var _q=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"число";case"object":{if(Array.isArray(J))return"масив";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return(J)=>{switch(J.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${J.expected}, отримано ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Неправильні вхідні дані: очікується ${Z(J.values[0])}`;return`Неправильна опція: очікується одне з ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Занадто велике: очікується, що ${J.origin??"значення"} ${U.verb} ${G}${J.maximum.toString()} ${U.unit??"елементів"}`;return`Занадто велике: очікується, що ${J.origin??"значення"} буде ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Занадто мале: очікується, що ${J.origin} ${U.verb} ${G}${J.minimum.toString()} ${U.unit}`;return`Занадто мале: очікується, що ${J.origin} буде ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Неправильний рядок: повинен починатися з "${G.prefix}"`;if(G.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${G.suffix}"`;if(G.format==="includes")return`Неправильний рядок: повинен містити "${G.includes}"`;if(G.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${G.pattern}`;return`Неправильний ${Y[G.format]??J.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${J.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${J.keys.length>1?"і":""}: ${q(J.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${J.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${J.origin}`;default:return"Неправильні вхідні дані"}}};function YX(){return{localeError:_q()}}function wQ(){return YX()}var xq=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"نمبر";case"object":{if(Array.isArray(J))return"آرے";if(J===null)return"نل";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return(J)=>{switch(J.code){case"invalid_type":return`غلط ان پٹ: ${J.expected} متوقع تھا، ${W(J.input)} موصول ہوا`;case"invalid_value":if(J.values.length===1)return`غلط ان پٹ: ${Z(J.values[0])} متوقع تھا`;return`غلط آپشن: ${q(J.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`بہت بڑا: ${J.origin??"ویلیو"} کے ${G}${J.maximum.toString()} ${U.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${J.origin??"ویلیو"} کا ${G}${J.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`بہت چھوٹا: ${J.origin} کے ${G}${J.minimum.toString()} ${U.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${J.origin} کا ${G}${J.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`غلط سٹرنگ: "${G.prefix}" سے شروع ہونا چاہیے`;if(G.format==="ends_with")return`غلط سٹرنگ: "${G.suffix}" پر ختم ہونا چاہیے`;if(G.format==="includes")return`غلط سٹرنگ: "${G.includes}" شامل ہونا چاہیے`;if(G.format==="regex")return`غلط سٹرنگ: پیٹرن ${G.pattern} سے میچ ہونا چاہیے`;return`غلط ${Y[G.format]??J.format}`}case"not_multiple_of":return`غلط نمبر: ${J.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${J.keys.length>1?"ز":""}: ${q(J.keys,"، ")}`;case"invalid_key":return`${J.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${J.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function VQ(){return{localeError:xq()}}var uq=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"số";case"object":{if(Array.isArray(J))return"mảng";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return(J)=>{switch(J.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${J.expected}, nhận được ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${Z(J.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${U.verb} ${G}${J.maximum.toString()} ${U.unit??"phần tử"}`;return`Quá lớn: mong đợi ${J.origin??"giá trị"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Quá nhỏ: mong đợi ${J.origin} ${U.verb} ${G}${J.minimum.toString()} ${U.unit}`;return`Quá nhỏ: mong đợi ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${G.prefix}"`;if(G.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${G.suffix}"`;if(G.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${G.includes}"`;if(G.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${G.pattern}`;return`${Y[G.format]??J.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${J.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${q(J.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${J.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${J.origin}`;default:return"Đầu vào không hợp lệ"}}};function AQ(){return{localeError:uq()}}var yq=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(J))return"数组";if(J===null)return"空值(null)";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return(J)=>{switch(J.code){case"invalid_type":return`无效输入:期望 ${J.expected},实际接收 ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`无效输入:期望 ${Z(J.values[0])}`;return`无效选项:期望以下之一 ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`数值过大:期望 ${J.origin??"值"} ${G}${J.maximum.toString()} ${U.unit??"个元素"}`;return`数值过大:期望 ${J.origin??"值"} ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`数值过小:期望 ${J.origin} ${G}${J.minimum.toString()} ${U.unit}`;return`数值过小:期望 ${J.origin} ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`无效字符串:必须以 "${G.prefix}" 开头`;if(G.format==="ends_with")return`无效字符串:必须以 "${G.suffix}" 结尾`;if(G.format==="includes")return`无效字符串:必须包含 "${G.includes}"`;if(G.format==="regex")return`无效字符串:必须满足正则表达式 ${G.pattern}`;return`无效${Y[G.format]??J.format}`}case"not_multiple_of":return`无效数字:必须是 ${J.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${q(J.keys,", ")}`;case"invalid_key":return`${J.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${J.origin} 中包含无效值(value)`;default:return"无效输入"}}};function bQ(){return{localeError:yq()}}var gq=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"number";case"object":{if(Array.isArray(J))return"array";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return(J)=>{switch(J.code){case"invalid_type":return`無效的輸入值:預期為 ${J.expected},但收到 ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`無效的輸入值:預期為 ${Z(J.values[0])}`;return`無效的選項:預期為以下其中之一 ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`數值過大:預期 ${J.origin??"值"} 應為 ${G}${J.maximum.toString()} ${U.unit??"個元素"}`;return`數值過大:預期 ${J.origin??"值"} 應為 ${G}${J.maximum.toString()}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`數值過小:預期 ${J.origin} 應為 ${G}${J.minimum.toString()} ${U.unit}`;return`數值過小:預期 ${J.origin} 應為 ${G}${J.minimum.toString()}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`無效的字串:必須以 "${G.prefix}" 開頭`;if(G.format==="ends_with")return`無效的字串:必須以 "${G.suffix}" 結尾`;if(G.format==="includes")return`無效的字串:必須包含 "${G.includes}"`;if(G.format==="regex")return`無效的字串:必須符合格式 ${G.pattern}`;return`無效的 ${Y[G.format]??J.format}`}case"not_multiple_of":return`無效的數字:必須為 ${J.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${J.keys.length>1?"們":""}:${q(J.keys,"、")}`;case"invalid_key":return`${J.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${J.origin} 中有無效的值`;default:return"無效的輸入值"}}};function KQ(){return{localeError:gq()}}var fq=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function X(J){return $[J]??null}let W=(J)=>{let G=typeof J;switch(G){case"number":return Number.isNaN(J)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(J))return"akopọ";if(J===null)return"null";if(Object.getPrototypeOf(J)!==Object.prototype&&J.constructor)return J.constructor.name}}return G},Y={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return(J)=>{switch(J.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${J.expected}, àmọ̀ a rí ${W(J.input)}`;case"invalid_value":if(J.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${Z(J.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${q(J.values,"|")}`;case"too_big":{let G=J.inclusive?"<=":"<",U=X(J.origin);if(U)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${J.origin??"iye"} ${U.verb} ${G}${J.maximum} ${U.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${G}${J.maximum}`}case"too_small":{let G=J.inclusive?">=":">",U=X(J.origin);if(U)return`Kéré ju: a ní láti jẹ́ pé ${J.origin} ${U.verb} ${G}${J.minimum} ${U.unit}`;return`Kéré ju: a ní láti jẹ́ ${G}${J.minimum}`}case"invalid_format":{let G=J;if(G.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${G.prefix}"`;if(G.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${G.suffix}"`;if(G.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${G.includes}"`;if(G.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${G.pattern}`;return`Aṣìṣe: ${Y[G.format]??J.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${J.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${q(J.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${J.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${J.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function vQ(){return{localeError:fq()}}var pH,R9=Symbol("ZodOutput"),Z9=Symbol("ZodInput");class GX{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...X){let W=X[0];if(this._map.set($,W),W&&typeof W==="object"&&"id"in W){if(this._idmap.has(W.id))throw Error(`ID ${W.id} already exists in the registry`);this._idmap.set(W.id,$)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let X=this._map.get($);if(X&&typeof X==="object"&&"id"in X)this._idmap.delete(X.id);return this._map.delete($),this}get($){let X=$._zod.parent;if(X){let W={...this.get(X)??{}};delete W.id;let Y={...W,...this._map.get($)};return Object.keys(Y).length?Y:void 0}return this._map.get($)}has($){return this._map.has($)}}function UX(){return new GX}(pH=globalThis).__zod_globalRegistry??(pH.__zod_globalRegistry=UX());var d$=globalThis.__zod_globalRegistry;function k9($,X){return new $({type:"string",...k(X)})}function qQ($,X){return new $({type:"string",coerce:!0,...k(X)})}function QX($,X){return new $({type:"string",format:"email",check:"string_format",abort:!1,...k(X)})}function r1($,X){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...k(X)})}function zX($,X){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...k(X)})}function HX($,X){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...k(X)})}function jX($,X){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...k(X)})}function IX($,X){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...k(X)})}function p1($,X){return new $({type:"string",format:"url",check:"string_format",abort:!1,...k(X)})}function OX($,X){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...k(X)})}function NX($,X){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...k(X)})}function DX($,X){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...k(X)})}function BX($,X){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...k(X)})}function wX($,X){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...k(X)})}function VX($,X){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...k(X)})}function AX($,X){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...k(X)})}function bX($,X){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...k(X)})}function KX($,X){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...k(X)})}function T9($,X){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...k(X)})}function vX($,X){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...k(X)})}function qX($,X){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...k(X)})}function LX($,X){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...k(X)})}function FX($,X){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...k(X)})}function MX($,X){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...k(X)})}function SX($,X){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...k(X)})}var C9={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function LQ($,X){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...k(X)})}function FQ($,X){return new $({type:"string",format:"date",check:"string_format",...k(X)})}function MQ($,X){return new $({type:"string",format:"time",check:"string_format",precision:null,...k(X)})}function SQ($,X){return new $({type:"string",format:"duration",check:"string_format",...k(X)})}function _9($,X){return new $({type:"number",checks:[],...k(X)})}function EQ($,X){return new $({type:"number",coerce:!0,checks:[],...k(X)})}function x9($,X){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...k(X)})}function u9($,X){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...k(X)})}function y9($,X){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...k(X)})}function g9($,X){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...k(X)})}function f9($,X){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...k(X)})}function h9($,X){return new $({type:"boolean",...k(X)})}function PQ($,X){return new $({type:"boolean",coerce:!0,...k(X)})}function l9($,X){return new $({type:"bigint",...k(X)})}function RQ($,X){return new $({type:"bigint",coerce:!0,...k(X)})}function m9($,X){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...k(X)})}function i9($,X){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...k(X)})}function n9($,X){return new $({type:"symbol",...k(X)})}function c9($,X){return new $({type:"undefined",...k(X)})}function r9($,X){return new $({type:"null",...k(X)})}function p9($){return new $({type:"any"})}function d9($){return new $({type:"unknown"})}function o9($,X){return new $({type:"never",...k(X)})}function t9($,X){return new $({type:"void",...k(X)})}function a9($,X){return new $({type:"date",...k(X)})}function ZQ($,X){return new $({type:"date",coerce:!0,...k(X)})}function s9($,X){return new $({type:"nan",...k(X)})}function B6($,X){return new AJ({check:"less_than",...k(X),value:$,inclusive:!1})}function S4($,X){return new AJ({check:"less_than",...k(X),value:$,inclusive:!0})}function w6($,X){return new bJ({check:"greater_than",...k(X),value:$,inclusive:!1})}function H4($,X){return new bJ({check:"greater_than",...k(X),value:$,inclusive:!0})}function kQ($){return w6(0,$)}function TQ($){return B6(0,$)}function CQ($){return S4(0,$)}function _Q($){return H4(0,$)}function j1($,X){return new UU({check:"multiple_of",...k(X),value:$})}function d1($,X){return new HU({check:"max_size",...k(X),maximum:$})}function I1($,X){return new jU({check:"min_size",...k(X),minimum:$})}function EX($,X){return new IU({check:"size_equals",...k(X),size:$})}function o1($,X){return new OU({check:"max_length",...k(X),maximum:$})}function f6($,X){return new NU({check:"min_length",...k(X),minimum:$})}function t1($,X){return new DU({check:"length_equals",...k(X),length:$})}function PX($,X){return new BU({check:"string_format",format:"regex",...k(X),pattern:$})}function RX($){return new wU({check:"string_format",format:"lowercase",...k($)})}function ZX($){return new VU({check:"string_format",format:"uppercase",...k($)})}function kX($,X){return new AU({check:"string_format",format:"includes",...k(X),includes:$})}function TX($,X){return new bU({check:"string_format",format:"starts_with",...k(X),prefix:$})}function CX($,X){return new KU({check:"string_format",format:"ends_with",...k(X),suffix:$})}function xQ($,X,W){return new vU({check:"property",property:$,schema:X,...k(W)})}function _X($,X){return new qU({check:"mime_type",mime:$,...k(X)})}function X6($){return new LU({check:"overwrite",tx:$})}function xX($){return X6((X)=>X.normalize($))}function uX(){return X6(($)=>$.trim())}function yX(){return X6(($)=>$.toLowerCase())}function gX(){return X6(($)=>$.toUpperCase())}function fX(){return X6(($)=>FG($))}function uQ($,X,W){return new $({type:"array",element:X,...k(W)})}function lq($,X,W){return new $({type:"union",options:X,...k(W)})}function mq($,X,W,Y){return new $({type:"union",options:W,discriminator:X,...k(Y)})}function iq($,X,W){return new $({type:"intersection",left:X,right:W})}function nq($,X,W,Y){let J=W instanceof n;return new $({type:"tuple",items:X,rest:J?W:null,...k(J?Y:W)})}function cq($,X,W,Y){return new $({type:"record",keyType:X,valueType:W,...k(Y)})}function rq($,X,W,Y){return new $({type:"map",keyType:X,valueType:W,...k(Y)})}function pq($,X,W){return new $({type:"set",valueType:X,...k(W)})}function dq($,X,W){let Y=Array.isArray(X)?Object.fromEntries(X.map((J)=>[J,J])):X;return new $({type:"enum",entries:Y,...k(W)})}function oq($,X,W){return new $({type:"enum",entries:X,...k(W)})}function tq($,X,W){return new $({type:"literal",values:Array.isArray(X)?X:[X],...k(W)})}function e9($,X){return new $({type:"file",...k(X)})}function aq($,X){return new $({type:"transform",transform:X})}function sq($,X){return new $({type:"optional",innerType:X})}function eq($,X){return new $({type:"nullable",innerType:X})}function $L($,X,W){return new $({type:"default",innerType:X,get defaultValue(){return typeof W==="function"?W():SG(W)}})}function XL($,X,W){return new $({type:"nonoptional",innerType:X,...k(W)})}function WL($,X){return new $({type:"success",innerType:X})}function JL($,X,W){return new $({type:"catch",innerType:X,catchValue:typeof W==="function"?W:()=>W})}function YL($,X,W){return new $({type:"pipe",in:X,out:W})}function GL($,X){return new $({type:"readonly",innerType:X})}function UL($,X,W){return new $({type:"template_literal",parts:X,...k(W)})}function QL($,X){return new $({type:"lazy",getter:X})}function zL($,X){return new $({type:"promise",innerType:X})}function $Y($,X,W){let Y=k(W);return Y.abort??(Y.abort=!0),new $({type:"custom",check:"custom",fn:X,...Y})}function XY($,X,W){return new $({type:"custom",check:"custom",fn:X,...k(W)})}function WY($){let X=dH((W)=>{return W.addIssue=(Y)=>{if(typeof Y==="string")W.issues.push(x1(Y,W.value,X._zod.def));else{let J=Y;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=W.value),J.inst??(J.inst=X),J.continue??(J.continue=!X._zod.def.abort),W.issues.push(x1(J))}},$(W.value,W)});return X}function dH($,X){let W=new B$({check:"custom",...k(X)});return W._zod.check=$,W}function JY($){let X=new B$({check:"describe"});return X._zod.onattach=[(W)=>{let Y=d$.get(W)??{};d$.add(W,{...Y,description:$})}],X._zod.check=()=>{},X}function YY($){let X=new B$({check:"meta"});return X._zod.onattach=[(W)=>{let Y=d$.get(W)??{};d$.add(W,{...Y,...$})}],X._zod.check=()=>{},X}function GY($,X){let W=k(X),Y=W.truthy??["true","1","yes","on","y","enabled"],J=W.falsy??["false","0","no","off","n","disabled"];if(W.case!=="sensitive")Y=Y.map((I)=>typeof I==="string"?I.toLowerCase():I),J=J.map((I)=>typeof I==="string"?I.toLowerCase():I);let G=new Set(Y),U=new Set(J),Q=$.Codec??n1,z=$.Boolean??i1,j=new($.String??g6)({type:"string",error:W.error}),O=new z({type:"boolean",error:W.error}),B=new Q({type:"pipe",in:j,out:O,transform:(I,N)=>{let D=I;if(W.case!=="sensitive")D=D.toLowerCase();if(G.has(D))return!0;else if(U.has(D))return!1;else return N.issues.push({code:"invalid_value",expected:"stringbool",values:[...G,...U],input:N.value,inst:B,continue:!1}),{}},reverseTransform:(I,N)=>{if(I===!0)return Y[0]||"true";else return J[0]||"false"},error:W.error});return B}function O1($,X,W,Y={}){let J=k(Y),G={...k(Y),check:"string_format",type:"string",format:X,fn:typeof W==="function"?W:(Q)=>W.test(Q),...J};if(W instanceof RegExp)G.pattern=W;return new $(G)}class UY{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??d$,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,X={path:[],schemaPath:[]}){var W;let Y=$._zod.def,J={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},G=this.seen.get($);if(G){if(G.count++,X.schemaPath.includes($))G.cycle=X.path;return G.schema}let U={schema:{},count:1,cycle:void 0,path:X.path};this.seen.set($,U);let Q=$._zod.toJSONSchema?.();if(Q)U.schema=Q;else{let j={...X,schemaPath:[...X.schemaPath,$],path:X.path},O=$._zod.parent;if(O)U.ref=O,this.process(O,j),this.seen.get(O).isParent=!0;else{let B=U.schema;switch(Y.type){case"string":{let I=B;I.type="string";let{minimum:N,maximum:D,format:w,patterns:V,contentEncoding:K}=$._zod.bag;if(typeof N==="number")I.minLength=N;if(typeof D==="number")I.maxLength=D;if(w){if(I.format=J[w]??w,I.format==="")delete I.format}if(K)I.contentEncoding=K;if(V&&V.size>0){let b=[...V];if(b.length===1)I.pattern=b[0].source;else if(b.length>1)U.schema.allOf=[...b.map((S)=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))]}break}case"number":{let I=B,{minimum:N,maximum:D,format:w,multipleOf:V,exclusiveMaximum:K,exclusiveMinimum:b}=$._zod.bag;if(typeof w==="string"&&w.includes("int"))I.type="integer";else I.type="number";if(typeof b==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")I.minimum=b,I.exclusiveMinimum=!0;else I.exclusiveMinimum=b;if(typeof N==="number"){if(I.minimum=N,typeof b==="number"&&this.target!=="draft-4")if(b>=N)delete I.minimum;else delete I.exclusiveMinimum}if(typeof K==="number")if(this.target==="draft-4"||this.target==="openapi-3.0")I.maximum=K,I.exclusiveMaximum=!0;else I.exclusiveMaximum=K;if(typeof D==="number"){if(I.maximum=D,typeof K==="number"&&this.target!=="draft-4")if(K<=D)delete I.maximum;else delete I.exclusiveMaximum}if(typeof V==="number")I.multipleOf=V;break}case"boolean":{let I=B;I.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{if(this.target==="openapi-3.0")B.type="string",B.nullable=!0,B.enum=[null];else B.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{B.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let I=B,{minimum:N,maximum:D}=$._zod.bag;if(typeof N==="number")I.minItems=N;if(typeof D==="number")I.maxItems=D;I.type="array",I.items=this.process(Y.element,{...j,path:[...j.path,"items"]});break}case"object":{let I=B;I.type="object",I.properties={};let N=Y.shape;for(let V in N)I.properties[V]=this.process(N[V],{...j,path:[...j.path,"properties",V]});let D=new Set(Object.keys(N)),w=new Set([...D].filter((V)=>{let K=Y.shape[V]._zod;if(this.io==="input")return K.optin===void 0;else return K.optout===void 0}));if(w.size>0)I.required=Array.from(w);if(Y.catchall?._zod.def.type==="never")I.additionalProperties=!1;else if(!Y.catchall){if(this.io==="output")I.additionalProperties=!1}else if(Y.catchall)I.additionalProperties=this.process(Y.catchall,{...j,path:[...j.path,"additionalProperties"]});break}case"union":{let I=B,N=Y.discriminator!==void 0,D=Y.options.map((w,V)=>this.process(w,{...j,path:[...j.path,N?"oneOf":"anyOf",V]}));if(N)I.oneOf=D;else I.anyOf=D;break}case"intersection":{let I=B,N=this.process(Y.left,{...j,path:[...j.path,"allOf",0]}),D=this.process(Y.right,{...j,path:[...j.path,"allOf",1]}),w=(K)=>("allOf"in K)&&Object.keys(K).length===1,V=[...w(N)?N.allOf:[N],...w(D)?D.allOf:[D]];I.allOf=V;break}case"tuple":{let I=B;I.type="array";let N=this.target==="draft-2020-12"?"prefixItems":"items",D=this.target==="draft-2020-12"?"items":this.target==="openapi-3.0"?"items":"additionalItems",w=Y.items.map((S,L)=>this.process(S,{...j,path:[...j.path,N,L]})),V=Y.rest?this.process(Y.rest,{...j,path:[...j.path,D,...this.target==="openapi-3.0"?[Y.items.length]:[]]}):null;if(this.target==="draft-2020-12"){if(I.prefixItems=w,V)I.items=V}else if(this.target==="openapi-3.0"){if(I.items={anyOf:w},V)I.items.anyOf.push(V);if(I.minItems=w.length,!V)I.maxItems=w.length}else if(I.items=w,V)I.additionalItems=V;let{minimum:K,maximum:b}=$._zod.bag;if(typeof K==="number")I.minItems=K;if(typeof b==="number")I.maxItems=b;break}case"record":{let I=B;if(I.type="object",this.target==="draft-7"||this.target==="draft-2020-12")I.propertyNames=this.process(Y.keyType,{...j,path:[...j.path,"propertyNames"]});I.additionalProperties=this.process(Y.valueType,{...j,path:[...j.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let I=B,N=m0(Y.entries);if(N.every((D)=>typeof D==="number"))I.type="number";if(N.every((D)=>typeof D==="string"))I.type="string";I.enum=N;break}case"literal":{let I=B,N=[];for(let D of Y.values)if(D===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof D==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else N.push(Number(D));else N.push(D);if(N.length===0);else if(N.length===1){let D=N[0];if(I.type=D===null?"null":typeof D,this.target==="draft-4"||this.target==="openapi-3.0")I.enum=[D];else I.const=D}else{if(N.every((D)=>typeof D==="number"))I.type="number";if(N.every((D)=>typeof D==="string"))I.type="string";if(N.every((D)=>typeof D==="boolean"))I.type="string";if(N.every((D)=>D===null))I.type="null";I.enum=N}break}case"file":{let I=B,N={type:"string",format:"binary",contentEncoding:"binary"},{minimum:D,maximum:w,mime:V}=$._zod.bag;if(D!==void 0)N.minLength=D;if(w!==void 0)N.maxLength=w;if(V)if(V.length===1)N.contentMediaType=V[0],Object.assign(I,N);else I.anyOf=V.map((K)=>{return{...N,contentMediaType:K}});else Object.assign(I,N);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let I=this.process(Y.innerType,j);if(this.target==="openapi-3.0")U.ref=Y.innerType,B.nullable=!0;else B.anyOf=[I,{type:"null"}];break}case"nonoptional":{this.process(Y.innerType,j),U.ref=Y.innerType;break}case"success":{let I=B;I.type="boolean";break}case"default":{this.process(Y.innerType,j),U.ref=Y.innerType,B.default=JSON.parse(JSON.stringify(Y.defaultValue));break}case"prefault":{if(this.process(Y.innerType,j),U.ref=Y.innerType,this.io==="input")B._prefault=JSON.parse(JSON.stringify(Y.defaultValue));break}case"catch":{this.process(Y.innerType,j),U.ref=Y.innerType;let I;try{I=Y.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}B.default=I;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let I=B,N=$._zod.pattern;if(!N)throw Error("Pattern not found in template literal");I.type="string",I.pattern=N.source;break}case"pipe":{let I=this.io==="input"?Y.in._zod.def.type==="transform"?Y.out:Y.in:Y.out;this.process(I,j),U.ref=I;break}case"readonly":{this.process(Y.innerType,j),U.ref=Y.innerType,B.readOnly=!0;break}case"promise":{this.process(Y.innerType,j),U.ref=Y.innerType;break}case"optional":{this.process(Y.innerType,j),U.ref=Y.innerType;break}case"lazy":{let I=$._zod.innerType;this.process(I,j),U.ref=I;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema");break}default:}}}let z=this.metadataRegistry.get($);if(z)Object.assign(U.schema,z);if(this.io==="input"&&$4($))delete U.schema.examples,delete U.schema.default;if(this.io==="input"&&U.schema._prefault)(W=U.schema).default??(W.default=U.schema._prefault);return delete U.schema._prefault,this.seen.get($).schema}emit($,X){let W={cycles:X?.cycles??"ref",reused:X?.reused??"inline",external:X?.external??void 0},Y=this.seen.get($);if(!Y)throw Error("Unprocessed schema. This is a bug in Zod.");let J=(H)=>{let j=this.target==="draft-2020-12"?"$defs":"definitions";if(W.external){let N=W.external.registry.get(H[0])?.id,D=W.external.uri??((V)=>V);if(N)return{ref:D(N)};let w=H[1].defId??H[1].schema.id??`schema${this.counter++}`;return H[1].defId=w,{defId:w,ref:`${D("__shared")}#/${j}/${w}`}}if(H[1]===Y)return{ref:"#"};let B=`${"#"}/${j}/`,I=H[1].schema.id??`__schema${this.counter++}`;return{defId:I,ref:B+I}},G=(H)=>{if(H[1].schema.$ref)return;let j=H[1],{ref:O,defId:B}=J(H);if(j.def={...j.schema},B)j.defId=B;let I=j.schema;for(let N in I)delete I[N];I.$ref=O};if(W.cycles==="throw")for(let H of this.seen.entries()){let j=H[1];if(j.cycle)throw Error(`Cycle detected: #/${j.cycle?.join("/")}/<root>
|
|
39
|
+
|
|
40
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let H of this.seen.entries()){let j=H[1];if($===H[0]){G(H);continue}if(W.external){let B=W.external.registry.get(H[0])?.id;if($!==H[0]&&B){G(H);continue}}if(this.metadataRegistry.get(H[0])?.id){G(H);continue}if(j.cycle){G(H);continue}if(j.count>1){if(W.reused==="ref"){G(H);continue}}}let U=(H,j)=>{let O=this.seen.get(H),B=O.def??O.schema,I={...B};if(O.ref===null)return;let N=O.ref;if(O.ref=null,N){U(N,j);let D=this.seen.get(N).schema;if(D.$ref&&(j.target==="draft-7"||j.target==="draft-4"||j.target==="openapi-3.0"))B.allOf=B.allOf??[],B.allOf.push(D);else Object.assign(B,D),Object.assign(B,I)}if(!O.isParent)this.override({zodSchema:H,jsonSchema:B,path:O.path??[]})};for(let H of[...this.seen.entries()].reverse())U(H[0],{target:this.target});let Q={};if(this.target==="draft-2020-12")Q.$schema="https://json-schema.org/draft/2020-12/schema";else if(this.target==="draft-7")Q.$schema="http://json-schema.org/draft-07/schema#";else if(this.target==="draft-4")Q.$schema="http://json-schema.org/draft-04/schema#";else if(this.target==="openapi-3.0");else console.warn(`Invalid target: ${this.target}`);if(W.external?.uri){let H=W.external.registry.get($)?.id;if(!H)throw Error("Schema is missing an `id` property");Q.$id=W.external.uri(H)}Object.assign(Q,Y.def);let z=W.external?.defs??{};for(let H of this.seen.entries()){let j=H[1];if(j.def&&j.defId)z[j.defId]=j.def}if(W.external);else if(Object.keys(z).length>0)if(this.target==="draft-2020-12")Q.$defs=z;else Q.definitions=z;try{return JSON.parse(JSON.stringify(Q))}catch(H){throw Error("Error converting schema to JSON.")}}}function a1($,X){if($ instanceof GX){let Y=new UY(X),J={};for(let Q of $._idmap.entries()){let[z,H]=Q;Y.process(H)}let G={},U={registry:$,uri:X?.uri,defs:J};for(let Q of $._idmap.entries()){let[z,H]=Q;G[z]=Y.emit(H,{...X,external:U})}if(Object.keys(J).length>0){let Q=Y.target==="draft-2020-12"?"$defs":"definitions";G.__shared={[Q]:J}}return{schemas:G}}let W=new UY(X);return W.process($),W.emit($,X)}function $4($,X){let W=X??{seen:new Set};if(W.seen.has($))return!1;W.seen.add($);let Y=$._zod.def;if(Y.type==="transform")return!0;if(Y.type==="array")return $4(Y.element,W);if(Y.type==="set")return $4(Y.valueType,W);if(Y.type==="lazy")return $4(Y.getter(),W);if(Y.type==="promise"||Y.type==="optional"||Y.type==="nonoptional"||Y.type==="nullable"||Y.type==="readonly"||Y.type==="default"||Y.type==="prefault")return $4(Y.innerType,W);if(Y.type==="intersection")return $4(Y.left,W)||$4(Y.right,W);if(Y.type==="record"||Y.type==="map")return $4(Y.keyType,W)||$4(Y.valueType,W);if(Y.type==="pipe")return $4(Y.in,W)||$4(Y.out,W);if(Y.type==="object"){for(let J in Y.shape)if($4(Y.shape[J],W))return!0;return!1}if(Y.type==="union"){for(let J of Y.options)if($4(J,W))return!0;return!1}if(Y.type==="tuple"){for(let J of Y.items)if($4(J,W))return!0;if(Y.rest&&$4(Y.rest,W))return!0;return!1}return!1}var oH={};var jL=A("ZodMiniType",($,X)=>{if(!$._zod)throw Error("Uninitialized schema in ZodMiniType.");n.init($,X),$.def=X,$.type=X.type,$.parse=(W,Y)=>Q1($,W,Y,{callee:$.parse}),$.safeParse=(W,Y)=>u6($,W,Y),$.parseAsync=async(W,Y)=>z1($,W,Y,{callee:$.parseAsync}),$.safeParseAsync=async(W,Y)=>y6($,W,Y),$.check=(...W)=>{return $.clone({...X,checks:[...X.checks??[],...W.map((Y)=>typeof Y==="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]})},$.clone=(W,Y)=>m$($,W,Y),$.brand=()=>$,$.register=(W,Y)=>{return W.add($,Y),$}});var IL=A("ZodMiniObject",($,X)=>{Y9.init($,X),jL.init($,X),P.defineLazy($,"shape",()=>X.shape)});function yQ($,X){let W={type:"object",shape:$??{},...P.normalizeParams(X)};return new IL(W)}function _4($){return!!$._zod}function s1($){let X=Object.values($);if(X.length===0)return yQ({});let W=X.every(_4),Y=X.every((J)=>!_4(J));if(W)return yQ($);if(Y)return HH($);throw Error("Mixed Zod versions detected in object shape.")}function QY($,X){if(_4($))return u6($,X);return $.safeParse(X)}async function zY($,X){if(_4($))return await y6($,X);return await $.safeParseAsync(X)}function e1($){var X,W;if(!$)return;let Y;if(_4($))Y=(W=(X=$._zod)===null||X===void 0?void 0:X.def)===null||W===void 0?void 0:W.shape;else Y=$.shape;if(!Y)return;if(typeof Y==="function")try{return Y()}catch(J){return}return Y}function $0($){var X;if(!$)return;if(typeof $==="object"){let W=$,Y=$;if(!W._def&&!Y._zod){let J=Object.values($);if(J.length>0&&J.every((G)=>typeof G==="object"&&G!==null&&(G._def!==void 0||G._zod!==void 0||typeof G.parse==="function")))return s1($)}}if(_4($)){let Y=(X=$._zod)===null||X===void 0?void 0:X.def;if(Y&&(Y.typeName==="object"||Y.shape!==void 0))return $}else if($.shape!==void 0)return $;return}function HY($){if($&&typeof $==="object"){if("message"in $&&typeof $.message==="string")return $.message;if("issues"in $&&Array.isArray($.issues)&&$.issues.length>0){let X=$.issues[0];if(X&&typeof X==="object"&&"message"in X)return String(X.message)}try{return JSON.stringify($)}catch(X){return String($)}}return String($)}function tH($){var X,W,Y,J;if(_4($))return(W=(X=$._zod)===null||X===void 0?void 0:X.def)===null||W===void 0?void 0:W.description;let G=$;return(Y=$.description)!==null&&Y!==void 0?Y:(J=G._def)===null||J===void 0?void 0:J.description}function aH($){var X,W,Y;if(_4($))return((W=(X=$._zod)===null||X===void 0?void 0:X.def)===null||W===void 0?void 0:W.typeName)==="ZodOptional";let J=$;if(typeof $.isOptional==="function")return $.isOptional();return((Y=J._def)===null||Y===void 0?void 0:Y.typeName)==="ZodOptional"}function jY($){var X;if(_4($)){let U=(X=$._zod)===null||X===void 0?void 0:X.def;if(U){if(U.value!==void 0)return U.value;if(Array.isArray(U.values)&&U.values.length>0)return U.values[0]}}let Y=$._def;if(Y){if(Y.value!==void 0)return Y.value;if(Array.isArray(Y.values)&&Y.values.length>0)return Y.values[0]}let J=$.value;if(J!==void 0)return J;return}var M={};X1(M,{xid:()=>RL,void:()=>$F,uuidv7:()=>vL,uuidv6:()=>KL,uuidv4:()=>bL,uuid:()=>AL,util:()=>P,url:()=>qL,uppercase:()=>ZX,unknown:()=>v$,union:()=>q$,undefined:()=>sL,ulid:()=>PL,uint64:()=>tL,uint32:()=>pL,tuple:()=>N3,trim:()=>uX,treeifyError:()=>QJ,transform:()=>L7,toUpperCase:()=>gX,toLowerCase:()=>yX,toJSONSchema:()=>a1,templateLiteral:()=>NF,symbol:()=>aL,superRefine:()=>y3,success:()=>jF,stringbool:()=>KF,stringFormat:()=>hL,string:()=>F,strictObject:()=>JF,startsWith:()=>TX,slugify:()=>fX,size:()=>EX,setErrorMap:()=>LF,set:()=>UF,safeParseAsync:()=>cQ,safeParse:()=>nQ,safeEncodeAsync:()=>sQ,safeEncode:()=>tQ,safeDecodeAsync:()=>eQ,safeDecode:()=>aQ,registry:()=>UX,regexes:()=>z4,regex:()=>PX,refine:()=>u3,record:()=>P$,readonly:()=>Z3,property:()=>xQ,promise:()=>DF,prettifyError:()=>zJ,preprocess:()=>R7,prefault:()=>L3,positive:()=>kQ,pipe:()=>AY,partialRecord:()=>YF,parseAsync:()=>iQ,parse:()=>mQ,overwrite:()=>X6,optional:()=>d,object:()=>u,number:()=>E$,nullish:()=>HF,nullable:()=>VY,null:()=>Y3,normalize:()=>xX,nonpositive:()=>CQ,nonoptional:()=>F3,nonnegative:()=>_Q,never:()=>b7,negative:()=>TQ,nativeEnum:()=>QF,nanoid:()=>ML,nan:()=>IF,multipleOf:()=>j1,minSize:()=>I1,minLength:()=>f6,mime:()=>_X,meta:()=>AF,maxSize:()=>d1,maxLength:()=>o1,map:()=>GF,mac:()=>TL,lte:()=>S4,lt:()=>B6,lowercase:()=>RX,looseObject:()=>W6,locales:()=>c1,literal:()=>h,length:()=>t1,lazy:()=>C3,ksuid:()=>ZL,keyof:()=>WF,jwt:()=>fL,json:()=>vF,iso:()=>BY,ipv6:()=>CL,ipv4:()=>kL,intersection:()=>rX,int64:()=>oL,int32:()=>rL,int:()=>$7,instanceof:()=>bF,includes:()=>kX,httpUrl:()=>LL,hostname:()=>lL,hex:()=>mL,hash:()=>iL,guid:()=>VL,gte:()=>H4,gt:()=>w6,globalRegistry:()=>d$,getErrorMap:()=>FF,function:()=>BF,formatError:()=>y1,float64:()=>cL,float32:()=>nL,flattenError:()=>u1,file:()=>zF,enum:()=>I4,endsWith:()=>CX,encodeAsync:()=>dQ,encode:()=>rQ,emoji:()=>FL,email:()=>wL,e164:()=>gL,discriminatedUnion:()=>v7,describe:()=>VF,decodeAsync:()=>oQ,decode:()=>pQ,date:()=>XF,custom:()=>P7,cuid2:()=>EL,cuid:()=>SL,core:()=>C4,config:()=>x$,coerce:()=>k7,codec:()=>OF,clone:()=>m$,cidrv6:()=>xL,cidrv4:()=>_L,check:()=>wF,catch:()=>E3,boolean:()=>f$,bigint:()=>dL,base64url:()=>yL,base64:()=>uL,array:()=>Y$,any:()=>eL,_function:()=>BF,_default:()=>v3,_ZodString:()=>X7,ZodXID:()=>z7,ZodVoid:()=>z3,ZodUnknown:()=>U3,ZodUnion:()=>K7,ZodUndefined:()=>W3,ZodUUID:()=>V6,ZodURL:()=>bY,ZodULID:()=>Q7,ZodType:()=>s,ZodTuple:()=>O3,ZodTransform:()=>A3,ZodTemplateLiteral:()=>k3,ZodSymbol:()=>X3,ZodSuccess:()=>M3,ZodStringFormat:()=>A$,ZodString:()=>lX,ZodSet:()=>B3,ZodRecord:()=>q7,ZodRealError:()=>j4,ZodReadonly:()=>R3,ZodPromise:()=>_3,ZodPrefault:()=>q3,ZodPipe:()=>S7,ZodOptional:()=>F7,ZodObject:()=>vY,ZodNumberFormat:()=>X0,ZodNumber:()=>iX,ZodNullable:()=>b3,ZodNull:()=>J3,ZodNonOptional:()=>M7,ZodNever:()=>Q3,ZodNanoID:()=>Y7,ZodNaN:()=>P3,ZodMap:()=>D3,ZodMAC:()=>$3,ZodLiteral:()=>w3,ZodLazy:()=>T3,ZodKSUID:()=>H7,ZodJWT:()=>V7,ZodIssueCode:()=>qF,ZodIntersection:()=>I3,ZodISOTime:()=>NY,ZodISODuration:()=>DY,ZodISODateTime:()=>IY,ZodISODate:()=>OY,ZodIPv6:()=>I7,ZodIPv4:()=>j7,ZodGUID:()=>wY,ZodFunction:()=>x3,ZodFirstPartyTypeKind:()=>Z7,ZodFile:()=>V3,ZodError:()=>DL,ZodEnum:()=>hX,ZodEmoji:()=>J7,ZodEmail:()=>W7,ZodE164:()=>w7,ZodDiscriminatedUnion:()=>j3,ZodDefault:()=>K3,ZodDate:()=>KY,ZodCustomStringFormat:()=>mX,ZodCustom:()=>qY,ZodCodec:()=>E7,ZodCatch:()=>S3,ZodCUID2:()=>U7,ZodCUID:()=>G7,ZodCIDRv6:()=>N7,ZodCIDRv4:()=>O7,ZodBoolean:()=>nX,ZodBigIntFormat:()=>A7,ZodBigInt:()=>cX,ZodBase64URL:()=>B7,ZodBase64:()=>D7,ZodArray:()=>H3,ZodAny:()=>G3,TimePrecision:()=>C9,NEVER:()=>JJ,$output:()=>R9,$input:()=>Z9,$brand:()=>YJ});var BY={};X1(BY,{time:()=>hQ,duration:()=>lQ,datetime:()=>gQ,date:()=>fQ,ZodISOTime:()=>NY,ZodISODuration:()=>DY,ZodISODateTime:()=>IY,ZodISODate:()=>OY});var IY=A("ZodISODateTime",($,X)=>{SU.init($,X),A$.init($,X)});function gQ($){return LQ(IY,$)}var OY=A("ZodISODate",($,X)=>{EU.init($,X),A$.init($,X)});function fQ($){return FQ(OY,$)}var NY=A("ZodISOTime",($,X)=>{PU.init($,X),A$.init($,X)});function hQ($){return MQ(NY,$)}var DY=A("ZodISODuration",($,X)=>{RU.init($,X),A$.init($,X)});function lQ($){return SQ(DY,$)}var eH=($,X)=>{p0.init($,X),$.name="ZodError",Object.defineProperties($,{format:{value:(W)=>y1($,W)},flatten:{value:(W)=>u1($,W)},addIssue:{value:(W)=>{$.issues.push(W),$.message=JSON.stringify($.issues,C1,2)}},addIssues:{value:(W)=>{$.issues.push(...W),$.message=JSON.stringify($.issues,C1,2)}},isEmpty:{get(){return $.issues.length===0}}})},DL=A("ZodError",eH),j4=A("ZodError",eH,{Parent:Error});var mQ=g1(j4),iQ=f1(j4),nQ=h1(j4),cQ=l1(j4),rQ=HJ(j4),pQ=jJ(j4),dQ=IJ(j4),oQ=OJ(j4),tQ=NJ(j4),aQ=DJ(j4),sQ=BJ(j4),eQ=wJ(j4);var s=A("ZodType",($,X)=>{return n.init($,X),$.def=X,$.type=X.type,Object.defineProperty($,"_def",{value:X}),$.check=(...W)=>{return $.clone(P.mergeDefs(X,{checks:[...X.checks??[],...W.map((Y)=>typeof Y==="function"?{_zod:{check:Y,def:{check:"custom"},onattach:[]}}:Y)]}))},$.clone=(W,Y)=>m$($,W,Y),$.brand=()=>$,$.register=(W,Y)=>{return W.add($,Y),$},$.parse=(W,Y)=>mQ($,W,Y,{callee:$.parse}),$.safeParse=(W,Y)=>nQ($,W,Y),$.parseAsync=async(W,Y)=>iQ($,W,Y,{callee:$.parseAsync}),$.safeParseAsync=async(W,Y)=>cQ($,W,Y),$.spa=$.safeParseAsync,$.encode=(W,Y)=>rQ($,W,Y),$.decode=(W,Y)=>pQ($,W,Y),$.encodeAsync=async(W,Y)=>dQ($,W,Y),$.decodeAsync=async(W,Y)=>oQ($,W,Y),$.safeEncode=(W,Y)=>tQ($,W,Y),$.safeDecode=(W,Y)=>aQ($,W,Y),$.safeEncodeAsync=async(W,Y)=>sQ($,W,Y),$.safeDecodeAsync=async(W,Y)=>eQ($,W,Y),$.refine=(W,Y)=>$.check(u3(W,Y)),$.superRefine=(W)=>$.check(y3(W)),$.overwrite=(W)=>$.check(X6(W)),$.optional=()=>d($),$.nullable=()=>VY($),$.nullish=()=>d(VY($)),$.nonoptional=(W)=>F3($,W),$.array=()=>Y$($),$.or=(W)=>q$([$,W]),$.and=(W)=>rX($,W),$.transform=(W)=>AY($,L7(W)),$.default=(W)=>v3($,W),$.prefault=(W)=>L3($,W),$.catch=(W)=>E3($,W),$.pipe=(W)=>AY($,W),$.readonly=()=>Z3($),$.describe=(W)=>{let Y=$.clone();return d$.add(Y,{description:W}),Y},Object.defineProperty($,"description",{get(){return d$.get($)?.description},configurable:!0}),$.meta=(...W)=>{if(W.length===0)return d$.get($);let Y=$.clone();return d$.add(Y,W[0]),Y},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),X7=A("_ZodString",($,X)=>{g6.init($,X),s.init($,X);let W=$._zod.bag;$.format=W.format??null,$.minLength=W.minimum??null,$.maxLength=W.maximum??null,$.regex=(...Y)=>$.check(PX(...Y)),$.includes=(...Y)=>$.check(kX(...Y)),$.startsWith=(...Y)=>$.check(TX(...Y)),$.endsWith=(...Y)=>$.check(CX(...Y)),$.min=(...Y)=>$.check(f6(...Y)),$.max=(...Y)=>$.check(o1(...Y)),$.length=(...Y)=>$.check(t1(...Y)),$.nonempty=(...Y)=>$.check(f6(1,...Y)),$.lowercase=(Y)=>$.check(RX(Y)),$.uppercase=(Y)=>$.check(ZX(Y)),$.trim=()=>$.check(uX()),$.normalize=(...Y)=>$.check(xX(...Y)),$.toLowerCase=()=>$.check(yX()),$.toUpperCase=()=>$.check(gX()),$.slugify=()=>$.check(fX())}),lX=A("ZodString",($,X)=>{g6.init($,X),X7.init($,X),$.email=(W)=>$.check(QX(W7,W)),$.url=(W)=>$.check(p1(bY,W)),$.jwt=(W)=>$.check(SX(V7,W)),$.emoji=(W)=>$.check(OX(J7,W)),$.guid=(W)=>$.check(r1(wY,W)),$.uuid=(W)=>$.check(zX(V6,W)),$.uuidv4=(W)=>$.check(HX(V6,W)),$.uuidv6=(W)=>$.check(jX(V6,W)),$.uuidv7=(W)=>$.check(IX(V6,W)),$.nanoid=(W)=>$.check(NX(Y7,W)),$.guid=(W)=>$.check(r1(wY,W)),$.cuid=(W)=>$.check(DX(G7,W)),$.cuid2=(W)=>$.check(BX(U7,W)),$.ulid=(W)=>$.check(wX(Q7,W)),$.base64=(W)=>$.check(LX(D7,W)),$.base64url=(W)=>$.check(FX(B7,W)),$.xid=(W)=>$.check(VX(z7,W)),$.ksuid=(W)=>$.check(AX(H7,W)),$.ipv4=(W)=>$.check(bX(j7,W)),$.ipv6=(W)=>$.check(KX(I7,W)),$.cidrv4=(W)=>$.check(vX(O7,W)),$.cidrv6=(W)=>$.check(qX(N7,W)),$.e164=(W)=>$.check(MX(w7,W)),$.datetime=(W)=>$.check(gQ(W)),$.date=(W)=>$.check(fQ(W)),$.time=(W)=>$.check(hQ(W)),$.duration=(W)=>$.check(lQ(W))});function F($){return k9(lX,$)}var A$=A("ZodStringFormat",($,X)=>{O$.init($,X),X7.init($,X)}),W7=A("ZodEmail",($,X)=>{PJ.init($,X),A$.init($,X)});function wL($){return QX(W7,$)}var wY=A("ZodGUID",($,X)=>{SJ.init($,X),A$.init($,X)});function VL($){return r1(wY,$)}var V6=A("ZodUUID",($,X)=>{EJ.init($,X),A$.init($,X)});function AL($){return zX(V6,$)}function bL($){return HX(V6,$)}function KL($){return jX(V6,$)}function vL($){return IX(V6,$)}var bY=A("ZodURL",($,X)=>{RJ.init($,X),A$.init($,X)});function qL($){return p1(bY,$)}function LL($){return p1(bY,{protocol:/^https?$/,hostname:z4.domain,...P.normalizeParams($)})}var J7=A("ZodEmoji",($,X)=>{ZJ.init($,X),A$.init($,X)});function FL($){return OX(J7,$)}var Y7=A("ZodNanoID",($,X)=>{kJ.init($,X),A$.init($,X)});function ML($){return NX(Y7,$)}var G7=A("ZodCUID",($,X)=>{TJ.init($,X),A$.init($,X)});function SL($){return DX(G7,$)}var U7=A("ZodCUID2",($,X)=>{CJ.init($,X),A$.init($,X)});function EL($){return BX(U7,$)}var Q7=A("ZodULID",($,X)=>{_J.init($,X),A$.init($,X)});function PL($){return wX(Q7,$)}var z7=A("ZodXID",($,X)=>{xJ.init($,X),A$.init($,X)});function RL($){return VX(z7,$)}var H7=A("ZodKSUID",($,X)=>{uJ.init($,X),A$.init($,X)});function ZL($){return AX(H7,$)}var j7=A("ZodIPv4",($,X)=>{yJ.init($,X),A$.init($,X)});function kL($){return bX(j7,$)}var $3=A("ZodMAC",($,X)=>{fJ.init($,X),A$.init($,X)});function TL($){return T9($3,$)}var I7=A("ZodIPv6",($,X)=>{gJ.init($,X),A$.init($,X)});function CL($){return KX(I7,$)}var O7=A("ZodCIDRv4",($,X)=>{hJ.init($,X),A$.init($,X)});function _L($){return vX(O7,$)}var N7=A("ZodCIDRv6",($,X)=>{lJ.init($,X),A$.init($,X)});function xL($){return qX(N7,$)}var D7=A("ZodBase64",($,X)=>{mJ.init($,X),A$.init($,X)});function uL($){return LX(D7,$)}var B7=A("ZodBase64URL",($,X)=>{iJ.init($,X),A$.init($,X)});function yL($){return FX(B7,$)}var w7=A("ZodE164",($,X)=>{nJ.init($,X),A$.init($,X)});function gL($){return MX(w7,$)}var V7=A("ZodJWT",($,X)=>{cJ.init($,X),A$.init($,X)});function fL($){return SX(V7,$)}var mX=A("ZodCustomStringFormat",($,X)=>{rJ.init($,X),A$.init($,X)});function hL($,X,W={}){return O1(mX,$,X,W)}function lL($){return O1(mX,"hostname",z4.hostname,$)}function mL($){return O1(mX,"hex",z4.hex,$)}function iL($,X){let W=X?.enc??"hex",Y=`${$}_${W}`,J=z4[Y];if(!J)throw Error(`Unrecognized hash format: ${Y}`);return O1(mX,Y,J,X)}var iX=A("ZodNumber",($,X)=>{t0.init($,X),s.init($,X),$.gt=(Y,J)=>$.check(w6(Y,J)),$.gte=(Y,J)=>$.check(H4(Y,J)),$.min=(Y,J)=>$.check(H4(Y,J)),$.lt=(Y,J)=>$.check(B6(Y,J)),$.lte=(Y,J)=>$.check(S4(Y,J)),$.max=(Y,J)=>$.check(S4(Y,J)),$.int=(Y)=>$.check($7(Y)),$.safe=(Y)=>$.check($7(Y)),$.positive=(Y)=>$.check(w6(0,Y)),$.nonnegative=(Y)=>$.check(H4(0,Y)),$.negative=(Y)=>$.check(B6(0,Y)),$.nonpositive=(Y)=>$.check(S4(0,Y)),$.multipleOf=(Y,J)=>$.check(j1(Y,J)),$.step=(Y,J)=>$.check(j1(Y,J)),$.finite=()=>$;let W=$._zod.bag;$.minValue=Math.max(W.minimum??Number.NEGATIVE_INFINITY,W.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(W.maximum??Number.POSITIVE_INFINITY,W.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(W.format??"").includes("int")||Number.isSafeInteger(W.multipleOf??0.5),$.isFinite=!0,$.format=W.format??null});function E$($){return _9(iX,$)}var X0=A("ZodNumberFormat",($,X)=>{pJ.init($,X),iX.init($,X)});function $7($){return x9(X0,$)}function nL($){return u9(X0,$)}function cL($){return y9(X0,$)}function rL($){return g9(X0,$)}function pL($){return f9(X0,$)}var nX=A("ZodBoolean",($,X)=>{i1.init($,X),s.init($,X)});function f$($){return h9(nX,$)}var cX=A("ZodBigInt",($,X)=>{a0.init($,X),s.init($,X),$.gte=(Y,J)=>$.check(H4(Y,J)),$.min=(Y,J)=>$.check(H4(Y,J)),$.gt=(Y,J)=>$.check(w6(Y,J)),$.gte=(Y,J)=>$.check(H4(Y,J)),$.min=(Y,J)=>$.check(H4(Y,J)),$.lt=(Y,J)=>$.check(B6(Y,J)),$.lte=(Y,J)=>$.check(S4(Y,J)),$.max=(Y,J)=>$.check(S4(Y,J)),$.positive=(Y)=>$.check(w6(BigInt(0),Y)),$.negative=(Y)=>$.check(B6(BigInt(0),Y)),$.nonpositive=(Y)=>$.check(S4(BigInt(0),Y)),$.nonnegative=(Y)=>$.check(H4(BigInt(0),Y)),$.multipleOf=(Y,J)=>$.check(j1(Y,J));let W=$._zod.bag;$.minValue=W.minimum??null,$.maxValue=W.maximum??null,$.format=W.format??null});function dL($){return l9(cX,$)}var A7=A("ZodBigIntFormat",($,X)=>{dJ.init($,X),cX.init($,X)});function oL($){return m9(A7,$)}function tL($){return i9(A7,$)}var X3=A("ZodSymbol",($,X)=>{oJ.init($,X),s.init($,X)});function aL($){return n9(X3,$)}var W3=A("ZodUndefined",($,X)=>{tJ.init($,X),s.init($,X)});function sL($){return c9(W3,$)}var J3=A("ZodNull",($,X)=>{aJ.init($,X),s.init($,X)});function Y3($){return r9(J3,$)}var G3=A("ZodAny",($,X)=>{sJ.init($,X),s.init($,X)});function eL(){return p9(G3)}var U3=A("ZodUnknown",($,X)=>{eJ.init($,X),s.init($,X)});function v$(){return d9(U3)}var Q3=A("ZodNever",($,X)=>{$9.init($,X),s.init($,X)});function b7($){return o9(Q3,$)}var z3=A("ZodVoid",($,X)=>{X9.init($,X),s.init($,X)});function $F($){return t9(z3,$)}var KY=A("ZodDate",($,X)=>{W9.init($,X),s.init($,X),$.min=(Y,J)=>$.check(H4(Y,J)),$.max=(Y,J)=>$.check(S4(Y,J));let W=$._zod.bag;$.minDate=W.minimum?new Date(W.minimum):null,$.maxDate=W.maximum?new Date(W.maximum):null});function XF($){return a9(KY,$)}var H3=A("ZodArray",($,X)=>{J9.init($,X),s.init($,X),$.element=X.element,$.min=(W,Y)=>$.check(f6(W,Y)),$.nonempty=(W)=>$.check(f6(1,W)),$.max=(W,Y)=>$.check(o1(W,Y)),$.length=(W,Y)=>$.check(t1(W,Y)),$.unwrap=()=>$.element});function Y$($,X){return uQ(H3,$,X)}function WF($){let X=$._zod.def.shape;return I4(Object.keys(X))}var vY=A("ZodObject",($,X)=>{kU.init($,X),s.init($,X),P.defineLazy($,"shape",()=>{return X.shape}),$.keyof=()=>I4(Object.keys($._zod.def.shape)),$.catchall=(W)=>$.clone({...$._zod.def,catchall:W}),$.passthrough=()=>$.clone({...$._zod.def,catchall:v$()}),$.loose=()=>$.clone({...$._zod.def,catchall:v$()}),$.strict=()=>$.clone({...$._zod.def,catchall:b7()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(W)=>{return P.extend($,W)},$.safeExtend=(W)=>{return P.safeExtend($,W)},$.merge=(W)=>P.merge($,W),$.pick=(W)=>P.pick($,W),$.omit=(W)=>P.omit($,W),$.partial=(...W)=>P.partial(F7,$,W[0]),$.required=(...W)=>P.required(M7,$,W[0])});function u($,X){let W={type:"object",shape:$??{},...P.normalizeParams(X)};return new vY(W)}function JF($,X){return new vY({type:"object",shape:$,catchall:b7(),...P.normalizeParams(X)})}function W6($,X){return new vY({type:"object",shape:$,catchall:v$(),...P.normalizeParams(X)})}var K7=A("ZodUnion",($,X)=>{s0.init($,X),s.init($,X),$.options=X.options});function q$($,X){return new K7({type:"union",options:$,...P.normalizeParams(X)})}var j3=A("ZodDiscriminatedUnion",($,X)=>{K7.init($,X),G9.init($,X)});function v7($,X,W){return new j3({type:"union",options:X,discriminator:$,...P.normalizeParams(W)})}var I3=A("ZodIntersection",($,X)=>{U9.init($,X),s.init($,X)});function rX($,X){return new I3({type:"intersection",left:$,right:X})}var O3=A("ZodTuple",($,X)=>{e0.init($,X),s.init($,X),$.rest=(W)=>$.clone({...$._zod.def,rest:W})});function N3($,X,W){let Y=X instanceof n,J=Y?W:X;return new O3({type:"tuple",items:$,rest:Y?X:null,...P.normalizeParams(J)})}var q7=A("ZodRecord",($,X)=>{Q9.init($,X),s.init($,X),$.keyType=X.keyType,$.valueType=X.valueType});function P$($,X,W){return new q7({type:"record",keyType:$,valueType:X,...P.normalizeParams(W)})}function YF($,X,W){let Y=m$($);return Y._zod.values=void 0,new q7({type:"record",keyType:Y,valueType:X,...P.normalizeParams(W)})}var D3=A("ZodMap",($,X)=>{z9.init($,X),s.init($,X),$.keyType=X.keyType,$.valueType=X.valueType});function GF($,X,W){return new D3({type:"map",keyType:$,valueType:X,...P.normalizeParams(W)})}var B3=A("ZodSet",($,X)=>{H9.init($,X),s.init($,X),$.min=(...W)=>$.check(I1(...W)),$.nonempty=(W)=>$.check(I1(1,W)),$.max=(...W)=>$.check(d1(...W)),$.size=(...W)=>$.check(EX(...W))});function UF($,X){return new B3({type:"set",valueType:$,...P.normalizeParams(X)})}var hX=A("ZodEnum",($,X)=>{j9.init($,X),s.init($,X),$.enum=X.entries,$.options=Object.values(X.entries);let W=new Set(Object.keys(X.entries));$.extract=(Y,J)=>{let G={};for(let U of Y)if(W.has(U))G[U]=X.entries[U];else throw Error(`Key ${U} not found in enum`);return new hX({...X,checks:[],...P.normalizeParams(J),entries:G})},$.exclude=(Y,J)=>{let G={...X.entries};for(let U of Y)if(W.has(U))delete G[U];else throw Error(`Key ${U} not found in enum`);return new hX({...X,checks:[],...P.normalizeParams(J),entries:G})}});function I4($,X){let W=Array.isArray($)?Object.fromEntries($.map((Y)=>[Y,Y])):$;return new hX({type:"enum",entries:W,...P.normalizeParams(X)})}function QF($,X){return new hX({type:"enum",entries:$,...P.normalizeParams(X)})}var w3=A("ZodLiteral",($,X)=>{I9.init($,X),s.init($,X),$.values=new Set(X.values),Object.defineProperty($,"value",{get(){if(X.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return X.values[0]}})});function h($,X){return new w3({type:"literal",values:Array.isArray($)?$:[$],...P.normalizeParams(X)})}var V3=A("ZodFile",($,X)=>{O9.init($,X),s.init($,X),$.min=(W,Y)=>$.check(I1(W,Y)),$.max=(W,Y)=>$.check(d1(W,Y)),$.mime=(W,Y)=>$.check(_X(Array.isArray(W)?W:[W],Y))});function zF($){return e9(V3,$)}var A3=A("ZodTransform",($,X)=>{N9.init($,X),s.init($,X),$._zod.parse=(W,Y)=>{if(Y.direction==="backward")throw new G1($.constructor.name);W.addIssue=(G)=>{if(typeof G==="string")W.issues.push(P.issue(G,W.value,X));else{let U=G;if(U.fatal)U.continue=!1;U.code??(U.code="custom"),U.input??(U.input=W.value),U.inst??(U.inst=$),W.issues.push(P.issue(U))}};let J=X.transform(W.value,W);if(J instanceof Promise)return J.then((G)=>{return W.value=G,W});return W.value=J,W}});function L7($){return new A3({type:"transform",transform:$})}var F7=A("ZodOptional",($,X)=>{D9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType});function d($){return new F7({type:"optional",innerType:$})}var b3=A("ZodNullable",($,X)=>{B9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType});function VY($){return new b3({type:"nullable",innerType:$})}function HF($){return d(VY($))}var K3=A("ZodDefault",($,X)=>{w9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function v3($,X){return new K3({type:"default",innerType:$,get defaultValue(){return typeof X==="function"?X():P.shallowClone(X)}})}var q3=A("ZodPrefault",($,X)=>{V9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType});function L3($,X){return new q3({type:"prefault",innerType:$,get defaultValue(){return typeof X==="function"?X():P.shallowClone(X)}})}var M7=A("ZodNonOptional",($,X)=>{A9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType});function F3($,X){return new M7({type:"nonoptional",innerType:$,...P.normalizeParams(X)})}var M3=A("ZodSuccess",($,X)=>{b9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType});function jF($){return new M3({type:"success",innerType:$})}var S3=A("ZodCatch",($,X)=>{K9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function E3($,X){return new S3({type:"catch",innerType:$,catchValue:typeof X==="function"?X:()=>X})}var P3=A("ZodNaN",($,X)=>{v9.init($,X),s.init($,X)});function IF($){return s9(P3,$)}var S7=A("ZodPipe",($,X)=>{q9.init($,X),s.init($,X),$.in=X.in,$.out=X.out});function AY($,X){return new S7({type:"pipe",in:$,out:X})}var E7=A("ZodCodec",($,X)=>{S7.init($,X),n1.init($,X)});function OF($,X,W){return new E7({type:"pipe",in:$,out:X,transform:W.decode,reverseTransform:W.encode})}var R3=A("ZodReadonly",($,X)=>{L9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType});function Z3($){return new R3({type:"readonly",innerType:$})}var k3=A("ZodTemplateLiteral",($,X)=>{F9.init($,X),s.init($,X)});function NF($,X){return new k3({type:"template_literal",parts:$,...P.normalizeParams(X)})}var T3=A("ZodLazy",($,X)=>{E9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.getter()});function C3($){return new T3({type:"lazy",getter:$})}var _3=A("ZodPromise",($,X)=>{S9.init($,X),s.init($,X),$.unwrap=()=>$._zod.def.innerType});function DF($){return new _3({type:"promise",innerType:$})}var x3=A("ZodFunction",($,X)=>{M9.init($,X),s.init($,X)});function BF($){return new x3({type:"function",input:Array.isArray($?.input)?N3($?.input):$?.input??Y$(v$()),output:$?.output??v$()})}var qY=A("ZodCustom",($,X)=>{P9.init($,X),s.init($,X)});function wF($){let X=new B$({check:"custom"});return X._zod.check=$,X}function P7($,X){return $Y(qY,$??(()=>!0),X)}function u3($,X={}){return XY(qY,$,X)}function y3($){return WY($)}var VF=JY,AF=YY;function bF($,X={error:`Input not instance of ${$.name}`}){let W=new qY({type:"custom",check:"custom",fn:(Y)=>Y instanceof $,abort:!0,...P.normalizeParams(X)});return W._zod.bag.Class=$,W}var KF=(...$)=>GY({Codec:E7,Boolean:nX,String:lX},...$);function vF($){let X=C3(()=>{return q$([F($),E$(),f$(),Y3(),Y$(X),P$(F(),X)])});return X}function R7($,X){return AY(L7($),X)}var qF={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function LF($){x$({customError:$})}function FF(){return x$().customError}var Z7;(function($){})(Z7||(Z7={}));var k7={};X1(k7,{string:()=>MF,number:()=>SF,date:()=>RF,boolean:()=>EF,bigint:()=>PF});function MF($){return qQ(lX,$)}function SF($){return EQ(iX,$)}function EF($){return PQ(nX,$)}function PF($){return RQ(cX,$)}function RF($){return ZQ(KY,$)}x$($X());var T7="2025-06-18";var g3=[T7,"2025-03-26","2024-11-05","2024-10-07"],FY="2.0",J6=P7(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),f3=q$([F(),E$().int()]),h3=F(),ZF=W6({progressToken:f3.optional()}),x4=W6({_meta:ZF.optional()}),O4=u({method:F(),params:x4.optional()}),J0=W6({_meta:P$(F(),v$()).optional()}),u4=u({method:F(),params:J0.optional()}),E4=W6({_meta:P$(F(),v$()).optional()}),MY=q$([F(),E$().int()]),l3=u({jsonrpc:h(FY),id:MY,...O4.shape}).strict(),m3=($)=>l3.safeParse($).success,i3=u({jsonrpc:h(FY),...u4.shape}).strict(),n3=($)=>i3.safeParse($).success,c3=u({jsonrpc:h(FY),id:MY,result:E4}).strict(),C7=($)=>c3.safeParse($).success,N$;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(N$||(N$={}));var r3=u({jsonrpc:h(FY),id:MY,error:u({code:E$().int(),message:F(),data:d(v$())})}).strict(),p3=($)=>r3.safeParse($).success,d3=q$([l3,i3,c3,r3]),SY=E4.strict(),kF=J0.extend({requestId:MY,reason:F().optional()}),EY=u4.extend({method:h("notifications/cancelled"),params:kF}),TF=u({src:F(),mimeType:F().optional(),sizes:Y$(F()).optional()}),pX=u({icons:Y$(TF).optional()}),W0=u({name:F(),title:F().optional()}),o3=W0.extend({...W0.shape,...pX.shape,version:F(),websiteUrl:F().optional()}),CF=rX(u({applyDefaults:f$().optional()}),P$(F(),v$())),_F=R7(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},rX(u({form:CF.optional(),url:J6.optional()}),P$(F(),v$()).optional())),xF=u({experimental:P$(F(),J6).optional(),sampling:u({context:J6.optional(),tools:J6.optional()}).optional(),elicitation:_F.optional(),roots:u({listChanged:f$().optional()}).optional()}),uF=x4.extend({protocolVersion:F(),capabilities:xF,clientInfo:o3}),_7=O4.extend({method:h("initialize"),params:uF});var yF=u({experimental:P$(F(),J6).optional(),logging:J6.optional(),completions:J6.optional(),prompts:d(u({listChanged:d(f$())})),resources:u({subscribe:f$().optional(),listChanged:f$().optional()}).optional(),tools:u({listChanged:f$().optional()}).optional()}),gF=E4.extend({protocolVersion:F(),capabilities:yF,serverInfo:o3,instructions:F().optional()}),x7=u4.extend({method:h("notifications/initialized")});var PY=O4.extend({method:h("ping")}),fF=u({progress:E$(),total:d(E$()),message:d(F())}),hF=u({...J0.shape,...fF.shape,progressToken:f3}),RY=u4.extend({method:h("notifications/progress"),params:hF}),lF=x4.extend({cursor:h3.optional()}),ZY=O4.extend({params:lF.optional()}),kY=E4.extend({nextCursor:d(h3)}),t3=u({uri:F(),mimeType:d(F()),_meta:P$(F(),v$()).optional()}),a3=t3.extend({text:F()}),u7=F().refine(($)=>{try{return atob($),!0}catch(X){return!1}},{message:"Invalid Base64 string"}),s3=t3.extend({blob:u7}),e3=u({...W0.shape,...pX.shape,uri:F(),description:d(F()),mimeType:d(F()),_meta:d(W6({}))}),mF=u({...W0.shape,...pX.shape,uriTemplate:F(),description:d(F()),mimeType:d(F()),_meta:d(W6({}))}),TY=ZY.extend({method:h("resources/list")}),iF=kY.extend({resources:Y$(e3)}),CY=ZY.extend({method:h("resources/templates/list")}),nF=kY.extend({resourceTemplates:Y$(mF)}),y7=x4.extend({uri:F()}),cF=y7,_Y=O4.extend({method:h("resources/read"),params:cF}),rF=E4.extend({contents:Y$(q$([a3,s3]))}),pF=u4.extend({method:h("notifications/resources/list_changed")}),dF=y7,oF=O4.extend({method:h("resources/subscribe"),params:dF}),tF=y7,aF=O4.extend({method:h("resources/unsubscribe"),params:tF}),sF=J0.extend({uri:F()}),eF=u4.extend({method:h("notifications/resources/updated"),params:sF}),$M=u({name:F(),description:d(F()),required:d(f$())}),XM=u({...W0.shape,...pX.shape,description:d(F()),arguments:d(Y$($M)),_meta:d(W6({}))}),xY=ZY.extend({method:h("prompts/list")}),WM=kY.extend({prompts:Y$(XM)}),JM=x4.extend({name:F(),arguments:P$(F(),F()).optional()}),uY=O4.extend({method:h("prompts/get"),params:JM}),$j=u({type:h("text"),text:F(),_meta:P$(F(),v$()).optional()}),Xj=u({type:h("image"),data:u7,mimeType:F(),_meta:P$(F(),v$()).optional()}),Wj=u({type:h("audio"),data:u7,mimeType:F(),_meta:P$(F(),v$()).optional()}),YM=u({type:h("tool_use"),name:F(),id:F(),input:u({}).passthrough(),_meta:d(u({}).passthrough())}).passthrough(),GM=u({type:h("resource"),resource:q$([a3,s3]),_meta:P$(F(),v$()).optional()}),UM=e3.extend({type:h("resource_link")}),g7=q$([$j,Xj,Wj,UM,GM]),QM=u({role:I4(["user","assistant"]),content:g7}),zM=E4.extend({description:d(F()),messages:Y$(QM)}),HM=u4.extend({method:h("notifications/prompts/list_changed")}),jM=u({title:F().optional(),readOnlyHint:f$().optional(),destructiveHint:f$().optional(),idempotentHint:f$().optional(),openWorldHint:f$().optional()}),Jj=u({...W0.shape,...pX.shape,description:F().optional(),inputSchema:u({type:h("object"),properties:P$(F(),J6).optional(),required:Y$(F()).optional()}).catchall(v$()),outputSchema:u({type:h("object"),properties:P$(F(),J6).optional(),required:Y$(F()).optional()}).catchall(v$()).optional(),annotations:d(jM),_meta:P$(F(),v$()).optional()}),yY=ZY.extend({method:h("tools/list")}),IM=kY.extend({tools:Y$(Jj)}),Yj=E4.extend({content:Y$(g7).default([]),structuredContent:P$(F(),v$()).optional(),isError:d(f$())}),Jc=Yj.or(E4.extend({toolResult:v$()})),OM=x4.extend({name:F(),arguments:d(P$(F(),v$()))}),gY=O4.extend({method:h("tools/call"),params:OM}),NM=u4.extend({method:h("notifications/tools/list_changed")}),dX=I4(["debug","info","notice","warning","error","critical","alert","emergency"]),DM=x4.extend({level:dX}),f7=O4.extend({method:h("logging/setLevel"),params:DM}),BM=J0.extend({level:dX,logger:F().optional(),data:v$()}),wM=u4.extend({method:h("notifications/message"),params:BM}),VM=u({name:F().optional()}),AM=u({hints:d(Y$(VM)),costPriority:d(E$().min(0).max(1)),speedPriority:d(E$().min(0).max(1)),intelligencePriority:d(E$().min(0).max(1))}),bM=u({mode:d(I4(["auto","required","none"]))}),KM=u({type:h("tool_result"),toolUseId:F().describe("The unique identifier for the corresponding tool call."),content:Y$(g7).default([]),structuredContent:u({}).passthrough().optional(),isError:d(f$()),_meta:d(u({}).passthrough())}).passthrough(),LY=v7("type",[$j,Xj,Wj,YM,KM]),vM=u({role:I4(["user","assistant"]),content:q$([LY,Y$(LY)]),_meta:d(u({}).passthrough())}).passthrough(),qM=x4.extend({messages:Y$(vM),modelPreferences:AM.optional(),systemPrompt:F().optional(),includeContext:I4(["none","thisServer","allServers"]).optional(),temperature:E$().optional(),maxTokens:E$().int(),stopSequences:Y$(F()).optional(),metadata:J6.optional(),tools:d(Y$(Jj)),toolChoice:d(bM)}),LM=O4.extend({method:h("sampling/createMessage"),params:qM}),h7=E4.extend({model:F(),stopReason:d(I4(["endTurn","stopSequence","maxTokens","toolUse"]).or(F())),role:I4(["user","assistant"]),content:q$([LY,Y$(LY)])}),FM=u({type:h("boolean"),title:F().optional(),description:F().optional(),default:f$().optional()}),MM=u({type:h("string"),title:F().optional(),description:F().optional(),minLength:E$().optional(),maxLength:E$().optional(),format:I4(["email","uri","date","date-time"]).optional(),default:F().optional()}),SM=u({type:I4(["number","integer"]),title:F().optional(),description:F().optional(),minimum:E$().optional(),maximum:E$().optional(),default:E$().optional()}),EM=u({type:h("string"),title:F().optional(),description:F().optional(),enum:Y$(F()),default:F().optional()}),PM=u({type:h("string"),title:F().optional(),description:F().optional(),oneOf:Y$(u({const:F(),title:F()})),default:F().optional()}),RM=u({type:h("string"),title:F().optional(),description:F().optional(),enum:Y$(F()),enumNames:Y$(F()).optional(),default:F().optional()}),ZM=q$([EM,PM]),kM=u({type:h("array"),title:F().optional(),description:F().optional(),minItems:E$().optional(),maxItems:E$().optional(),items:u({type:h("string"),enum:Y$(F())}),default:Y$(F()).optional()}),TM=u({type:h("array"),title:F().optional(),description:F().optional(),minItems:E$().optional(),maxItems:E$().optional(),items:u({anyOf:Y$(u({const:F(),title:F()}))}),default:Y$(F()).optional()}),CM=q$([kM,TM]),_M=q$([RM,ZM,CM]),xM=q$([_M,FM,MM,SM]),uM=x4.extend({mode:h("form").optional(),message:F(),requestedSchema:u({type:h("object"),properties:P$(F(),xM),required:Y$(F()).optional()})}),yM=x4.extend({mode:h("url"),message:F(),elicitationId:F(),url:F().url()}),gM=q$([uM,yM]),fM=O4.extend({method:h("elicitation/create"),params:gM}),hM=J0.extend({elicitationId:F()}),lM=u4.extend({method:h("notifications/elicitation/complete"),params:hM}),fY=E4.extend({action:I4(["accept","decline","cancel"]),content:P$(F(),q$([F(),E$(),f$(),Y$(F())])).optional()}),mM=u({type:h("ref/resource"),uri:F()});var iM=u({type:h("ref/prompt"),name:F()}),nM=x4.extend({ref:q$([iM,mM]),argument:u({name:F(),value:F()}),context:u({arguments:P$(F(),F()).optional()}).optional()}),hY=O4.extend({method:h("completion/complete"),params:nM});function Gj($){if($.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${$.params.ref.type}`)}function Uj($){if($.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${$.params.ref.type}`)}var cM=E4.extend({completion:W6({values:Y$(F()).max(100),total:d(E$().int()),hasMore:d(f$())})}),rM=u({uri:F().startsWith("file://"),name:F().optional(),_meta:P$(F(),v$()).optional()}),pM=O4.extend({method:h("roots/list")}),l7=E4.extend({roots:Y$(rM)}),dM=u4.extend({method:h("notifications/roots/list_changed")}),Yc=q$([PY,_7,hY,f7,uY,xY,TY,CY,_Y,oF,aF,gY,yY]),Gc=q$([EY,RY,x7,dM]),Uc=q$([SY,h7,fY,l7]),Qc=q$([PY,LM,fM,pM]),zc=q$([EY,RY,wM,eF,pF,NM,HM,lM]),Hc=q$([SY,gF,cM,zM,WM,iF,nF,rF,Yj,IM]);class w$ extends Error{constructor($,X,W){super(`MCP error ${$}: ${X}`);this.code=$,this.data=W,this.name="McpError"}static fromError($,X,W){if($===N$.UrlElicitationRequired&&W){let Y=W;if(Y.elicitations)return new Qj(Y.elicitations,X)}return new w$($,X,W)}}class Qj extends w${constructor($,X=`URL elicitation${$.length>1?"s":""} required`){super(N$.UrlElicitationRequired,X,{elicitations:$})}get elicitations(){var $,X;return(X=($=this.data)===null||$===void 0?void 0:$.elicitations)!==null&&X!==void 0?X:[]}}var Hj=Symbol("Let zodToJsonSchema decide on which parser to use");var zj={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"},jj=($)=>typeof $==="string"?{...zj,name:$}:{...zj,...$};var Ij=($)=>{let X=jj($),W=X.name!==void 0?[...X.basePath,X.definitionPath,X.name]:X.basePath;return{...X,flags:{hasReferencedOpenAiAnyType:!1},currentPath:W,propertyPath:void 0,seen:new Map(Object.entries(X.definitions).map(([Y,J])=>[J._def,{def:J._def,path:[...X.basePath,X.definitionPath,Y],jsonSchema:void 0}]))}};function m7($,X,W,Y){if(!Y?.errorMessages)return;if(W)$.errorMessage={...$.errorMessage,[X]:W}}function G$($,X,W,Y,J){$[X]=W,m7($,X,Y,J)}var lY=($,X)=>{let W=0;for(;W<$.length&&W<X.length;W++)if($[W]!==X[W])break;return[($.length-W).toString(),...X.slice(W)].join("/")};function R$($){if($.target!=="openAi")return{};let X=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?lY(X,$.currentPath):X.join("/")}}function Oj($,X){let W={type:"array"};if($.type?._def&&$.type?._def?.typeName!==R.ZodAny)W.items=i($.type._def,{...X,currentPath:[...X.currentPath,"items"]});if($.minLength)G$(W,"minItems",$.minLength.value,$.minLength.message,X);if($.maxLength)G$(W,"maxItems",$.maxLength.value,$.maxLength.message,X);if($.exactLength)G$(W,"minItems",$.exactLength.value,$.exactLength.message,X),G$(W,"maxItems",$.exactLength.value,$.exactLength.message,X);return W}function Nj($,X){let W={type:"integer",format:"int64"};if(!$.checks)return W;for(let Y of $.checks)switch(Y.kind){case"min":if(X.target==="jsonSchema7")if(Y.inclusive)G$(W,"minimum",Y.value,Y.message,X);else G$(W,"exclusiveMinimum",Y.value,Y.message,X);else{if(!Y.inclusive)W.exclusiveMinimum=!0;G$(W,"minimum",Y.value,Y.message,X)}break;case"max":if(X.target==="jsonSchema7")if(Y.inclusive)G$(W,"maximum",Y.value,Y.message,X);else G$(W,"exclusiveMaximum",Y.value,Y.message,X);else{if(!Y.inclusive)W.exclusiveMaximum=!0;G$(W,"maximum",Y.value,Y.message,X)}break;case"multipleOf":G$(W,"multipleOf",Y.value,Y.message,X);break}return W}function Dj(){return{type:"boolean"}}function mY($,X){return i($.type._def,X)}var Bj=($,X)=>{return i($.innerType._def,X)};function i7($,X,W){let Y=W??X.dateStrategy;if(Array.isArray(Y))return{anyOf:Y.map((J,G)=>i7($,X,J))};switch(Y){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return oM($,X)}}var oM=($,X)=>{let W={type:"integer",format:"unix-time"};if(X.target==="openApi3")return W;for(let Y of $.checks)switch(Y.kind){case"min":G$(W,"minimum",Y.value,Y.message,X);break;case"max":G$(W,"maximum",Y.value,Y.message,X);break}return W};function wj($,X){return{...i($.innerType._def,X),default:$.defaultValue()}}function Vj($,X){return X.effectStrategy==="input"?i($.schema._def,X):R$(X)}function Aj($){return{type:"string",enum:Array.from($.values)}}var tM=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function bj($,X){let W=[i($.left._def,{...X,currentPath:[...X.currentPath,"allOf","0"]}),i($.right._def,{...X,currentPath:[...X.currentPath,"allOf","1"]})].filter((G)=>!!G),Y=X.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,J=[];return W.forEach((G)=>{if(tM(G)){if(J.push(...G.allOf),G.unevaluatedProperties===void 0)Y=void 0}else{let U=G;if("additionalProperties"in G&&G.additionalProperties===!1){let{additionalProperties:Q,...z}=G;U=z}else Y=void 0;J.push(U)}}),J.length?{allOf:J,...Y}:void 0}function Kj($,X){let W=typeof $.value;if(W!=="bigint"&&W!=="number"&&W!=="boolean"&&W!=="string")return{type:Array.isArray($.value)?"array":"object"};if(X.target==="openApi3")return{type:W==="bigint"?"integer":W,enum:[$.value]};return{type:W==="bigint"?"integer":W,const:$.value}}var n7=void 0,y4={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:()=>{if(n7===void 0)n7=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return n7},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 iY($,X){let W={type:"string"};if($.checks)for(let Y of $.checks)switch(Y.kind){case"min":G$(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,Y.value):Y.value,Y.message,X);break;case"max":G$(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,Y.value):Y.value,Y.message,X);break;case"email":switch(X.emailStrategy){case"format:email":g4(W,"email",Y.message,X);break;case"format:idn-email":g4(W,"idn-email",Y.message,X);break;case"pattern:zod":X4(W,y4.email,Y.message,X);break}break;case"url":g4(W,"uri",Y.message,X);break;case"uuid":g4(W,"uuid",Y.message,X);break;case"regex":X4(W,Y.regex,Y.message,X);break;case"cuid":X4(W,y4.cuid,Y.message,X);break;case"cuid2":X4(W,y4.cuid2,Y.message,X);break;case"startsWith":X4(W,RegExp(`^${c7(Y.value,X)}`),Y.message,X);break;case"endsWith":X4(W,RegExp(`${c7(Y.value,X)}$`),Y.message,X);break;case"datetime":g4(W,"date-time",Y.message,X);break;case"date":g4(W,"date",Y.message,X);break;case"time":g4(W,"time",Y.message,X);break;case"duration":g4(W,"duration",Y.message,X);break;case"length":G$(W,"minLength",typeof W.minLength==="number"?Math.max(W.minLength,Y.value):Y.value,Y.message,X),G$(W,"maxLength",typeof W.maxLength==="number"?Math.min(W.maxLength,Y.value):Y.value,Y.message,X);break;case"includes":{X4(W,RegExp(c7(Y.value,X)),Y.message,X);break}case"ip":{if(Y.version!=="v6")g4(W,"ipv4",Y.message,X);if(Y.version!=="v4")g4(W,"ipv6",Y.message,X);break}case"base64url":X4(W,y4.base64url,Y.message,X);break;case"jwt":X4(W,y4.jwt,Y.message,X);break;case"cidr":{if(Y.version!=="v6")X4(W,y4.ipv4Cidr,Y.message,X);if(Y.version!=="v4")X4(W,y4.ipv6Cidr,Y.message,X);break}case"emoji":X4(W,y4.emoji(),Y.message,X);break;case"ulid":{X4(W,y4.ulid,Y.message,X);break}case"base64":{switch(X.base64Strategy){case"format:binary":{g4(W,"binary",Y.message,X);break}case"contentEncoding:base64":{G$(W,"contentEncoding","base64",Y.message,X);break}case"pattern:zod":{X4(W,y4.base64,Y.message,X);break}}break}case"nanoid":X4(W,y4.nanoid,Y.message,X);case"toLowerCase":case"toUpperCase":case"trim":break;default:((J)=>{})(Y)}return W}function c7($,X){return X.patternStrategy==="escape"?sM($):$}var aM=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function sM($){let X="";for(let W=0;W<$.length;W++){if(!aM.has($[W]))X+="\\";X+=$[W]}return X}function g4($,X,W,Y){if($.format||$.anyOf?.some((J)=>J.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&Y.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:X,...W&&Y.errorMessages&&{errorMessage:{format:W}}})}else G$($,"format",X,W,Y)}function X4($,X,W,Y){if($.pattern||$.allOf?.some((J)=>J.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&Y.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:vj(X,Y),...W&&Y.errorMessages&&{errorMessage:{pattern:W}}})}else G$($,"pattern",vj(X,Y),W,Y)}function vj($,X){if(!X.applyRegexFlags||!$.flags)return $.source;let W={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},Y=W.i?$.source.toLowerCase():$.source,J="",G=!1,U=!1,Q=!1;for(let z=0;z<Y.length;z++){if(G){J+=Y[z],G=!1;continue}if(W.i){if(U){if(Y[z].match(/[a-z]/)){if(Q)J+=Y[z],J+=`${Y[z-2]}-${Y[z]}`.toUpperCase(),Q=!1;else if(Y[z+1]==="-"&&Y[z+2]?.match(/[a-z]/))J+=Y[z],Q=!0;else J+=`${Y[z]}${Y[z].toUpperCase()}`;continue}}else if(Y[z].match(/[a-z]/)){J+=`[${Y[z]}${Y[z].toUpperCase()}]`;continue}}if(W.m){if(Y[z]==="^"){J+=`(^|(?<=[\r
|
|
41
|
+
]))`;continue}else if(Y[z]==="$"){J+=`($|(?=[\r
|
|
42
|
+
]))`;continue}}if(W.s&&Y[z]==="."){J+=U?`${Y[z]}\r
|
|
43
|
+
`:`[${Y[z]}\r
|
|
44
|
+
]`;continue}if(J+=Y[z],Y[z]==="\\")G=!0;else if(U&&Y[z]==="]")U=!1;else if(!U&&Y[z]==="[")U=!0}try{new RegExp(J)}catch{return console.warn(`Could not convert regex pattern at ${X.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return J}function nY($,X){if(X.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(X.target==="openApi3"&&$.keyType?._def.typeName===R.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((Y,J)=>({...Y,[J]:i($.valueType._def,{...X,currentPath:[...X.currentPath,"properties",J]})??R$(X)}),{}),additionalProperties:X.rejectedAdditionalProperties};let W={type:"object",additionalProperties:i($.valueType._def,{...X,currentPath:[...X.currentPath,"additionalProperties"]})??X.allowedAdditionalProperties};if(X.target==="openApi3")return W;if($.keyType?._def.typeName===R.ZodString&&$.keyType._def.checks?.length){let{type:Y,...J}=iY($.keyType._def,X);return{...W,propertyNames:J}}else if($.keyType?._def.typeName===R.ZodEnum)return{...W,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===R.ZodBranded&&$.keyType._def.type._def.typeName===R.ZodString&&$.keyType._def.type._def.checks?.length){let{type:Y,...J}=mY($.keyType._def,X);return{...W,propertyNames:J}}return W}function qj($,X){if(X.mapStrategy==="record")return nY($,X);let W=i($.keyType._def,{...X,currentPath:[...X.currentPath,"items","items","0"]})||R$(X),Y=i($.valueType._def,{...X,currentPath:[...X.currentPath,"items","items","1"]})||R$(X);return{type:"array",maxItems:125,items:{type:"array",items:[W,Y],minItems:2,maxItems:2}}}function Lj($){let X=$.values,Y=Object.keys($.values).filter((G)=>{return typeof X[X[G]]!=="number"}).map((G)=>X[G]),J=Array.from(new Set(Y.map((G)=>typeof G)));return{type:J.length===1?J[0]==="string"?"string":"number":["string","number"],enum:Y}}function Fj($){return $.target==="openAi"?void 0:{not:R$({...$,currentPath:[...$.currentPath,"not"]})}}function Mj($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var oX={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Ej($,X){if(X.target==="openApi3")return Sj($,X);let W=$.options instanceof Map?Array.from($.options.values()):$.options;if(W.every((Y)=>(Y._def.typeName in oX)&&(!Y._def.checks||!Y._def.checks.length))){let Y=W.reduce((J,G)=>{let U=oX[G._def.typeName];return U&&!J.includes(U)?[...J,U]:J},[]);return{type:Y.length>1?Y:Y[0]}}else if(W.every((Y)=>Y._def.typeName==="ZodLiteral"&&!Y.description)){let Y=W.reduce((J,G)=>{let U=typeof G._def.value;switch(U){case"string":case"number":case"boolean":return[...J,U];case"bigint":return[...J,"integer"];case"object":if(G._def.value===null)return[...J,"null"];case"symbol":case"undefined":case"function":default:return J}},[]);if(Y.length===W.length){let J=Y.filter((G,U,Q)=>Q.indexOf(G)===U);return{type:J.length>1?J:J[0],enum:W.reduce((G,U)=>{return G.includes(U._def.value)?G:[...G,U._def.value]},[])}}}else if(W.every((Y)=>Y._def.typeName==="ZodEnum"))return{type:"string",enum:W.reduce((Y,J)=>[...Y,...J._def.values.filter((G)=>!Y.includes(G))],[])};return Sj($,X)}var Sj=($,X)=>{let W=($.options instanceof Map?Array.from($.options.values()):$.options).map((Y,J)=>i(Y._def,{...X,currentPath:[...X.currentPath,"anyOf",`${J}`]})).filter((Y)=>!!Y&&(!X.strictUnions||typeof Y==="object"&&Object.keys(Y).length>0));return W.length?{anyOf:W}:void 0};function Pj($,X){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(X.target==="openApi3")return{type:oX[$.innerType._def.typeName],nullable:!0};return{type:[oX[$.innerType._def.typeName],"null"]}}if(X.target==="openApi3"){let Y=i($.innerType._def,{...X,currentPath:[...X.currentPath]});if(Y&&"$ref"in Y)return{allOf:[Y],nullable:!0};return Y&&{...Y,nullable:!0}}let W=i($.innerType._def,{...X,currentPath:[...X.currentPath,"anyOf","0"]});return W&&{anyOf:[W,{type:"null"}]}}function Rj($,X){let W={type:"number"};if(!$.checks)return W;for(let Y of $.checks)switch(Y.kind){case"int":W.type="integer",m7(W,"type",Y.message,X);break;case"min":if(X.target==="jsonSchema7")if(Y.inclusive)G$(W,"minimum",Y.value,Y.message,X);else G$(W,"exclusiveMinimum",Y.value,Y.message,X);else{if(!Y.inclusive)W.exclusiveMinimum=!0;G$(W,"minimum",Y.value,Y.message,X)}break;case"max":if(X.target==="jsonSchema7")if(Y.inclusive)G$(W,"maximum",Y.value,Y.message,X);else G$(W,"exclusiveMaximum",Y.value,Y.message,X);else{if(!Y.inclusive)W.exclusiveMaximum=!0;G$(W,"maximum",Y.value,Y.message,X)}break;case"multipleOf":G$(W,"multipleOf",Y.value,Y.message,X);break}return W}function Zj($,X){let W=X.target==="openAi",Y={type:"object",properties:{}},J=[],G=$.shape();for(let Q in G){let z=G[Q];if(z===void 0||z._def===void 0)continue;let H=$S(z);if(H&&W){if(z._def.typeName==="ZodOptional")z=z._def.innerType;if(!z.isNullable())z=z.nullable();H=!1}let j=i(z._def,{...X,currentPath:[...X.currentPath,"properties",Q],propertyPath:[...X.currentPath,"properties",Q]});if(j===void 0)continue;if(Y.properties[Q]=j,!H)J.push(Q)}if(J.length)Y.required=J;let U=eM($,X);if(U!==void 0)Y.additionalProperties=U;return Y}function eM($,X){if($.catchall._def.typeName!=="ZodNever")return i($.catchall._def,{...X,currentPath:[...X.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return X.allowedAdditionalProperties;case"strict":return X.rejectedAdditionalProperties;case"strip":return X.removeAdditionalStrategy==="strict"?X.allowedAdditionalProperties:X.rejectedAdditionalProperties}}function $S($){try{return $.isOptional()}catch{return!0}}var kj=($,X)=>{if(X.currentPath.toString()===X.propertyPath?.toString())return i($.innerType._def,X);let W=i($.innerType._def,{...X,currentPath:[...X.currentPath,"anyOf","1"]});return W?{anyOf:[{not:R$(X)},W]}:R$(X)};var Tj=($,X)=>{if(X.pipeStrategy==="input")return i($.in._def,X);else if(X.pipeStrategy==="output")return i($.out._def,X);let W=i($.in._def,{...X,currentPath:[...X.currentPath,"allOf","0"]}),Y=i($.out._def,{...X,currentPath:[...X.currentPath,"allOf",W?"1":"0"]});return{allOf:[W,Y].filter((J)=>J!==void 0)}};function Cj($,X){return i($.type._def,X)}function _j($,X){let Y={type:"array",uniqueItems:!0,items:i($.valueType._def,{...X,currentPath:[...X.currentPath,"items"]})};if($.minSize)G$(Y,"minItems",$.minSize.value,$.minSize.message,X);if($.maxSize)G$(Y,"maxItems",$.maxSize.value,$.maxSize.message,X);return Y}function xj($,X){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((W,Y)=>i(W._def,{...X,currentPath:[...X.currentPath,"items",`${Y}`]})).reduce((W,Y)=>Y===void 0?W:[...W,Y],[]),additionalItems:i($.rest._def,{...X,currentPath:[...X.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((W,Y)=>i(W._def,{...X,currentPath:[...X.currentPath,"items",`${Y}`]})).reduce((W,Y)=>Y===void 0?W:[...W,Y],[])}}function uj($){return{not:R$($)}}function yj($){return R$($)}var gj=($,X)=>{return i($.innerType._def,X)};var fj=($,X,W)=>{switch(X){case R.ZodString:return iY($,W);case R.ZodNumber:return Rj($,W);case R.ZodObject:return Zj($,W);case R.ZodBigInt:return Nj($,W);case R.ZodBoolean:return Dj();case R.ZodDate:return i7($,W);case R.ZodUndefined:return uj(W);case R.ZodNull:return Mj(W);case R.ZodArray:return Oj($,W);case R.ZodUnion:case R.ZodDiscriminatedUnion:return Ej($,W);case R.ZodIntersection:return bj($,W);case R.ZodTuple:return xj($,W);case R.ZodRecord:return nY($,W);case R.ZodLiteral:return Kj($,W);case R.ZodEnum:return Aj($);case R.ZodNativeEnum:return Lj($);case R.ZodNullable:return Pj($,W);case R.ZodOptional:return kj($,W);case R.ZodMap:return qj($,W);case R.ZodSet:return _j($,W);case R.ZodLazy:return()=>$.getter()._def;case R.ZodPromise:return Cj($,W);case R.ZodNaN:case R.ZodNever:return Fj(W);case R.ZodEffects:return Vj($,W);case R.ZodAny:return R$(W);case R.ZodUnknown:return yj(W);case R.ZodDefault:return wj($,W);case R.ZodBranded:return mY($,W);case R.ZodReadonly:return gj($,W);case R.ZodCatch:return Bj($,W);case R.ZodPipeline:return Tj($,W);case R.ZodFunction:case R.ZodVoid:case R.ZodSymbol:return;default:return((Y)=>{return})(X)}};function i($,X,W=!1){let Y=X.seen.get($);if(X.override){let Q=X.override?.($,X,Y,W);if(Q!==Hj)return Q}if(Y&&!W){let Q=XS(Y,X);if(Q!==void 0)return Q}let J={def:$,path:X.currentPath,jsonSchema:void 0};X.seen.set($,J);let G=fj($,$.typeName,X),U=typeof G==="function"?i(G(),X):G;if(U)WS($,X,U);if(X.postProcess){let Q=X.postProcess(U,$,X);return J.jsonSchema=U,Q}return J.jsonSchema=U,U}var XS=($,X)=>{switch(X.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:lY(X.currentPath,$.path)};case"none":case"seen":{if($.path.length<X.currentPath.length&&$.path.every((W,Y)=>X.currentPath[Y]===W))return console.warn(`Recursive reference detected at ${X.currentPath.join("/")}! Defaulting to any`),R$(X);return X.$refStrategy==="seen"?R$(X):void 0}}},WS=($,X,W)=>{if($.description){if(W.description=$.description,X.markdownDescription)W.markdownDescription=$.description}return W};var r7=($,X)=>{let W=Ij(X),Y=typeof X==="object"&&X.definitions?Object.entries(X.definitions).reduce((z,[H,j])=>({...z,[H]:i(j._def,{...W,currentPath:[...W.basePath,W.definitionPath,H]},!0)??R$(W)}),{}):void 0,J=typeof X==="string"?X:X?.nameStrategy==="title"?void 0:X?.name,G=i($._def,J===void 0?W:{...W,currentPath:[...W.basePath,W.definitionPath,J]},!1)??R$(W),U=typeof X==="object"&&X.name!==void 0&&X.nameStrategy==="title"?X.name:void 0;if(U!==void 0)G.title=U;if(W.flags.hasReferencedOpenAiAnyType){if(!Y)Y={};if(!Y[W.openAiAnyTypeName])Y[W.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:W.$refStrategy==="relative"?"1":[...W.basePath,W.definitionPath,W.openAiAnyTypeName].join("/")}}}let Q=J===void 0?Y?{...G,[W.definitionPath]:Y}:G:{$ref:[...W.$refStrategy==="relative"?[]:W.basePath,W.definitionPath,J].join("/"),[W.definitionPath]:{...Y,[J]:G}};if(W.target==="jsonSchema7")Q.$schema="http://json-schema.org/draft-07/schema#";else if(W.target==="jsonSchema2019-09"||W.target==="openAi")Q.$schema="https://json-schema.org/draft/2019-09/schema#";if(W.target==="openAi"&&(("anyOf"in Q)||("oneOf"in Q)||("allOf"in Q)||("type"in Q)&&Array.isArray(Q.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return Q};function JS($){if(!$)return"draft-7";if($==="jsonSchema7"||$==="draft-7")return"draft-7";if($==="jsonSchema2019-09"||$==="draft-2020-12")return"draft-2020-12";return"draft-7"}function p7($,X){var W,Y,J;if(_4($))return a1($,{target:JS(X===null||X===void 0?void 0:X.target),io:(W=X===null||X===void 0?void 0:X.pipeStrategy)!==null&&W!==void 0?W:"input"});return r7($,{strictUnions:(Y=X===null||X===void 0?void 0:X.strictUnions)!==null&&Y!==void 0?Y:!0,pipeStrategy:(J=X===null||X===void 0?void 0:X.pipeStrategy)!==null&&J!==void 0?J:"input"})}function d7($){let X=e1($),W=X===null||X===void 0?void 0:X.method;if(!W)throw Error("Schema is missing a method literal");let Y=jY(W);if(typeof Y!=="string")throw Error("Schema method literal must be a string");return Y}function o7($,X){let W=QY($,X);if(!W.success)throw W.error;return W.data}var YS=60000;class t7{constructor($){this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(EY,(X)=>{let W=this._requestHandlerAbortControllers.get(X.params.requestId);W===null||W===void 0||W.abort(X.params.reason)}),this.setNotificationHandler(RY,(X)=>{this._onprogress(X)}),this.setRequestHandler(PY,(X)=>({}))}_setupTimeout($,X,W,Y,J=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(Y,X),startTime:Date.now(),timeout:X,maxTotalTimeout:W,resetTimeoutOnProgress:J,onTimeout:Y})}_resetTimeout($){let X=this._timeoutInfo.get($);if(!X)return!1;let W=Date.now()-X.startTime;if(X.maxTotalTimeout&&W>=X.maxTotalTimeout)throw this._timeoutInfo.delete($),w$.fromError(N$.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:X.maxTotalTimeout,totalElapsed:W});return clearTimeout(X.timeoutId),X.timeoutId=setTimeout(X.onTimeout,X.timeout),!0}_cleanupTimeout($){let X=this._timeoutInfo.get($);if(X)clearTimeout(X.timeoutId),this._timeoutInfo.delete($)}async connect($){var X,W,Y;this._transport=$;let J=(X=this.transport)===null||X===void 0?void 0:X.onclose;this._transport.onclose=()=>{J===null||J===void 0||J(),this._onclose()};let G=(W=this.transport)===null||W===void 0?void 0:W.onerror;this._transport.onerror=(Q)=>{G===null||G===void 0||G(Q),this._onerror(Q)};let U=(Y=this._transport)===null||Y===void 0?void 0:Y.onmessage;this._transport.onmessage=(Q,z)=>{if(U===null||U===void 0||U(Q,z),C7(Q)||p3(Q))this._onresponse(Q);else if(m3(Q))this._onrequest(Q,z);else if(n3(Q))this._onnotification(Q);else this._onerror(Error(`Unknown message type: ${JSON.stringify(Q)}`))},await this._transport.start()}_onclose(){var $;let X=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,($=this.onclose)===null||$===void 0||$.call(this);let W=w$.fromError(N$.ConnectionClosed,"Connection closed");for(let Y of X.values())Y(W)}_onerror($){var X;(X=this.onerror)===null||X===void 0||X.call(this,$)}_onnotification($){var X;let W=(X=this._notificationHandlers.get($.method))!==null&&X!==void 0?X:this.fallbackNotificationHandler;if(W===void 0)return;Promise.resolve().then(()=>W($)).catch((Y)=>this._onerror(Error(`Uncaught error in notification handler: ${Y}`)))}_onrequest($,X){var W,Y;let J=(W=this._requestHandlers.get($.method))!==null&&W!==void 0?W:this.fallbackRequestHandler,G=this._transport;if(J===void 0){G===null||G===void 0||G.send({jsonrpc:"2.0",id:$.id,error:{code:N$.MethodNotFound,message:"Method not found"}}).catch((z)=>this._onerror(Error(`Failed to send an error response: ${z}`)));return}let U=new AbortController;this._requestHandlerAbortControllers.set($.id,U);let Q={signal:U.signal,sessionId:G===null||G===void 0?void 0:G.sessionId,_meta:(Y=$.params)===null||Y===void 0?void 0:Y._meta,sendNotification:(z)=>this.notification(z,{relatedRequestId:$.id}),sendRequest:(z,H,j)=>this.request(z,H,{...j,relatedRequestId:$.id}),authInfo:X===null||X===void 0?void 0:X.authInfo,requestId:$.id,requestInfo:X===null||X===void 0?void 0:X.requestInfo};Promise.resolve().then(()=>J($,Q)).then((z)=>{if(U.signal.aborted)return;return G===null||G===void 0?void 0:G.send({result:z,jsonrpc:"2.0",id:$.id})},(z)=>{var H;if(U.signal.aborted)return;return G===null||G===void 0?void 0:G.send({jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(z.code)?z.code:N$.InternalError,message:(H=z.message)!==null&&H!==void 0?H:"Internal error",...z.data!==void 0&&{data:z.data}}})}).catch((z)=>this._onerror(Error(`Failed to send response: ${z}`))).finally(()=>{this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:X,...W}=$.params,Y=Number(X),J=this._progressHandlers.get(Y);if(!J){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let G=this._responseHandlers.get(Y),U=this._timeoutInfo.get(Y);if(U&&G&&U.resetTimeoutOnProgress)try{this._resetTimeout(Y)}catch(Q){G(Q);return}J(W)}_onresponse($){let X=Number($.id),W=this._responseHandlers.get(X);if(W===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}if(this._responseHandlers.delete(X),this._progressHandlers.delete(X),this._cleanupTimeout(X),C7($))W($);else{let Y=w$.fromError($.error.code,$.error.message,$.error.data);W(Y)}}get transport(){return this._transport}async close(){var $;await(($=this._transport)===null||$===void 0?void 0:$.close())}request($,X,W){let{relatedRequestId:Y,resumptionToken:J,onresumptiontoken:G}=W!==null&&W!==void 0?W:{};return new Promise((U,Q)=>{var z,H,j,O,B,I;if(!this._transport){Q(Error("Not connected"));return}if(((z=this._options)===null||z===void 0?void 0:z.enforceStrictCapabilities)===!0)this.assertCapabilityForMethod($.method);(H=W===null||W===void 0?void 0:W.signal)===null||H===void 0||H.throwIfAborted();let N=this._requestMessageId++,D={...$,jsonrpc:"2.0",id:N};if(W===null||W===void 0?void 0:W.onprogress)this._progressHandlers.set(N,W.onprogress),D.params={...$.params,_meta:{...((j=$.params)===null||j===void 0?void 0:j._meta)||{},progressToken:N}};let w=(b)=>{var S;this._responseHandlers.delete(N),this._progressHandlers.delete(N),this._cleanupTimeout(N),(S=this._transport)===null||S===void 0||S.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:N,reason:String(b)}},{relatedRequestId:Y,resumptionToken:J,onresumptiontoken:G}).catch((L)=>this._onerror(Error(`Failed to send cancellation: ${L}`))),Q(b)};this._responseHandlers.set(N,(b)=>{var S;if((S=W===null||W===void 0?void 0:W.signal)===null||S===void 0?void 0:S.aborted)return;if(b instanceof Error)return Q(b);try{let L=QY(X,b.result);if(!L.success)Q(L.error);else U(L.data)}catch(L){Q(L)}}),(O=W===null||W===void 0?void 0:W.signal)===null||O===void 0||O.addEventListener("abort",()=>{var b;w((b=W===null||W===void 0?void 0:W.signal)===null||b===void 0?void 0:b.reason)});let V=(B=W===null||W===void 0?void 0:W.timeout)!==null&&B!==void 0?B:YS,K=()=>w(w$.fromError(N$.RequestTimeout,"Request timed out",{timeout:V}));this._setupTimeout(N,V,W===null||W===void 0?void 0:W.maxTotalTimeout,K,(I=W===null||W===void 0?void 0:W.resetTimeoutOnProgress)!==null&&I!==void 0?I:!1),this._transport.send(D,{relatedRequestId:Y,resumptionToken:J,onresumptiontoken:G}).catch((b)=>{this._cleanupTimeout(N),Q(b)})})}async notification($,X){var W,Y;if(!this._transport)throw Error("Not connected");if(this.assertNotificationCapability($.method),((Y=(W=this._options)===null||W===void 0?void 0:W.debouncedNotificationMethods)!==null&&Y!==void 0?Y:[]).includes($.method)&&!$.params&&!(X===null||X===void 0?void 0:X.relatedRequestId)){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{var Q;if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let z={...$,jsonrpc:"2.0"};(Q=this._transport)===null||Q===void 0||Q.send(z,X).catch((H)=>this._onerror(H))});return}let U={...$,jsonrpc:"2.0"};await this._transport.send(U,X)}setRequestHandler($,X){let W=d7($);this.assertRequestHandlerCapability(W),this._requestHandlers.set(W,(Y,J)=>{let G=o7($,Y);return Promise.resolve(X(G,J))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,X){let W=d7($);this._notificationHandlers.set(W,(Y)=>{let J=o7($,Y);return Promise.resolve(X(J))})}removeNotificationHandler($){this._notificationHandlers.delete($)}}function hj($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function lj($,X){let W={...$};for(let Y in X){let J=Y,G=X[J];if(G===void 0)continue;let U=W[J];if(hj(U)&&hj(G))W[J]={...U,...G};else W[J]=G}return W}var Kb=BG(XB(),1),vb=BG(bb(),1);function Mh(){let $=new Kb.Ajv({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return vb.default($),$}class h5{constructor($){this._ajv=$!==null&&$!==void 0?$:Mh()}getValidator($){var X;let W="$id"in $&&typeof $.$id==="string"?(X=this._ajv.getSchema($.$id))!==null&&X!==void 0?X:this._ajv.compile($):this._ajv.compile($);return(Y)=>{if(W(Y))return{valid:!0,data:Y,errorMessage:void 0};else return{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(W.errors)}}}}class l5 extends t7{constructor($,X){var W,Y;super(X);if(this._serverInfo=$,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(dX.options.map((J,G)=>[J,G])),this.isMessageIgnored=(J,G)=>{let U=this._loggingLevels.get(G);return U?this.LOG_LEVEL_SEVERITY.get(J)<this.LOG_LEVEL_SEVERITY.get(U):!1},this._capabilities=(W=X===null||X===void 0?void 0:X.capabilities)!==null&&W!==void 0?W:{},this._instructions=X===null||X===void 0?void 0:X.instructions,this._jsonSchemaValidator=(Y=X===null||X===void 0?void 0:X.jsonSchemaValidator)!==null&&Y!==void 0?Y:new h5,this.setRequestHandler(_7,(J)=>this._oninitialize(J)),this.setNotificationHandler(x7,()=>{var J;return(J=this.oninitialized)===null||J===void 0?void 0:J.call(this)}),this._capabilities.logging)this.setRequestHandler(f7,async(J,G)=>{var U;let Q=G.sessionId||((U=G.requestInfo)===null||U===void 0?void 0:U.headers["mcp-session-id"])||void 0,{level:z}=J.params,H=dX.safeParse(z);if(H.success)this._loggingLevels.set(Q,H.data);return{}})}registerCapabilities($){if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=lj(this._capabilities,$)}assertCapabilityForMethod($){var X,W,Y;switch($){case"sampling/createMessage":if(!((X=this._clientCapabilities)===null||X===void 0?void 0:X.sampling))throw Error(`Client does not support sampling (required for ${$})`);break;case"elicitation/create":if(!((W=this._clientCapabilities)===null||W===void 0?void 0:W.elicitation))throw Error(`Client does not support elicitation (required for ${$})`);break;case"roots/list":if(!((Y=this._clientCapabilities)===null||Y===void 0?void 0:Y.roots))throw Error(`Client does not support listing roots (required for ${$})`);break;case"ping":break}}assertNotificationCapability($){var X,W;switch($){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${$})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${$})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${$})`);break;case"notifications/elicitation/complete":if(!((W=(X=this._clientCapabilities)===null||X===void 0?void 0:X.elicitation)===null||W===void 0?void 0:W.url))throw Error(`Client does not support URL elicitation (required for ${$})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability($){switch($){case"completion/complete":if(!this._capabilities.completions)throw Error(`Server does not support completions (required for ${$})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${$})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${$})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${$})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${$})`);break;case"ping":case"initialize":break}}async _oninitialize($){let X=$.params.protocolVersion;return this._clientCapabilities=$.params.capabilities,this._clientVersion=$.params.clientInfo,{protocolVersion:g3.includes(X)?X:T7,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},SY)}async createMessage($,X){var W,Y;if($.tools||$.toolChoice){if(!((Y=(W=this._clientCapabilities)===null||W===void 0?void 0:W.sampling)===null||Y===void 0?void 0:Y.tools))throw Error("Client does not support sampling tools capability.")}if($.messages.length>0){let J=$.messages[$.messages.length-1],G=Array.isArray(J.content)?J.content:[J.content],U=G.some((j)=>j.type==="tool_result"),Q=$.messages.length>1?$.messages[$.messages.length-2]:void 0,z=Q?Array.isArray(Q.content)?Q.content:[Q.content]:[],H=z.some((j)=>j.type==="tool_use");if(U){if(G.some((j)=>j.type!=="tool_result"))throw Error("The last message must contain only tool_result content if any is present");if(!H)throw Error("tool_result blocks are not matching any tool_use from the previous message")}if(H){let j=new Set(z.filter((B)=>B.type==="tool_use").map((B)=>B.id)),O=new Set(G.filter((B)=>B.type==="tool_result").map((B)=>B.toolUseId));if(j.size!==O.size||![...j].every((B)=>O.has(B)))throw Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.request({method:"sampling/createMessage",params:$},h7,X)}async elicitInput($,X){var W,Y,J,G,U;switch((W=$.mode)!==null&&W!==void 0?W:"form"){case"url":{if(!((J=(Y=this._clientCapabilities)===null||Y===void 0?void 0:Y.elicitation)===null||J===void 0?void 0:J.url))throw Error("Client does not support url elicitation.");let z=$;return this.request({method:"elicitation/create",params:z},fY,X)}case"form":{if(!((U=(G=this._clientCapabilities)===null||G===void 0?void 0:G.elicitation)===null||U===void 0?void 0:U.form))throw Error("Client does not support form elicitation.");let z=$.mode==="form"?$:{...$,mode:"form"},H=await this.request({method:"elicitation/create",params:z},fY,X);if(H.action==="accept"&&H.content&&z.requestedSchema)try{let O=this._jsonSchemaValidator.getValidator(z.requestedSchema)(H.content);if(!O.valid)throw new w$(N$.InvalidParams,`Elicitation response content does not match requested schema: ${O.errorMessage}`)}catch(j){if(j instanceof w$)throw j;throw new w$(N$.InternalError,`Error validating elicitation response: ${j instanceof Error?j.message:String(j)}`)}return H}}}createElicitationCompletionNotifier($,X){var W,Y;if(!((Y=(W=this._clientCapabilities)===null||W===void 0?void 0:W.elicitation)===null||Y===void 0?void 0:Y.url))throw Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:$}},X)}async listRoots($,X){return this.request({method:"roots/list",params:$},l7,X)}async sendLoggingMessage($,X){if(this._capabilities.logging){if(!this.isMessageIgnored($.level,X))return this.notification({method:"notifications/message",params:$})}}async sendResourceUpdated($){return this.notification({method:"notifications/resources/updated",params:$})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var Lb=Symbol.for("mcp.completable");function Fb($){return!!$&&typeof $==="object"&&Lb in $}function Mb($){let X=$[Lb];return X===null||X===void 0?void 0:X.complete}var qb;(function($){$.Completable="McpCompletable"})(qb||(qb={}));class E6{static isTemplate($){return/\{[^}\s]+\}/.test($)}static validateLength($,X,W){if($.length>X)throw Error(`${W} exceeds maximum length of ${X} characters (got ${$.length})`)}get variableNames(){return this.parts.flatMap(($)=>typeof $==="string"?[]:$.names)}constructor($){E6.validateLength($,1e6,"Template"),this.template=$,this.parts=this.parse($)}toString(){return this.template}parse($){let X=[],W="",Y=0,J=0;while(Y<$.length)if($[Y]==="{"){if(W)X.push(W),W="";let G=$.indexOf("}",Y);if(G===-1)throw Error("Unclosed template expression");if(J++,J>1e4)throw Error("Template contains too many expressions (max 10000)");let U=$.slice(Y+1,G),Q=this.getOperator(U),z=U.includes("*"),H=this.getNames(U),j=H[0];for(let O of H)E6.validateLength(O,1e6,"Variable name");X.push({name:j,operator:Q,names:H,exploded:z}),Y=G+1}else W+=$[Y],Y++;if(W)X.push(W);return X}getOperator($){return["+","#",".","/","?","&"].find((W)=>$.startsWith(W))||""}getNames($){let X=this.getOperator($);return $.slice(X.length).split(",").map((W)=>W.replace("*","").trim()).filter((W)=>W.length>0)}encodeValue($,X){if(E6.validateLength($,1e6,"Variable value"),X==="+"||X==="#")return encodeURI($);return encodeURIComponent($)}expandPart($,X){if($.operator==="?"||$.operator==="&"){let G=$.names.map((Q)=>{let z=X[Q];if(z===void 0)return"";let H=Array.isArray(z)?z.map((j)=>this.encodeValue(j,$.operator)).join(","):this.encodeValue(z.toString(),$.operator);return`${Q}=${H}`}).filter((Q)=>Q.length>0);if(G.length===0)return"";return($.operator==="?"?"?":"&")+G.join("&")}if($.names.length>1){let G=$.names.map((U)=>X[U]).filter((U)=>U!==void 0);if(G.length===0)return"";return G.map((U)=>Array.isArray(U)?U[0]:U).join(",")}let W=X[$.name];if(W===void 0)return"";let J=(Array.isArray(W)?W:[W]).map((G)=>this.encodeValue(G,$.operator));switch($.operator){case"":return J.join(",");case"+":return J.join(",");case"#":return"#"+J.join(",");case".":return"."+J.join(".");case"/":return"/"+J.join("/");default:return J.join(",")}}expand($){let X="",W=!1;for(let Y of this.parts){if(typeof Y==="string"){X+=Y;continue}let J=this.expandPart(Y,$);if(!J)continue;if((Y.operator==="?"||Y.operator==="&")&&W)X+=J.replace("?","&");else X+=J;if(Y.operator==="?"||Y.operator==="&")W=!0}return X}escapeRegExp($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp($){let X=[];for(let J of $.names)E6.validateLength(J,1e6,"Variable name");if($.operator==="?"||$.operator==="&"){for(let J=0;J<$.names.length;J++){let G=$.names[J],U=J===0?"\\"+$.operator:"&";X.push({pattern:U+this.escapeRegExp(G)+"=([^&]+)",name:G})}return X}let W,Y=$.name;switch($.operator){case"":W=$.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)";break;case"+":case"#":W="(.+)";break;case".":W="\\.([^/,]+)";break;case"/":W="/"+($.exploded?"([^/]+(?:,[^/]+)*)":"([^/,]+)");break;default:W="([^/]+)"}return X.push({pattern:W,name:Y}),X}match($){E6.validateLength($,1e6,"URI");let X="^",W=[];for(let U of this.parts)if(typeof U==="string")X+=this.escapeRegExp(U);else{let Q=this.partToRegExp(U);for(let{pattern:z,name:H}of Q)X+=z,W.push({name:H,exploded:U.exploded})}X+="$",E6.validateLength(X,1e6,"Generated regex pattern");let Y=new RegExp(X),J=$.match(Y);if(!J)return null;let G={};for(let U=0;U<W.length;U++){let{name:Q,exploded:z}=W[U],H=J[U+1],j=Q.replace("*","");if(z&&H.includes(","))G[j]=H.split(",");else G[j]=H}return G}}var Sh=/^[A-Za-z0-9._-]{1,128}$/;function Eh($){let X=[];if($.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if($.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${$.length})`]};if($.includes(" "))X.push("Tool name contains spaces, which may cause parsing issues");if($.includes(","))X.push("Tool name contains commas, which may cause parsing issues");if($.startsWith("-")||$.endsWith("-"))X.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if($.startsWith(".")||$.endsWith("."))X.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Sh.test($)){let W=$.split("").filter((Y)=>!/[A-Za-z0-9._-]/.test(Y)).filter((Y,J,G)=>G.indexOf(Y)===J);return X.push(`Tool name contains invalid characters: ${W.map((Y)=>`"${Y}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:X}}return{isValid:!0,warnings:X}}function Ph($,X){if(X.length>0){console.warn(`Tool name validation warning for "${$}":`);for(let W of X)console.warn(` - ${W}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function m5($){let X=Eh($);return Ph($,X.warnings),X.isValid}class n5{constructor($,X){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new l5($,X)}async connect($){return await this.server.connect($)}async close(){await this.server.close()}setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler(e6(yY)),this.server.assertCanSetRequestHandler(e6(gY)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(yY,()=>({tools:Object.entries(this._registeredTools).filter(([,$])=>$.enabled).map(([$,X])=>{let W={name:$,title:X.title,description:X.description,inputSchema:(()=>{let Y=$0(X.inputSchema);return Y?p7(Y,{strictUnions:!0,pipeStrategy:"input"}):Rh})(),annotations:X.annotations,_meta:X._meta};if(X.outputSchema){let Y=$0(X.outputSchema);if(Y)W.outputSchema=p7(Y,{strictUnions:!0,pipeStrategy:"output"})}return W})})),this.server.setRequestHandler(gY,async($,X)=>{let W=this._registeredTools[$.params.name],Y;try{if(!W)throw new w$(N$.InvalidParams,`Tool ${$.params.name} not found`);if(!W.enabled)throw new w$(N$.InvalidParams,`Tool ${$.params.name} disabled`);if(W.inputSchema){let J=W.callback,G=$0(W.inputSchema),U=G!==null&&G!==void 0?G:W.inputSchema,Q=await zY(U,$.params.arguments);if(!Q.success)throw new w$(N$.InvalidParams,`Input validation error: Invalid arguments for tool ${$.params.name}: ${HY(Q.error)}`);let z=Q.data;Y=await Promise.resolve(J(z,X))}else{let J=W.callback;Y=await Promise.resolve(J(X))}if(W.outputSchema&&!Y.isError){if(!Y.structuredContent)throw new w$(N$.InvalidParams,`Output validation error: Tool ${$.params.name} has an output schema but no structured content was provided`);let J=$0(W.outputSchema),G=await zY(J,Y.structuredContent);if(!G.success)throw new w$(N$.InvalidParams,`Output validation error: Invalid structured content for tool ${$.params.name}: ${HY(G.error)}`)}}catch(J){if(J instanceof w$){if(J.code===N$.UrlElicitationRequired)throw J}return this.createToolError(J instanceof Error?J.message:String(J))}return Y}),this._toolHandlersInitialized=!0}createToolError($){return{content:[{type:"text",text:$}],isError:!0}}setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler(e6(hY)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(hY,async($)=>{switch($.params.ref.type){case"ref/prompt":return Gj($),this.handlePromptCompletion($,$.params.ref);case"ref/resource":return Uj($),this.handleResourceCompletion($,$.params.ref);default:throw new w$(N$.InvalidParams,`Invalid completion reference: ${$.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion($,X){let W=this._registeredPrompts[X.name];if(!W)throw new w$(N$.InvalidParams,`Prompt ${X.name} not found`);if(!W.enabled)throw new w$(N$.InvalidParams,`Prompt ${X.name} disabled`);if(!W.argsSchema)return lW;let Y=e1(W.argsSchema),J=Y===null||Y===void 0?void 0:Y[$.params.argument.name];if(!Fb(J))return lW;let G=Mb(J);if(!G)return lW;let U=await G($.params.argument.value,$.params.context);return Eb(U)}async handleResourceCompletion($,X){let W=Object.values(this._registeredResourceTemplates).find((G)=>G.resourceTemplate.uriTemplate.toString()===X.uri);if(!W){if(this._registeredResources[X.uri])return lW;throw new w$(N$.InvalidParams,`Resource template ${$.params.ref.uri} not found`)}let Y=W.resourceTemplate.completeCallback($.params.argument.name);if(!Y)return lW;let J=await Y($.params.argument.value,$.params.context);return Eb(J)}setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler(e6(TY)),this.server.assertCanSetRequestHandler(e6(CY)),this.server.assertCanSetRequestHandler(e6(_Y)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(TY,async($,X)=>{let W=Object.entries(this._registeredResources).filter(([J,G])=>G.enabled).map(([J,G])=>({uri:J,name:G.name,...G.metadata})),Y=[];for(let J of Object.values(this._registeredResourceTemplates)){if(!J.resourceTemplate.listCallback)continue;let G=await J.resourceTemplate.listCallback(X);for(let U of G.resources)Y.push({...J.metadata,...U})}return{resources:[...W,...Y]}}),this.server.setRequestHandler(CY,async()=>{return{resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([X,W])=>({name:X,uriTemplate:W.resourceTemplate.uriTemplate.toString(),...W.metadata}))}}),this.server.setRequestHandler(_Y,async($,X)=>{let W=new URL($.params.uri),Y=this._registeredResources[W.toString()];if(Y){if(!Y.enabled)throw new w$(N$.InvalidParams,`Resource ${W} disabled`);return Y.readCallback(W,X)}for(let J of Object.values(this._registeredResourceTemplates)){let G=J.resourceTemplate.uriTemplate.match(W.toString());if(G)return J.readCallback(W,G,X)}throw new w$(N$.InvalidParams,`Resource ${W} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0}setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler(e6(xY)),this.server.assertCanSetRequestHandler(e6(uY)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(xY,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,$])=>$.enabled).map(([$,X])=>{return{name:$,title:X.title,description:X.description,arguments:X.argsSchema?kh(X.argsSchema):void 0}})})),this.server.setRequestHandler(uY,async($,X)=>{let W=this._registeredPrompts[$.params.name];if(!W)throw new w$(N$.InvalidParams,`Prompt ${$.params.name} not found`);if(!W.enabled)throw new w$(N$.InvalidParams,`Prompt ${$.params.name} disabled`);if(W.argsSchema){let Y=$0(W.argsSchema),J=await zY(Y,$.params.arguments);if(!J.success)throw new w$(N$.InvalidParams,`Invalid arguments for prompt ${$.params.name}: ${HY(J.error)}`);let G=J.data,U=W.callback;return await Promise.resolve(U(G,X))}else{let Y=W.callback;return await Promise.resolve(Y(X))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0}resource($,X,...W){let Y;if(typeof W[0]==="object")Y=W.shift();let J=W[0];if(typeof X==="string"){if(this._registeredResources[X])throw Error(`Resource ${X} is already registered`);let G=this._createRegisteredResource($,void 0,X,Y,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),G}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let G=this._createRegisteredResourceTemplate($,void 0,X,Y,J);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),G}}registerResource($,X,W,Y){if(typeof X==="string"){if(this._registeredResources[X])throw Error(`Resource ${X} is already registered`);let J=this._createRegisteredResource($,W.title,X,W,Y);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}else{if(this._registeredResourceTemplates[$])throw Error(`Resource template ${$} is already registered`);let J=this._createRegisteredResourceTemplate($,W.title,X,W,Y);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),J}}_createRegisteredResource($,X,W,Y,J){let G={name:$,title:X,metadata:Y,readCallback:J,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({uri:null}),update:(U)=>{if(typeof U.uri<"u"&&U.uri!==W){if(delete this._registeredResources[W],U.uri)this._registeredResources[U.uri]=G}if(typeof U.name<"u")G.name=U.name;if(typeof U.title<"u")G.title=U.title;if(typeof U.metadata<"u")G.metadata=U.metadata;if(typeof U.callback<"u")G.readCallback=U.callback;if(typeof U.enabled<"u")G.enabled=U.enabled;this.sendResourceListChanged()}};return this._registeredResources[W]=G,G}_createRegisteredResourceTemplate($,X,W,Y,J){let G={resourceTemplate:W,title:X,metadata:Y,readCallback:J,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(U)=>{if(typeof U.name<"u"&&U.name!==$){if(delete this._registeredResourceTemplates[$],U.name)this._registeredResourceTemplates[U.name]=G}if(typeof U.title<"u")G.title=U.title;if(typeof U.template<"u")G.resourceTemplate=U.template;if(typeof U.metadata<"u")G.metadata=U.metadata;if(typeof U.callback<"u")G.readCallback=U.callback;if(typeof U.enabled<"u")G.enabled=U.enabled;this.sendResourceListChanged()}};return this._registeredResourceTemplates[$]=G,G}_createRegisteredPrompt($,X,W,Y,J){let G={title:X,description:W,argsSchema:Y===void 0?void 0:s1(Y),callback:J,enabled:!0,disable:()=>G.update({enabled:!1}),enable:()=>G.update({enabled:!0}),remove:()=>G.update({name:null}),update:(U)=>{if(typeof U.name<"u"&&U.name!==$){if(delete this._registeredPrompts[$],U.name)this._registeredPrompts[U.name]=G}if(typeof U.title<"u")G.title=U.title;if(typeof U.description<"u")G.description=U.description;if(typeof U.argsSchema<"u")G.argsSchema=s1(U.argsSchema);if(typeof U.callback<"u")G.callback=U.callback;if(typeof U.enabled<"u")G.enabled=U.enabled;this.sendPromptListChanged()}};return this._registeredPrompts[$]=G,G}_createRegisteredTool($,X,W,Y,J,G,U,Q){m5($);let z={title:X,description:W,inputSchema:Sb(Y),outputSchema:Sb(J),annotations:G,_meta:U,callback:Q,enabled:!0,disable:()=>z.update({enabled:!1}),enable:()=>z.update({enabled:!0}),remove:()=>z.update({name:null}),update:(H)=>{if(typeof H.name<"u"&&H.name!==$){if(typeof H.name==="string")m5(H.name);if(delete this._registeredTools[$],H.name)this._registeredTools[H.name]=z}if(typeof H.title<"u")z.title=H.title;if(typeof H.description<"u")z.description=H.description;if(typeof H.paramsSchema<"u")z.inputSchema=s1(H.paramsSchema);if(typeof H.callback<"u")z.callback=H.callback;if(typeof H.annotations<"u")z.annotations=H.annotations;if(typeof H._meta<"u")z._meta=H._meta;if(typeof H.enabled<"u")z.enabled=H.enabled;this.sendToolListChanged()}};return this._registeredTools[$]=z,this.setToolRequestHandlers(),this.sendToolListChanged(),z}tool($,...X){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let W,Y,J,G;if(typeof X[0]==="string")W=X.shift();if(X.length>1){let Q=X[0];if(i5(Q)){if(Y=X.shift(),X.length>1&&typeof X[0]==="object"&&X[0]!==null&&!i5(X[0]))G=X.shift()}else if(typeof Q==="object"&&Q!==null)G=X.shift()}let U=X[0];return this._createRegisteredTool($,void 0,W,Y,J,G,void 0,U)}registerTool($,X,W){if(this._registeredTools[$])throw Error(`Tool ${$} is already registered`);let{title:Y,description:J,inputSchema:G,outputSchema:U,annotations:Q,_meta:z}=X;return this._createRegisteredTool($,Y,J,G,U,Q,z,W)}prompt($,...X){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let W;if(typeof X[0]==="string")W=X.shift();let Y;if(X.length>1)Y=X.shift();let J=X[0],G=this._createRegisteredPrompt($,void 0,W,Y,J);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),G}registerPrompt($,X,W){if(this._registeredPrompts[$])throw Error(`Prompt ${$} is already registered`);let{title:Y,description:J,argsSchema:G}=X,U=this._createRegisteredPrompt($,Y,J,G,W);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),U}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage($,X){return this.server.sendLoggingMessage($,X)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}}class M1{constructor($,X){this._callbacks=X,this._uriTemplate=typeof $==="string"?new E6($):$}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback($){var X;return(X=this._callbacks.complete)===null||X===void 0?void 0:X[$]}}var Rh={type:"object",properties:{}};function i5($){if(typeof $!=="object"||$===null)return!1;return Object.keys($).length===0||Object.values($).some(Zh)}function Zh($){return $!==null&&typeof $==="object"&&"parse"in $&&typeof $.parse==="function"&&"safeParse"in $&&typeof $.safeParse==="function"}function Sb($){if(!$)return;if(i5($))return s1($);return $}function kh($){let X=e1($);if(!X)return[];return Object.entries(X).map(([W,Y])=>{let J=tH(Y),G=aH(Y);return{name:W,description:J,required:!G}})}function e6($){let X=e1($),W=X===null||X===void 0?void 0:X.method;if(!W)throw Error("Schema is missing a method literal");let Y=jY(W);if(typeof Y==="string")return Y;throw Error("Schema method literal must be a string")}function Eb($){return{completion:{values:$.slice(0,100),total:$.length,hasMore:$.length>100}}}var lW={completion:{values:[],hasMore:!1}};import Rb from"node:process";class c5{append($){this._buffer=this._buffer?Buffer.concat([this._buffer,$]):$}readMessage(){if(!this._buffer)return null;let $=this._buffer.indexOf(`
|
|
45
|
+
`);if($===-1)return null;let X=this._buffer.toString("utf8",0,$).replace(/\r$/,"");return this._buffer=this._buffer.subarray($+1),Th(X)}clear(){this._buffer=void 0}}function Th($){return d3.parse(JSON.parse($))}function Pb($){return JSON.stringify($)+`
|
|
46
|
+
`}class r5{constructor($=Rb.stdin,X=Rb.stdout){this._stdin=$,this._stdout=X,this._readBuffer=new c5,this._started=!1,this._ondata=(W)=>{this._readBuffer.append(W),this.processReadBuffer()},this._onerror=(W)=>{var Y;(Y=this.onerror)===null||Y===void 0||Y.call(this,W)}}async start(){if(this._started)throw Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){var $,X;while(!0)try{let W=this._readBuffer.readMessage();if(W===null)break;($=this.onmessage)===null||$===void 0||$.call(this,W)}catch(W){(X=this.onerror)===null||X===void 0||X.call(this,W)}}async close(){var $;if(this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0)this._stdin.pause();this._readBuffer.clear(),($=this.onclose)===null||$===void 0||$.call(this)}send($){return new Promise((X)=>{let W=Pb($);if(this._stdout.write(W))X();else this._stdout.once("drain",X)})}}var ub=BG(xb(),1);ub.default.config();var $l=process.env.LOGSEQ_PORT||"12315",Xl=process.env.LOGSEQ_HOST||"127.0.0.1",o5=process.env.LOGSEQ_TOKEN||"",yb=`http://${Xl}:${$l}/api`;if(!o5&&process.env.TEST_TYPE!=="unit"&&process.env.MOCK_LOGSEQ_API!=="true")console.error("Error: LOGSEQ_TOKEN is required. Set it in a .env file or as an environment variable."),process.exit(1);var D$=(...$)=>console.error(...$);var Wl=()=>{let $=process.env.MOCK_LOGSEQ_API==="true";return D$(`Mock mode check: MOCK_LOGSEQ_API=${process.env.MOCK_LOGSEQ_API}, isMockMode=${$}`),$},a={pages:[{name:"MCP-Test-Page",uuid:"mock-page-1",properties:{"test-property":"test-value"}},{name:"Current-Test-Page",uuid:"mock-page-2",properties:{}},{name:"Reference-Test-Page",uuid:"mock-page-3",properties:{}},{name:"Recipe Page",uuid:"mock-page-4",properties:{tags:["recipe"]}},{name:"Tasks-Page",uuid:"mock-page-5",properties:{}}],blocks:[{uuid:"mock-block-uuid",content:"This is a test block created by MCP integration test",page:{id:"MCP-Test-Page"},parent:null},{uuid:"task-todo",content:"TODO This is a todo task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-doing",content:"DOING This is a doing task",page:{id:"Tasks-Page"},parent:null},{uuid:"task-done",content:"DONE This is a done task",page:{id:"Tasks-Page"},parent:null},{uuid:"recipe-block",content:"This is a recipe block",page:{id:"Recipe Page"},properties:{tags:["recipe"]},parent:null}],currentPage:{name:"Current-Test-Page",uuid:"mock-page-2"}};async function C($,X=[]){if(Wl())return Jl($,X);try{D$(`Calling Logseq API: ${$} with args:`,JSON.stringify(X));let W=await fetch(yb,{method:"POST",headers:{Authorization:`Bearer ${o5}`,"Content-Type":"application/json"},body:JSON.stringify({method:$,args:X})});if(!W.ok)throw Error(`Logseq API error: ${W.status} ${W.statusText}`);let Y;try{let J=await W.text();if(!J||J.trim()==="")return D$(`Empty response from Logseq API (${$})`),null;Y=JSON.parse(J)}catch(J){if(D$(`JSON parse error for ${$}:`,J),$.includes("getBlockProperty")||$.includes("getProperty")||$.includes("removeBlockProperty"))return null;throw Error(`Failed to parse JSON response: ${J.message}`)}return D$("Logseq API response:",JSON.stringify(Y).substring(0,200)+"..."),Y}catch(W){throw console.error(`Error calling Logseq API (${$}):`,W),W}}function Jl($,X=[]){switch(D$(`[MOCK] Calling Logseq API: ${$} with args:`,JSON.stringify(X)),$){case"logseq.Editor.createPage":let[W,Y,J]=X,G={name:W,uuid:`page-${Date.now()}`,properties:Y||{}};if(a.pages.push(G),J?.redirect)a.currentPage={name:W,uuid:G.uuid||"mock-page-2"};return{name:W,uuid:G.uuid||"mock-page-2",properties:Y||{},id:Date.now()};case"logseq.Editor.getPage":let U=X[0],Q=a.pages.find((T)=>T.name.toLowerCase()===U.toLowerCase());if(!Q)return null;return{name:Q.name.toLowerCase().replace(/\s/g,"-"),originalName:Q.name,uuid:Q.uuid||"mock-page-2",properties:Q.properties,id:Date.now()};case"logseq.Editor.getCurrentPage":return{name:a.currentPage.name.toLowerCase().replace(/\s/g,"-"),originalName:a.currentPage.name,uuid:a.currentPage.uuid||"mock-page-2",id:Date.now()};case"logseq.Editor.getAllPages":return a.pages.map((T)=>({name:T.name.toLowerCase().replace(/\s/g,"-"),originalName:T.name,uuid:T.uuid||"mock-page-2",id:Date.now(),journal:!1}));case"logseq.Editor.getPageBlocksTree":let z=X[0];return a.blocks.filter((T)=>T.page.id.toLowerCase()===z.toLowerCase()||T.page.id.toLowerCase().replace(/\s/g,"-")===z.toLowerCase());case"logseq.Editor.getPageLinkedReferences":return[{from:{name:"Another-Page",uuid:"mock-page-ref"},to:{name:X[0],uuid:"mock-page-target"},content:"Reference content"}];case"logseq.Editor.createBlock":let[H,j,O]=X,B={uuid:`mock-block-${Date.now()}`,content:j,page:{id:H},properties:O?.properties||{},parent:null};return a.blocks.push(B),B;case"logseq.Editor.insertBlock":let[I,N,D]=X,V={uuid:`mock-block-${Date.now()}`,content:N,page:{id:typeof I==="string"&&!I.includes("-")?I:"MCP-Test-Page"},properties:D?.properties||{},parent:typeof I==="string"&&I.includes("-")?I:null};return a.blocks.push(V),V;case"logseq.Editor.getBlock":let[K,b]=X,S=a.blocks.find((T)=>T.uuid===K);if(!S)return null;if(b?.includeChildren)return{...S,children:a.blocks.filter((T)=>T.parent===K)};return S;case"logseq.Editor.updateBlock":let[L,l,V$]=X,s$=a.blocks.find((T)=>T.uuid===L);if(s$){if(s$.content=l,V$?.properties)s$.properties={...s$.properties,...V$.properties};return s$}return null;case"logseq.Editor.removeBlock":let[t4]=X,U4=a.blocks.findIndex((T)=>T.uuid===t4);if(U4>=0)return a.blocks.splice(U4,1),{success:!0,uuid:t4};return null;case"logseq.Editor.getBlockProperty":let[z6,$1]=X,H6=a.blocks.find((T)=>T.uuid===z6);if(!H6||!H6.properties)return null;let S1=H6.properties[$1];return S1!==void 0?S1:null;case"logseq.Editor.getBlockProperties":let[XK]=X,e5=a.blocks.find((T)=>T.uuid===XK);if(!e5)return null;return e5.properties||{};case"logseq.Editor.setBlockProperty":let[WK,JK,YK]=X,cW=a.blocks.find((T)=>T.uuid===WK);if(!cW)return null;if(!cW.properties)cW.properties={};return cW.properties[JK]=YK,!0;case"logseq.DB.datascriptQuery":let[k$]=X;if(k$&&typeof k$==="string"&&k$.includes("clojure.string/includes?")){let T=k$.match(/"(TODO|DOING|DONE|LATER|NOW|WAITING)"/g),Z$=T?T.map((v4)=>v4.replace(/"/g,"")):["TODO","DOING","DONE"];return a.blocks.filter((v4)=>{return Z$.some((OK)=>v4.content.includes(OK))}).map((v4)=>[v4])}if(k$&&typeof k$==="string"&&k$.includes(":block/marker")){let T=k$&&typeof k$==="string"&&k$.includes("TODO")?["TODO"]:k$&&typeof k$==="string"&&k$.includes("DOING")?["DOING"]:k$&&typeof k$==="string"&&k$.includes("DONE")?["DONE"]:["TODO","DOING","DONE"];return a.blocks.filter((r$)=>{let v4=r$.content.split(" ")[0]||"";return T.includes(v4)}).map((r$)=>[r$])}if(k$&&typeof k$==="string"&&k$.includes("This is a test block created by MCP integration test")){let T=a.blocks.find((Z$)=>Z$.content.includes("This is a test block created by MCP integration test"));if(T)return[[T]]}if(k$&&typeof k$==="string"&&k$.includes("recipe")){let T=a.blocks.filter((Z$)=>Z$.properties?.tags?.includes("recipe")||Z$.content.includes("#recipe")||Z$.content.includes("recipe"));if(T.length>0)return T.map((Z$)=>[Z$])}return[[{uuid:"mock-query-result",content:"Mock query result",properties:{}}]];case"logseq.DB.q":let[M0]=X;if(M0&&typeof M0==="string"){if(M0.includes("This is a test block created by MCP integration test")){let Z$=a.blocks.find((r$)=>r$.content.includes("This is a test block created by MCP integration test"));if(Z$)return[[Z$]]}let T=a.blocks.filter((Z$)=>Z$.content.includes(M0)).map((Z$)=>[Z$]);return T.length>0?T:[[{uuid:"search-result",content:`Search result for: ${M0}`,properties:{}}]]}return[[{uuid:"default-search-result",content:"Default search result",properties:{}}]];case"logseq.Datascript.q":let[i$]=X;if(i$&&typeof i$==="string"&&i$.includes("block/marker"))return a.blocks.filter((T)=>T.content.startsWith("TODO")||T.content.startsWith("DOING")||T.content.startsWith("DONE")).map((T)=>[T.uuid,T.content.split(" ")[0]]);else if(i$&&typeof i$==="string"&&i$.includes(":block/content"))return a.blocks.map((T)=>[{uuid:T.uuid,content:T.content,":block/content":T.content,page:T.page}]);else if(i$&&typeof i$==="string"&&i$.includes(":block/_refs"))return[["mock-reference-uuid"]];else if(i$&&typeof i$==="string"&&i$.includes(":block/properties")&&i$.includes("recipe"))return a.blocks.filter((T)=>T.properties&&T.properties.tags&&T.properties.tags.includes("recipe")).map((T)=>[T.uuid]);else if(i$&&typeof i$==="string"&&i$.includes(":page/properties")&&i$.includes("recipe"))return a.pages.filter((T)=>T.properties&&T.properties.tags&&T.properties.tags.includes("recipe")).map((T)=>[T.name]);return a.blocks.map((T)=>[{uuid:T.uuid,content:T.content}]);case"logseq.Datascript.qUpsert":return{blocks:a.blocks.filter((T)=>T.properties&&T.properties.tags&&T.properties.tags.includes("recipe")).map((T)=>({uuid:T.uuid,content:T.content})),pages:a.pages.filter((T)=>T.properties&&T.properties.tags&&T.properties.tags.includes("recipe")).map((T)=>({name:T.name}))};case"logseq.Editor.removeBlockProperty":let[GK,UK]=X,NG=a.blocks.find((T)=>T.uuid===GK);if(!NG||!NG.properties)return null;return delete NG.properties[UK],{success:!0};case"logseq.Editor.insertBatchBlock":let[QK,zK]=X,$H=[],XH=(T,Z$)=>{return T.map((r$)=>{let v4={uuid:`mock-block-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,content:r$.content||"",page:{id:QK},parent:Z$,properties:r$.properties||{}};if(a.blocks.push(v4),$H.push(v4),r$.children&&Array.isArray(r$.children))v4.children=XH(r$.children,v4.uuid);return v4})};return XH(zK,null),$H[0]||null;case"logseq.Editor.setBlockCollapsed":return null;case"logseq.Editor.toggleBlockCollapsed":return null;case"logseq.Editor.getNextSiblingBlock":let[HK]=X,rW=a.blocks.findIndex((T)=>T.uuid===HK);if(rW>=0&&rW<a.blocks.length-1){let T=a.blocks[rW];if(T)for(let Z$=rW+1;Z$<a.blocks.length;Z$++){let r$=a.blocks[Z$];if(r$&&r$.parent===T.parent)return r$}}return null;case"logseq.Editor.moveBlock":let[WH,jK,IK]=X,JH=a.blocks.find((T)=>T.uuid===WH);if(JH)return JH.parent=IK?.children?jK:null,{success:!0,uuid:WH};return null;case"logseq.Editor.selectBlock":return null;case"logseq.Editor.editBlock":return null;case"logseq.Editor.getCurrentBlock":return a.blocks.length>0?a.blocks[0]:null;default:return D$(`[MOCK] Unhandled method: ${$}`),null}}function C$($){let X;if($===null)X="null";else if(typeof $==="string")X=$;else X=JSON.stringify($,null,2);return{isError:!1,content:[{type:"text",text:X}]}}function g$($,X,W){let Y;if(X instanceof Error)Y=X.message;else if(typeof X==="string")Y=X;else Y=String(X);let J=`Failed to ${$}: ${Y}`;if(W)J+=`
|
|
47
|
+
|
|
48
|
+
Hint: ${W}`;return{isError:!0,content:[{type:"text",text:J}]}}function t5($,X){return{isError:!0,content:[{type:"text",text:`${$} "${X}" not found`}]}}function HG($,X){return{isError:!0,content:[{type:"text",text:`${$} is required for ${X} operation`}]}}var a$={filterInternalProps:M.boolean().optional().default(!0).describe("Filter out internal Logseq properties (e.g., :plugin.property.*, :logseq.property.*)"),fields:M.array(M.string()).optional().describe('Only return these fields. Example: ["uuid", "content", "createdAt"]'),expandRefs:M.boolean().optional().default(!1).describe("Expand reference IDs to include name/uuid (requires additional API calls)"),expandParent:M.boolean().optional().default(!1).describe("Expand parent ID to include uuid/content"),expandPage:M.boolean().optional().default(!1).describe("Expand page ID to include name/uuid"),timestampFormat:M.enum(["ms","iso"]).optional().default("ms").describe('Timestamp format: "ms" (milliseconds) or "iso" (ISO 8601)'),deduplicateFields:M.boolean().optional().default(!0).describe("Remove redundant fields (title/fullTitle when same as content)")},gb={filterInternalProps:!0,fields:[],expandRefs:!1,expandParent:!1,expandPage:!1,timestampFormat:"ms",deduplicateFields:!0},Yl=[/^:plugin\.property\./,/^:logseq\.property\./,/^:block\//,/^:db\//,/^:logseq\.property\//],Gl=["createdAt","updatedAt","scheduled","deadline"],Ul=[{primary:"content",duplicates:["title","fullTitle"]}];function jG($){if(!$||typeof $!=="object")return $;let X={};for(let[W,Y]of Object.entries($))if(!Yl.some((G)=>G.test(W)))if(Y&&typeof Y==="object"&&!Array.isArray(Y))X[W]=jG(Y);else if(Array.isArray(Y))X[W]=Y.map((G)=>G&&typeof G==="object"?jG(G):G);else X[W]=Y;return X}function a5($,X){if(!$||typeof $!=="object")return $;if(!X||X.length===0)return $;let W={};for(let Y of X)if(Y.includes(".")){let[J,...G]=Y.split(".");if(J&&J in $){let U=$[J];if(U&&typeof U==="object"){if(!W[J])W[J]={};let Q=a5(U,[G.join(".")]);W[J]={...W[J],...Q}}}}else if(Y in $)W[Y]=$[Y];return W}function IG($,X){if(!$||typeof $!=="object")return $;if(X==="ms")return $;let W={...$};for(let Y of Gl)if(Y in W&&typeof W[Y]==="number"){let J=W[Y];if(J>946684800000&&J<4102444800000)W[Y]=new Date(J).toISOString()}for(let[Y,J]of Object.entries(W))if(J&&typeof J==="object"&&!Array.isArray(J))W[Y]=IG(J,X);else if(Array.isArray(J))W[Y]=J.map((G)=>G&&typeof G==="object"?IG(G,X):G);return W}function OG($){if(!$||typeof $!=="object")return $;let X={...$};for(let{primary:W,duplicates:Y}of Ul)if(W in X){let J=X[W];for(let G of Y)if(G in X&&X[G]===J)delete X[G]}delete X.order;for(let[W,Y]of Object.entries(X))if(Y&&typeof Y==="object"&&!Array.isArray(Y))X[W]=OG(Y);else if(Array.isArray(Y))X[W]=Y.map((J)=>J&&typeof J==="object"?OG(J):J);return X}async function Ql($,X){if(!$||!Array.isArray($)||$.length===0)return[];return await Promise.all($.map(async(Y)=>{let J=typeof Y==="number"?Y:Y.id;try{let G=await X("logseq.Editor.getBlock",[J]);if(G&&G.uuid)return{id:J,uuid:G.uuid,content:(G.content||"").substring(0,50),type:"block"}}catch{}try{let G=await X("logseq.Editor.getPage",[J]);if(G&&G.name)return{id:J,name:G.name,uuid:G.uuid,type:"page"}}catch{}return{id:J}}))}async function zl($,X){if(!$)return;let W=typeof $==="number"?$:$.id;try{let Y=await X("logseq.Editor.getBlock",[W]);if(Y)return{id:W,uuid:Y.uuid,content:(Y.content||"").substring(0,100)}}catch{}return{id:W}}async function Hl($,X){if(!$)return;let W=typeof $==="number"?$:$.id;try{let Y=await X("logseq.Editor.getPage",[W]);if(Y)return{id:W,name:Y.name||Y.originalName,uuid:Y.uuid}}catch{}return{id:W}}async function M$($,X={},W){let Y={...gb,...X};if(Array.isArray($))return await Promise.all($.map((U)=>M$(U,X,W)));if(!$||typeof $!=="object")return $;let J={...$};if(Y.filterInternalProps)J=jG(J);if(Y.deduplicateFields)J=OG(J);if(Y.expandRefs&&W&&J.refs)J.refs=await Ql(J.refs,W);if(Y.expandParent&&W&&J.parent)J.parent=await zl(J.parent,W);if(Y.expandPage&&W&&J.page)J.page=await Hl(J.page,W);if(Y.timestampFormat==="iso")J=IG(J,"iso");if(Y.fields&&Y.fields.length>0)J=a5(J,Y.fields);if(J.children&&Array.isArray(J.children))J.children=await Promise.all(J.children.map((G)=>M$(G,X,W)));if(J.blocks&&Array.isArray(J.blocks))J.blocks=await Promise.all(J.blocks.map((G)=>M$(G,X,W)));return J}function S$($,X={}){let W={...gb,...X};if(Array.isArray($))return $.map((J)=>S$(J,X));if(!$||typeof $!=="object")return $;let Y={...$};if(W.filterInternalProps)Y=jG(Y);if(W.deduplicateFields)Y=OG(Y);if(W.timestampFormat==="iso")Y=IG(Y,"iso");if(W.fields&&W.fields.length>0)Y=a5(Y,W.fields);if(Y.children&&Array.isArray(Y.children))Y.children=Y.children.map((J)=>S$(J,X));if(Y.blocks&&Array.isArray(Y.blocks))Y.blocks=Y.blocks.map((J)=>S$(J,X));return Y}function _$($){return!!($.expandRefs||$.expandParent||$.expandPage)}function iW($){return{content:$.content,isError:$.isError}}function fb($){$.tool("query",`Search and query the Logseq graph using Datalog queries or text search. This is the most powerful way to retrieve specific information.
|
|
11
49
|
|
|
12
50
|
IMPORTANT USAGE NOTES:
|
|
13
51
|
- Datalog queries provide advanced filtering capabilities using Datalog syntax
|
|
@@ -32,14 +70,14 @@ EXAMPLES:
|
|
|
32
70
|
4) Find all journal pages:
|
|
33
71
|
- type: "datalog"
|
|
34
72
|
- query: "[:find (pull ?p [*]) :where [?p :block/journal? true]]"
|
|
35
|
-
`,{type:
|
|
73
|
+
`,{type:M.enum(["datalog","search"]).default("datalog").describe(`Query type:
|
|
36
74
|
- datalog: Advanced Datalog query using Logseq's Datalog syntax (more powerful)
|
|
37
|
-
- search: Simple text search to find blocks containing specific text (easier to use)`),query:
|
|
75
|
+
- search: Simple text search to find blocks containing specific text (easier to use)`),query:M.string().describe("The query to execute - either a Datalog query string or a text search term"),includeChildren:M.boolean().optional().default(!0).describe("Whether to include child blocks in results. Provides context but may increase response size."),limit:M.number().optional().describe("Maximum number of results to return. Use this for large result sets to avoid performance issues."),...a$},async({type:X,query:W,includeChildren:Y=!0,limit:J,filterInternalProps:G,fields:U,expandRefs:Q,expandParent:z,expandPage:H,timestampFormat:j,deduplicateFields:O})=>{try{if(D$(`Executing ${X} query: ${W}`),X==="search"){let B=`[:find (pull ?b [*])
|
|
38
76
|
:where
|
|
39
77
|
[?b :block/content ?c]
|
|
40
|
-
[(clojure.string/includes? ?c "${W}")]]`,
|
|
78
|
+
[(clojure.string/includes? ?c "${W}")]]`,I=await C("logseq.DB.datascriptQuery",[B]);D$(`Search result count: ${Array.isArray(I)?I.length:I?1:0}`);let N=Array.isArray(I)?I:I?[I]:[];if(J&&J>0&&N.length>J)N=N.slice(0,J);if(N.length===0){let K=C$(`No results found for search: "${W}"`);return iW(K)}let D={filterInternalProps:G??!0,fields:U,expandRefs:Q,expandParent:z,expandPage:H,timestampFormat:j,deduplicateFields:O??!0},w;if(_$(D))w=await M$(N,D,C);else w=S$(N,D);let V=C$(w);return iW(V)}else{let B=await C("logseq.DB.datascriptQuery",[W]),I=Array.isArray(B)?B:B?[B]:[];if(J&&J>0&&I.length>J)I=I.slice(0,J);let N=I.some((K)=>K&&(K.uuid||Array.isArray(K)&&K[0]?.uuid));if(Y&&N&&I.length>0)I=await Promise.all(I.map(async(b)=>{let S=b.uuid||(Array.isArray(b)?b[0]?.uuid:null);if(!S)return b;try{return await C("logseq.Editor.getBlock",[S,{includeChildren:!0}])||b}catch(L){return b}}));if(D$(`Query result (processed): ${I.length} items`),I.length===0){let K=C$("No results found for Datalog query");return iW(K)}let D={filterInternalProps:G??!0,fields:U,expandRefs:Q,expandParent:z,expandPage:H,timestampFormat:j,deduplicateFields:O??!0},w;if(_$(D))w=await M$(I,D,C);else w=S$(I,D);let V=C$(w);return iW(V)}}catch(B){console.error(`Error in query operation: ${B}`);let I=g$("execute query",B,"Check your query syntax and ensure it follows Datalog format");return iW(I)}})}var s5=($,X=!0)=>{if(!X)return $;return $.split(`
|
|
41
79
|
`).map((W)=>W.replace(/^\s*-\s+/,"")).join(`
|
|
42
|
-
`)},
|
|
80
|
+
`)},hb=($,X=!0)=>{return $.map((W)=>{if(typeof W==="string")return s5(W,X);if(W&&typeof W==="object"){let Y={...W};if(W.content)Y.content=s5(W.content,X);if("children"in W&&Array.isArray(W.children)&&W.children.length>0)Y.children=hb(W.children,X);return Y}return W})},jl=async($)=>{let X=$.operation;try{let W;if(X==="get"){let{uuid:Y,includeChildren:J=!0}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for get operation"}]};if(W=await C("logseq.Editor.getBlock",[Y,{includeChildren:J}]),!W)return{isError:!0,content:[{type:"text",text:`Block with UUID "${Y}" not found`}]};let G={filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0},U;if(_$(G))U=await M$(W,G,C);else U=S$(W,G);return{isError:!1,content:[{type:"text",text:JSON.stringify(U,null,2)}]}}else if(X==="get-current"){if(W=await C("logseq.Editor.getCurrentBlock",[]),!W)return{isError:!0,content:[{type:"text",text:"No block is currently focused"}]};let Y={filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0},J;if(_$(Y))J=await M$(W,Y,C);else J=S$(W,Y);return{isError:!1,content:[{type:"text",text:JSON.stringify(J,null,2)}]}}else if(X==="get-selected"){if(W=await C("logseq.Editor.getSelectedBlocks",[]),!W||!Array.isArray(W)||W.length===0)return{isError:!0,content:[{type:"text",text:"No blocks are currently selected"}]};let Y={filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0},J;if(_$(Y))J=await M$(W,Y,C);else J=S$(W,Y);return{isError:!1,content:[{type:"text",text:JSON.stringify(J,null,2)}]}}else if(X==="get-siblings"){let{uuid:Y,direction:J="next"}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for get-siblings operation"}]};if(W=await C(J==="previous"?"logseq.Editor.getPreviousSiblingBlock":"logseq.Editor.getNextSiblingBlock",[Y]),!W)return{isError:!0,content:[{type:"text",text:`No ${J} sibling found for block "${Y}"`}]};let U={filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0},Q;if(_$(U))Q=await M$(W,U,C);else Q=S$(W,U);return{isError:!1,content:[{type:"text",text:JSON.stringify(Q,null,2)}]}}else if(X==="create"){let{target:Y,content:J,blocks:G,position:U="child",stripLeadingHyphen:Q=!0,keepUUID:z=!1}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"Target (page name or block UUID) is required for create operation"}]};if(!J&&!G)return{isError:!0,content:[{type:"text",text:"Content or blocks array is required for create operation"}]};if(G){let O=hb(G,Q);W=await C("logseq.Editor.insertBatchBlock",[Y,O,{sibling:U==="before"||U==="after",before:U==="before",keepId:z}])}else{let O=s5(J,Q);if(U==="first")W=await C("logseq.Editor.insertBlock",[Y,O,{isPageBlock:!0,keepId:z}]);else W=await C("logseq.Editor.insertBlock",[Y,O,{before:U==="before",sibling:U==="before"||U==="after",isPageBlock:U==="child",keepId:z}])}if(!W)return{isError:!0,content:[{type:"text",text:"Failed to create block"}]};let H={filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0},j;if(_$(H))j=await M$(W,H,C);else j=S$(W,H);return{isError:!1,content:[{type:"text",text:JSON.stringify(j,null,2)}]}}else if(X==="update"){let{uuid:Y,content:J,properties:G}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for update operation"}]};if(!J&&!G)return{isError:!0,content:[{type:"text",text:"Content or properties is required for update operation"}]};if(J)W=await C("logseq.Editor.updateBlock",[Y,J]);else if(G)W=await C("logseq.Editor.setBlockProperties",[Y,G]);if(!W)return{isError:!0,content:[{type:"text",text:`Failed to update block "${Y}"`}]};let U={filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0},Q;if(_$(U))Q=await M$(W,U,C);else Q=S$(W,U);return{isError:!1,content:[{type:"text",text:JSON.stringify(Q,null,2)}]}}else if(X==="move"){let{uuid:Y,target:J,position:G="child"}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for move operation"}]};if(!J)return{isError:!0,content:[{type:"text",text:"Target is required for move operation"}]};if(W=await C("logseq.Editor.moveBlock",[Y,J,{before:G==="before",children:G==="child"}]),!W)return{isError:!0,content:[{type:"text",text:`Failed to move block "${Y}" to "${J}"`}]};return{isError:!1,content:[{type:"text",text:`Block "${Y}" moved successfully`}]}}else if(X==="remove"){let{uuid:Y,uuids:J}=$;if(!Y&&!J)return{isError:!0,content:[{type:"text",text:"UUID or uuids array is required for remove operation"}]};if(J&&Array.isArray(J)){let G=await Promise.all(J.map(async(z)=>{try{return await C("logseq.Editor.removeBlock",[z]),{uuid:z,success:!0}}catch(H){return{uuid:z,success:!1,error:H}}})),U=G.filter((z)=>z.success).length,Q=G.filter((z)=>!z.success);if(Q.length===0)return{isError:!1,content:[{type:"text",text:`Successfully removed ${U} blocks`}]};else return{isError:!0,content:[{type:"text",text:`Removed ${U} blocks, failed to remove ${Q.length}: ${Q.map((z)=>z.uuid).join(", ")}`}]}}else{if(W=await C("logseq.Editor.removeBlock",[Y]),!W)return{isError:!0,content:[{type:"text",text:`Failed to remove block "${Y}"`}]};return{isError:!1,content:[{type:"text",text:`Block "${Y}" removed successfully`}]}}}else if(X==="toggle-collapse"){let{uuid:Y,collapsed:J}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for toggle-collapse operation"}]};if(J==="toggle")W=await C("logseq.Editor.toggleBlockCollapsed",[Y]);else W=await C("logseq.Editor.setBlockCollapsed",[Y,J]);return{isError:!1,content:[{type:"text",text:`Block "${Y}" collapse state toggled successfully`}]}}else if(X==="select"){let{uuid:Y}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for select operation"}]};return W=await C("logseq.Editor.selectBlock",[Y]),{isError:!1,content:[{type:"text",text:`Block "${Y}" selected successfully`}]}}else if(X==="edit"){let{uuid:Y,pos:J}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for edit operation"}]};return W=await C("logseq.Editor.editBlock",[Y,J]),{isError:!1,content:[{type:"text",text:`Block "${Y}" is now in edit mode`}]}}else if(X==="open-sidebar"){let{uuid:Y}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for open-sidebar operation"}]};return W=await C("logseq.Editor.openInRightSidebar",[Y]),{isError:!1,content:[{type:"text",text:`Block "${Y}" opened in right sidebar`}]}}else if(X==="scroll-to"){let{uuid:Y,pageName:J}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for scroll-to operation"}]};return W=await C("logseq.Editor.scrollToBlockInPage",[J||null,Y]),{isError:!1,content:[{type:"text",text:`Scrolled to block "${Y}"${J?` in page "${J}"`:""}`}]}}else if(X==="get-property"){let{uuid:Y,propertyKey:J}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for get-property operation"}]};if(!J)return{isError:!0,content:[{type:"text",text:"Property key is required for get-property operation"}]};return W=await C("logseq.Editor.getBlockProperty",[Y,J]),{isError:!1,content:[{type:"text",text:JSON.stringify(W,null,2)}]}}else if(X==="get-properties"){let{uuid:Y}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for get-properties operation"}]};W=await C("logseq.Editor.getBlockProperties",[Y]);let J={filterInternalProps:$.filterInternalProps??!0,fields:$.fields,expandRefs:$.expandRefs??!1,expandParent:$.expandParent??!1,expandPage:$.expandPage??!1,timestampFormat:$.timestampFormat??"ms",deduplicateFields:$.deduplicateFields??!0},G;if(_$(J))G=await M$(W,J,C);else G=S$(W,J);return{isError:!1,content:[{type:"text",text:JSON.stringify(G,null,2)}]}}else if(X==="set-property"){let{uuid:Y,propertyKey:J,propertyValue:G}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for set-property operation"}]};if(!J)return{isError:!0,content:[{type:"text",text:"Property key is required for set-property operation"}]};if(W=await C("logseq.Editor.setBlockProperty",[Y,J,G]),!W)return{isError:!0,content:[{type:"text",text:`Failed to set property "${J}" for block "${Y}"`}]};return{isError:!1,content:[{type:"text",text:`Property "${J}" set successfully for block "${Y}"`}]}}else if(X==="remove-property"){let{uuid:Y,propertyKey:J}=$;if(!Y)return{isError:!0,content:[{type:"text",text:"UUID is required for remove-property operation"}]};if(!J)return{isError:!0,content:[{type:"text",text:"Property key is required for remove-property operation"}]};if(W=await C("logseq.Editor.removeBlockProperty",[Y,J]),!W)return{isError:!0,content:[{type:"text",text:`Failed to remove property "${J}" from block "${Y}"`}]};return{isError:!1,content:[{type:"text",text:`Property "${J}" removed successfully from block "${Y}"`}]}}return{isError:!0,content:[{type:"text",text:`Unknown operation: ${X}`}]}}catch(W){return console.error(`Error in block operation (${X}):`,W),{isError:!0,content:[{type:"text",text:`Error in block operation (${X}): ${W}`}]}}};function lb($){let X=jl;return $.tool("block",`Perform operations on Logseq blocks - read, write, organize, and manage properties.
|
|
43
81
|
|
|
44
82
|
OPERATIONS:
|
|
45
83
|
- get: Retrieve a block by UUID
|
|
@@ -87,7 +125,7 @@ EXAMPLES:
|
|
|
87
125
|
- uuid: "block-uuid"
|
|
88
126
|
- propertyKey: "status"
|
|
89
127
|
- propertyValue: "DONE"
|
|
90
|
-
`,{operation:
|
|
128
|
+
`,{operation:M.enum(["get","get-current","get-selected","get-siblings","create","update","move","remove","toggle-collapse","select","edit","open-sidebar","scroll-to","get-property","get-properties","set-property","remove-property"]).describe("Operation to perform on blocks"),uuid:M.string().optional().describe("UUID of the block for operations requiring a specific block"),includeChildren:M.boolean().optional().default(!0).describe("Whether to include child blocks in results"),direction:M.enum(["previous","next"]).optional().default("next").describe("Direction for sibling operations"),content:M.string().optional().describe("Content for create/update operations"),properties:M.record(M.string(),M.any()).optional().describe("Block properties as a key-value object"),target:M.string().optional().describe("Target block UUID or page name for create/move operations"),position:M.enum(["child","before","after","first","last"]).optional().default("child").describe("Position for create/move operations"),preventAutoFormat:M.boolean().optional().default(!0).describe("Prevent Logseq from auto-formatting blocks"),stripLeadingHyphen:M.boolean().optional().default(!0).describe("Remove leading hyphens from content"),blocks:M.array(M.any()).optional().describe("Array of blocks for batch operations with nesting"),keepUUID:M.boolean().optional().default(!1).describe("Keep custom UUIDs if specified in properties"),collapsed:M.union([M.boolean(),M.literal("toggle")]).optional().describe("Collapsed state for toggle-collapse"),pageName:M.string().optional().describe("Page name for scroll-to operation"),pos:M.number().optional().describe("Position for edit operation"),propertyKey:M.string().optional().describe("Property key for property operations"),propertyValue:M.any().optional().describe("Value for set-property operation"),uuids:M.array(M.string()).optional().describe("Array of block UUIDs for batch operations"),...a$},X),Il($,X),X}function Il($,X){$.tool("block-read","Read operations for Logseq blocks",{operation:M.enum(["get","get-current","get-selected","get-siblings"]).describe("Read operation to perform"),uuid:M.string().optional().describe("UUID of the block"),includeChildren:M.boolean().optional().default(!0).describe("Whether to include child blocks"),direction:M.enum(["previous","next"]).optional().default("next").describe("Direction for sibling operations"),...a$},async(W)=>{return await X(W)}),$.tool("block-write","Write operations for Logseq blocks",{operation:M.enum(["create","update"]).describe("Write operation to perform"),uuid:M.string().optional().describe("UUID of the block for update"),content:M.string().optional().describe("Content for the block"),target:M.string().optional().describe("Target block UUID or page name for create"),position:M.enum(["child","before","after","first","last"]).optional().default("child").describe("Position for create"),properties:M.record(M.string(),M.any()).optional().describe("Block properties"),preventAutoFormat:M.boolean().optional().default(!0).describe("Prevent auto-formatting"),stripLeadingHyphen:M.boolean().optional().default(!0).describe("Remove leading hyphens"),blocks:M.array(M.any()).optional().describe("Array of blocks for batch operations"),keepUUID:M.boolean().optional().default(!1).describe("Keep custom UUIDs"),...a$},async(W)=>{return await X(W)}),$.tool("block-organize","Organize operations for Logseq blocks",{operation:M.enum(["move","remove"]).describe("Organize operation to perform"),uuid:M.string().optional().describe("UUID of the block"),target:M.string().optional().describe("Target for move operation"),position:M.enum(["child","before","after"]).optional().default("child").describe("Position for move"),includeChildren:M.boolean().optional().default(!0).describe("Whether to move children"),uuids:M.array(M.string()).optional().describe("Array of block UUIDs for batch removal"),...a$},async(W)=>{return await X(W)}),$.tool("block-ui","UI operations for Logseq blocks",{operation:M.enum(["toggle-collapse","select","edit","open-sidebar","scroll-to"]).describe("UI operation to perform"),uuid:M.string().optional().describe("UUID of the block"),collapsed:M.union([M.boolean(),M.literal("toggle")]).optional().describe("Collapsed state"),pos:M.number().optional().describe("Position for edit"),pageName:M.string().optional().describe("Page name for scroll-to"),...a$},async(W)=>{return await X(W)}),$.tool("block-property","Property operations for Logseq blocks",{operation:M.enum(["get-property","get-properties","set-property","remove-property"]).describe("Property operation to perform"),uuid:M.string().optional().describe("UUID of the block"),propertyKey:M.string().optional().describe("Property key"),propertyValue:M.any().optional().describe("Property value for set"),...a$},async(W)=>{return await X(W)})}function l$($){return{content:$.content,isError:$.isError}}function mb($){$.tool("page",`Create, retrieve, and manage pages in Logseq. Pages are the top-level organization unit in Logseq that contain blocks.
|
|
91
129
|
|
|
92
130
|
IMPORTANT USAGE NOTES:
|
|
93
131
|
- Pages can have properties that provide metadata
|
|
@@ -113,13 +151,13 @@ EXAMPLES:
|
|
|
113
151
|
4) Get linked references to a page:
|
|
114
152
|
- operation: "get-linked-references"
|
|
115
153
|
- pageName: "Project Ideas"
|
|
116
|
-
`,{operation:
|
|
154
|
+
`,{operation:M.enum(["create","get","get-current","get-all","get-blocks","get-linked-references"]).describe(`Operation to perform:
|
|
117
155
|
- create: Create a new page
|
|
118
156
|
- get: Retrieve a specific page by name
|
|
119
157
|
- get-current: Get the currently active page
|
|
120
158
|
- get-all: Get a list of all pages
|
|
121
159
|
- get-blocks: Get all blocks from a specific page
|
|
122
|
-
- get-linked-references: Get references to a page from other pages`),pageName:
|
|
160
|
+
- get-linked-references: Get references to a page from other pages`),pageName:M.string().optional().describe('Name of the page. Required for page-specific operations like "get", "create", etc.'),properties:M.record(M.string(),M.any()).optional().describe('Properties for page creation/update as a key-value object. Example: { "type": "project", "status": "active" }'),includeChildren:M.boolean().optional().default(!0).describe("Whether to include page blocks in results. Set to false for better performance when blocks are not needed."),includeProperties:M.boolean().optional().default(!0).describe("Whether to include page properties in results (for get-all). Set to false for faster performance."),limit:M.number().optional().describe("Maximum number of pages to return (for get-all). Use this to avoid retrieving too many pages at once."),redirect:M.boolean().optional().default(!1).describe("Whether to redirect to the page after creation. Typically set to true when you want to show the page to the user."),...a$},async(X)=>{let{operation:W,pageName:Y,properties:J,includeChildren:G=!0,includeProperties:U=!0,limit:Q,redirect:z=!1,filterInternalProps:H,fields:j,expandRefs:O,expandParent:B,expandPage:I,timestampFormat:N,deduplicateFields:D}=X;try{if(W==="create"){if(!Y){let V=HG("pageName","create");return l$(V)}try{await C("logseq.Editor.createPage",[Y,J||{},{redirect:z}]);let K=C$(`Page "${Y}" created successfully`);return l$(K)}catch(V){let K=g$("create page",V,"Check if the page name is valid and not already in use");return l$(K)}}else if(W==="get"&&Y)try{let V=await C("logseq.Editor.getPage",[Y]);if(!V){let l=t5("Page",Y);return l$(l)}let K={...V};if(G){let l=await C("logseq.Editor.getPageBlocksTree",[Y]);K.blocks=l}let b={filterInternalProps:H??!0,fields:j,expandRefs:O,expandParent:B,expandPage:I,timestampFormat:N,deduplicateFields:D??!0},S;if(_$(b))S=await M$(K,b,C);else S=S$(K,b);let L=C$(S);return l$(L)}catch(V){let K=g$("get page",V);return l$(K)}else if(W==="get-current")try{let V=await C("logseq.Editor.getCurrentPage",[]);if(!V){let l=g$("get current page",Error("No active page found"));return l$(l)}let K={...V};if(G){let l=await C("logseq.Editor.getPageBlocksTree",[V.name]);K.blocks=l}let b={filterInternalProps:H??!0,fields:j,expandRefs:O,expandParent:B,expandPage:I,timestampFormat:N,deduplicateFields:D??!0},S;if(_$(b))S=await M$(K,b,C);else S=S$(K,b);let L=C$(S);return l$(L)}catch(V){let K=g$("get current page",V);return l$(K)}else if(W==="get-all")try{let V=await C("logseq.Editor.getAllPages",[]);if(Q&&Q>0&&Array.isArray(V)&&V.length>Q)V=V.slice(0,Q);if(U&&Array.isArray(V))V=await Promise.all(V.map(async(l)=>{try{return await C("logseq.Editor.getPage",[l.name])||l}catch(V$){return l}}));let K={filterInternalProps:H??!0,fields:j,expandRefs:O,expandParent:B,expandPage:I,timestampFormat:N,deduplicateFields:D??!0},b;if(_$(K))b=await M$(V,K,C);else b=S$(V,K);let S=C$(b);return l$(S)}catch(V){let K=g$("get all pages",V);return l$(K)}else if(W==="get-blocks"&&Y)try{if(!await C("logseq.Editor.getPage",[Y])){let l=t5("Page",Y);return l$(l)}let K=await C("logseq.Editor.getPageBlocksTree",[Y]),b={filterInternalProps:H??!0,fields:j,expandRefs:O,expandParent:B,expandPage:I,timestampFormat:N,deduplicateFields:D??!0},S;if(_$(b))S=await M$(K,b,C);else S=S$(K,b);let L=C$(S);return l$(L)}catch(V){let K=g$("get page blocks",V);return l$(K)}else if(W==="get-linked-references"&&Y)try{let V=await C("logseq.Editor.getPageLinkedReferences",[Y]);if(!V||Array.isArray(V)&&V.length===0){let L=C$(`No linked references found for page "${Y}"`);return l$(L)}let K={filterInternalProps:H??!0,fields:j,expandRefs:O,expandParent:B,expandPage:I,timestampFormat:N,deduplicateFields:D??!0},b;if(_$(K))b=await M$(V,K,C);else b=S$(V,K);let S=C$(b);return l$(S)}catch(V){let K=g$("get page linked references",V);return l$(K)}let w=g$(W?`perform page operation "${W}"`:"perform page operation",Error("Invalid operation or missing required parameters"));return l$(w)}catch(w){console.error(`Error in page operation (${W}):`,w);let V=g$(`perform page operation "${W}"`,w);return l$(V)}})}function nW($){return{content:$.content,isError:$.isError}}function ib($){$.tool("tasks",`Find and manage task blocks with specific markers (TODO, DOING, DONE, etc.) across the graph.
|
|
123
161
|
|
|
124
162
|
IMPORTANT USAGE NOTES:
|
|
125
163
|
- Tasks in Logseq are blocks with special markers like TODO, DOING, DONE
|
|
@@ -141,17 +179,87 @@ EXAMPLES:
|
|
|
141
179
|
3) Find all task blocks regardless of status:
|
|
142
180
|
- operation: "get"
|
|
143
181
|
- markers: ["TODO", "DOING", "DONE", "LATER", "NOW", "WAITING"]
|
|
144
|
-
`,{operation:
|
|
182
|
+
`,{operation:M.enum(["get"]).default("get").describe('Operation to perform on tasks. Currently only "get" is supported.'),markers:M.array(M.string()).describe(`Task markers to search for. Common examples:
|
|
145
183
|
- "TODO": Incomplete tasks
|
|
146
184
|
- "DOING": In-progress tasks
|
|
147
185
|
- "DONE": Completed tasks
|
|
148
186
|
- "LATER": Postponed tasks
|
|
149
187
|
- "NOW": Current tasks
|
|
150
|
-
- "WAITING": Blocked tasks`),includeChildren:
|
|
188
|
+
- "WAITING": Blocked tasks`),includeChildren:M.boolean().optional().default(!0).describe("Whether to include child blocks in results. Useful for seeing subtasks or additional context."),limit:M.number().optional().describe("Maximum number of tasks to return. Use this for better performance when you only need a subset of tasks."),...a$},async(X)=>{let{operation:W,markers:Y,includeChildren:J=!0,limit:G,filterInternalProps:U,fields:Q,expandRefs:z,expandParent:H,expandPage:j,timestampFormat:O,deduplicateFields:B}=X;try{if(W==="get"){if(!Y||!Array.isArray(Y)||Y.length===0){let L=HG("markers","get tasks");return nW(L)}D$(`Getting tasks with markers: ${Y.join(", ")}`);let D=`[:find (pull ?b [*])
|
|
151
189
|
:where
|
|
152
190
|
[?b :block/content ?c]
|
|
153
|
-
(or ${
|
|
154
|
-
`)})]`;
|
|
191
|
+
(or ${Y.map((L)=>`[(clojure.string/includes? ?c "${L}")]`).join(`
|
|
192
|
+
`)})]`;D$(`Executing task query: ${D}`);let w=await C("logseq.DB.datascriptQuery",[D]);D$(`Task query result count: ${Array.isArray(w)?w.length:w?1:0}`);let V=Array.isArray(w)?w:w?[w]:[];if(G&&G>0&&V.length>G)V=V.slice(0,G);if(J&&V.length>0)V=await Promise.all(V.map(async(l)=>{let V$=l.uuid||(Array.isArray(l)?l[0]?.uuid:null);if(!V$)return l;try{return await C("logseq.Editor.getBlock",[V$,{includeChildren:!0}])||l}catch(s$){return l}}));if(V.length===0){let L=C$(`No tasks found with markers: ${Y.join(", ")}`);return nW(L)}let K={filterInternalProps:U??!0,fields:Q,expandRefs:z,expandParent:H,expandPage:j,timestampFormat:O,deduplicateFields:B??!0},b;if(_$(K))b=await M$(V,K,C);else b=S$(V,K);let S=C$(b);return nW(S)}let I=g$("perform tasks operation",Error(`Invalid operation: ${W}`));return nW(I)}catch(I){console.error(`Error in tasks operation (${W}):`,I);let N=g$(`perform tasks operation "${W}"`,I);return nW(N)}})}function nb($){Ol($),Nl($),Dl($)}function Ol($){$.tool("listTags",`List all tags in the Logseq graph.
|
|
193
|
+
|
|
194
|
+
Tags in Logseq are used to categorize and organize content. This tool retrieves all available tags.
|
|
195
|
+
|
|
196
|
+
EXAMPLES:
|
|
197
|
+
1) Get all tags with basic info:
|
|
198
|
+
- expand: false
|
|
199
|
+
|
|
200
|
+
2) Get all tags with full details (parents, properties):
|
|
201
|
+
- expand: true
|
|
202
|
+
`,{expand:M.boolean().optional().default(!1).describe("When true, returns additional details for each tag (parent tags, associated properties). When false, returns just tag names and IDs."),...a$},async({expand:X=!1,filterInternalProps:W,fields:Y,expandRefs:J,expandParent:G,expandPage:U,timestampFormat:Q,deduplicateFields:z})=>{try{let j=await C("logseq.DB.datascriptQuery",[`[:find (pull ?t [*])
|
|
203
|
+
:where
|
|
204
|
+
[?t :block/type "class"]]`]);if(!j||Array.isArray(j)&&j.length===0)j=await C("logseq.DB.datascriptQuery",[`[:find ?tag
|
|
205
|
+
:where
|
|
206
|
+
[?b :block/tags ?t]
|
|
207
|
+
[?t :block/name ?tag]]`]);if(!j||Array.isArray(j)&&j.length===0){let D=C$("No tags found in the graph");return{content:D.content,isError:D.isError}}let O;if(X)O=Array.isArray(j)?j.map((D)=>{let w=Array.isArray(D)?D[0]:D;return{name:w?.name||w?.["block/name"]||w,uuid:w?.uuid||w?.["block/uuid"],properties:w?.properties||w?.["block/properties"],extends:w?.["class/extends"]||w?.extends,classProperties:w?.["class/properties"]||w?.classProperties}}):[j];else O=Array.isArray(j)?j.map((D)=>{let w=Array.isArray(D)?D[0]:D;return{name:w?.name||w?.["block/name"]||w,uuid:w?.uuid||w?.["block/uuid"]}}):[{name:j}];let B={filterInternalProps:W??!0,fields:Y,expandRefs:J,expandParent:G,expandPage:U,timestampFormat:Q,deduplicateFields:z??!0},I;if(_$(B))I=await M$(O,B,C);else I=S$(O,B);let N=C$(I);return{content:N.content,isError:N.isError}}catch(H){let j=g$("list tags",H,"This may occur if the graph uses an older Logseq version without tag support.");return{content:j.content,isError:j.isError}}})}function Nl($){$.tool("listProperties",`List all properties defined in the Logseq graph.
|
|
208
|
+
|
|
209
|
+
Properties in Logseq are key-value pairs attached to blocks and pages. This tool retrieves all property definitions.
|
|
210
|
+
|
|
211
|
+
EXAMPLES:
|
|
212
|
+
1) Get all properties with basic info:
|
|
213
|
+
- expand: false
|
|
214
|
+
|
|
215
|
+
2) Get all properties with full details (type, cardinality):
|
|
216
|
+
- expand: true
|
|
217
|
+
`,{expand:M.boolean().optional().default(!1).describe("When true, returns additional details for each property (type, cardinality, allowed values). When false, returns just property names and IDs."),...a$},async({expand:X=!1,filterInternalProps:W,fields:Y,expandRefs:J,expandParent:G,expandPage:U,timestampFormat:Q,deduplicateFields:z})=>{try{let j=await C("logseq.DB.datascriptQuery",[`[:find (pull ?p [*])
|
|
218
|
+
:where
|
|
219
|
+
[?p :block/type "property"]]`]);if(!j||Array.isArray(j)&&j.length===0)j=await C("logseq.DB.datascriptQuery",[`[:find ?prop
|
|
220
|
+
:where
|
|
221
|
+
[?b :block/properties ?props]
|
|
222
|
+
[(keys ?props) ?ks]
|
|
223
|
+
[(first ?ks) ?prop]]`]);if(!j||Array.isArray(j)&&j.length===0){let D=C$("No properties found in the graph");return{content:D.content,isError:D.isError}}let O;if(X)O=Array.isArray(j)?j.map((D)=>{let w=Array.isArray(D)?D[0]:D;return{name:w?.name||w?.["block/name"]||w,uuid:w?.uuid||w?.["block/uuid"],type:w?.["property/type"]||w?.type||"default",cardinality:w?.["property/cardinality"]||w?.cardinality||"one",classes:w?.["property/classes"]||w?.classes,description:w?.["property/description"]||w?.description}}):[j];else O=Array.isArray(j)?j.map((D)=>{let w=Array.isArray(D)?D[0]:D;return{name:w?.name||w?.["block/name"]||w,uuid:w?.uuid||w?.["block/uuid"]}}):[{name:j}];let B={filterInternalProps:W??!0,fields:Y,expandRefs:J,expandParent:G,expandPage:U,timestampFormat:Q,deduplicateFields:z??!0},I;if(_$(B))I=await M$(O,B,C);else I=S$(O,B);let N=C$(I);return{content:N.content,isError:N.isError}}catch(H){let j=g$("list properties",H,"This may occur if the graph uses an older Logseq version.");return{content:j.content,isError:j.isError}}})}function Dl($){$.tool("readAPI",`Read API - Comprehensive read-only access to Logseq graph data with API key authentication.
|
|
224
|
+
|
|
225
|
+
This tool provides a unified interface for reading various types of data from your Logseq graph.
|
|
226
|
+
It requires an API key for authentication: ANaQHMagrKGblvnqczYT3B3pNlBk1fuB
|
|
227
|
+
|
|
228
|
+
SUPPORTED READ TYPES:
|
|
229
|
+
- blocks: Get block content and metadata
|
|
230
|
+
- pages: Get page information and content
|
|
231
|
+
- tasks: Get task blocks (TODO, DOING, DONE)
|
|
232
|
+
- tags: Get all tags in the graph
|
|
233
|
+
- properties: Get all properties defined in the graph
|
|
234
|
+
- references: Get linked references between pages/blocks
|
|
235
|
+
- graph: Get general graph information
|
|
236
|
+
|
|
237
|
+
EXAMPLES:
|
|
238
|
+
1) Read all pages:
|
|
239
|
+
- type: "pages"
|
|
240
|
+
- apiKey: "ANaQHMagrKGblvnqczYT3B3pNlBk1fuB"
|
|
241
|
+
|
|
242
|
+
2) Read all tasks with specific markers:
|
|
243
|
+
- type: "tasks"
|
|
244
|
+
- apiKey: "ANaQHMagrKGblvnqczYT3B3pNlBk1fuB"
|
|
245
|
+
- filter: ["TODO", "DOING"]
|
|
246
|
+
|
|
247
|
+
3) Read specific blocks by UUID:
|
|
248
|
+
- type: "blocks"
|
|
249
|
+
- apiKey: "ANaQHMagrKGblvnqczYT3B3pNlBk1fuB"
|
|
250
|
+
- filter: ["block-uuid-1", "block-uuid-2"]
|
|
251
|
+
|
|
252
|
+
4) Read graph metadata:
|
|
253
|
+
- type: "graph"
|
|
254
|
+
- apiKey: "ANaQHMagrKGblvnqczYT3B3pNlBk1fuB"
|
|
255
|
+
`,{type:M.enum(["blocks","pages","tasks","tags","properties","references","graph"]).describe("Type of data to read from the Logseq graph"),apiKey:M.string().describe("API key for authentication (required: ANaQHMagrKGblvnqczYT3B3pNlBk1fuB)"),filter:M.array(M.string()).optional().describe("Optional filter to limit results (block UUIDs, task markers, etc.)"),includeContent:M.boolean().optional().default(!0).describe("Whether to include full content in the response"),limit:M.number().optional().describe("Maximum number of results to return")},async({type:X,apiKey:W,filter:Y,includeContent:J=!0,limit:G})=>{if(W!=="ANaQHMagrKGblvnqczYT3B3pNlBk1fuB"){let U=g$("read API",Error("Invalid API key"),"The provided API key is invalid. Use: ANaQHMagrKGblvnqczYT3B3pNlBk1fuB");return{content:U.content,isError:U.isError}}try{let U;switch(X){case"blocks":if(Y&&Y.length>0){let b=[];for(let S of Y){let L=await C("logseq.Editor.getBlock",[S,{includeChildren:J}]);if(L)b.push(L)}U=b}else{let b=await C("logseq.Editor.getAllPages",[]),S=[];for(let L of b||[]){let l=await C("logseq.Editor.getPageBlocksTree",[L.name]);if(l)S.push(...l)}U=S}break;case"pages":if(Y&&Y.length>0){let b=[];for(let S of Y){let L=await C("logseq.Editor.getPage",[S]);if(L){let l=J?await C("logseq.Editor.getPageBlocksTree",[S]):[];b.push({...L,blocks:l})}}U=b}else U=await C("logseq.Editor.getAllPages",[]);break;case"tasks":let H=`[:find (pull ?b [*])
|
|
256
|
+
:where
|
|
257
|
+
[?b :block/marker ?marker]
|
|
258
|
+
[(contains? #{${(Y&&Y.length>0?Y:["TODO","DOING","DONE","LATER","NOW","WAITING"]).map((b)=>`"${b}"`).join(" ")}} ?marker)]]`;U=await C("logseq.DB.datascriptQuery",[H]);break;case"tags":U=await C("logseq.DB.datascriptQuery",[`[:find (pull ?t [*])
|
|
259
|
+
:where
|
|
260
|
+
[?t :block/type "class"]]`]);break;case"properties":U=await C("logseq.DB.datascriptQuery",[`[:find (pull ?p [*])
|
|
261
|
+
:where
|
|
262
|
+
[?p :block/type "property"]]`]);break;case"references":let B=await C("logseq.Editor.getAllPages",[]),I=[];for(let b of B||[]){let S=await C("logseq.Editor.getPageLinkedReferences",[b.name]);if(S&&S.length>0)I.push({page:b.name,references:S})}U=I;break;case"graph":let N=await C("logseq.Editor.getAllPages",[]),D=N?.length||0,w="unknown",V="unknown";if(N&&N.length>0){let b=N[0];if(b.uuid&&b.uuid.includes("-"))w="0.10.x";V=b.name||"Logseq Graph"}U={info:{version:w,graphName:V},totalPages:D,version:w,graphName:V};break;default:let K=g$("read API",Error(`Unsupported read type: ${X}`),"Supported types: blocks, pages, tasks, tags, properties, references, graph");return{content:K.content,isError:K.isError}}if(G&&Array.isArray(U)&&U.length>G)U=U.slice(0,G);let Q=C$({type:X,data:U,count:Array.isArray(U)?U.length:1,timestamp:new Date().toISOString()});return{content:Q.content,isError:Q.isError}}catch(U){let Q=g$("read API",U,`Failed to read ${X} data. Ensure Logseq is running and the HTTP API is enabled.`);return{content:Q.content,isError:Q.isError}}})}function cb($){fb($),lb($),mb($),ib($),nb($)}function rb($){$.resource("pages",new M1("logseq:page:{pageName}",{list:async()=>{try{return{resources:(await C("logseq.Editor.getAllPages",[])).map((W)=>({uri:`logseq:page:${encodeURIComponent(W.originalName||W.name)}`,name:W.originalName||W.name,description:`Page: ${W.originalName||W.name}`,mimeType:"application/json",uriTemplate:"logseq:page:{pageName}"}))}}catch(X){return console.error("Error listing resources:",X),{resources:[]}}}}),async(X,{pageName:W})=>{try{let Y=decodeURIComponent(W);D$(`Reading page resource for: "${Y}"`);let J=await C("logseq.Editor.getPage",[Y]);if(!J)return D$(`Page not found: "${Y}"`),{contents:[{uri:X.href,mimeType:"text/plain",text:`Page "${Y}" not found`}]};D$(`Getting blocks for page: "${Y}"`);let G=await C("logseq.Editor.getPageBlocksTree",[Y]),U={...J,blocks:G};return D$(`Successfully retrieved page resource: "${Y}"`),{contents:[{uri:X.href,mimeType:"application/json",text:JSON.stringify(U,null,2)}]}}catch(Y){return console.error(`Error reading page resource (${X}):`,Y),{contents:[{uri:X.href,mimeType:"text/plain",text:`Error reading page: ${Y}`}]}}})}function pb($){$.resource("blocks",new M1("logseq:block:{uuid}",{list:void 0}),async(X,{uuid:W})=>{try{let Y=await C("logseq.Editor.getBlock",[W]);if(Y)return{contents:[{uri:X.href,mimeType:"application/json",text:JSON.stringify(Y,null,2)}]};return{contents:[]}}catch(Y){return console.error(`Error reading block resource (${X}):`,Y),{contents:[]}}})}function db($){$.resource("query",new M1("logseq:query:{query}",{list:void 0}),async(X,{query:W})=>{try{let Y=decodeURIComponent(W),J=await C("logseq.DB.q",[Y]);return{contents:[{uri:X.href,mimeType:"application/json",text:JSON.stringify(J,null,2)}]}}catch(Y){return console.error(`Error executing query resource (${X}):`,Y),{contents:[]}}})}function ob($){rb($),pb($),db($)}function tb($){$.prompt("query-tasks",{status:M.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Find all tasks with status ${X.status||"TODO"} in my Logseq graph. Here's the Datalog query to use:
|
|
155
263
|
|
|
156
264
|
\`\`\`clojure
|
|
157
265
|
{:title "Tasks with status ${X.status||"TODO"}"
|
|
@@ -159,21 +267,21 @@ EXAMPLES:
|
|
|
159
267
|
:where
|
|
160
268
|
(task ?b #{"${X.status||"TODO"}"})]
|
|
161
269
|
}
|
|
162
|
-
\`\`\``}}]})),$.prompt("extract-tasks",{source:
|
|
270
|
+
\`\`\``}}]})),$.prompt("extract-tasks",{source:M.string().optional(),status:M.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Extract all ${X.status||""} tasks from ${X.source||"my notes"} and organize them into a structured list. First search for task blocks, then analyze and group them by project, priority, or other relevant criteria.`}}]}))}function ab($){$.prompt("create-daily-note",{sections:M.string().optional()},(X)=>{return{messages:[{role:"user",content:{type:"text",text:`Create a daily note for today with the following sections:
|
|
163
271
|
|
|
164
272
|
${(X.sections||"Tasks,Notes,Journal").split(",").map((G)=>G.trim()).map((G)=>`## ${G}
|
|
165
273
|
|
|
166
274
|
`).join("")}
|
|
167
|
-
This will help me organize my day and keep track of important information.`}}]}}),$.prompt("search-knowledge",{query:
|
|
275
|
+
This will help me organize my day and keep track of important information.`}}]}}),$.prompt("search-knowledge",{query:M.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Search my Logseq knowledge base for information about "${X.query||""}". Use the search-blocks tool with the query parameter set to "${X.query||""}" to find relevant blocks, then summarize the findings.`}}]})),$.prompt("summarize-page",{pageName:M.string()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Create a concise summary of the "${X.pageName}" page. First get the full page content, analyze it, and then generate a summary that captures the main points, key insights, and important details.`}}]})),$.prompt("create-nested-content",{pageName:M.string(),content:M.string()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Create a well-structured nested hierarchy of blocks in page "${X.pageName}" from the following content:
|
|
168
276
|
|
|
169
277
|
${X.content}
|
|
170
278
|
|
|
171
|
-
Please organize this content with all section headers at the same level (as siblings) and nest related content as children underneath them. Use the create-nested-blocks tool since it's specifically designed for hierarchical content. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`}}]}))}function
|
|
279
|
+
Please organize this content with all section headers at the same level (as siblings) and nest related content as children underneath them. Use the create-nested-blocks tool since it's specifically designed for hierarchical content. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`}}]}))}function sb($){$.prompt("organize-blocks",{pageOrBlockId:M.string(),criteria:M.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Organize the blocks${X.pageOrBlockId?` in ${X.pageOrBlockId}`:""} ${X.criteria?`by ${X.criteria}`:""}. First get the blocks, then analyze them, and finally create a structured hierarchy by moving blocks appropriately.`}}]})),$.prompt("organize-blocks-as-nested",{pageName:M.string(),structure:M.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Analyze the page "${X.pageName}" and reorganize its content into a well-structured nested hierarchy of blocks.${X.structure?`
|
|
172
280
|
|
|
173
281
|
Use the following structure as a guide:
|
|
174
282
|
${X.structure}`:""}
|
|
175
283
|
|
|
176
|
-
Always use the create-nested-blocks tool which is specifically designed for hierarchical content. Keep all section headers at the same level (as siblings) and nest related content as children underneath these headers. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`}}]})),$.prompt("convert-flat-to-nested",{pageName:
|
|
284
|
+
Always use the create-nested-blocks tool which is specifically designed for hierarchical content. Keep all section headers at the same level (as siblings) and nest related content as children underneath these headers. Use page properties for page metadata instead of creating an overall page header. Never use bullet points (dashes) at the beginning of blocks.`}}]})),$.prompt("convert-flat-to-nested",{pageName:M.string(),structureCriteria:M.string().optional()},(X)=>({messages:[{role:"user",content:{type:"text",text:`Convert the flat content of page "${X.pageName}" into a proper nested structure. ${X.structureCriteria?`Use ${X.structureCriteria} as the criteria for organizing the content.`:""}
|
|
177
285
|
|
|
178
286
|
Please follow these guidelines:
|
|
179
287
|
1. Use the get-full-page tool to retrieve all content from the page
|
|
@@ -185,6 +293,6 @@ Please follow these guidelines:
|
|
|
185
293
|
7. Never use bullet points (dashes) at the beginning of blocks
|
|
186
294
|
8. Always use the create-nested-blocks tool which is specifically designed for hierarchical content
|
|
187
295
|
|
|
188
|
-
Focus on creating a clear hierarchical structure that enhances readability and navigation.`}}]}))}function
|
|
296
|
+
Focus on creating a clear hierarchical structure that enhances readability and navigation.`}}]}))}function eb($){tb($),ab($),sb($)}function Bl(){let $=new n5({name:"logseq-mcp-server",version:"1.0.0"});return cb($),ob($),eb($),$}async function $K(){try{D$("Checking Logseq API connection..."),D$(`Environment MOCK_LOGSEQ_API: ${process.env.MOCK_LOGSEQ_API}`),await C("logseq.DB.datascriptQuery",["[:find (pull ?p [*]) :where [?p :block/name] :limit 1]"]),D$("Successfully connected to Logseq API!")}catch(X){if(process.env.MOCK_LOGSEQ_API==="true")D$("In mock mode, continuing despite connection check failure");else console.error("Failed to connect to Logseq API. Make sure Logseq is running with HTTP API enabled."),console.error("Error details:",X),console.error(`
|
|
189
297
|
====== TROUBLESHOOTING STEPS ======`),console.error("1. Ensure Logseq is running before starting this application"),console.error("2. Enable the Logseq HTTP API:"),console.error(" - Open Logseq"),console.error(" - Go to Settings (using the three dots in top-right)"),console.error(" - Navigate to 'Advanced'"),console.error(" - Enable 'Developer mode'"),console.error(" - Restart Logseq"),console.error(" - Go to Settings again"),console.error(" - Find and enable 'HTTP API server'"),console.error("3. Make sure the port isn't blocked by your firewall"),console.error("4. Check that your LOGSEQ_TOKEN is correct in your .env file"),console.error(`=====================================
|
|
190
|
-
`),process.exit(1)}let $=
|
|
298
|
+
`),process.exit(1)}let $=Bl();try{let X=new r5;await $.connect(X),D$("Logseq MCP Server connected to stdio transport"),process.on("SIGINT",()=>{D$("Received SIGINT signal, shutting down server..."),process.exit(0)}),D$("Server running. Press Ctrl+C to exit.")}catch(X){console.error("Error connecting server to transport:",X),process.exit(1)}}async function wl(){try{await $K()}catch($){console.error("Fatal error:",$),process.exit(1)}}wl().catch(($)=>{console.error("Fatal error:",$),process.exit(1)});
|