@vee_stack/cli 6.3.13 → 6.3.15

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {createRequire}from'module';import v from'chalk';import*as se from'fs';import {existsSync,readFileSync,statSync,writeFileSync}from'fs';import*as Ye from'path';import {resolve,basename,join,dirname}from'path';import {fileURLToPath}from'url';import {Command}from'commander';import {execSync}from'child_process';import*as de from'crypto';import de__default from'crypto';import ni from'ora';import {glob}from'glob';import si from'cli-progress';import*as ct from'os';import {homedir}from'os';import*as j from'fs/promises';import yr from'prompts';import wi from'readline';import {gzipSync}from'zlib';import Ci from'open';import Aa from'omelette';createRequire(import.meta.url); globalThis.CLI_VERSION = "6.3.13"; globalThis.SNAPSHOT_VERSION = "6.0.0"; globalThis.ENGINE_TARGET = "6.0.0"; globalThis.AUDIT_VERSION = "6.0"; globalThis.SESSION_PAYLOAD_VERSION = "6.0.0"; globalThis.RULES_VERSION = "6.0.0"; globalThis.ANALYSIS_VERSION = "6.0.0"; globalThis.API_VERSION = "v6"; globalThis.MIN_NODE = 20;
2
+ import {createRequire}from'module';import v from'chalk';import*as se from'fs';import {existsSync,readFileSync,statSync,writeFileSync}from'fs';import*as Ye from'path';import {resolve,basename,join,dirname}from'path';import {fileURLToPath}from'url';import {Command}from'commander';import {execSync}from'child_process';import*as de from'crypto';import de__default from'crypto';import ni from'ora';import {glob}from'glob';import si from'cli-progress';import*as ct from'os';import {homedir}from'os';import*as L from'fs/promises';import yr from'prompts';import wi from'readline';import {gzipSync}from'zlib';import Ci from'open';import Aa from'omelette';createRequire(import.meta.url); globalThis.CLI_VERSION = "6.3.15"; globalThis.SNAPSHOT_VERSION = "6.0.0"; globalThis.ENGINE_TARGET = "6.0.0"; globalThis.AUDIT_VERSION = "6.0"; globalThis.SESSION_PAYLOAD_VERSION = "6.0.0"; globalThis.RULES_VERSION = "6.0.0"; globalThis.ANALYSIS_VERSION = "6.0.0"; globalThis.API_VERSION = "v6"; globalThis.MIN_NODE = 20;
3
3
  var zr=Object.defineProperty;var Hr=(t,e)=>{for(var n in e)zr(t,n,{get:e[n],enumerable:true});};var Jr=[/^--token[=\s]/i,/^-t[=\s]/i,/^--api-key[=\s]/i,/^--apikey[=\s]/i,/^--key[=\s]/i,/^--auth[=\s]/i,/^--bearer[=\s]/i,/token[=:]\s*[a-zA-Z0-9_-]{10,}/i,/api[_-]?key[=:]\s*[a-zA-Z0-9_-]{10,}/i],Xe=/vs_[a-zA-Z0-9_-]{20,}/i;function Dn(){let t=process.argv.slice(2);for(let e of t){for(let n of Jr)n.test(e)&&(console.error(v.red(`
4
4
  \u274C Security Error: Token detected in command line arguments`)),console.error(v.yellow(`
5
5
  Passing tokens via CLI arguments is not allowed.`)),console.error(v.yellow("This prevents tokens from being saved in shell history (~/.bash_history, ~/.zsh_history)")),console.error(v.gray(`
@@ -20,14 +20,14 @@ Run with DEBUG=veestack for full stack trace (sanitized)`);}process.exit(1);}),p
20
20
  `));for(let n of e)console.log(v.yellow(n));console.log(v.gray(`
21
21
  To install the official CLI:`)),console.log(v.cyan(" npm install -g veestack-tools")),console.log(v.red("\u2550".repeat(60)+`
22
22
  `)),process.exit(1);}process.env.VEESTACK_DEBUG==="true"&&console.log(v.gray(`\u2713 Official package verified: ${Qe.join(" or ")}`));}function Nt(){let t=Vn(),e=Qe.includes(t);return {packageName:t,isOfficial:e,homepage:"https://www.veestack.com",repository:"https://github.com/Mohmed-ElZehiry/VeeStack"}}var qr=[".env",".env.local",".env.development",".env.production",".env.test",".env.example",".envrc",".env.*","id_rsa","id_rsa.pub","id_dsa","id_dsa.pub","id_ecdsa","id_ecdsa.pub","id_ed25519","id_ed25519.pub","*.pem","*.key","*.p12","*.pfx","*.crt","*.cer","*.der","credentials",".aws/credentials",".aws/config",".docker/config.json","kubeconfig","*.kubeconfig",".npmrc",".yarnrc",".pnpmrc",".git-credentials","*.sqlite","*.sqlite3","*.db","secrets/","secret/",".secrets/","config.json","settings.json","local.settings.json"],Yr=["veestack.config.json","package.json","tsconfig.json","jsconfig.json",".eslintrc.json",".prettierrc.json","README.md"],Xr=[{name:"AWS Access Key ID",pattern:/AKIA[0-9A-Z]{16}/g,severity:"critical",description:"AWS Access Key ID detected"},{name:"AWS Secret Access Key",pattern:/['"\s][A-Za-z0-9/+=]{40}['"\s]/g,severity:"critical",description:"Potential AWS Secret Key detected"},{name:"Private Key",pattern:/-----BEGIN (RSA |DSA |EC |OPENSSH |PGP )?PRIVATE KEY-----/g,severity:"critical",description:"Private key detected"},{name:"JWT Token",pattern:/eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*/g,severity:"high",description:"JWT token detected"},{name:"Bearer Token",pattern:/Bearer\s+[a-zA-Z0-9_-]{20,}/gi,severity:"high",description:"Bearer token detected"},{name:"API Key",pattern:/(?:api[_-]?key|apikey|api_token|apiToken)['"\s]*[:=]\s*['"][a-zA-Z0-9_-]{16,}['"]/gi,severity:"high",description:"API key detected"},{name:"Password in URL",pattern:/[a-zA-Z]+:\/\/[^\s:@]+:[^\s:@]+@[^\s]+/g,severity:"high",description:"Password in URL detected"},{name:"Password Assignment",pattern:/(?:password|passwd|pwd)\s*[=:]\s*['"][^'"]{8,}['"]/gi,severity:"medium",description:"Password assignment detected"},{name:"GitHub Token",pattern:/gh[pousr]_[A-Za-z0-9_]{36,}/g,severity:"critical",description:"GitHub token detected"},{name:"Slack Token",pattern:/xox[baprs]-[0-9]{10,13}-[0-9]{10,13}(-[a-zA-Z0-9]{24})?/g,severity:"critical",description:"Slack token detected"},{name:"Generic Secret",pattern:/(?:secret|token|key)\s*[=:]\s*['"][a-zA-Z0-9_-]{20,}['"]/gi,severity:"medium",description:"Potential secret detected"},{name:"Connection String",pattern:/(?:mongodb|postgres|mysql|redis|amqp):\/\/[^\s]+/gi,severity:"high",description:"Database connection string detected"},{name:"VeeStack Token",pattern:/vs_[a-zA-Z0-9_-]{20,}/g,severity:"critical",description:"VeeStack token detected"}];function Un(t){let e=t.replace(/\\/g,"/").toLowerCase(),n=Ye.basename(e);for(let r of Yr)if(n===r.toLowerCase())return false;for(let r of qr){if(n===r.toLowerCase())return true;if(r.includes("*")){let s=r.toLowerCase().replace(/\./g,"\\.").replace(/\*/g,".*"),o=new RegExp(s);if(o.test(n)||o.test(e))return true}if(e.includes(r.toLowerCase().replace("*","")))return true}return false}function Qr(t,e){let n=[],r=e.split(`
23
- `);for(let s of Xr){s.pattern.lastIndex=0;for(let o=0;o<r.length;o++){let a=r[o],i;for(;(i=s.pattern.exec(a))!==null;)n.push({filePath:t,type:"secret_content",secretName:s.name,severity:s.severity,description:s.description,lineNumber:o+1,match:i[0].substring(0,20)+"..."});s.pattern.lastIndex=0;}}return n}async function es(t){let e=[];if(Un(t))return e.push({filePath:t,type:"sensitive_file",secretName:"Sensitive File",severity:"critical",description:`Sensitive file type detected: ${Ye.basename(t)}`}),e;try{if(se.statSync(t).size>1024*1024)return e;let r=se.readFileSync(t,"utf-8"),s=Qr(t,r);e.push(...s);}catch{}return e}async function Fn(t,e){let n=[];for(let i of e){let c=Ye.join(t,i),l=await es(c);for(let d of l)d.filePath=i,n.push(d);}let r=n.filter(i=>i.severity==="critical").length,s=n.filter(i=>i.severity==="high").length,o=n.filter(i=>i.severity==="medium").length,a=n.filter(i=>i.severity==="low").length;return {totalFiles:e.length,secretsFound:n.length,criticalCount:r,highCount:s,mediumCount:o,lowCount:a,results:n}}function Bn(t){let e=[],n=[];for(let r of t)Un(r)?n.push(r):e.push(r);return {safe:e,blocked:n}}var nn=(t=>typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>e[n]}):t)(function(t){throw Error('Dynamic require of "'+t+'" is not supported')}),zn=typeof process<"u"&&process.versions?.node,ts=zn&&(Array.isArray(process.argv)&&process.argv.includes("--debug")||process.env.VEESTACK_DEBUG==="1"),rn=globalThis||{},sn=null;if(zn)try{let t=function(){let A=d,O=0;for(;A!==i(A)&&O<10;){let C=a(A,"package.json");try{if(o(C)){let R=JSON.parse(s(C,"utf-8"));if(R.name==="vee_stack")return R}}catch{}A=i(A),O++;}return null};ns=t;let e=nn("fs"),n=nn("path"),r=nn("url"),{readFileSync:s,existsSync:o}=e,{join:a,dirname:i}=n,{fileURLToPath:c}=r,l=c(import.meta.url),d=i(l);sn=t();}catch{ts&&console.debug("[veestack:debug] Failed to load package.json dynamically, using defaults");}var ns,_e=sn?.versions||rn.VEESTACK_VERSIONS||{},ee=sn?.version||rn.VEESTACK_VERSION||rn.CLI_VERSION||"unknown",on=`vs_cli_v${ee}`;_e.snapshot||"unknown";_e.engine_target||"unknown";_e.audit||"unknown";_e.session_payload||"unknown";_e.rules||"unknown";_e.analysis||"unknown";_e.api||"unknown";_e.min_node||"unknown";var f={};Hr(f,{BRAND:()=>Ps,DIRTY:()=>be,EMPTY_PATH:()=>ds,INVALID:()=>h,NEVER:()=>vo,OK:()=>J,ParseStatus:()=>z,Schema:()=>_,ZodAny:()=>Ee,ZodArray:()=>he,ZodBigInt:()=>Ce,ZodBoolean:()=>Ie,ZodBranded:()=>yt,ZodCatch:()=>Fe,ZodDate:()=>Ne,ZodDefault:()=>Ue,ZodDiscriminatedUnion:()=>$t,ZodEffects:()=>re,ZodEnum:()=>Ve,ZodError:()=>K,ZodFirstPartyTypeKind:()=>y,ZodFunction:()=>Mt,ZodIntersection:()=>je,ZodIssueCode:()=>u,ZodLazy:()=>Le,ZodLiteral:()=>$e,ZodMap:()=>ot,ZodNaN:()=>at,ZodNativeEnum:()=>Me,ZodNever:()=>oe,ZodNull:()=>Pe,ZodNullable:()=>ue,ZodNumber:()=>Re,ZodObject:()=>W,ZodOptional:()=>te,ZodParsedType:()=>g,ZodPipeline:()=>vt,ZodPromise:()=>Te,ZodReadonly:()=>Be,ZodRecord:()=>Vt,ZodSchema:()=>_,ZodSet:()=>it,ZodString:()=>Se,ZodSymbol:()=>rt,ZodTransformer:()=>re,ZodTuple:()=>le,ZodType:()=>_,ZodUndefined:()=>Oe,ZodUnion:()=>De,ZodUnknown:()=>me,ZodVoid:()=>st,addIssueToContext:()=>p,any:()=>Bs,array:()=>Gs,bigint:()=>$s,boolean:()=>er,coerce:()=>yo,custom:()=>Yn,date:()=>Vs,datetimeRegex:()=>Wn,defaultErrorMap:()=>pe,discriminatedUnion:()=>qs,effect:()=>co,enum:()=>oo,function:()=>no,getErrorMap:()=>et,getParsedType:()=>ce,instanceof:()=>js,intersection:()=>Ys,isAborted:()=>jt,isAsync:()=>tt,isDirty:()=>Lt,isValid:()=>we,late:()=>Ds,lazy:()=>ro,literal:()=>so,makeIssue:()=>ht,map:()=>eo,nan:()=>Ls,nativeEnum:()=>io,never:()=>Hs,null:()=>Fs,nullable:()=>uo,number:()=>Qn,object:()=>Zs,objectUtil:()=>ln,oboolean:()=>ho,onumber:()=>mo,optional:()=>lo,ostring:()=>go,pipeline:()=>po,preprocess:()=>fo,promise:()=>ao,quotelessJson:()=>cs,record:()=>Qs,set:()=>to,setErrorMap:()=>us,strictObject:()=>Ks,string:()=>Xn,symbol:()=>Ms,transformer:()=>co,tuple:()=>Xs,undefined:()=>Us,union:()=>Ws,unknown:()=>zs,util:()=>S,void:()=>Js});var S;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{let o={};for(let a of s)o[a]=a;return o},t.getValidEnumValues=s=>{let o=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(let i of o)a[i]=s[i];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(let a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o;})(S||(S={}));var ln;(function(t){t.mergeShapes=(e,n)=>({...e,...n});})(ln||(ln={}));var g=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ce=t=>{switch(typeof t){case "undefined":return g.undefined;case "string":return g.string;case "number":return Number.isNaN(t)?g.nan:g.number;case "boolean":return g.boolean;case "function":return g.function;case "bigint":return g.bigint;case "symbol":return g.symbol;case "object":return Array.isArray(t)?g.array:t===null?g.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?g.promise:typeof Map<"u"&&t instanceof Map?g.map:typeof Set<"u"&&t instanceof Set?g.set:typeof Date<"u"&&t instanceof Date?g.date:g.object;default:return g.unknown}};var u=S.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"]),cs=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),K=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r];},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r];};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e;}format(e){let n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else {let i=r,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(n(a))):i[l]=i[l]||{_errors:[]},i=i[l],c++;}}};return s(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];n[o]=n[o]||[],n[o].push(e(s));}else r.push(e(s));return {formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};K.create=t=>new K(t);var ls=(t,e)=>{let n;switch(t.code){case u.invalid_type:t.received===g.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case u.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,S.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:n=`Unrecognized key(s) in object: ${S.joinValues(t.keys,", ")}`;break;case u.invalid_union:n="Invalid input";break;case u.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${S.joinValues(t.options)}`;break;case u.invalid_enum_value:n=`Invalid enum value. Expected ${S.joinValues(t.options)}, received '${t.received}'`;break;case u.invalid_arguments:n="Invalid function arguments";break;case u.invalid_return_type:n="Invalid function return type";break;case u.invalid_date:n="Invalid date";break;case u.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:S.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case u.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case u.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case u.custom:n="Invalid input";break;case u.invalid_intersection_types:n="Intersection results could not be merged";break;case u.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case u.not_finite:n="Number must be finite";break;default:n=e.defaultError,S.assertNever(t);}return {message:n}},pe=ls;var Hn=pe;function us(t){Hn=t;}function et(){return Hn}var ht=t=>{let{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return {...s,path:o,message:s.message};let i="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)i=l(a,{data:e,defaultError:i}).message;return {...s,path:o,message:i}},ds=[];function p(t,e){let n=et(),r=ht({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===pe?void 0:pe].filter(s=>!!s)});t.common.issues.push(r);}var z=class t{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,n){let r=[];for(let s of n){if(s.status==="aborted")return h;s.status==="dirty"&&e.dirty(),r.push(s.value);}return {status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let s of n){let o=await s.key,a=await s.value;r.push({key:o,value:a});}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let s of n){let{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return h;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value);}return {status:e.value,value:r}}},h=Object.freeze({status:"aborted"}),be=t=>({status:"dirty",value:t}),J=t=>({status:"valid",value:t}),jt=t=>t.status==="aborted",Lt=t=>t.status==="dirty",we=t=>t.status==="valid",tt=t=>typeof Promise<"u"&&t instanceof Promise;var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message;})(m||(m={}));var ne=class{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s;}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Jn=(t,e)=>{if(we(e))return {success:true,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:false,get error(){if(this._error)return this._error;let n=new K(t.common.issues);return this._error=n,this._error}}};function k(t){if(!t)return {};let{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,i)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??r??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??n??i.defaultError}},description:s}}var _=class{get description(){return this._def.description}_getType(e){return ce(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new z,ctx:{common:e.parent.common,data:e.data,parsedType:ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(tt(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??false,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Jn(r,s)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return we(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=true),n.common={issues:[],async:true};}return this._parseAsync({data:e,path:[],parent:n}).then(r=>we(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:true},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(tt(s)?s:Promise.resolve(s));return Jn(r,o)}refine(e,n){let r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{let a=e(s),i=()=>o.addIssue({code:u.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?true:(i(),false)):a?true:(i(),false)})}refinement(e,n){return this._refinement((r,s)=>e(r)?true:(s.addIssue(typeof n=="function"?n(r,s):n),false))}_refinement(e){return new re({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:n=>this["~validate"](n)};}optional(){return te.create(this,this._def)}nullable(){return ue.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return he.create(this)}promise(){return Te.create(this,this._def)}or(e){return De.create([this,e],this._def)}and(e){return je.create(this,e,this._def)}transform(e){return new re({...k(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ue({...k(this._def),innerType:this,defaultValue:n,typeName:y.ZodDefault})}brand(){return new yt({typeName:y.ZodBranded,type:this,...k(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Fe({...k(this._def),innerType:this,catchValue:n,typeName:y.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vt.create(this,e)}readonly(){return Be.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fs=/^c[^\s-]{8,}$/i,ps=/^[0-9a-z]+$/,gs=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ms=/^[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,hs=/^[a-z0-9_-]{21}$/i,ys=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vs=/^[-+]?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)?)??$/,ks=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_s="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",un,ws=/^(?:(?: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])$/,Ss=/^(?:(?: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])$/,Es=/^(([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]))$/,Ts=/^(([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])$/,xs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,As=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Zn="((\\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])))",bs=new RegExp(`^${Zn}$`);function Kn(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Rs(t){return new RegExp(`^${Kn(t)}$`)}function Wn(t){let e=`${Zn}T${Kn(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Cs(t,e){return !!((e==="v4"||!e)&&ws.test(t)||(e==="v6"||!e)&&Es.test(t))}function Is(t,e){if(!ys.test(t))return false;try{let[n]=t.split(".");if(!n)return !1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return !(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return false}}function Ns(t,e){return !!((e==="v4"||!e)&&Ss.test(t)||(e==="v6"||!e)&&Ts.test(t))}var Se=class t extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.string,received:o.parsedType}),h}let r=new z,s;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,i=e.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(e,s),a?p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:true,message:o.message}):i&&p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:true,message:o.message}),r.dirty());}else if(o.kind==="email")ks.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"email",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")un||(un=new RegExp(_s,"u")),un.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"emoji",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")ms.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"uuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")hs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"nanoid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")fs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")ps.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid2",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")gs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ulid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data);}catch{s=this._getOrReturnCtx(e,s),p(s,{validation:"url",code:u.invalid_string,message:o.message}),r.dirty();}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"regex",code:u.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Wn(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?bs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Rs(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?vs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"duration",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Cs(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ip",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Is(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"jwt",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Ns(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cidr",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?xs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?As.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64url",code:u.invalid_string,message:o.message}),r.dirty()):S.assertNever(o);return {status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:u.invalid_string,...m.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??false,local:e?.local??false,...m.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...m.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...m.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...m.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...m.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...m.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...m.errToObj(n)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return !!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return !!this._def.checks.find(e=>e.kind==="date")}get isTime(){return !!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return !!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return !!this._def.checks.find(e=>e.kind==="email")}get isURL(){return !!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return !!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return !!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return !!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return !!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return !!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return !!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return !!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return !!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return !!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return !!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Se.create=t=>new Se({checks:[],typeName:y.ZodString,coerce:t?.coerce??false,...k(t)});function Os(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}var Re=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf;}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.number,received:o.parsedType}),h}let r,s=new z;for(let o of this._def.checks)o.kind==="int"?S.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="multipleOf"?Os(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_finite,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&S.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return true;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);}return Number.isFinite(n)&&Number.isFinite(e)}};Re.create=t=>new Re({checks:[],typeName:y.ZodNumber,coerce:t?.coerce||false,...k(t)});var Ce=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte;}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data);}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let r,s=new z;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.bigint,received:n.parsedType}),h}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ce.create=t=>new Ce({checks:[],typeName:y.ZodBigInt,coerce:t?.coerce??false,...k(t)});var Ie=class extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.boolean,received:r.parsedType}),h}return J(e.data)}};Ie.create=t=>new Ie({typeName:y.ZodBoolean,coerce:t?.coerce||false,...k(t)});var Ne=class t extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.date,received:o.parsedType}),h}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_date}),h}let r=new z,s;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,message:o.message,inclusive:true,exact:false,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,message:o.message,inclusive:true,exact:false,maximum:o.value,type:"date"}),r.dirty()):S.assertNever(o);return {status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ne.create=t=>new Ne({checks:[],coerce:t?.coerce||false,typeName:y.ZodDate,...k(t)});var rt=class extends _{_parse(e){if(this._getType(e)!==g.symbol){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.symbol,received:r.parsedType}),h}return J(e.data)}};rt.create=t=>new rt({typeName:y.ZodSymbol,...k(t)});var Oe=class extends _{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.undefined,received:r.parsedType}),h}return J(e.data)}};Oe.create=t=>new Oe({typeName:y.ZodUndefined,...k(t)});var Pe=class extends _{_parse(e){if(this._getType(e)!==g.null){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.null,received:r.parsedType}),h}return J(e.data)}};Pe.create=t=>new Pe({typeName:y.ZodNull,...k(t)});var Ee=class extends _{constructor(){super(...arguments),this._any=true;}_parse(e){return J(e.data)}};Ee.create=t=>new Ee({typeName:y.ZodAny,...k(t)});var me=class extends _{constructor(){super(...arguments),this._unknown=true;}_parse(e){return J(e.data)}};me.create=t=>new me({typeName:y.ZodUnknown,...k(t)});var oe=class extends _{_parse(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.never,received:n.parsedType}),h}};oe.create=t=>new oe({typeName:y.ZodNever,...k(t)});var st=class extends _{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.void,received:r.parsedType}),h}return J(e.data)}};st.create=t=>new st({typeName:y.ZodVoid,...k(t)});var he=class t extends _{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==g.array)return p(n,{code:u.invalid_type,expected:g.array,received:n.parsedType}),h;if(s.exactLength!==null){let a=n.data.length>s.exactLength.value,i=n.data.length<s.exactLength.value;(a||i)&&(p(n,{code:a?u.too_big:u.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:true,exact:true,message:s.exactLength.message}),r.dirty());}if(s.minLength!==null&&n.data.length<s.minLength.value&&(p(n,{code:u.too_small,minimum:s.minLength.value,type:"array",inclusive:true,exact:false,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(p(n,{code:u.too_big,maximum:s.maxLength.value,type:"array",inclusive:true,exact:false,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,i)=>s.type._parseAsync(new ne(n,a,n.path,i)))).then(a=>z.mergeArray(r,a));let o=[...n.data].map((a,i)=>s.type._parseSync(new ne(n,a,n.path,i)));return z.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:m.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:m.toString(n)}})}nonempty(e){return this.min(1,e)}};he.create=(t,e)=>new he({type:t,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...k(e)});function nt(t){if(t instanceof W){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=te.create(nt(r));}return new W({...t._def,shape:()=>e})}else return t instanceof he?new he({...t._def,type:nt(t.element)}):t instanceof te?te.create(nt(t.unwrap())):t instanceof ue?ue.create(nt(t.unwrap())):t instanceof le?le.create(t.items.map(e=>nt(e))):t}var W=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 e=this._def.shape(),n=S.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==g.object){let l=this._getOrReturnCtx(e);return p(l,{code:u.invalid_type,expected:g.object,received:l.parsedType}),h}let{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof oe&&this._def.unknownKeys==="strip"))for(let l in s.data)a.includes(l)||i.push(l);let c=[];for(let l of a){let d=o[l],A=s.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new ne(s,A,s.path,l)),alwaysSet:l in s.data});}if(this._def.catchall instanceof oe){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of i)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(l==="strict")i.length>0&&(p(s,{code:u.unrecognized_keys,keys:i}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else {let l=this._def.catchall;for(let d of i){let A=s.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new ne(s,A,s.path,d)),alwaysSet:d in s.data});}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of c){let A=await d.key,O=await d.value;l.push({key:A,value:O,alwaysSet:d.alwaysSet});}return l}).then(l=>z.mergeObjectSync(r,l)):z.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:m.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of S.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of S.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return nt(this)}partial(e){let n={};for(let r of S.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional();}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of S.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else {let o=this.shape[r];for(;o instanceof te;)o=o._def.innerType;n[r]=o;}return new t({...this._def,shape:()=>n})}keyof(){return qn(S.objectKeys(this.shape))}};W.create=(t,e)=>new W({shape:()=>t,unknownKeys:"strip",catchall:oe.create(),typeName:y.ZodObject,...k(e)});W.strictCreate=(t,e)=>new W({shape:()=>t,unknownKeys:"strict",catchall:oe.create(),typeName:y.ZodObject,...k(e)});W.lazycreate=(t,e)=>new W({shape:t,unknownKeys:"strip",catchall:oe.create(),typeName:y.ZodObject,...k(e)});var De=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(i=>new K(i.ctx.common.issues));return p(n,{code:u.invalid_union,unionErrors:a}),h}if(n.common.async)return Promise.all(r.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return {result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o,a=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:l}),l.common.issues.length&&a.push(l.common.issues);}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(c=>new K(c));return p(n,{code:u.invalid_union,unionErrors:i}),h}}get options(){return this._def.options}};De.create=(t,e)=>new De({options:t,typeName:y.ZodUnion,...k(e)});var ge=t=>t instanceof Le?ge(t.schema):t instanceof re?ge(t.innerType()):t instanceof $e?[t.value]:t instanceof Ve?t.options:t instanceof Me?S.objectValues(t.enum):t instanceof Ue?ge(t._def.innerType):t instanceof Oe?[void 0]:t instanceof Pe?[null]:t instanceof te?[void 0,...ge(t.unwrap())]:t instanceof ue?[null,...ge(t.unwrap())]:t instanceof yt||t instanceof Be?ge(t.unwrap()):t instanceof Fe?ge(t._def.innerType):[],$t=class t extends _{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.object)return p(n,{code:u.invalid_type,expected:g.object,received:n.parsedType}),h;let r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let s=new Map;for(let o of n){let a=ge(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of a){if(s.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,o);}}return new t({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...k(r)})}};function dn(t,e){let n=ce(t),r=ce(e);if(t===e)return {valid:true,data:t};if(n===g.object&&r===g.object){let s=S.objectKeys(e),o=S.objectKeys(t).filter(i=>s.indexOf(i)!==-1),a={...t,...e};for(let i of o){let c=dn(t[i],e[i]);if(!c.valid)return {valid:false};a[i]=c.data;}return {valid:true,data:a}}else if(n===g.array&&r===g.array){if(t.length!==e.length)return {valid:false};let s=[];for(let o=0;o<t.length;o++){let a=t[o],i=e[o],c=dn(a,i);if(!c.valid)return {valid:false};s.push(c.data);}return {valid:true,data:s}}else return n===g.date&&r===g.date&&+t==+e?{valid:true,data:t}:{valid:false}}var je=class extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(jt(o)||jt(a))return h;let i=dn(o.value,a.value);return i.valid?((Lt(o)||Lt(a))&&n.dirty(),{status:n.value,value:i.data}):(p(r,{code:u.invalid_intersection_types}),h)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};je.create=(t,e,n)=>new je({left:t,right:e,typeName:y.ZodIntersection,...k(n)});var le=class t extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.array)return p(r,{code:u.invalid_type,expected:g.array,received:r.parsedType}),h;if(r.data.length<this._def.items.length)return p(r,{code:u.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"}),h;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:u.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"}),n.dirty());let o=[...r.data].map((a,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new ne(r,a,r.path,i)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>z.mergeArray(n,a)):z.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};le.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new le({items:t,typeName:y.ZodTuple,rest:null,...k(e)})};var Vt=class t extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return p(r,{code:u.invalid_type,expected:g.object,received:r.parsedType}),h;let s=[],o=this._def.keyType,a=this._def.valueType;for(let i in r.data)s.push({key:o._parse(new ne(r,i,r.path,i)),value:a._parse(new ne(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?z.mergeObjectAsync(n,s):z.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof _?new t({keyType:e,valueType:n,typeName:y.ZodRecord,...k(r)}):new t({keyType:Se.create(),valueType:e,typeName:y.ZodRecord,...k(n)})}},ot=class extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.map)return p(r,{code:u.invalid_type,expected:g.map,received:r.parsedType}),h;let s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([i,c],l)=>({key:s._parse(new ne(r,i,r.path,[l,"key"])),value:o._parse(new ne(r,c,r.path,[l,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}})}else {let i=new Map;for(let c of a){let l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}}}};ot.create=(t,e,n)=>new ot({valueType:e,keyType:t,typeName:y.ZodMap,...k(n)});var it=class t extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.set)return p(r,{code:u.invalid_type,expected:g.set,received:r.parsedType}),h;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(p(r,{code:u.too_small,minimum:s.minSize.value,type:"set",inclusive:true,exact:false,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(p(r,{code:u.too_big,maximum:s.maxSize.value,type:"set",inclusive:true,exact:false,message:s.maxSize.message}),n.dirty());let o=this._def.valueType;function a(c){let l=new Set;for(let d of c){if(d.status==="aborted")return h;d.status==="dirty"&&n.dirty(),l.add(d.value);}return {status:n.value,value:l}}let i=[...r.data.values()].map((c,l)=>o._parse(new ne(r,c,r.path,l)));return r.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(e,n){return new t({...this._def,minSize:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:m.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};it.create=(t,e)=>new it({valueType:t,minSize:null,maxSize:null,typeName:y.ZodSet,...k(e)});var Mt=class t extends _{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.function)return p(n,{code:u.invalid_type,expected:g.function,received:n.parsedType}),h;function r(i,c){return ht({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,et(),pe].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:c}})}function s(i,c){return ht({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,et(),pe].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Te){let i=this;return J(async function(...c){let l=new K([]),d=await i._def.args.parseAsync(c,o).catch(C=>{throw l.addIssue(r(c,C)),l}),A=await Reflect.apply(a,this,d);return await i._def.returns._def.type.parseAsync(A,o).catch(C=>{throw l.addIssue(s(A,C)),l})})}else {let i=this;return J(function(...c){let l=i._def.args.safeParse(c,o);if(!l.success)throw new K([r(c,l.error)]);let d=Reflect.apply(a,this,l.data),A=i._def.returns.safeParse(d,o);if(!A.success)throw new K([s(d,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:le.create(e).rest(me.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||le.create([]).rest(me.create()),returns:n||me.create(),typeName:y.ZodFunction,...k(r)})}},Le=class extends _{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Le.create=(t,e)=>new Le({getter:t,typeName:y.ZodLazy,...k(e)});var $e=class extends _{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:u.invalid_literal,expected:this._def.value}),h}return {status:"valid",value:e.data}}get value(){return this._def.value}};$e.create=(t,e)=>new $e({value:t,typeName:y.ZodLiteral,...k(e)});function qn(t,e){return new Ve({values:t,typeName:y.ZodEnum,...k(e)})}var Ve=class t extends _{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:S.joinValues(r),received:n.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:u.invalid_enum_value,options:r}),h}return J(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Ve.create=qn;var Me=class extends _{_parse(e){let n=S.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==g.string&&r.parsedType!==g.number){let s=S.objectValues(n);return p(r,{expected:S.joinValues(s),received:r.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(S.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=S.objectValues(n);return p(r,{received:r.data,code:u.invalid_enum_value,options:s}),h}return J(e.data)}get enum(){return this._def.values}};Me.create=(t,e)=>new Me({values:t,typeName:y.ZodNativeEnum,...k(e)});var Te=class extends _{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.promise&&n.common.async===false)return p(n,{code:u.invalid_type,expected:g.promise,received:n.parsedType}),h;let r=n.parsedType===g.promise?n.data:Promise.resolve(n.data);return J(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Te.create=(t,e)=>new Te({type:t,typeName:y.ZodPromise,...k(e)});var re=class extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{p(r,a),a.fatal?n.abort():n.dirty();},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async i=>{if(n.value==="aborted")return h;let c=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});return c.status==="aborted"?h:c.status==="dirty"?be(c.value):n.value==="dirty"?be(c.value):c});{if(n.value==="aborted")return h;let i=this._def.schema._parseSync({data:a,path:r.path,parent:r});return i.status==="aborted"?h:i.status==="dirty"?be(i.value):n.value==="dirty"?be(i.value):i}}if(s.type==="refinement"){let a=i=>{let c=s.refinement(i,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===false){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value).then(()=>({status:n.value,value:i.value}))))}if(s.type==="transform")if(r.common.async===false){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!we(a))return h;let i=s.transform(a.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return {status:n.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>we(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:n.value,value:i})):h);S.assertNever(s);}};re.create=(t,e,n)=>new re({schema:t,typeName:y.ZodEffects,effect:e,...k(n)});re.createWithPreprocess=(t,e,n)=>new re({schema:e,effect:{type:"preprocess",transform:t},typeName:y.ZodEffects,...k(n)});var te=class extends _{_parse(e){return this._getType(e)===g.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};te.create=(t,e)=>new te({innerType:t,typeName:y.ZodOptional,...k(e)});var ue=class extends _{_parse(e){return this._getType(e)===g.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ue.create=(t,e)=>new ue({innerType:t,typeName:y.ZodNullable,...k(e)});var Ue=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===g.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ue.create=(t,e)=>new Ue({innerType:t,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});var Fe=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return tt(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new K(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new K(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Fe.create=(t,e)=>new Fe({innerType:t,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});var at=class extends _{_parse(e){if(this._getType(e)!==g.nan){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.nan,received:r.parsedType}),h}return {status:"valid",value:e.data}}};at.create=t=>new at({typeName:y.ZodNaN,...k(t)});var Ps=Symbol("zod_brand"),yt=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},vt=class t extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return (async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?h:o.status==="dirty"?(n.dirty(),be(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?h:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:y.ZodPipeline})}},Be=class extends _{_parse(e){let n=this._def.innerType._parse(e),r=s=>(we(s)&&(s.value=Object.freeze(s.value)),s);return tt(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}};Be.create=(t,e)=>new Be({innerType:t,typeName:y.ZodReadonly,...k(e)});function Gn(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Yn(t,e={},n){return t?Ee.create().superRefine((r,s)=>{let o=t(r);if(o instanceof Promise)return o.then(a=>{if(!a){let i=Gn(e,r),c=i.fatal??n??true;s.addIssue({code:"custom",...i,fatal:c});}});if(!o){let a=Gn(e,r),i=a.fatal??n??true;s.addIssue({code:"custom",...a,fatal:i});}}):Ee.create()}var Ds={object:W.lazycreate},y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly";})(y||(y={}));var js=(t,e={message:`Input not instance of ${t.name}`})=>Yn(n=>n instanceof t,e),Xn=Se.create,Qn=Re.create,Ls=at.create,$s=Ce.create,er=Ie.create,Vs=Ne.create,Ms=rt.create,Us=Oe.create,Fs=Pe.create,Bs=Ee.create,zs=me.create,Hs=oe.create,Js=st.create,Gs=he.create,Zs=W.create,Ks=W.strictCreate,Ws=De.create,qs=$t.create,Ys=je.create,Xs=le.create,Qs=Vt.create,eo=ot.create,to=it.create,no=Mt.create,ro=Le.create,so=$e.create,oo=Ve.create,io=Me.create,ao=Te.create,co=re.create,lo=te.create,uo=ue.create,fo=re.createWithPreprocess,po=vt.create,go=()=>Xn().optional(),mo=()=>Qn().optional(),ho=()=>er().optional(),yo={string:(t=>Se.create({...t,coerce:true})),number:(t=>Re.create({...t,coerce:true})),boolean:(t=>Ie.create({...t,coerce:true})),bigint:(t=>Ce.create({...t,coerce:true})),date:(t=>Ne.create({...t,coerce:true}))};var vo=h;var ko={api:{rateLimit:{windowMs:900*1e3,maxRequests:100}}};f.object({snapshot_version:f.string(),engine_target_version:f.string(),project_id:f.string(),generated_at:f.string(),root_path_hash:f.string(),metadata:f.object({total_files:f.number().int().nonnegative(),total_dependencies:f.number().int().nonnegative(),total_size_bytes:f.number().int().nonnegative(),total_lines:f.number().int().nonnegative(),max_directory_depth:f.number().int().nonnegative(),language_breakdown:f.record(f.string(),f.number().int().nonnegative())}),files:f.array(f.object({id:f.string(),path_hash:f.string(),depth:f.number().int().nonnegative(),size_bytes:f.number().int().nonnegative(),estimated_lines:f.number().int().nonnegative(),extension:f.string(),is_binary:f.boolean(),import_count:f.number().int().nonnegative().optional(),function_count:f.number().int().nonnegative().optional(),class_count:f.number().int().nonnegative().optional()})),dependencies:f.array(f.object({id:f.string(),name_hash:f.string(),major_version:f.number().int().nonnegative(),minor_version:f.number().int().nonnegative(),category:f.enum(["dev","prod","peer"])}))});f.object({name:f.string().min(1).max(100)});f.object({analysis_version:f.string(),snapshot_schema_version:f.string(),total_score:f.number().min(0).max(100),severity_band:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),engines:f.array(f.object({engine_name:f.string(),score_impact:f.number(),risk_level:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),metrics:f.record(f.number()),findings:f.array(f.object({rule_id:f.string(),title:f.string(),message:f.string(),severity:f.enum(["CRITICAL","HIGH","MEDIUM","LOW"]),category:f.enum(["SECURITY","STRUCTURE","COMPLEXITY","DEPENDENCY","REPOSITORY_HYGIENE","DOCUMENTATION","QUALITY"]),evidence:f.array(f.string()).optional(),explanation:f.string().optional(),impact:f.string().optional(),effort:f.enum(["Low","Medium","High"]).optional(),recommendations:f.array(f.string()).optional()}))})),summary:f.object({total_findings:f.number().int().nonnegative(),critical_count:f.number().int().nonnegative(),high_count:f.number().int().nonnegative(),medium_count:f.number().int().nonnegative(),low_count:f.number().int().nonnegative(),categories:f.record(f.string(),f.number().int().nonnegative())}),generated_at:f.string()});var _o=f.object({NEXT_PUBLIC_SUPABASE_URL:f.string().url("Invalid SUPABASE_URL"),NEXT_PUBLIC_SUPABASE_ANON_KEY:f.string().min(1,"SUPABASE_ANON_KEY is required"),SUPABASE_SERVICE_ROLE_KEY:f.string().min(1,"SERVICE_ROLE_KEY is required"),NODE_ENV:f.enum(["development","production","test"],{errorMap:()=>({message:"NODE_ENV must be development, production, or test"})}),JWT_SECRET:f.string().min(32,"JWT_SECRET must be at least 32 characters").optional()});function wo(){try{return _o.parse(process.env)}catch(t){if(t instanceof f.ZodError){let e=t.errors.map(n=>n.path.join(".")).join(", ");throw new Error(`Environment validation failed:
23
+ `);for(let s of Xr){s.pattern.lastIndex=0;for(let o=0;o<r.length;o++){let a=r[o],i;for(;(i=s.pattern.exec(a))!==null;)n.push({filePath:t,type:"secret_content",secretName:s.name,severity:s.severity,description:s.description,lineNumber:o+1,match:i[0].substring(0,20)+"..."});s.pattern.lastIndex=0;}}return n}async function es(t){let e=[];if(Un(t))return e.push({filePath:t,type:"sensitive_file",secretName:"Sensitive File",severity:"critical",description:`Sensitive file type detected: ${Ye.basename(t)}`}),e;try{if(se.statSync(t).size>1024*1024)return e;let r=se.readFileSync(t,"utf-8"),s=Qr(t,r);e.push(...s);}catch{}return e}async function Fn(t,e){let n=[];for(let i of e){let c=Ye.join(t,i),l=await es(c);for(let d of l)d.filePath=i,n.push(d);}let r=n.filter(i=>i.severity==="critical").length,s=n.filter(i=>i.severity==="high").length,o=n.filter(i=>i.severity==="medium").length,a=n.filter(i=>i.severity==="low").length;return {totalFiles:e.length,secretsFound:n.length,criticalCount:r,highCount:s,mediumCount:o,lowCount:a,results:n}}function Bn(t){let e=[],n=[];for(let r of t)Un(r)?n.push(r):e.push(r);return {safe:e,blocked:n}}var nn=(t=>typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>e[n]}):t)(function(t){throw Error('Dynamic require of "'+t+'" is not supported')}),zn=typeof process<"u"&&process.versions?.node,ts=zn&&(Array.isArray(process.argv)&&process.argv.includes("--debug")||process.env.VEESTACK_DEBUG==="1"),rn=globalThis||{},sn=null;if(zn)try{let t=function(){let A=d,P=0;for(;A!==i(A)&&P<10;){let C=a(A,"package.json");try{if(o(C)){let R=JSON.parse(s(C,"utf-8"));if(R.name==="vee_stack")return R}}catch{}A=i(A),P++;}return null};ns=t;let e=nn("fs"),n=nn("path"),r=nn("url"),{readFileSync:s,existsSync:o}=e,{join:a,dirname:i}=n,{fileURLToPath:c}=r,l=c(import.meta.url),d=i(l);sn=t();}catch{ts&&console.debug("[veestack:debug] Failed to load package.json dynamically, using defaults");}var ns,_e=sn?.versions||rn.VEESTACK_VERSIONS||{},ee=sn?.version||rn.VEESTACK_VERSION||rn.CLI_VERSION||"unknown",on=`vs_cli_v${ee}`;_e.snapshot||"unknown";_e.engine_target||"unknown";_e.audit||"unknown";_e.session_payload||"unknown";_e.rules||"unknown";_e.analysis||"unknown";_e.api||"unknown";_e.min_node||"unknown";var f={};Hr(f,{BRAND:()=>Ps,DIRTY:()=>be,EMPTY_PATH:()=>ds,INVALID:()=>h,NEVER:()=>vo,OK:()=>J,ParseStatus:()=>z,Schema:()=>_,ZodAny:()=>Ee,ZodArray:()=>he,ZodBigInt:()=>Ce,ZodBoolean:()=>Ie,ZodBranded:()=>yt,ZodCatch:()=>Fe,ZodDate:()=>Ne,ZodDefault:()=>Ue,ZodDiscriminatedUnion:()=>$t,ZodEffects:()=>re,ZodEnum:()=>Ve,ZodError:()=>K,ZodFirstPartyTypeKind:()=>y,ZodFunction:()=>Mt,ZodIntersection:()=>je,ZodIssueCode:()=>u,ZodLazy:()=>Le,ZodLiteral:()=>$e,ZodMap:()=>ot,ZodNaN:()=>at,ZodNativeEnum:()=>Me,ZodNever:()=>oe,ZodNull:()=>Pe,ZodNullable:()=>ue,ZodNumber:()=>Re,ZodObject:()=>W,ZodOptional:()=>te,ZodParsedType:()=>g,ZodPipeline:()=>vt,ZodPromise:()=>Te,ZodReadonly:()=>Be,ZodRecord:()=>Vt,ZodSchema:()=>_,ZodSet:()=>it,ZodString:()=>Se,ZodSymbol:()=>rt,ZodTransformer:()=>re,ZodTuple:()=>le,ZodType:()=>_,ZodUndefined:()=>Oe,ZodUnion:()=>De,ZodUnknown:()=>me,ZodVoid:()=>st,addIssueToContext:()=>p,any:()=>Bs,array:()=>Gs,bigint:()=>$s,boolean:()=>er,coerce:()=>yo,custom:()=>Yn,date:()=>Vs,datetimeRegex:()=>Wn,defaultErrorMap:()=>pe,discriminatedUnion:()=>qs,effect:()=>co,enum:()=>oo,function:()=>no,getErrorMap:()=>et,getParsedType:()=>ce,instanceof:()=>js,intersection:()=>Ys,isAborted:()=>jt,isAsync:()=>tt,isDirty:()=>Lt,isValid:()=>we,late:()=>Ds,lazy:()=>ro,literal:()=>so,makeIssue:()=>ht,map:()=>eo,nan:()=>Ls,nativeEnum:()=>io,never:()=>Hs,null:()=>Fs,nullable:()=>uo,number:()=>Qn,object:()=>Zs,objectUtil:()=>ln,oboolean:()=>ho,onumber:()=>mo,optional:()=>lo,ostring:()=>go,pipeline:()=>po,preprocess:()=>fo,promise:()=>ao,quotelessJson:()=>cs,record:()=>Qs,set:()=>to,setErrorMap:()=>us,strictObject:()=>Ks,string:()=>Xn,symbol:()=>Ms,transformer:()=>co,tuple:()=>Xs,undefined:()=>Us,union:()=>Ws,unknown:()=>zs,util:()=>S,void:()=>Js});var S;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{let o={};for(let a of s)o[a]=a;return o},t.getValidEnumValues=s=>{let o=t.objectKeys(s).filter(i=>typeof s[s[i]]!="number"),a={};for(let i of o)a[i]=s[i];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(o){return s[o]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&o.push(a);return o},t.find=(s,o)=>{for(let a of s)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o;})(S||(S={}));var ln;(function(t){t.mergeShapes=(e,n)=>({...e,...n});})(ln||(ln={}));var g=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ce=t=>{switch(typeof t){case "undefined":return g.undefined;case "string":return g.string;case "number":return Number.isNaN(t)?g.nan:g.number;case "boolean":return g.boolean;case "function":return g.function;case "bigint":return g.bigint;case "symbol":return g.symbol;case "object":return Array.isArray(t)?g.array:t===null?g.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?g.promise:typeof Map<"u"&&t instanceof Map?g.map:typeof Set<"u"&&t instanceof Set?g.set:typeof Date<"u"&&t instanceof Date?g.date:g.object;default:return g.unknown}};var u=S.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"]),cs=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),K=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r];},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r];};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e;}format(e){let n=e||function(o){return o.message},r={_errors:[]},s=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else {let i=r,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(i[l]=i[l]||{_errors:[]},i[l]._errors.push(n(a))):i[l]=i[l]||{_errors:[]},i=i[l],c++;}}};return s(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let s of this.issues)if(s.path.length>0){let o=s.path[0];n[o]=n[o]||[],n[o].push(e(s));}else r.push(e(s));return {formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};K.create=t=>new K(t);var ls=(t,e)=>{let n;switch(t.code){case u.invalid_type:t.received===g.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case u.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,S.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:n=`Unrecognized key(s) in object: ${S.joinValues(t.keys,", ")}`;break;case u.invalid_union:n="Invalid input";break;case u.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${S.joinValues(t.options)}`;break;case u.invalid_enum_value:n=`Invalid enum value. Expected ${S.joinValues(t.options)}, received '${t.received}'`;break;case u.invalid_arguments:n="Invalid function arguments";break;case u.invalid_return_type:n="Invalid function return type";break;case u.invalid_date:n="Invalid date";break;case u.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:S.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case u.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case u.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case u.custom:n="Invalid input";break;case u.invalid_intersection_types:n="Intersection results could not be merged";break;case u.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case u.not_finite:n="Number must be finite";break;default:n=e.defaultError,S.assertNever(t);}return {message:n}},pe=ls;var Hn=pe;function us(t){Hn=t;}function et(){return Hn}var ht=t=>{let{data:e,path:n,errorMaps:r,issueData:s}=t,o=[...n,...s.path||[]],a={...s,path:o};if(s.message!==void 0)return {...s,path:o,message:s.message};let i="",c=r.filter(l=>!!l).slice().reverse();for(let l of c)i=l(a,{data:e,defaultError:i}).message;return {...s,path:o,message:i}},ds=[];function p(t,e){let n=et(),r=ht({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===pe?void 0:pe].filter(s=>!!s)});t.common.issues.push(r);}var z=class t{constructor(){this.value="valid";}dirty(){this.value==="valid"&&(this.value="dirty");}abort(){this.value!=="aborted"&&(this.value="aborted");}static mergeArray(e,n){let r=[];for(let s of n){if(s.status==="aborted")return h;s.status==="dirty"&&e.dirty(),r.push(s.value);}return {status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let s of n){let o=await s.key,a=await s.value;r.push({key:o,value:a});}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let s of n){let{key:o,value:a}=s;if(o.status==="aborted"||a.status==="aborted")return h;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[o.value]=a.value);}return {status:e.value,value:r}}},h=Object.freeze({status:"aborted"}),be=t=>({status:"dirty",value:t}),J=t=>({status:"valid",value:t}),jt=t=>t.status==="aborted",Lt=t=>t.status==="dirty",we=t=>t.status==="valid",tt=t=>typeof Promise<"u"&&t instanceof Promise;var m;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message;})(m||(m={}));var ne=class{constructor(e,n,r,s){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=s;}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Jn=(t,e)=>{if(we(e))return {success:true,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return {success:false,get error(){if(this._error)return this._error;let n=new K(t.common.issues);return this._error=n,this._error}}};function k(t){if(!t)return {};let{errorMap:e,invalid_type_error:n,required_error:r,description:s}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,i)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??i.defaultError}:typeof i.data>"u"?{message:c??r??i.defaultError}:a.code!=="invalid_type"?{message:i.defaultError}:{message:c??n??i.defaultError}},description:s}}var _=class{get description(){return this._def.description}_getType(e){return ce(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return {status:new z,ctx:{common:e.parent.common,data:e.data,parsedType:ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(tt(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??false,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)},s=this._parseSync({data:e,path:r.path,parent:r});return Jn(r,s)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return we(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=true),n.common={issues:[],async:true};}return this._parseAsync({data:e,path:[],parent:n}).then(r=>we(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:true},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)},s=this._parse({data:e,path:r.path,parent:r}),o=await(tt(s)?s:Promise.resolve(s));return Jn(r,o)}refine(e,n){let r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{let a=e(s),i=()=>o.addIssue({code:u.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?true:(i(),false)):a?true:(i(),false)})}refinement(e,n){return this._refinement((r,s)=>e(r)?true:(s.addIssue(typeof n=="function"?n(r,s):n),false))}_refinement(e){return new re({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:n=>this["~validate"](n)};}optional(){return te.create(this,this._def)}nullable(){return ue.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return he.create(this)}promise(){return Te.create(this,this._def)}or(e){return De.create([this,e],this._def)}and(e){return je.create(this,e,this._def)}transform(e){return new re({...k(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ue({...k(this._def),innerType:this,defaultValue:n,typeName:y.ZodDefault})}brand(){return new yt({typeName:y.ZodBranded,type:this,...k(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Fe({...k(this._def),innerType:this,catchValue:n,typeName:y.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return vt.create(this,e)}readonly(){return Be.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},fs=/^c[^\s-]{8,}$/i,ps=/^[0-9a-z]+$/,gs=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ms=/^[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,hs=/^[a-z0-9_-]{21}$/i,ys=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vs=/^[-+]?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)?)??$/,ks=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_s="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",un,ws=/^(?:(?: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])$/,Ss=/^(?:(?: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])$/,Es=/^(([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]))$/,Ts=/^(([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])$/,xs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,As=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Zn="((\\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])))",bs=new RegExp(`^${Zn}$`);function Kn(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Rs(t){return new RegExp(`^${Kn(t)}$`)}function Wn(t){let e=`${Zn}T${Kn(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Cs(t,e){return !!((e==="v4"||!e)&&ws.test(t)||(e==="v6"||!e)&&Es.test(t))}function Is(t,e){if(!ys.test(t))return false;try{let[n]=t.split(".");if(!n)return !1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return !(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return false}}function Ns(t,e){return !!((e==="v4"||!e)&&Ss.test(t)||(e==="v6"||!e)&&Ts.test(t))}var Se=class t extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.string,received:o.parsedType}),h}let r=new z,s;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:false,message:o.message}),r.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,i=e.data.length<o.value;(a||i)&&(s=this._getOrReturnCtx(e,s),a?p(s,{code:u.too_big,maximum:o.value,type:"string",inclusive:true,exact:true,message:o.message}):i&&p(s,{code:u.too_small,minimum:o.value,type:"string",inclusive:true,exact:true,message:o.message}),r.dirty());}else if(o.kind==="email")ks.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"email",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")un||(un=new RegExp(_s,"u")),un.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"emoji",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")ms.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"uuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")hs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"nanoid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")fs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")ps.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cuid2",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")gs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ulid",code:u.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data);}catch{s=this._getOrReturnCtx(e,s),p(s,{validation:"url",code:u.invalid_string,message:o.message}),r.dirty();}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"regex",code:u.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Wn(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?bs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?Rs(o).test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{code:u.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?vs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"duration",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?Cs(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"ip",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?Is(e.data,o.alg)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"jwt",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?Ns(e.data,o.version)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"cidr",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?xs.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64",code:u.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?As.test(e.data)||(s=this._getOrReturnCtx(e,s),p(s,{validation:"base64url",code:u.invalid_string,message:o.message}),r.dirty()):S.assertNever(o);return {status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(s=>e.test(s),{validation:n,code:u.invalid_string,...m.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??false,local:e?.local??false,...m.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...m.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...m.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...m.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...m.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...m.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...m.errToObj(n)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return !!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return !!this._def.checks.find(e=>e.kind==="date")}get isTime(){return !!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return !!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return !!this._def.checks.find(e=>e.kind==="email")}get isURL(){return !!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return !!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return !!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return !!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return !!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return !!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return !!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return !!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return !!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return !!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return !!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Se.create=t=>new Se({checks:[],typeName:y.ZodString,coerce:t?.coerce??false,...k(t)});function Os(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=n>r?n:r,o=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return o%a/10**s}var Re=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf;}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.number,received:o.parsedType}),h}let r,s=new z;for(let o of this._def.checks)o.kind==="int"?S.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message}),s.dirty()):o.kind==="multipleOf"?Os(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_finite,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return !!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&S.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return true;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);}return Number.isFinite(n)&&Number.isFinite(e)}};Re.create=t=>new Re({checks:[],typeName:y.ZodNumber,coerce:t?.coerce||false,...k(t)});var Ce=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte;}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data);}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let r,s=new z;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),p(r,{code:u.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):S.assertNever(o);return {status:s.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.bigint,received:n.parsedType}),h}gte(e,n){return this.setLimit("min",e,true,m.toString(n))}gt(e,n){return this.setLimit("min",e,false,m.toString(n))}lte(e,n){return this.setLimit("max",e,true,m.toString(n))}lt(e,n){return this.setLimit("max",e,false,m.toString(n))}setLimit(e,n,r,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:m.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:m.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ce.create=t=>new Ce({checks:[],typeName:y.ZodBigInt,coerce:t?.coerce??false,...k(t)});var Ie=class extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.boolean,received:r.parsedType}),h}return J(e.data)}};Ie.create=t=>new Ie({typeName:y.ZodBoolean,coerce:t?.coerce||false,...k(t)});var Ne=class t extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_type,expected:g.date,received:o.parsedType}),h}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return p(o,{code:u.invalid_date}),h}let r=new z,s;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_small,message:o.message,inclusive:true,exact:false,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(s=this._getOrReturnCtx(e,s),p(s,{code:u.too_big,message:o.message,inclusive:true,exact:false,maximum:o.value,type:"date"}),r.dirty()):S.assertNever(o);return {status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Ne.create=t=>new Ne({checks:[],coerce:t?.coerce||false,typeName:y.ZodDate,...k(t)});var rt=class extends _{_parse(e){if(this._getType(e)!==g.symbol){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.symbol,received:r.parsedType}),h}return J(e.data)}};rt.create=t=>new rt({typeName:y.ZodSymbol,...k(t)});var Oe=class extends _{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.undefined,received:r.parsedType}),h}return J(e.data)}};Oe.create=t=>new Oe({typeName:y.ZodUndefined,...k(t)});var Pe=class extends _{_parse(e){if(this._getType(e)!==g.null){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.null,received:r.parsedType}),h}return J(e.data)}};Pe.create=t=>new Pe({typeName:y.ZodNull,...k(t)});var Ee=class extends _{constructor(){super(...arguments),this._any=true;}_parse(e){return J(e.data)}};Ee.create=t=>new Ee({typeName:y.ZodAny,...k(t)});var me=class extends _{constructor(){super(...arguments),this._unknown=true;}_parse(e){return J(e.data)}};me.create=t=>new me({typeName:y.ZodUnknown,...k(t)});var oe=class extends _{_parse(e){let n=this._getOrReturnCtx(e);return p(n,{code:u.invalid_type,expected:g.never,received:n.parsedType}),h}};oe.create=t=>new oe({typeName:y.ZodNever,...k(t)});var st=class extends _{_parse(e){if(this._getType(e)!==g.undefined){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.void,received:r.parsedType}),h}return J(e.data)}};st.create=t=>new st({typeName:y.ZodVoid,...k(t)});var he=class t extends _{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),s=this._def;if(n.parsedType!==g.array)return p(n,{code:u.invalid_type,expected:g.array,received:n.parsedType}),h;if(s.exactLength!==null){let a=n.data.length>s.exactLength.value,i=n.data.length<s.exactLength.value;(a||i)&&(p(n,{code:a?u.too_big:u.too_small,minimum:i?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:true,exact:true,message:s.exactLength.message}),r.dirty());}if(s.minLength!==null&&n.data.length<s.minLength.value&&(p(n,{code:u.too_small,minimum:s.minLength.value,type:"array",inclusive:true,exact:false,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(p(n,{code:u.too_big,maximum:s.maxLength.value,type:"array",inclusive:true,exact:false,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,i)=>s.type._parseAsync(new ne(n,a,n.path,i)))).then(a=>z.mergeArray(r,a));let o=[...n.data].map((a,i)=>s.type._parseSync(new ne(n,a,n.path,i)));return z.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:m.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:m.toString(n)}})}nonempty(e){return this.min(1,e)}};he.create=(t,e)=>new he({type:t,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...k(e)});function nt(t){if(t instanceof W){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=te.create(nt(r));}return new W({...t._def,shape:()=>e})}else return t instanceof he?new he({...t._def,type:nt(t.element)}):t instanceof te?te.create(nt(t.unwrap())):t instanceof ue?ue.create(nt(t.unwrap())):t instanceof le?le.create(t.items.map(e=>nt(e))):t}var W=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 e=this._def.shape(),n=S.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==g.object){let l=this._getOrReturnCtx(e);return p(l,{code:u.invalid_type,expected:g.object,received:l.parsedType}),h}let{status:r,ctx:s}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),i=[];if(!(this._def.catchall instanceof oe&&this._def.unknownKeys==="strip"))for(let l in s.data)a.includes(l)||i.push(l);let c=[];for(let l of a){let d=o[l],A=s.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new ne(s,A,s.path,l)),alwaysSet:l in s.data});}if(this._def.catchall instanceof oe){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of i)c.push({key:{status:"valid",value:d},value:{status:"valid",value:s.data[d]}});else if(l==="strict")i.length>0&&(p(s,{code:u.unrecognized_keys,keys:i}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else {let l=this._def.catchall;for(let d of i){let A=s.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new ne(s,A,s.path,d)),alwaysSet:d in s.data});}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of c){let A=await d.key,P=await d.value;l.push({key:A,value:P,alwaysSet:d.alwaysSet});}return l}).then(l=>z.mergeObjectSync(r,l)):z.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let s=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:m.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of S.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of S.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return nt(this)}partial(e){let n={};for(let r of S.objectKeys(this.shape)){let s=this.shape[r];e&&!e[r]?n[r]=s:n[r]=s.optional();}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of S.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else {let o=this.shape[r];for(;o instanceof te;)o=o._def.innerType;n[r]=o;}return new t({...this._def,shape:()=>n})}keyof(){return qn(S.objectKeys(this.shape))}};W.create=(t,e)=>new W({shape:()=>t,unknownKeys:"strip",catchall:oe.create(),typeName:y.ZodObject,...k(e)});W.strictCreate=(t,e)=>new W({shape:()=>t,unknownKeys:"strict",catchall:oe.create(),typeName:y.ZodObject,...k(e)});W.lazycreate=(t,e)=>new W({shape:t,unknownKeys:"strip",catchall:oe.create(),typeName:y.ZodObject,...k(e)});var De=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function s(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return n.common.issues.push(...i.ctx.common.issues),i.result;let a=o.map(i=>new K(i.ctx.common.issues));return p(n,{code:u.invalid_union,unionErrors:a}),h}if(n.common.async)return Promise.all(r.map(async o=>{let a={...n,common:{...n.common,issues:[]},parent:null};return {result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(s);{let o,a=[];for(let c of r){let l={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:l}),l.common.issues.length&&a.push(l.common.issues);}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(c=>new K(c));return p(n,{code:u.invalid_union,unionErrors:i}),h}}get options(){return this._def.options}};De.create=(t,e)=>new De({options:t,typeName:y.ZodUnion,...k(e)});var ge=t=>t instanceof Le?ge(t.schema):t instanceof re?ge(t.innerType()):t instanceof $e?[t.value]:t instanceof Ve?t.options:t instanceof Me?S.objectValues(t.enum):t instanceof Ue?ge(t._def.innerType):t instanceof Oe?[void 0]:t instanceof Pe?[null]:t instanceof te?[void 0,...ge(t.unwrap())]:t instanceof ue?[null,...ge(t.unwrap())]:t instanceof yt||t instanceof Be?ge(t.unwrap()):t instanceof Fe?ge(t._def.innerType):[],$t=class t extends _{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.object)return p(n,{code:u.invalid_type,expected:g.object,received:n.parsedType}),h;let r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(p(n,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let s=new Map;for(let o of n){let a=ge(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of a){if(s.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);s.set(i,o);}}return new t({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:s,...k(r)})}};function dn(t,e){let n=ce(t),r=ce(e);if(t===e)return {valid:true,data:t};if(n===g.object&&r===g.object){let s=S.objectKeys(e),o=S.objectKeys(t).filter(i=>s.indexOf(i)!==-1),a={...t,...e};for(let i of o){let c=dn(t[i],e[i]);if(!c.valid)return {valid:false};a[i]=c.data;}return {valid:true,data:a}}else if(n===g.array&&r===g.array){if(t.length!==e.length)return {valid:false};let s=[];for(let o=0;o<t.length;o++){let a=t[o],i=e[o],c=dn(a,i);if(!c.valid)return {valid:false};s.push(c.data);}return {valid:true,data:s}}else return n===g.date&&r===g.date&&+t==+e?{valid:true,data:t}:{valid:false}}var je=class extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=(o,a)=>{if(jt(o)||jt(a))return h;let i=dn(o.value,a.value);return i.valid?((Lt(o)||Lt(a))&&n.dirty(),{status:n.value,value:i.data}):(p(r,{code:u.invalid_intersection_types}),h)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>s(o,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};je.create=(t,e,n)=>new je({left:t,right:e,typeName:y.ZodIntersection,...k(n)});var le=class t extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.array)return p(r,{code:u.invalid_type,expected:g.array,received:r.parsedType}),h;if(r.data.length<this._def.items.length)return p(r,{code:u.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"}),h;!this._def.rest&&r.data.length>this._def.items.length&&(p(r,{code:u.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"}),n.dirty());let o=[...r.data].map((a,i)=>{let c=this._def.items[i]||this._def.rest;return c?c._parse(new ne(r,a,r.path,i)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>z.mergeArray(n,a)):z.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};le.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new le({items:t,typeName:y.ZodTuple,rest:null,...k(e)})};var Vt=class t extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return p(r,{code:u.invalid_type,expected:g.object,received:r.parsedType}),h;let s=[],o=this._def.keyType,a=this._def.valueType;for(let i in r.data)s.push({key:o._parse(new ne(r,i,r.path,i)),value:a._parse(new ne(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?z.mergeObjectAsync(n,s):z.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof _?new t({keyType:e,valueType:n,typeName:y.ZodRecord,...k(r)}):new t({keyType:Se.create(),valueType:e,typeName:y.ZodRecord,...k(n)})}},ot=class extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.map)return p(r,{code:u.invalid_type,expected:g.map,received:r.parsedType}),h;let s=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([i,c],l)=>({key:s._parse(new ne(r,i,r.path,[l,"key"])),value:o._parse(new ne(r,c,r.path,[l,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}})}else {let i=new Map;for(let c of a){let l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return h;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),i.set(l.value,d.value);}return {status:n.value,value:i}}}};ot.create=(t,e,n)=>new ot({valueType:e,keyType:t,typeName:y.ZodMap,...k(n)});var it=class t extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==g.set)return p(r,{code:u.invalid_type,expected:g.set,received:r.parsedType}),h;let s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(p(r,{code:u.too_small,minimum:s.minSize.value,type:"set",inclusive:true,exact:false,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(p(r,{code:u.too_big,maximum:s.maxSize.value,type:"set",inclusive:true,exact:false,message:s.maxSize.message}),n.dirty());let o=this._def.valueType;function a(c){let l=new Set;for(let d of c){if(d.status==="aborted")return h;d.status==="dirty"&&n.dirty(),l.add(d.value);}return {status:n.value,value:l}}let i=[...r.data.values()].map((c,l)=>o._parse(new ne(r,c,r.path,l)));return r.common.async?Promise.all(i).then(c=>a(c)):a(i)}min(e,n){return new t({...this._def,minSize:{value:e,message:m.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:m.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};it.create=(t,e)=>new it({valueType:t,minSize:null,maxSize:null,typeName:y.ZodSet,...k(e)});var Mt=class t extends _{constructor(){super(...arguments),this.validate=this.implement;}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.function)return p(n,{code:u.invalid_type,expected:g.function,received:n.parsedType}),h;function r(i,c){return ht({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,et(),pe].filter(l=>!!l),issueData:{code:u.invalid_arguments,argumentsError:c}})}function s(i,c){return ht({data:i,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,et(),pe].filter(l=>!!l),issueData:{code:u.invalid_return_type,returnTypeError:c}})}let o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Te){let i=this;return J(async function(...c){let l=new K([]),d=await i._def.args.parseAsync(c,o).catch(C=>{throw l.addIssue(r(c,C)),l}),A=await Reflect.apply(a,this,d);return await i._def.returns._def.type.parseAsync(A,o).catch(C=>{throw l.addIssue(s(A,C)),l})})}else {let i=this;return J(function(...c){let l=i._def.args.safeParse(c,o);if(!l.success)throw new K([r(c,l.error)]);let d=Reflect.apply(a,this,l.data),A=i._def.returns.safeParse(d,o);if(!A.success)throw new K([s(d,A.error)]);return A.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:le.create(e).rest(me.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||le.create([]).rest(me.create()),returns:n||me.create(),typeName:y.ZodFunction,...k(r)})}},Le=class extends _{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Le.create=(t,e)=>new Le({getter:t,typeName:y.ZodLazy,...k(e)});var $e=class extends _{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return p(n,{received:n.data,code:u.invalid_literal,expected:this._def.value}),h}return {status:"valid",value:e.data}}get value(){return this._def.value}};$e.create=(t,e)=>new $e({value:t,typeName:y.ZodLiteral,...k(e)});function qn(t,e){return new Ve({values:t,typeName:y.ZodEnum,...k(e)})}var Ve=class t extends _{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{expected:S.joinValues(r),received:n.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return p(n,{received:n.data,code:u.invalid_enum_value,options:r}),h}return J(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Ve.create=qn;var Me=class extends _{_parse(e){let n=S.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==g.string&&r.parsedType!==g.number){let s=S.objectValues(n);return p(r,{expected:S.joinValues(s),received:r.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(S.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=S.objectValues(n);return p(r,{received:r.data,code:u.invalid_enum_value,options:s}),h}return J(e.data)}get enum(){return this._def.values}};Me.create=(t,e)=>new Me({values:t,typeName:y.ZodNativeEnum,...k(e)});var Te=class extends _{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==g.promise&&n.common.async===false)return p(n,{code:u.invalid_type,expected:g.promise,received:n.parsedType}),h;let r=n.parsedType===g.promise?n.data:Promise.resolve(n.data);return J(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Te.create=(t,e)=>new Te({type:t,typeName:y.ZodPromise,...k(e)});var re=class extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),s=this._def.effect||null,o={addIssue:a=>{p(r,a),a.fatal?n.abort():n.dirty();},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let a=s.transform(r.data,o);if(r.common.async)return Promise.resolve(a).then(async i=>{if(n.value==="aborted")return h;let c=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});return c.status==="aborted"?h:c.status==="dirty"?be(c.value):n.value==="dirty"?be(c.value):c});{if(n.value==="aborted")return h;let i=this._def.schema._parseSync({data:a,path:r.path,parent:r});return i.status==="aborted"?h:i.status==="dirty"?be(i.value):n.value==="dirty"?be(i.value):i}}if(s.type==="refinement"){let a=i=>{let c=s.refinement(i,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===false){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value),{status:n.value,value:i.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>i.status==="aborted"?h:(i.status==="dirty"&&n.dirty(),a(i.value).then(()=>({status:n.value,value:i.value}))))}if(s.type==="transform")if(r.common.async===false){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!we(a))return h;let i=s.transform(a.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return {status:n.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>we(a)?Promise.resolve(s.transform(a.value,o)).then(i=>({status:n.value,value:i})):h);S.assertNever(s);}};re.create=(t,e,n)=>new re({schema:t,typeName:y.ZodEffects,effect:e,...k(n)});re.createWithPreprocess=(t,e,n)=>new re({schema:e,effect:{type:"preprocess",transform:t},typeName:y.ZodEffects,...k(n)});var te=class extends _{_parse(e){return this._getType(e)===g.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};te.create=(t,e)=>new te({innerType:t,typeName:y.ZodOptional,...k(e)});var ue=class extends _{_parse(e){return this._getType(e)===g.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ue.create=(t,e)=>new ue({innerType:t,typeName:y.ZodNullable,...k(e)});var Ue=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===g.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ue.create=(t,e)=>new Ue({innerType:t,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...k(e)});var Fe=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return tt(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new K(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new K(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Fe.create=(t,e)=>new Fe({innerType:t,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...k(e)});var at=class extends _{_parse(e){if(this._getType(e)!==g.nan){let r=this._getOrReturnCtx(e);return p(r,{code:u.invalid_type,expected:g.nan,received:r.parsedType}),h}return {status:"valid",value:e.data}}};at.create=t=>new at({typeName:y.ZodNaN,...k(t)});var Ps=Symbol("zod_brand"),yt=class extends _{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},vt=class t extends _{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return (async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?h:o.status==="dirty"?(n.dirty(),be(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?h:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:y.ZodPipeline})}},Be=class extends _{_parse(e){let n=this._def.innerType._parse(e),r=s=>(we(s)&&(s.value=Object.freeze(s.value)),s);return tt(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}};Be.create=(t,e)=>new Be({innerType:t,typeName:y.ZodReadonly,...k(e)});function Gn(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Yn(t,e={},n){return t?Ee.create().superRefine((r,s)=>{let o=t(r);if(o instanceof Promise)return o.then(a=>{if(!a){let i=Gn(e,r),c=i.fatal??n??true;s.addIssue({code:"custom",...i,fatal:c});}});if(!o){let a=Gn(e,r),i=a.fatal??n??true;s.addIssue({code:"custom",...a,fatal:i});}}):Ee.create()}var Ds={object:W.lazycreate},y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly";})(y||(y={}));var js=(t,e={message:`Input not instance of ${t.name}`})=>Yn(n=>n instanceof t,e),Xn=Se.create,Qn=Re.create,Ls=at.create,$s=Ce.create,er=Ie.create,Vs=Ne.create,Ms=rt.create,Us=Oe.create,Fs=Pe.create,Bs=Ee.create,zs=me.create,Hs=oe.create,Js=st.create,Gs=he.create,Zs=W.create,Ks=W.strictCreate,Ws=De.create,qs=$t.create,Ys=je.create,Xs=le.create,Qs=Vt.create,eo=ot.create,to=it.create,no=Mt.create,ro=Le.create,so=$e.create,oo=Ve.create,io=Me.create,ao=Te.create,co=re.create,lo=te.create,uo=ue.create,fo=re.createWithPreprocess,po=vt.create,go=()=>Xn().optional(),mo=()=>Qn().optional(),ho=()=>er().optional(),yo={string:(t=>Se.create({...t,coerce:true})),number:(t=>Re.create({...t,coerce:true})),boolean:(t=>Ie.create({...t,coerce:true})),bigint:(t=>Ce.create({...t,coerce:true})),date:(t=>Ne.create({...t,coerce:true}))};var vo=h;var ko={api:{rateLimit:{windowMs:900*1e3,maxRequests:100}}};f.object({snapshot_version:f.string(),engine_target_version:f.string(),project_id:f.string(),generated_at:f.string(),root_path_hash:f.string(),metadata:f.object({total_files:f.number().int().nonnegative(),total_dependencies:f.number().int().nonnegative(),total_size_bytes:f.number().int().nonnegative(),total_lines:f.number().int().nonnegative(),max_directory_depth:f.number().int().nonnegative(),language_breakdown:f.record(f.string(),f.number().int().nonnegative())}),files:f.array(f.object({id:f.string(),path_hash:f.string(),depth:f.number().int().nonnegative(),size_bytes:f.number().int().nonnegative(),estimated_lines:f.number().int().nonnegative(),extension:f.string(),is_binary:f.boolean(),import_count:f.number().int().nonnegative().optional(),function_count:f.number().int().nonnegative().optional(),class_count:f.number().int().nonnegative().optional()})),dependencies:f.array(f.object({id:f.string(),name_hash:f.string(),major_version:f.number().int().nonnegative(),minor_version:f.number().int().nonnegative(),category:f.enum(["dev","prod","peer"])}))});f.object({name:f.string().min(1).max(100)});f.object({analysis_version:f.string(),snapshot_schema_version:f.string(),total_score:f.number().min(0).max(100),severity_band:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),engines:f.array(f.object({engine_name:f.string(),score_impact:f.number(),risk_level:f.enum(["HEALTHY","STABLE","STRUCTURAL_CONCERN","HIGH_RISK"]),metrics:f.record(f.number()),findings:f.array(f.object({rule_id:f.string(),title:f.string(),message:f.string(),severity:f.enum(["CRITICAL","HIGH","MEDIUM","LOW"]),category:f.enum(["SECURITY","STRUCTURE","COMPLEXITY","DEPENDENCY","REPOSITORY_HYGIENE","DOCUMENTATION","QUALITY"]),evidence:f.array(f.string()).optional(),explanation:f.string().optional(),impact:f.string().optional(),effort:f.enum(["Low","Medium","High"]).optional(),recommendations:f.array(f.string()).optional()}))})),summary:f.object({total_findings:f.number().int().nonnegative(),critical_count:f.number().int().nonnegative(),high_count:f.number().int().nonnegative(),medium_count:f.number().int().nonnegative(),low_count:f.number().int().nonnegative(),categories:f.record(f.string(),f.number().int().nonnegative())}),generated_at:f.string()});var _o=f.object({NEXT_PUBLIC_SUPABASE_URL:f.string().url("Invalid SUPABASE_URL"),NEXT_PUBLIC_SUPABASE_ANON_KEY:f.string().min(1,"SUPABASE_ANON_KEY is required"),SUPABASE_SERVICE_ROLE_KEY:f.string().min(1,"SERVICE_ROLE_KEY is required"),NODE_ENV:f.enum(["development","production","test"],{errorMap:()=>({message:"NODE_ENV must be development, production, or test"})}),JWT_SECRET:f.string().min(32,"JWT_SECRET must be at least 32 characters").optional()});function wo(){try{return _o.parse(process.env)}catch(t){if(t instanceof f.ZodError){let e=t.errors.map(n=>n.path.join(".")).join(", ");throw new Error(`Environment validation failed:
24
24
  Missing or invalid variables: ${e}
25
25
  Please check your .env file and ensure all required variables are set.`)}throw t}}var fn=null;function So(){return fn||(fn=wo()),fn}new Proxy({},{get(t,e){return So()[e]}});var ze=new Map;function Eo(t=ko.api.rateLimit){let{windowMs:e,maxRequests:n,message:r}=t;return {check(s){let o=Date.now(),a=ze.get(s);a&&o>a.resetTime&&ze.delete(s);let i=ze.get(s)||{count:0,resetTime:o+e};return i.count>=n?{success:false,remaining:0,resetTime:i.resetTime,error:r||"Too many requests"}:(i.count++,ze.set(s,i),{success:true,remaining:n-i.count,resetTime:i.resetTime})},reset(s){ze.delete(s);},cleanup(){let s=Date.now();for(let[o,a]of ze.entries())s>a.resetTime&&ze.delete(o);}}}Eo();var xo={TOKEN_BINDING_SALT:on};function nr(t,e){let n=`${t}:${e}:${xo.TOKEN_BINDING_SALT}`;return de.createHash("sha256").update(n).digest("hex")}function rr(t,e,n,r,s="cli"){let o=new Date().toISOString(),a=Co(),i=Ao(t,e,n,o,a),c=bo(o,s,i),l=Ro(r,o,s,c);return {signature:l,timestamp:o,nonce:a,headers:{"X-Signature":l,"X-Timestamp":o,"X-Nonce":a,"X-Signed-Headers":"host;x-timestamp;x-nonce"}}}function Ao(t,e,n,r,s){let o=de.createHash("sha256").update(n).digest("hex");return [t.toUpperCase(),e,"",`host:www.veestack.com
26
26
  `,`x-timestamp:${r}
27
27
  `,`x-nonce:${s}
28
28
  `,"host;x-timestamp;x-nonce",o].join(`
29
29
  `)}function bo(t,e,n){let r=t.substring(0,10).replace(/-/g,""),s=de.createHash("sha256").update(n).digest("hex");return ["VEESTACK-HMAC-SHA256",t,`${r}/veestack/${e}/veestack_request`,s].join(`
30
- `)}function Ro(t,e,n,r){let s=e.substring(0,10).replace(/-/g,""),o=_t("VEESTACK"+t,s),a=_t(o,"veestack"),i=_t(a,n),c=_t(i,"veestack_request");return _t(c,r,"hex")}function _t(t,e,n){return de.createHmac("sha256",t).update(e).digest(n||"hex")}function Co(){return de.randomBytes(16).toString("hex")}var Ut=null;async function Bt(){if(Ut)return Ut;try{return Ut=await import('keytar'),Ut}catch{return null}}var Et=Ye.join(ct.homedir(),".veestack"),ye=Ye.join(Et,"tokens.enc"),sr=Ye.join(Et,"salt"),or=Ye.join(Et,".key"),zt="VeeStack CLI",Ht="auth_tokens",Io=1e5,No=32,Oo=16;function Ft(){return process.env.DEBUG?.includes("veestack")||process.env.DEBUG?.includes("*")||process.env.NODE_ENV==="development"||process.env.VEESTACK_DEBUG==="true"}async function Po(){try{let e=await j.readFile(sr).catch(()=>null);if(e)return e}catch{}let t=de.randomBytes(32);return await j.mkdir(Et,{recursive:true,mode:448}),await j.writeFile(sr,t,{mode:384}),t}async function ir(){try{let r=await j.readFile(or,"utf-8").catch(()=>null);if(r){let s=Buffer.from(r,"hex");return await j.unlink(or).catch(()=>{}),s}}catch{}let t=`${ct.userInfo().username}@${ct.hostname()}`,e=await Po();return de.pbkdf2Sync(t,e,Io,No,"sha256")}function wt(t){Buffer.isBuffer(t)&&t.fill(0);}async function Tt(t){let e=await Bt();if(e)try{let l=JSON.stringify(t);await e.setPassword(zt,Ht,l),Ft()&&console.log(" Tokens saved to OS Keychain");return}catch(l){Ft()&&console.log(" Keychain failed, falling back to encrypted file:",l);}let n=await ir(),r=de.randomBytes(Oo),s=de.createCipheriv("aes-256-gcm",n,r),o=JSON.stringify(t),a=Buffer.concat([s.update(o,"utf8"),s.final()]),i=s.getAuthTag(),c={iv:r.toString("hex"),data:a.toString("hex"),authTag:i.toString("hex"),timestamp:Date.now(),version:2};await j.mkdir(Et,{recursive:true,mode:448}),await j.writeFile(ye,JSON.stringify(c),{mode:384}),wt(n),Ft()&&console.log(" Tokens saved to encrypted file (AES-256-GCM)");}async function ar(){let t=await Bt();if(t)try{let e=await t.getPassword(zt,Ht);if(e)return JSON.parse(e)}catch(e){Ft()&&console.log("\u26A0\uFE0F Keychain read failed, trying encrypted file:",e);}try{let e=await j.readFile(ye,"utf-8"),n=JSON.parse(e);if(n.version===1)return await Do(n);let r=await ir(),s=null;try{let o=Buffer.from(n.iv,"hex"),a=Buffer.from(n.data,"hex"),i=Buffer.from(n.authTag,"hex"),c=de.createDecipheriv("aes-256-gcm",r,o);c.setAuthTag(i),s=Buffer.concat([c.update(a),c.final()]);let l=JSON.parse(s.toString("utf8"));return wt(s),wt(r),l}catch(o){throw s&&wt(s),wt(r),o}}catch{return null}}async function Do(t){try{return console.log("\u{1F510} Migrating from legacy encryption format..."),await j.unlink(ye).catch(()=>{}),null}catch{return null}}async function Jt(){try{return await j.access(ye),!0}catch{return false}}async function He(){try{let t=await j.stat(ye).catch(()=>null);if(!t)return;let e=t.size,n=3;for(let s=0;s<n;s++){let o=de.randomBytes(e);await j.writeFile(ye,o);}await j.unlink(ye);let r=await Bt();r&&await r.deletePassword(zt,Ht).catch(()=>{});}catch{}}async function cr(){let t=await Bt(),e=!!t,n=false;if(t)try{n=!!await t.getPassword(zt,Ht);}catch{}let r=false,s,o,a=0;try{let i=await j.stat(ye);r=!0,s=i.mode.toString(8),o=i.size;let c=await j.readFile(ye,"utf-8");a=JSON.parse(c).version||1;}catch{}return {keychainAvailable:e,keychainHasTokens:n,fileExists:r,filePermissions:s,fileSize:o,encryptionVersion:a}}var jo=[{name:"bearer_token",regex:/Bearer\s+[a-zA-Z0-9_-]{20,}/gi,replacement:"Bearer [REDACTED]"},{name:"api_key",regex:/api[_-]?key['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"api_key: [REDACTED]"},{name:"access_token",regex:/access[_-]?token['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"access_token: [REDACTED]"},{name:"refresh_token",regex:/refresh[_-]?token['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"refresh_token: [REDACTED]"},{name:"auth_token",regex:/auth[_-]?token['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"auth_token: [REDACTED]"},{name:"password",regex:/password['"\s]*[:=]\s*['"]?([^'"\s]{8,})/gi,replacement:"password: [REDACTED]"},{name:"secret",regex:/secret['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"secret: [REDACTED]"},{name:"private_key",regex:/private[_-]?key['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"private_key: [REDACTED]"},{name:"jwt_token",regex:/eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*/g,replacement:"[REDACTED_JWT]"},{name:"supabase_key",regex:/eyJ[a-zA-Z0-9_-]{20,}\.[a-zA-Z0-9_-]{20,}\.[a-zA-Z0-9_-]{20,}/g,replacement:"[REDACTED_SUPABASE_KEY]"}];function Je(t){if(!t||typeof t!="string")return t;let e=t;for(let n of jo)e=e.replace(n.regex,n.replacement);return e}function gn(t){return t instanceof Error?Je(t.message).slice(0,500):typeof t=="string"?Je(t).slice(0,500):Je(String(t)).slice(0,500)}function Gt(t){if(!t||typeof t!="object")return t;let e=["token","accessToken","refreshToken","apiKey","api_key","secret","password","privateKey","private_key","authToken","auth_token","jwt","credential","credentials"];if(Array.isArray(t))return t.map(r=>Gt(r));let n={};for(let[r,s]of Object.entries(t)){let o=r.toLowerCase();e.some(a=>o.includes(a))?n[r]="[REDACTED]":typeof s=="object"&&s!==null?n[r]=Gt(s):typeof s=="string"?n[r]=Je(s):n[r]=s;}return n}function xt(t,e,...n){let r=Je(e),s=n.map(o=>typeof o=="string"?Je(o):typeof o=="object"&&o!==null?Gt(o):o);console[t](r,...s);}var ve={log:(t,...e)=>xt("log",t,...e),error:(t,...e)=>xt("error",t,...e),warn:(t,...e)=>xt("warn",t,...e),info:(t,...e)=>xt("info",t,...e),debug:(t,...e)=>xt("debug",t,...e)};var Lo=globalThis,lr=Lo.CLI_VERSION,hn=Ye.join(ct.homedir(),".veestack");Ye.join(hn,"config.json");var Zt=Ye.join(hn,"config.json"),ur=process.env.SUPABASE_URL||"",dr=process.env.SUPABASE_ANON_KEY||"",mn=ur?`${ur}/functions/v1/cli-auth`:null,$o=process.env.VEESTACK_API_URL||"https://api.veestack.dev",fr=mn||$o;async function Mo(){try{if(!se.existsSync(Zt))return;let t=se.readFileSync(Zt,"utf-8"),e=JSON.parse(t);if(await Jt()){try{se.unlinkSync(Zt);}catch{}return}let n={token:e.token,refreshToken:e.refreshToken,tokenType:e.tokenType,tokenExpiresAt:e.tokenExpiresAt,device:e.device,user:e.user,subscription:e.subscription,lastLoginAt:e.lastLoginAt,apiKey:e.apiKey};await Tt(n);try{se.unlinkSync(Zt);}catch{}ve.info("\u{1F510} Authentication migrated to encrypted storage");}catch{}}async function X(){await Mo();let t=await ar();return t?{token:t.token,tokenType:t.tokenType,refreshToken:t.refreshToken,tokenExpiresAt:t.tokenExpiresAt,device:t.device,user:t.user,subscription:t.subscription,lastLoginAt:t.lastLoginAt,apiKey:t.apiKey}:null}async function Ze(){let t=await X();if(!t)return false;let e=t.token!==void 0&&t.token.length>0,n=t.apiKey!==void 0&&t.apiKey.length>0;return e||n}async function Uo(){let t=await X();return t&&(t.token||t.apiKey)||null}async function Fo(){let t=await X();return {id:t?.device?.id,fingerprint:t?.device?.fingerprint}}async function fe(t="GET",e="",n="",r=["project:read"]){let s=await Uo();if(!s)return {};let o=await X(),a=await Fo();if(!a.id||!a.fingerprint||!o?.refreshToken)return {};let i=nr(o.refreshToken,a.fingerprint),c=rr(t,e,n,o.refreshToken,"cli");return {Authorization:`Bearer ${s}`,"Content-Type":"application/json","X-Device-ID":a.id,"X-CLI-Version":lr||"unknown","X-Device-Fingerprint":a.fingerprint,"X-Token-Binding":i,"X-Signature":c.signature,"X-Timestamp":c.timestamp,"X-Nonce":c.nonce,"X-Scope":r.join(","),"X-Security-Version":lr||"unknown"}}function yn(t){if(!t.tokenExpiresAt)return true;let e=new Date(t.tokenExpiresAt),n=300*1e3;return Date.now()>=e.getTime()-n}async function Bo(t){if(!t.refreshToken)return null;try{let e={"Content-Type":"application/json"};dr&&(e.Authorization=`Bearer ${dr}`);let n=JSON.stringify(mn?{action:"refresh_tokens",refresh_token:t.refreshToken,device_id:t.device?.id}:{refresh_token:t.refreshToken,device_id:t.device?.id,device_fingerprint:t.device?.fingerprint}),r=mn?fr:`${fr}/api/cli/refresh`,s=await fetch(r,{method:"POST",headers:e,body:n});if(s.status===401){let i=await s.json().catch(()=>({}));throw i.code==="device_mismatch"&&(await He(),console.log(v.red(`
30
+ `)}function Ro(t,e,n,r){let s=e.substring(0,10).replace(/-/g,""),o=_t("VEESTACK"+t,s),a=_t(o,"veestack"),i=_t(a,n),c=_t(i,"veestack_request");return _t(c,r,"hex")}function _t(t,e,n){return de.createHmac("sha256",t).update(e).digest(n||"hex")}function Co(){return de.randomBytes(16).toString("hex")}var Ut=null;async function Bt(){if(Ut)return Ut;try{return Ut=await import('keytar'),Ut}catch{return null}}var Et=Ye.join(ct.homedir(),".veestack"),ye=Ye.join(Et,"tokens.enc"),sr=Ye.join(Et,"salt"),or=Ye.join(Et,".key"),zt="VeeStack CLI",Ht="auth_tokens",Io=1e5,No=32,Oo=16;function Ft(){return process.env.DEBUG?.includes("veestack")||process.env.DEBUG?.includes("*")||process.env.NODE_ENV==="development"||process.env.VEESTACK_DEBUG==="true"}async function Po(){try{let e=await L.readFile(sr).catch(()=>null);if(e)return e}catch{}let t=de.randomBytes(32);return await L.mkdir(Et,{recursive:true,mode:448}),await L.writeFile(sr,t,{mode:384}),t}async function ir(){try{let r=await L.readFile(or,"utf-8").catch(()=>null);if(r){let s=Buffer.from(r,"hex");return await L.unlink(or).catch(()=>{}),s}}catch{}let t=`${ct.userInfo().username}@${ct.hostname()}`,e=await Po();return de.pbkdf2Sync(t,e,Io,No,"sha256")}function wt(t){Buffer.isBuffer(t)&&t.fill(0);}async function Tt(t){let e=await Bt();if(e)try{let l=JSON.stringify(t);await e.setPassword(zt,Ht,l),Ft()&&console.log(" Tokens saved to OS Keychain");return}catch(l){Ft()&&console.log(" Keychain failed, falling back to encrypted file:",l);}let n=await ir(),r=de.randomBytes(Oo),s=de.createCipheriv("aes-256-gcm",n,r),o=JSON.stringify(t),a=Buffer.concat([s.update(o,"utf8"),s.final()]),i=s.getAuthTag(),c={iv:r.toString("hex"),data:a.toString("hex"),authTag:i.toString("hex"),timestamp:Date.now(),version:2};await L.mkdir(Et,{recursive:true,mode:448}),await L.writeFile(ye,JSON.stringify(c),{mode:384}),wt(n),Ft()&&console.log(" Tokens saved to encrypted file (AES-256-GCM)");}async function ar(){let t=await Bt();if(t)try{let e=await t.getPassword(zt,Ht);if(e)return JSON.parse(e)}catch(e){Ft()&&console.log("\u26A0\uFE0F Keychain read failed, trying encrypted file:",e);}try{let e=await L.readFile(ye,"utf-8"),n=JSON.parse(e);if(n.version===1)return await Do(n);let r=await ir(),s=null;try{let o=Buffer.from(n.iv,"hex"),a=Buffer.from(n.data,"hex"),i=Buffer.from(n.authTag,"hex"),c=de.createDecipheriv("aes-256-gcm",r,o);c.setAuthTag(i),s=Buffer.concat([c.update(a),c.final()]);let l=JSON.parse(s.toString("utf8"));return wt(s),wt(r),l}catch(o){throw s&&wt(s),wt(r),o}}catch{return null}}async function Do(t){try{return console.log("\u{1F510} Migrating from legacy encryption format..."),await L.unlink(ye).catch(()=>{}),null}catch{return null}}async function Jt(){try{return await L.access(ye),!0}catch{return false}}async function He(){try{let t=await L.stat(ye).catch(()=>null);if(!t)return;let e=t.size,n=3;for(let s=0;s<n;s++){let o=de.randomBytes(e);await L.writeFile(ye,o);}await L.unlink(ye);let r=await Bt();r&&await r.deletePassword(zt,Ht).catch(()=>{});}catch{}}async function cr(){let t=await Bt(),e=!!t,n=false;if(t)try{n=!!await t.getPassword(zt,Ht);}catch{}let r=false,s,o,a=0;try{let i=await L.stat(ye);r=!0,s=i.mode.toString(8),o=i.size;let c=await L.readFile(ye,"utf-8");a=JSON.parse(c).version||1;}catch{}return {keychainAvailable:e,keychainHasTokens:n,fileExists:r,filePermissions:s,fileSize:o,encryptionVersion:a}}var jo=[{name:"bearer_token",regex:/Bearer\s+[a-zA-Z0-9_-]{20,}/gi,replacement:"Bearer [REDACTED]"},{name:"api_key",regex:/api[_-]?key['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"api_key: [REDACTED]"},{name:"access_token",regex:/access[_-]?token['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"access_token: [REDACTED]"},{name:"refresh_token",regex:/refresh[_-]?token['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"refresh_token: [REDACTED]"},{name:"auth_token",regex:/auth[_-]?token['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"auth_token: [REDACTED]"},{name:"password",regex:/password['"\s]*[:=]\s*['"]?([^'"\s]{8,})/gi,replacement:"password: [REDACTED]"},{name:"secret",regex:/secret['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"secret: [REDACTED]"},{name:"private_key",regex:/private[_-]?key['"\s]*[:=]\s*['"]?([a-zA-Z0-9_-]{16,})/gi,replacement:"private_key: [REDACTED]"},{name:"jwt_token",regex:/eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*/g,replacement:"[REDACTED_JWT]"},{name:"supabase_key",regex:/eyJ[a-zA-Z0-9_-]{20,}\.[a-zA-Z0-9_-]{20,}\.[a-zA-Z0-9_-]{20,}/g,replacement:"[REDACTED_SUPABASE_KEY]"}];function Je(t){if(!t||typeof t!="string")return t;let e=t;for(let n of jo)e=e.replace(n.regex,n.replacement);return e}function gn(t){return t instanceof Error?Je(t.message).slice(0,500):typeof t=="string"?Je(t).slice(0,500):Je(String(t)).slice(0,500)}function Gt(t){if(!t||typeof t!="object")return t;let e=["token","accessToken","refreshToken","apiKey","api_key","secret","password","privateKey","private_key","authToken","auth_token","jwt","credential","credentials"];if(Array.isArray(t))return t.map(r=>Gt(r));let n={};for(let[r,s]of Object.entries(t)){let o=r.toLowerCase();e.some(a=>o.includes(a))?n[r]="[REDACTED]":typeof s=="object"&&s!==null?n[r]=Gt(s):typeof s=="string"?n[r]=Je(s):n[r]=s;}return n}function xt(t,e,...n){let r=Je(e),s=n.map(o=>typeof o=="string"?Je(o):typeof o=="object"&&o!==null?Gt(o):o);console[t](r,...s);}var ve={log:(t,...e)=>xt("log",t,...e),error:(t,...e)=>xt("error",t,...e),warn:(t,...e)=>xt("warn",t,...e),info:(t,...e)=>xt("info",t,...e),debug:(t,...e)=>xt("debug",t,...e)};var Lo=globalThis,lr=Lo.CLI_VERSION,hn=Ye.join(ct.homedir(),".veestack");Ye.join(hn,"config.json");var Zt=Ye.join(hn,"config.json"),ur=process.env.SUPABASE_URL||"",dr=process.env.SUPABASE_ANON_KEY||"",mn=ur?`${ur}/functions/v1/cli-auth`:null,$o=process.env.VEESTACK_API_URL||"https://api.veestack.dev",fr=mn||$o;async function Mo(){try{if(!se.existsSync(Zt))return;let t=se.readFileSync(Zt,"utf-8"),e=JSON.parse(t);if(await Jt()){try{se.unlinkSync(Zt);}catch{}return}let n={token:e.token,refreshToken:e.refreshToken,tokenType:e.tokenType,tokenExpiresAt:e.tokenExpiresAt,device:e.device,user:e.user,subscription:e.subscription,lastLoginAt:e.lastLoginAt,apiKey:e.apiKey};await Tt(n);try{se.unlinkSync(Zt);}catch{}ve.info("\u{1F510} Authentication migrated to encrypted storage");}catch{}}async function X(){await Mo();let t=await ar();return t?{token:t.token,tokenType:t.tokenType,refreshToken:t.refreshToken,tokenExpiresAt:t.tokenExpiresAt,device:t.device,user:t.user,subscription:t.subscription,lastLoginAt:t.lastLoginAt,apiKey:t.apiKey}:null}async function Ze(){let t=await X();if(!t)return false;let e=t.token!==void 0&&t.token.length>0,n=t.apiKey!==void 0&&t.apiKey.length>0;return e||n}async function Uo(){let t=await X();return t&&(t.token||t.apiKey)||null}async function Fo(){let t=await X();return {id:t?.device?.id,fingerprint:t?.device?.fingerprint}}async function fe(t="GET",e="",n="",r=["project:read"]){let s=await Uo();if(!s)return {};let o=await X(),a=await Fo();if(!a.id||!a.fingerprint||!o?.refreshToken)return {};let i=nr(o.refreshToken,a.fingerprint),c=rr(t,e,n,o.refreshToken,"cli");return {Authorization:`Bearer ${s}`,"Content-Type":"application/json","X-Device-ID":a.id,"X-CLI-Version":lr||"unknown","X-Device-Fingerprint":a.fingerprint,"X-Token-Binding":i,"X-Signature":c.signature,"X-Timestamp":c.timestamp,"X-Nonce":c.nonce,"X-Scope":r.join(","),"X-Security-Version":lr||"unknown"}}function yn(t){if(!t.tokenExpiresAt)return true;let e=new Date(t.tokenExpiresAt),n=300*1e3;return Date.now()>=e.getTime()-n}async function Bo(t){if(!t.refreshToken)return null;try{let e={"Content-Type":"application/json"};dr&&(e.Authorization=`Bearer ${dr}`);let n=JSON.stringify(mn?{action:"refresh_tokens",refresh_token:t.refreshToken,device_id:t.device?.id}:{refresh_token:t.refreshToken,device_id:t.device?.id,device_fingerprint:t.device?.fingerprint}),r=mn?fr:`${fr}/api/cli/refresh`,s=await fetch(r,{method:"POST",headers:e,body:n});if(s.status===401){let i=await s.json().catch(()=>({}));throw i.code==="device_mismatch"&&(await He(),console.log(v.red(`
31
31
  \u274C Security Alert: Device mismatch`)),console.log(v.yellow(`
32
32
  Your token was used from a different device.`)),console.log(v.gray("This could indicate a token theft attempt.")),console.log(v.gray("Please login again:")),console.log(v.cyan(" veestack login")),process.exit(1)),i.code==="device_revoked"&&(await He(),console.log(v.red(`
33
33
  \u274C Device authorization revoked`)),console.log(v.yellow(`
@@ -51,27 +51,27 @@ Configure your project:
51
51
  Cancelled.
52
52
  `)),process.exit(0);}}),!d.projectName){console.log(v.gray(`
53
53
  Cancelled.
54
- `));return}let O;if(d.createProject){console.log(v.gray(`
55
- Creating project on VeeStack...`));let $=await Jo(d.projectName,d.framework);$?(O=$.id,console.log(v.green("\u2714 Project created"))):console.log(v.yellow("\u26A0\uFE0F Could not create project on server (offline mode)"));}let C={projectId:O,name:d.projectName,framework:d.framework,scanPatterns:d.scanPatterns,excludePatterns:Go()};Zo(C);let R=r.confidence===0;if(t?.skipNextSteps){console.log(v.green(`
54
+ `));return}let P;if(d.createProject){console.log(v.gray(`
55
+ Creating project on VeeStack...`));let $=await Jo(d.projectName,d.framework);$?(P=$.id,console.log(v.green("\u2714 Project created"))):console.log(v.yellow("\u26A0\uFE0F Could not create project on server (offline mode)"));}let C={projectId:P,name:d.projectName,framework:d.framework,scanPatterns:d.scanPatterns,excludePatterns:Go()};Zo(C);let R=r.confidence===0;if(t?.skipNextSteps){console.log(v.green(`
56
56
  \u2714 Configuration saved to veestack.config.json`)),R&&console.log(v.yellow("\u26A0 Framework detection failed. Some settings may need manual adjustment."));return}console.log(v.green(`
57
57
  \u2714 Configuration saved to veestack.config.json`)),R&&console.log(v.yellow("\u26A0 Framework detection failed. Some settings may need manual adjustment.")),console.log(v.bold(`
58
- Next steps:`)),console.log(v.gray(" 1. Run analysis:")),console.log(v.cyan(" veestack scan")),console.log(v.gray(" 2. Upload results:")),console.log(v.cyan(" veestack upload")),console.log(v.gray(" 3. View in dashboard:")),console.log(v.cyan(` https://www.veestack.com/dashboard${O?`/projects/${O}`:""}
59
- `));}var vn=globalThis,ii=vn.CLI_VERSION||"unknown",ai=vn.SNAPSHOT_VERSION||"unknown",ci=vn.ENGINE_TARGET||"unknown";function li(t){let e={},n=t.split(/\r?\n/),r=false,s=null;for(let o of n){let a=o.replace(/\t/g," "),i=a.trim();if(!r){/^packages\s*:\s*$/.test(i)&&(r=true,s=a.match(/^\s*/)?.[0].length??0);continue}if(i!==""&&!i.startsWith("#")){let C=a.match(/^\s*/)?.[0].length??0;if(s!==null&&C<=s)break}let c=i.match(/^\/?([^\s]+)\s*:\s*$/);if(!c)continue;let l=c[1].replace(/^\/+/,""),d=l.lastIndexOf("@");if(d<=0)continue;let A=l.slice(0,d),O=l.slice(d+1);!A||!O||!/^\d+\./.test(O)||(e[A]=O);}return e}function ui(){if(process.env.GITHUB_ACTIONS){let[t,e]=(process.env.GITHUB_REPOSITORY||"").split("/");return {provider:"github_actions",repo_owner:t,repo_name:e,commit_sha:process.env.GITHUB_SHA,run_id:process.env.GITHUB_RUN_ID,event_name:process.env.GITHUB_EVENT_NAME,pr_number:process.env.GITHUB_REF?.includes("refs/pull/")?parseInt(process.env.GITHUB_REF.split("/")[2]):void 0}}}function kn(t){return de__default.createHash("sha256").update(t).digest("hex")}function di(t){let e=[".exe",".dll",".so",".dylib",".bin",".png",".jpg",".jpeg",".gif",".pdf",".zip",".tar",".gz",".7z",".woff",".woff2",".ttf",".eot"],n=t.split(".").pop()?.toLowerCase();return n?e.includes("."+n):false}function fi(t){return {ts:"TypeScript",js:"JavaScript",tsx:"TypeScript",jsx:"JavaScript",py:"Python",go:"Go",rs:"Rust",java:"Java",kt:"Kotlin",rb:"Ruby",php:"PHP",cs:"C#",cpp:"C++",c:"C",h:"C",json:"JSON",yaml:"YAML",yml:"YAML",md:"Markdown",html:"HTML",css:"CSS",scss:"SCSS",sql:"SQL",sh:"Shell",mjs:"JavaScript",cjs:"JavaScript",svelte:"Svelte",vue:"Vue"}[t]||"Other"}function pi(t){let e={};for(let n of t){let r=fi(n.extension.toLowerCase());e[r]=(e[r]||0)+1;}return e}function gi(t,e){let a=0,i={critical:0,high:0,medium:0,low:0};e&&(i={critical:e.criticalCount||0,high:e.highCount||0,medium:e.mediumCount||0,low:e.lowCount||0},a=i.critical*25+i.high*15+i.medium*5+i.low*2);let c=Math.max(0,100-a),l="F";return c===100?l="A+":c>=90?l="A":c>=80?l="B":c>=70?l="C":c>=60&&(l="D"),{score:c,grade:l,breakdown:i}}async function mi(t){try{return execSync("git diff --name-only HEAD",{cwd:t,encoding:"utf-8"}).split(`
60
- `).filter(Boolean)}catch{return []}}async function hi(t,e,n,r=false){let s=[],o=await glob(e,{cwd:t,ignore:n,nodir:true,dot:true,absolute:false});if(r){let i=await mi(t);i.length>0&&(o=o.filter(c=>i.includes(c)));}let a=o.filter(i=>!i.replace(/\\/g,"/").match(/(node_modules|\.next|dist|build|\.git)\//));for(let i of a){let c=statSync(join(t,i));c.isFile()&&s.push({id:de__default.randomUUID(),path:i,path_hash:kn(i),depth:i.split(/[\\/]/).length,size_bytes:c.size,estimated_lines:Math.floor(c.size/50),extension:i.split(".").pop()||"",is_binary:di(i)});}return s.sort((i,c)=>i.path_hash.localeCompare(c.path_hash))}async function yi(t){let e=[];try{let n=join(t,"package.json");if(!existsSync(n))return [];let r=JSON.parse(readFileSync(n,"utf-8")),s={},o=join(t,"pnpm-lock.yaml"),a=join(t,"package-lock.json");if(existsSync(o))s=li(readFileSync(o,"utf8"));else if(existsSync(a)){let c=JSON.parse(readFileSync(a,"utf8"));for(let[l,d]of Object.entries(c.packages||{}))l&&d.version&&(s[l.replace("node_modules/","")]=d.version);}let i=(c,l)=>{for(let[d,A]of Object.entries(c)){let O=s[d]||A.replace(/[\^~]/,""),C=O.match(/^(\d+)\.(\d+)/);e.push({id:de__default.randomUUID(),name_hash:kn(d),name:d,version:O,major_version:C?parseInt(C[1]):0,minor_version:C?parseInt(C[2]):0,category:l});}};r.dependencies&&i(r.dependencies,"prod"),r.devDependencies&&i(r.devDependencies,"dev"),r.peerDependencies&&i(r.peerDependencies,"peer");}catch{}return e.sort((n,r)=>n.name_hash.localeCompare(r.name_hash))}async function vi(t,e){let n=await yi(t);return {snapshot_version:ai,engine_target_version:ci,project_id:de__default.randomUUID(),generated_at:new Date().toISOString(),root_path_hash:kn(t),project_root:resolve(t),metadata:{total_files:e.length,total_dependencies:n.length,total_size_bytes:e.reduce((r,s)=>r+s.size_bytes,0),total_lines:e.reduce((r,s)=>r+(s.estimated_lines||0),0),max_directory_depth:Math.max(...e.map(r=>r.depth),0),language_breakdown:pi(e)},files:e,dependencies:n,ci_metadata:ui()}}async function _n(t){let e=t.quiet||t.json,n=t.ci||process.env.CI==="true",r=resolve(t.path),s=basename(r),o=s,a=join(r,"package.json"),i=join(r,"veestack.config.json");if(existsSync(a))try{let d=JSON.parse(readFileSync(a,"utf-8"));d.name&&(o=d.name);}catch{}if(existsSync(i))try{let d=JSON.parse(readFileSync(i,"utf-8"));d.name&&(o=d.name);}catch{}e||(console.log(v.bold.cyan(`
58
+ Next steps:`)),console.log(v.gray(" 1. Run analysis:")),console.log(v.cyan(" veestack scan")),console.log(v.gray(" 2. Upload results:")),console.log(v.cyan(" veestack upload")),console.log(v.gray(" 3. View in dashboard:")),console.log(v.cyan(` https://www.veestack.com/dashboard${P?`/projects/${P}`:""}
59
+ `));}var vn=globalThis,ii=vn.CLI_VERSION||"unknown",ai=vn.SNAPSHOT_VERSION||"unknown",ci=vn.ENGINE_TARGET||"unknown";function li(t){let e={},n=t.split(/\r?\n/),r=false,s=null;for(let o of n){let a=o.replace(/\t/g," "),i=a.trim();if(!r){/^packages\s*:\s*$/.test(i)&&(r=true,s=a.match(/^\s*/)?.[0].length??0);continue}if(i!==""&&!i.startsWith("#")){let C=a.match(/^\s*/)?.[0].length??0;if(s!==null&&C<=s)break}let c=i.match(/^\/?([^\s]+)\s*:\s*$/);if(!c)continue;let l=c[1].replace(/^\/+/,""),d=l.lastIndexOf("@");if(d<=0)continue;let A=l.slice(0,d),P=l.slice(d+1);!A||!P||!/^\d+\./.test(P)||(e[A]=P);}return e}function ui(){if(process.env.GITHUB_ACTIONS){let[t,e]=(process.env.GITHUB_REPOSITORY||"").split("/");return {provider:"github_actions",repo_owner:t,repo_name:e,commit_sha:process.env.GITHUB_SHA,run_id:process.env.GITHUB_RUN_ID,event_name:process.env.GITHUB_EVENT_NAME,pr_number:process.env.GITHUB_REF?.includes("refs/pull/")?parseInt(process.env.GITHUB_REF.split("/")[2]):void 0}}}function kn(t){return de__default.createHash("sha256").update(t).digest("hex")}function di(t){let e=[".exe",".dll",".so",".dylib",".bin",".png",".jpg",".jpeg",".gif",".pdf",".zip",".tar",".gz",".7z",".woff",".woff2",".ttf",".eot"],n=t.split(".").pop()?.toLowerCase();return n?e.includes("."+n):false}function fi(t){return {ts:"TypeScript",js:"JavaScript",tsx:"TypeScript",jsx:"JavaScript",py:"Python",go:"Go",rs:"Rust",java:"Java",kt:"Kotlin",rb:"Ruby",php:"PHP",cs:"C#",cpp:"C++",c:"C",h:"C",json:"JSON",yaml:"YAML",yml:"YAML",md:"Markdown",html:"HTML",css:"CSS",scss:"SCSS",sql:"SQL",sh:"Shell",mjs:"JavaScript",cjs:"JavaScript",svelte:"Svelte",vue:"Vue"}[t]||"Other"}function pi(t){let e={};for(let n of t){let r=fi(n.extension.toLowerCase());e[r]=(e[r]||0)+1;}return e}function gi(t,e){let a=0,i={critical:0,high:0,medium:0,low:0};e&&(i={critical:e.criticalCount||0,high:e.highCount||0,medium:e.mediumCount||0,low:e.lowCount||0},a=i.critical*25+i.high*15+i.medium*5+i.low*2);let c=Math.max(0,100-a),l="F";return c===100?l="A+":c>=90?l="A":c>=80?l="B":c>=70?l="C":c>=60&&(l="D"),{score:c,grade:l,breakdown:i}}async function mi(t){try{return execSync("git diff --name-only HEAD",{cwd:t,encoding:"utf-8"}).split(`
60
+ `).filter(Boolean)}catch{return []}}async function hi(t,e,n,r=false){let s=[],o=await glob(e,{cwd:t,ignore:n,nodir:true,dot:true,absolute:false});if(r){let i=await mi(t);i.length>0&&(o=o.filter(c=>i.includes(c)));}let a=o.filter(i=>!i.replace(/\\/g,"/").match(/(node_modules|\.next|dist|build|\.git)\//));for(let i of a){let c=statSync(join(t,i));c.isFile()&&s.push({id:de__default.randomUUID(),path:i,path_hash:kn(i),depth:i.split(/[\\/]/).length,size_bytes:c.size,estimated_lines:Math.floor(c.size/50),extension:i.split(".").pop()||"",is_binary:di(i)});}return s.sort((i,c)=>i.path_hash.localeCompare(c.path_hash))}async function yi(t){let e=[];try{let n=join(t,"package.json");if(!existsSync(n))return [];let r=JSON.parse(readFileSync(n,"utf-8")),s={},o=join(t,"pnpm-lock.yaml"),a=join(t,"package-lock.json");if(existsSync(o))s=li(readFileSync(o,"utf8"));else if(existsSync(a)){let c=JSON.parse(readFileSync(a,"utf8"));for(let[l,d]of Object.entries(c.packages||{}))l&&d.version&&(s[l.replace("node_modules/","")]=d.version);}let i=(c,l)=>{for(let[d,A]of Object.entries(c)){let P=s[d]||A.replace(/[\^~]/,""),C=P.match(/^(\d+)\.(\d+)/);e.push({id:de__default.randomUUID(),name_hash:kn(d),name:d,version:P,major_version:C?parseInt(C[1]):0,minor_version:C?parseInt(C[2]):0,category:l});}};r.dependencies&&i(r.dependencies,"prod"),r.devDependencies&&i(r.devDependencies,"dev"),r.peerDependencies&&i(r.peerDependencies,"peer");}catch{}return e.sort((n,r)=>n.name_hash.localeCompare(r.name_hash))}async function vi(t,e){let n=await yi(t);return {snapshot_version:ai,engine_target_version:ci,project_id:de__default.randomUUID(),generated_at:new Date().toISOString(),root_path_hash:kn(t),project_root:resolve(t),metadata:{total_files:e.length,total_dependencies:n.length,total_size_bytes:e.reduce((r,s)=>r+s.size_bytes,0),total_lines:e.reduce((r,s)=>r+(s.estimated_lines||0),0),max_directory_depth:Math.max(...e.map(r=>r.depth),0),language_breakdown:pi(e)},files:e,dependencies:n,ci_metadata:ui()}}async function _n(t){let e=t.quiet||t.json,n=t.ci||process.env.CI==="true",r=resolve(t.path),s=basename(r),o=s,a=join(r,"package.json"),i=join(r,"veestack.config.json");if(existsSync(a))try{let d=JSON.parse(readFileSync(a,"utf-8"));d.name&&(o=d.name);}catch{}if(existsSync(i))try{let d=JSON.parse(readFileSync(i,"utf-8"));d.name&&(o=d.name);}catch{}e||(console.log(v.bold.cyan(`
61
61
  VeeStack Security Scan`)),console.log(v.gray("\u2500".repeat(40))));await Ze();if(!existsSync(i)&&!t.json){if(n)console.log(v.gray(`
62
62
  \u26A1 CI mode detected: Using default project name and scan directories`)),await ut({ci:true,skipAuthCheck:true,skipNextSteps:true});else if(!e){console.log(v.cyan(`
63
63
  \u2728 Welcome to VeeStack!`)),console.log(v.gray(`Let's configure your project to start scanning for security issues.
64
64
  `));let{runInit:d}=await yr({type:"confirm",name:"runInit",message:"Would you like to run 'veestack init' first?",initial:true});d?await ut({skipAuthCheck:true,skipNextSteps:true}):console.log(v.gray(`
65
65
  Using smart defaults for this scan...`));}}let l=ni({text:"Preparing scan...",spinner:"dots",stream:process.stdout});e||(console.log(`
66
66
  `+v.bold.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log(v.bold.white(" Analyzing Project")),console.log(v.bold.cyan(`\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
67
- `)),l.start());try{let d=Date.now(),A=existsSync(i)?JSON.parse(readFileSync(i,"utf-8")):{},O=A.scanPatterns||["**/*.{js,jsx,ts,tsx,json,py,go,rs,rb,php,cs,cpp,c,h,mjs,cjs,svelte,vue,html}"],C=A.excludePatterns||["**/node_modules/**","**/.next/**","**/dist/**","**/build/**","**/.git/**","**/coverage/**","**/*.test.ts","**/*.spec.ts"],R=await hi(r,O,C,t.diff);if(R.length===0&&!t.json){e||console.log(v.yellow(`
68
- \u26A0 No source files found to scan.`));return}let $=new si.SingleBar({format:"Scanning |"+v.cyan("{bar}")+"| {percentage}% ({value}/{total} files)",barCompleteChar:"\u2588",barIncompleteChar:"\u2591",hideCursor:!0});e||$.start(R.length,0);let V=await Fn(r,R.map(Y=>Y.path));e||($.update(Math.floor(R.length*.5)),l.text="Analyzing security...");let D=gi(R.length,V),pt=`report-${o}-security.json`;if(V.secretsFound&&V.secretsFound.length>0){let Y={project:o,directory:s,timestamp:new Date().toISOString(),score:D.score,grade:D.grade,criticalIssues:V.criticalCount,issues:V.secretsFound};await(await import('fs/promises')).writeFile(pt,JSON.stringify(Y,null,2));}t.json&&(console.log(JSON.stringify({version:ii,timestamp:new Date().toISOString(),score:D.score,grade:D.grade,files:R.length,issues:D.breakdown,project:o,directory:s},null,2)),process.exit(0)),V.criticalCount>0&&(e||($.stop(),l.fail("Security validation failed"),console.log(v.red(`
67
+ `)),l.start());try{let d=Date.now(),A=existsSync(i)?JSON.parse(readFileSync(i,"utf-8")):{},P=A.scanPatterns||["**/*.{js,jsx,ts,tsx,json,py,go,rs,rb,php,cs,cpp,c,h,mjs,cjs,svelte,vue,html}"],C=A.excludePatterns||["**/node_modules/**","**/.next/**","**/dist/**","**/build/**","**/.git/**","**/coverage/**","**/*.test.ts","**/*.spec.ts"],R=await hi(r,P,C,t.diff);if(R.length===0&&!t.json){e||console.log(v.yellow(`
68
+ \u26A0 No source files found to scan.`));return}let $=new si.SingleBar({format:"Scanning |"+v.cyan("{bar}")+"| {percentage}% ({value}/{total} files)",barCompleteChar:"\u2588",barIncompleteChar:"\u2591",hideCursor:!0});e||$.start(R.length,0);let V=await Fn(r,R.map(Y=>Y.path));e||($.update(Math.floor(R.length*.5)),l.text="Analyzing security...");let j=gi(R.length,V),pt=`report-${o}-security.json`;if(V.secretsFound&&V.secretsFound.length>0){let Y={project:o,directory:s,timestamp:new Date().toISOString(),score:j.score,grade:j.grade,criticalIssues:V.criticalCount,issues:V.secretsFound};await(await import('fs/promises')).writeFile(pt,JSON.stringify(Y,null,2));}t.json&&(console.log(JSON.stringify({version:ii,timestamp:new Date().toISOString(),score:j.score,grade:j.grade,files:R.length,issues:j.breakdown,project:o,directory:s},null,2)),process.exit(0)),V.criticalCount>0&&(e||($.stop(),l.fail("Security validation failed"),console.log(v.red(`
69
69
  \u274C ${V.criticalCount} Critical security risks detected.`)),V.secretsFound&&V.secretsFound.length>0&&(console.log(v.gray(`
70
70
  Issues detail:`)),V.secretsFound.slice(0,5).forEach(Y=>{console.log(v.yellow(` \u2022 ${Y.ruleId}: `)+v.gray(`${Y.filePath}:${Y.line}`));}),V.secretsFound.length>5&&console.log(v.gray(` ... and ${V.secretsFound.length-5} more issues.`))),console.log(v.cyan(`
71
71
  \u{1F4C4} Detailed report saved to: ${pt}`)),console.log(v.yellow(`
72
72
  For your protection, local snapshot generation is blocked.`)),console.log(v.gray(`
73
- \u2139 Recommended actions:`)),console.log(v.gray(" 1. Open the affected file(s) and review the reported security issue.")),console.log(v.gray(" 2. Fix the vulnerability or sensitive data exposure.")),console.log(v.gray(" 3. Run 'veestack scan' again.")),process.exit(1)));let{safe:B}=Bn(R.map(Y=>Y.path)),ie=await vi(r,R.filter(Y=>B.includes(Y.path)));if(e||($.update(R.length),$.stop(),l.succeed(`Analysis prepared in ${((Date.now()-d)/1e3).toFixed(1)}s`)),e)console.log(v.green(`\u2714 Scan completed. Score: ${D.grade}`));else {console.log(v.gray(`
74
- \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`)),console.log(v.bold.cyan(" Security Summary")),console.log(v.gray("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(v.gray("Project: "),v.white(o)),o!==s&&console.log(v.gray("Directory: "),v.white(s));let Y=D.score>=90?v.green:D.score>=70?v.yellow:v.red;console.log(v.gray("Score: "),Y(`${D.score} Grade: ${D.grade}`)),console.log(v.gray("Issues found: "),v.white(`${D.breakdown.critical+D.breakdown.high+D.breakdown.medium+D.breakdown.low}`)),console.log(v.gray("Dependencies: "),v.white(ie.metadata.total_dependencies)),console.log(v.gray("Files: "),v.white(R.length)),console.log(v.gray(`
73
+ \u2139 Recommended actions:`)),console.log(v.gray(" 1. Open the affected file(s) and review the reported security issue.")),console.log(v.gray(" 2. Fix the vulnerability or sensitive data exposure.")),console.log(v.gray(" 3. Run 'veestack scan' again.")),process.exit(1)));let{safe:B}=Bn(R.map(Y=>Y.path)),ie=await vi(r,R.filter(Y=>B.includes(Y.path)));if(e||($.update(R.length),$.stop(),l.succeed(`Analysis prepared in ${((Date.now()-d)/1e3).toFixed(1)}s`)),e)console.log(v.green(`\u2714 Scan completed. Score: ${j.grade}`));else {console.log(v.gray(`
74
+ \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`)),console.log(v.bold.cyan(" Security Summary")),console.log(v.gray("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(v.gray("Project: "),v.white(o)),o!==s&&console.log(v.gray("Directory: "),v.white(s));let Y=j.score>=90?v.green:j.score>=70?v.yellow:v.red;console.log(v.gray("Score: "),Y(`${j.score} Grade: ${j.grade}`)),console.log(v.gray("Issues found: "),v.white(`${j.breakdown.critical+j.breakdown.high+j.breakdown.medium+j.breakdown.low}`)),console.log(v.gray("Dependencies: "),v.white(ie.metadata.total_dependencies)),console.log(v.gray("Files: "),v.white(R.length)),console.log(v.gray(`
75
75
  Next steps:`)),console.log(v.gray(" 1. Upload results to dashboard:")),console.log(v.cyan(" veestack login")),console.log(v.cyan(" veestack upload")),console.log(v.gray(`
76
76
  2. View detailed report:`)),console.log(v.cyan(` ${t.output}`)),console.log(v.gray(`
77
77
  \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
@@ -95,19 +95,24 @@ Enter project name: `);if(r.trim()){let s=await Er(r.trim());if(s)return console
95
95
  \u{1F510} Authentication verified`)),r.user&&console.log(v.gray(`User: ${r.user.name}`)),console.log(v.gray(`Subscription tier: ${s==="pro"?"Pro":"Free"}`)),console.log(v.gray("\u2500".repeat(40)+`
96
96
  `)));let o=ni({text:"Preparing upload...",isSilent:n}).start();try{let a=await import('fs/promises');existsSync(t.file)||(o.fail(`File not found: ${t.file}`),n||console.log(v.yellow(`
97
97
  Tip: Run "veestack scan" first to generate a snapshot.`)),process.exit(1));let i=await a.readFile(t.file,"utf-8"),c=JSON.parse(i),l=t.projectId||process.env.VEESTACK_PROJECT_ID;if(!l){n&&(o.fail("Project ID is required in CI mode. Please set VEESTACK_PROJECT_ID."),process.exit(1)),o.stop();let ie=await xi();ie||(console.log(v.red(`
98
- \u274C No project selected. Exiting.`)),process.exit(1)),l=ie,o.start("Uploading snapshot...");}o.text="Compressing and uploading snapshot...";let d=gzipSync(JSON.stringify(c)).toString("base64"),A=JSON.stringify({project_id:l,snapshot:d,compressed:!0,encoding:"base64"}),O=await fe("POST","/api/snapshots/upload",A),C=await Sn(`${wn}/api/snapshots/upload`,{method:"POST",headers:O,body:A});if(!C.ok){let ie=await C.json().catch(()=>({}));o.fail("Upload failed"),console.error(v.red(`Error: ${ie.message||ie.error||"Server error"}`)),process.exit(1);}let R=await C.json(),{snapshotId:$,reportId:V,score:D,severity:pt,findings:B}=R;if(o.succeed("Analysis complete"),n)console.log(`\u2714 Upload successful. Report: ${Sr}/reports/${V}?project=${l}`);else {console.log(v.green(`
98
+ \u274C No project selected. Exiting.`)),process.exit(1)),l=ie,o.start("Uploading snapshot...");}o.text="Compressing and uploading snapshot...";let d=gzipSync(JSON.stringify(c)).toString("base64"),A=JSON.stringify({project_id:l,snapshot:d,compressed:!0,encoding:"base64"}),P=await fe("POST","/api/snapshots/upload",A),C=await Sn(`${wn}/api/snapshots/upload`,{method:"POST",headers:P,body:A});if(!C.ok){let ie=await C.json().catch(()=>({}));o.fail("Upload failed"),console.error(v.red(`Error: ${ie.message||ie.error||"Server error"}`)),process.exit(1);}let R=await C.json(),{snapshotId:$,reportId:V,score:j,severity:pt,findings:B}=R;if(o.succeed("Analysis complete"),n)console.log(`\u2714 Upload successful. Report: ${Sr}/reports/${V}?project=${l}`);else {console.log(v.green(`
99
99
  \u2705 Report generated and saved to VeeStack`)),console.log(v.gray("Project ID: "),v.white(l)),console.log(v.gray("Snapshot ID: "),v.white($)),console.log(v.gray("Report ID: "),v.white(V)),console.log(v.bold(`
100
- \u{1F4CA} Security Score:`),D>=90?v.green(D):D>=70?v.yellow(D):v.red(D)),console.log(v.gray("Severity: "),pt),console.log(v.gray("Findings: "),B);let ie=`${Sr}/reports/${V}?project=${l}`;console.log(v.blue(`
100
+ \u{1F4CA} Security Score:`),j>=90?v.green(j):j>=70?v.yellow(j):v.red(j)),console.log(v.gray("Severity: "),pt),console.log(v.gray("Findings: "),B);let ie=`${Sr}/reports/${V}?project=${l}`;console.log(v.blue(`
101
101
  \u{1F517} View your full report at:`)),console.log(v.underline(ie));}}catch(a){o.fail("Upload failed"),console.error(a),process.exit(1);}}var Ai=process.env.VEESTACK_API_URL||"https://api.veestack.dev";async function Tr(t){t.format==="sarif"?await bi(t):console.log(v.red('\u274C Unsupported format. Currently only "sarif" is supported.'));}async function bi(t){await Ae()||(console.error(v.red("\u274C Authentication required. Please login first.")),process.exit(1));let n=t.reportId;n||(console.error(v.red("\u274C Report ID is required for SARIF export.")),process.exit(1)),console.log(v.blue(`
102
102
  \u{1F4CA} Fetching report ${n} for SARIF export...`));try{let r=await fe("GET",`/api/reports/${n}/sarif`),s=await fetch(`${Ai}/api/reports/${n}/sarif`,{headers:r});if(!s.ok){let c=await s.json().catch(()=>({}));throw new Error(c.message||"Failed to fetch SARIF report")}let o=await s.json(),a=t.output||"veestack-results.sarif";await(await import('fs/promises')).writeFile(a,JSON.stringify(o,null,2)),console.log(v.green(`
103
103
  \u2705 SARIF report exported to: ${a}`)),console.log(v.gray("You can now upload this to GitHub Security Tab."));}catch(r){console.error(v.red(`
104
- \u274C Export failed:`),r instanceof Error?r.message:r),process.exit(1);}}var Ni=globalThis,Oi=Ni.CLI_VERSION||"unknown",xr=process.env.SUPABASE_URL||"";process.env.SUPABASE_ANON_KEY||"";var Pi=xr?`${xr}/functions/v1/cli-auth`:null,Di=process.env.VEESTACK_API_URL||"https://api.veestack.dev",ji=Pi||Di,Li=process.env.VEESTACK_WEB_URL||"https://www.veestack.com";function $i(){let t=process.platform,e=ct.hostname(),n=Oi,r=e||de__default.randomBytes(8).toString("hex"),s=de__default.createHash("sha256").update(`${r}:${t}:${n}`).digest("hex"),o=de__default.randomBytes(12).toString("hex"),a=`${e||"Unknown"} (${t==="win32"?"Windows":t==="darwin"?"macOS":"Linux"})`;return {id:o,name:a,fingerprint:s,os:t,version:n}}function Vi(){return new Promise(t=>{let e=wi.createInterface({input:process.stdin,output:process.stdout});e.question(v.cyan("Enter the code from your browser: "),n=>{e.close(),t(n.trim().toUpperCase());});})}async function Mi(t,e){try{let n=await fetch(`${ji}/api/cli/verify-code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_code:t,device_info:e})});if(n.status===202)return null;if(!n.ok){let r=await n.json().catch(()=>({}));throw new Error(r.error||`Failed to verify code: ${n.statusText}`)}return await n.json()}catch(n){throw n}}async function At(){console.log(v.bold.cyan(`
104
+ \u274C Export failed:`),r instanceof Error?r.message:r),process.exit(1);}}var Ni=globalThis,Oi=Ni.CLI_VERSION||"unknown",xr=process.env.SUPABASE_URL||"";process.env.SUPABASE_ANON_KEY||"";var Pi=xr?`${xr}/functions/v1/cli-auth`:null,Di=process.env.VEESTACK_API_URL||"https://api.veestack.dev",ji=Pi||Di,Li=process.env.VEESTACK_WEB_URL||"https://www.veestack.com";function $i(){let t=process.platform,e=ct.hostname(),n=Oi,r=e||de__default.randomBytes(8).toString("hex"),s=de__default.createHash("sha256").update(`${r}:${t}:${n}`).digest("hex"),o=de__default.randomBytes(12).toString("hex"),a=`${e||"Unknown"} (${t==="win32"?"Windows":t==="darwin"?"macOS":"Linux"})`;return {id:o,name:a,fingerprint:s,os:t,version:n}}function Vi(){return new Promise(t=>{console.log(v.gray(`
105
+ \u{1F4A1} Tip: Right-click to paste, then press Enter
106
+ `));let e=wi.createInterface({input:process.stdin,output:process.stdout});e.question(v.cyan("Enter the code from your browser: "),n=>{e.close(),t(n.trim().toUpperCase());});})}async function Mi(t,e){try{let n=await fetch(`${ji}/api/cli/verify-code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_code:t,device_info:e})});if(n.status===202)return null;if(!n.ok){let r=await n.json().catch(()=>({}));throw console.log(v.red(`
107
+ \u274C Server error: ${r.error||n.statusText}`)),new Error(r.error||`Failed to verify code: ${n.statusText}`)}return await n.json()}catch(n){throw console.log(v.red(`
108
+ \u274C Connection error: ${n instanceof Error?n.message:"Unknown error"}`)),n}}async function At(){console.log(v.bold.cyan(`
105
109
  \u{1F510} Login to VeeStack
106
110
  `));let t=$i(),e=`${Li}/cli-auth`;console.log(v.yellow(`Opening browser to authenticate...
107
111
  `)),console.log(v.gray(`Please copy the code from your browser and paste it here.
108
112
  `)),await Ci(e);let n=await Vi();(!n||n.length<6)&&(console.log(v.red(`
109
113
  \u274C Invalid code. Please try again.`)),process.exit(1));let r=ni({text:"Verifying code...",spinner:"dots",stream:process.stdout});r.start();try{let s=null,o=0,a=300;for(;!s&&o<a;){await new Promise(c=>setTimeout(c,2e3));try{s=await Mi(n,t);}catch(c){c instanceof Error&&c.message.includes("Invalid or expired")&&(r.fail("Verification failed"),console.log(v.red(`
110
- \u274C Invalid or expired code. Please try again.`)),process.exit(1));}o++,s||(r.text=`Waiting for browser authorization... (${o*2}s)`);}s||(r.fail("Authentication timeout"),console.log(v.red(`
114
+ \u274C Invalid or expired code. Please try again.`)),process.exit(1)),c instanceof Error&&console.log(v.yellow(`
115
+ \u26A0\uFE0F API error: ${c.message}`));}o++,s||(r.text=`Waiting for browser authorization... (${o*2}s)`);}s||(r.fail("Authentication timeout"),console.log(v.red(`
111
116
  \u274C Authentication timed out after 10 minutes.`)),console.log(v.yellow("Please try again with: veestack login")),process.exit(1)),r.succeed("Authentication successful");let i={token:s.access_token,tokenType:s.token_type,refreshToken:s.refresh_token,tokenExpiresAt:new Date(Date.now()+s.expires_in*1e3).toISOString(),device:{id:t.id,name:t.name,fingerprint:t.fingerprint},user:{id:s.user.id,email:s.user.email,name:s.user.name,provider:s.user.provider},subscription:s.subscription||{tier:"free",isActive:!0},lastLoginAt:new Date().toISOString()};try{await Tt(i),console.log(v.green(`
112
117
  \u2714 Authentication successful
113
118
  `)),console.log(v.gray("Account: ")+v.white(i.user.name)),console.log(v.gray("Email: ")+v.white(i.user.email)),console.log(v.gray("Device: ")+v.white(i.device.name)),console.log(v.gray("Subscription: ")+(i.subscription?.tier==="pro"?v.cyan("Pro"):v.blue("Free"))),console.log(v.gray(`
@@ -150,7 +155,7 @@ Opening ${e}...`));try{await Ci(e),console.log(v.green(`\u2714 Dashboard opened
150
155
  Project`));let a=await Promise.all([oa()]);a.forEach(Ct),console.log(v.bold(`
151
156
  Authentication`));let i=await Promise.all([ra(),aa()]);i.forEach(Ct),console.log(v.bold(`
152
157
  Connectivity`));let c=await Promise.all([sa()]);c.forEach(Ct),console.log(v.bold(`
153
- Security`));let l=await Promise.all([ia()]);l.forEach(Ct);let d=[...o,...a,...i,...c,...l];d.filter(B=>B.status==="ok").length;let O=d.filter(B=>B.status==="warning").length,C=d.filter(B=>B.status==="error").length;console.log(""),console.log(C===0&&O===0?v.green.bold("\u2728 All systems operational!"):C===0?v.yellow.bold(`\u26A0 ${O} issue(s) detected`):v.red.bold(`\u2718 ${C} error(s) found`)),console.log("");let R=0;i.find(B=>B.name==="Authentication")?.status!=="ok"&&(R++,console.log(v.bold(`${R}. Authentication`)),console.log(v.gray(" Run:")),console.log(v.cyan(` veestack login
158
+ Security`));let l=await Promise.all([ia()]);l.forEach(Ct);let d=[...o,...a,...i,...c,...l];d.filter(B=>B.status==="ok").length;let P=d.filter(B=>B.status==="warning").length,C=d.filter(B=>B.status==="error").length;console.log(""),console.log(C===0&&P===0?v.green.bold("\u2728 All systems operational!"):C===0?v.yellow.bold(`\u26A0 ${P} issue(s) detected`):v.red.bold(`\u2718 ${C} error(s) found`)),console.log("");let R=0;i.find(B=>B.name==="Authentication")?.status!=="ok"&&(R++,console.log(v.bold(`${R}. Authentication`)),console.log(v.gray(" Run:")),console.log(v.cyan(` veestack login
154
159
  `)));let V=i.find(B=>B.name==="Token Storage");V?.status==="warning"&&V.message.includes("File-based")&&(R++,console.log(v.bold(`${R}. Secure token storage`)),console.log(v.gray(" Install OS keychain support:")),console.log(v.cyan(` npm install -g keytar
155
160
  `))),c.find(B=>B.name==="API Connectivity")?.status==="warning"&&await Ze()&&(R++,console.log(v.bold(`${R}. API connectivity`)),console.log(v.gray(" Check your internet connection")),console.log(v.gray(` or verify API endpoint
156
161
  `))),a.find(B=>B.name==="Project Config")?.status==="warning"&&(R++,console.log(v.bold(`${R}. Project initialization`)),console.log(v.gray(" Run:")),console.log(v.cyan(` veestack init
@@ -163,15 +168,15 @@ Security`));let l=await Promise.all([ia()]);l.forEach(Ct);let d=[...o,...a,...i,
163
168
  \u{1F4F1} Device Binding Tests
164
169
  `));try{let e=await this.getConfig();e?.device?.id?this.addResult("Device ID","Device Binding","pass",`Configured (${e.device.id.substring(0,8)}...)`):this.addResult("Device ID","Device Binding","warn","No device ID");}catch{this.addResult("Device ID","Device Binding","skip","Not authenticated");}try{let e=await this.getConfig();e?.device?.fingerprint?e.device.fingerprint.length>=16?this.addResult("Device Fingerprint","Device Binding","pass","Strong fingerprint"):this.addResult("Device Fingerprint","Device Binding","warn","Weak fingerprint","Consider regenerating"):this.addResult("Device Fingerprint","Device Binding","warn","No fingerprint");}catch{this.addResult("Device Fingerprint","Device Binding","skip","Not authenticated");}try{(await this.getConfig())?.tokenBinding?this.addResult("Token Binding","Device Binding","pass","Cryptographic binding active"):this.addResult("Token Binding","Device Binding","warn","No token binding");}catch{this.addResult("Token Binding","Device Binding","skip","Not authenticated");}}async runStorageTests(){console.log(v.blue.bold(`
165
170
  \u{1F4BE} Storage Security Tests
166
- `));try{let e=Ye.join(this.configDir,"config.json");((await j.stat(e)).mode&36)!==0?this.addResult("Config Permissions","Storage","fail","World readable!","Run: chmod 600 ~/.veestack/config.json"):this.addResult("Config Permissions","Storage","pass","Restricted (0600)");}catch{this.addResult("Config Permissions","Storage","skip","No config file");}try{let e=Ye.join(this.configDir,"config.json"),n=await j.readFile(e,"utf-8");!(/"token":\s*"vs_[a-f0-9]+"/i.test(n)||/"refreshToken":\s*"vs_[a-f0-9]+"/i.test(n))||n.includes("encrypted")?this.addResult("No Plaintext Tokens","Storage","pass","Tokens encrypted or not present"):this.addResult("No Plaintext Tokens","Storage","fail","Plaintext tokens found!","Use OS Keychain");}catch{this.addResult("No Plaintext Tokens","Storage","skip","No config file");}}async runFilesystemTests(){console.log(v.blue.bold(`
171
+ `));try{let e=Ye.join(this.configDir,"config.json");((await L.stat(e)).mode&36)!==0?this.addResult("Config Permissions","Storage","fail","World readable!","Run: chmod 600 ~/.veestack/config.json"):this.addResult("Config Permissions","Storage","pass","Restricted (0600)");}catch{this.addResult("Config Permissions","Storage","skip","No config file");}try{let e=Ye.join(this.configDir,"config.json"),n=await L.readFile(e,"utf-8");!(/"token":\s*"vs_[a-f0-9]+"/i.test(n)||/"refreshToken":\s*"vs_[a-f0-9]+"/i.test(n))||n.includes("encrypted")?this.addResult("No Plaintext Tokens","Storage","pass","Tokens encrypted or not present"):this.addResult("No Plaintext Tokens","Storage","fail","Plaintext tokens found!","Use OS Keychain");}catch{this.addResult("No Plaintext Tokens","Storage","skip","No config file");}}async runFilesystemTests(){console.log(v.blue.bold(`
167
172
  \u{1F4C1} Filesystem Safety Tests
168
173
  `)),this.addResult("Input Validation","Filesystem","pass","Server-side enforced"),this.addResult("Path Traversal","Filesystem","pass","Server-side blocked"),this.addResult("Symlink Attack","Filesystem","pass","Verified");}async runDependencyTests(){console.log(v.blue.bold(`
169
174
  \u{1F4E6} Dependency Security Tests
170
- `));try{let e=await j.readFile(Ye.join(process.cwd(),"package.json"),"utf-8"),n=JSON.parse(e),r=JSON.stringify(n.dependencies||{}),o=["veestack-core","veestackcli","veestak","@veestack/core"].filter(a=>r.includes(a));o.length===0?this.addResult("Typosquatting Check","Dependencies","pass","No suspicious packages"):this.addResult("Typosquatting Check","Dependencies","fail","Suspicious packages found",o.join(", "));}catch{this.addResult("Typosquatting Check","Dependencies","skip","No package.json");}try{let e=["pnpm-lock.yaml","package-lock.json","yarn.lock"];(await Promise.all(e.map(async r=>{try{return await j.access(r),!0}catch{return !1}}))).some(r=>r)?this.addResult("Lockfile Present","Dependencies","pass","Lockfile committed"):this.addResult("Lockfile Present","Dependencies","warn","No lockfile found");}catch{this.addResult("Lockfile Present","Dependencies","skip","Unable to check");}}async runAPITests(){console.log(v.blue.bold(`
175
+ `));try{let e=await L.readFile(Ye.join(process.cwd(),"package.json"),"utf-8"),n=JSON.parse(e),r=JSON.stringify(n.dependencies||{}),o=["veestack-core","veestackcli","veestak","@veestack/core"].filter(a=>r.includes(a));o.length===0?this.addResult("Typosquatting Check","Dependencies","pass","No suspicious packages"):this.addResult("Typosquatting Check","Dependencies","fail","Suspicious packages found",o.join(", "));}catch{this.addResult("Typosquatting Check","Dependencies","skip","No package.json");}try{let e=["pnpm-lock.yaml","package-lock.json","yarn.lock"];(await Promise.all(e.map(async r=>{try{return await L.access(r),!0}catch{return !1}}))).some(r=>r)?this.addResult("Lockfile Present","Dependencies","pass","Lockfile committed"):this.addResult("Lockfile Present","Dependencies","warn","No lockfile found");}catch{this.addResult("Lockfile Present","Dependencies","skip","Unable to check");}}async runAPITests(){console.log(v.blue.bold(`
171
176
  \u{1F310} API Security Tests (Full Mode)
172
177
  `)),this.addResult("Device Binding","API Security","pass","Verified (API)"),this.addResult("Token Rotation","API Security","pass","Verified (API)"),this.addResult("Replay Protection","API Security","pass","Verified (API)"),this.addResult("HMAC Signatures","API Security","pass","Verified (API)");}async runNetworkTests(){console.log(v.blue.bold(`
173
178
  \u{1F512} Network Security Tests (Full Mode)
174
- `)),this.addResult("HTTPS Only","Network","pass","TLS 1.3 enforced"),this.addResult("Certificate Valid","Network","pass","Valid certificate chain"),this.addResult("No MITM","Network","pass","No proxy detected");}async checkTokenStorage(){let e=ct.platform();if(e==="darwin")try{return execSync('security find-generic-password -s "VeeStack CLI" 2>/dev/null',{stdio:"pipe"}),{secure:!0,method:"macOS Keychain"}}catch{}else if(e==="win32")try{return execSync('cmdkey /list 2>nul | findstr "VeeStack"',{stdio:"pipe"}),{secure:!0,method:"Windows Credential Manager"}}catch{}else try{return execSync("secret-tool lookup app VeeStack-CLI 2>/dev/null",{stdio:"pipe"}),{secure:!0,method:"Linux Secret Service"}}catch{}try{let n=Ye.join(this.configDir,"config.json"),r=await j.readFile(n,"utf-8");return r.includes("encrypted")||!r.includes('"token":')?{secure:!0,method:"Encrypted file (AES-256-GCM)"}:{secure:!1,method:"Plaintext file (INSECURE!)"}}catch{return {secure:true,method:"No tokens stored"}}}async getConfig(){try{let e=Ye.join(this.configDir,"config.json"),n=await j.readFile(e,"utf-8");return JSON.parse(n)}catch{return null}}generateReport(){let e=this.results.filter(i=>i.status==="pass").length,n=this.results.filter(i=>i.status==="fail").length,r=this.results.filter(i=>i.status==="warn").length,s=this.results.filter(i=>i.status!=="skip").length,o=s>0?((e+r*.5)/s*10).toFixed(1):"0.0",a=[];return n>0&&a.push(`Fix ${n} failed security test(s) before production deployment`),r>0&&a.push(`Address ${r} warning(s) to improve security posture`),this.results.some(i=>i.test==="Secure Token Storage"&&i.status==="pass")||a.push("Enable OS Keychain for secure token storage"),{timestamp:new Date().toISOString(),version:Ur,summary:{total:s,passed:e,failed:n,warnings:r,score:parseFloat(o)},results:this.results,recommendations:a}}};async function Fr(){let t=process.argv.slice(3),e=t.includes("--full"),n=t.includes("--json"),s=await new In(e).run();console.log(v.gray("=".repeat(60))),console.log(v.blue.bold(`
179
+ `)),this.addResult("HTTPS Only","Network","pass","TLS 1.3 enforced"),this.addResult("Certificate Valid","Network","pass","Valid certificate chain"),this.addResult("No MITM","Network","pass","No proxy detected");}async checkTokenStorage(){let e=ct.platform();if(e==="darwin")try{return execSync('security find-generic-password -s "VeeStack CLI" 2>/dev/null',{stdio:"pipe"}),{secure:!0,method:"macOS Keychain"}}catch{}else if(e==="win32")try{return execSync('cmdkey /list 2>nul | findstr "VeeStack"',{stdio:"pipe"}),{secure:!0,method:"Windows Credential Manager"}}catch{}else try{return execSync("secret-tool lookup app VeeStack-CLI 2>/dev/null",{stdio:"pipe"}),{secure:!0,method:"Linux Secret Service"}}catch{}try{let n=Ye.join(this.configDir,"config.json"),r=await L.readFile(n,"utf-8");return r.includes("encrypted")||!r.includes('"token":')?{secure:!0,method:"Encrypted file (AES-256-GCM)"}:{secure:!1,method:"Plaintext file (INSECURE!)"}}catch{return {secure:true,method:"No tokens stored"}}}async getConfig(){try{let e=Ye.join(this.configDir,"config.json"),n=await L.readFile(e,"utf-8");return JSON.parse(n)}catch{return null}}generateReport(){let e=this.results.filter(i=>i.status==="pass").length,n=this.results.filter(i=>i.status==="fail").length,r=this.results.filter(i=>i.status==="warn").length,s=this.results.filter(i=>i.status!=="skip").length,o=s>0?((e+r*.5)/s*10).toFixed(1):"0.0",a=[];return n>0&&a.push(`Fix ${n} failed security test(s) before production deployment`),r>0&&a.push(`Address ${r} warning(s) to improve security posture`),this.results.some(i=>i.test==="Secure Token Storage"&&i.status==="pass")||a.push("Enable OS Keychain for secure token storage"),{timestamp:new Date().toISOString(),version:Ur,summary:{total:s,passed:e,failed:n,warnings:r,score:parseFloat(o)},results:this.results,recommendations:a}}};async function Fr(){let t=process.argv.slice(3),e=t.includes("--full"),n=t.includes("--json"),s=await new In(e).run();console.log(v.gray("=".repeat(60))),console.log(v.blue.bold(`
175
180
  \u{1F4CA} Security Audit Report
176
181
  `));let{summary:o}=s;console.log(` Total Tests: ${o.total}`),console.log(` ${v.green("\u2713 Passed:")} ${o.passed}`),console.log(` ${v.red("\u2717 Failed:")} ${o.failed}`),console.log(` ${v.yellow("\u26A0 Warnings:")} ${o.warnings}`);let a=o.score>=8?v.green:o.score>=6?v.yellow:v.red;console.log(v.bold(`
177
182
  Security Score: ${a(o.score+"/10")}`)),o.score>=9?console.log(v.green.bold(`
package/dist/version.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vee_stack/cli",
3
- "version": "6.3.13",
3
+ "version": "6.3.15",
4
4
  "commit": "eb2a9885e020e3baef623e0d681d20c0b6f271e4",
5
- "buildTime": "2026-03-14T11:07:30.096Z",
5
+ "buildTime": "2026-03-14T11:52:26.965Z",
6
6
  "node": ">=18.0.0"
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vee_stack/cli",
3
- "version": "6.3.13",
3
+ "version": "6.3.15",
4
4
  "description": "VeeStack CLI - Technical Stack Visibility Tool",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",