game-dev-cli-darwin-arm64 0.25.9 → 0.25.11

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.
@@ -0,0 +1,59 @@
1
+ var __aigdRuntimeUrl=require("node:url").pathToFileURL(__filename).href;
2
+ var ec=require("node:child_process"),tc=require("node:path");var ee=require("node:path");var Ie=require("node:path");function hr(){return process.platform==="win32"?"win32":"posix"}function gr(e){return e==="win32"?Ie.win32:Ie.posix}var ic=/^[A-Za-z]:[\\/]/,sc=/^[\\/]{2}[^\\/]/,cc=/^[A-Za-z]:$/;function Oe(e){return ic.test(e)||sc.test(e)}function uc(e){let t=e.replace(/[\\/]+$/,"");if(t.length===0)return e;if(cc.test(t))return e;return t}function mr(e,t=hr()){if(e.length===0)return"";let r=gr(t),n=uc(r.normalize(e));return t==="win32"?n.toLowerCase():n}function _r(e,t,r={}){let n=r.platform??hr(),o=gr(n),i=e,s=t;if(i.length===0||s.length===0)return!1;let c=o.isAbsolute(i)||Oe(i);if(c&&Oe(i)!==Oe(s))return!1;let u=r.relativeBase??s,a=o.resolve(s),l=c?o.resolve(i):o.resolve(u,i),f=mr(a,n),d=mr(l,n);if(f.length===0||d.length===0)return!1;if(d===f)return!0;let m=o.relative(f,d);if(m.length===0)return!0;if(o.isAbsolute(m)||Oe(m))return!1;if(m===".."||m.startsWith(`..${o.sep}`)||m.startsWith("../"))return!1;return!0}function pt(e,t){if(typeof t!=="string")return null;if(ee.isAbsolute(t))return null;if(/^[A-Za-z]:/.test(t))return null;if(t==="")return ee.resolve(e);let r=ee.resolve(e,t);return _r(r,e)?r:null}function xr(e,t){let r=pt(e,t);if(r===null)return null;return r===ee.resolve(e)?null:r}var yr=require("node:child_process"),ft=require("node:string_decoder");var ac={GIT_PAGER:"cat",GIT_OPTIONAL_LOCKS:"0",LC_ALL:"C",GIT_LITERAL_PATHSPECS:"1"},br=(e,t)=>new Promise((r)=>{let n=yr.spawn("git",[...e],{cwd:t,stdio:["ignore","pipe","pipe"],env:{...process.env,...ac}}),o=new ft.StringDecoder("utf8"),i=new ft.StringDecoder("utf8"),s="",c="";n.stdout?.on("data",(u)=>{s+=o.write(u)}),n.stderr?.on("data",(u)=>{c+=i.write(u)}),n.on("error",(u)=>{r({code:127,stdout:"",stderr:u.message})}),n.on("close",(u)=>{r({code:u??0,stdout:s+o.end(),stderr:c+i.end()})})});var lc={insertions:0,deletions:0};var Aa={hasRemote:!1,...lc};function pc(e,t){if(t===void 0||t.length===0)return{ok:!1,message:"No files were named, so nothing was changed."};for(let r of t)if(xr(e,r)===null)return{ok:!1,message:pt(e,r)===null?`“${r}” is not inside this repository, so nothing was changed.`:"That path is the repository itself, so nothing was changed."};return{ok:!0,argv:["--",...t]}}function fc(e,t){let{repoRoot:r,hasCommit:n}=t,o=(i)=>{let s=pc(r,e.paths);return s.ok?{ok:!0,argv:[...i,...s.argv]}:s};switch(e.kind){case"stage":return o(["add"]);case"unstage":return o(n?["reset","-q"]:["rm","--cached","-q","-r"]);case"discard":return o(["restore","--worktree"]);case"discardStaged":return n?o(["restore","--staged","--worktree"]):{ok:!1,message:"This repository has no commits yet, so there is nothing to restore these files to. Unstage them instead, or delete them."};case"clean":return o(["clean","-f","-d","-q"]);case"commit":{let i=e.message?.trim()??"";if(i==="")return{ok:!1,message:"Write a commit message first."};return{ok:!0,argv:["commit","-m",i]}}case"push":return{ok:!0,argv:["push"]};case"forcePush":return{ok:!0,argv:["push","--force-with-lease"]};case"pull":return{ok:!0,argv:["pull"]};case"fetch":return{ok:!0,argv:["fetch"]};case"init":return{ok:!0,argv:["init"]};default:{let i=e.kind;return{ok:!1,message:`Unknown git action “${String(i)}”.`}}}}function dc(e,t){let r=t.stderr.trim(),n=r===""?`git exited with code ${t.code}`:r;if(t.code===127)return`git could not be run — check that it is installed and on your PATH. (${n})`;if(/no upstream branch/i.test(r))return`This branch has no upstream yet, so there is nowhere to ${e==="pull"?"pull from":"push to"}. Publish it from a terminal with “git push -u origin <branch>”. (${n})`;if(/stale info|rejected.*fetch first|non-fast-forward/i.test(r))return`The remote has commits this branch does not. Pull first, then push again. (${n})`;if(/could not read Username|Authentication failed|Permission denied \(publickey\)/i.test(r))return`git could not authenticate with the remote. Check your credentials or SSH key, then try again. (${n})`;if(/conflict/i.test(r))return`The merge left conflicts. Resolve them in your editor, stage the files, then commit. (${n})`;if(/nothing to commit/i.test(r)||/nothing added to commit/i.test(r))return"There is nothing staged to commit. Stage a change first.";return`The “git ${e}” command failed. ${n}`}async function vr(e,t,r=br){let n=fc(e,t);if(!n.ok)return{ok:!1,message:n.message,command:`git ${e.kind}`};let o=e.kind==="commit"?"git commit -m <message>":`git ${n.argv.join(" ")}`,i=await r(n.argv,t.repoRoot);if(i.code!==0)return{ok:!1,message:dc(e.kind,i),command:o};return{ok:!0,message:null,command:o}}function ge(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function mt(e,t="|"){return e.map((r)=>_t(r)).join(t)}function _e(e,t){if(typeof t==="bigint")return t.toString();return t}class zr{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function xe(e){return new zr(e)}function $r(e){return e===null||e===void 0}function Ae(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function wr(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function j(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ye(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function X(e){return ye(e._zod.def)??e._zod.def.shape}function kr(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return j(this,t,n),n},enumerable:!0,configurable:!0})}function Zr(e,t,r){if(t in e)j(e,t,r);else e[t]=r}function ce(e,t,r,n){let o=X(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)kr(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c});else Zr(e,i,n?n(s.value,i):s.value)}}function mc(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)kr(e,r,()=>t[r]);else Zr(e,r,n.value)}}function T(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Pr(e){return JSON.stringify(e)}function Sr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ht="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function le(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Or=xe(()=>{if(N.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function pe(e){if(le(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(le(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function gt(e){if(pe(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Ir=new Set(["string","number","symbol"]);function re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function G(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function g(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function _t(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Ar(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Ee=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),xt={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return ce(i,e,Te(e,t)),G(e,T(r,{shape:i,checks:[]}))}function Te(e,t){let r=X(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function gc(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Te(e,t)),s={};return ce(s,e,Reflect.ownKeys(X(e)).filter((c)=>!i.has(c))),G(e,T(r,{shape:s,checks:[]}))}function _c(e,t){if(!pe(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=X(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return G(e,T(e._zod.def,{shape:Er(e,t)}))}function Er(e,t){let r={};return ce(r,e,Reflect.ownKeys(X(e))),mc(r,t),r}function xc(e,t){if(!pe(t))throw Error("Invalid input to safeExtend: expected a plain object");return G(e,T(e._zod.def,{shape:Er(e,t)}))}function yc(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ce(r,e,Reflect.ownKeys(X(e))),ce(r,t,Reflect.ownKeys(X(t)));let n=T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return G(e,n)}function Tr(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(Te(t,r)):void 0,u={};return ce(u,t,Reflect.ownKeys(X(t)),e&&((a,l)=>c&&!c.has(l)?a:new e({type:"optional",innerType:a}))),G(t,T(t._zod.def,{shape:u,checks:[]}))}function bc(e,t,r){let n=r?new Set(Te(t,r)):void 0,o={};return ce(o,t,Reflect.ownKeys(X(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),G(t,T(t._zod.def,{shape:o}))}function K(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Nr(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Ne(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function he(e){return typeof e==="string"?e:e?.message}function yt(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;if(o>=0)t.push([o,r])}return t}function Ce(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function ne(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:he(e.inst?._zod.def?.error?.(e))??he(i?.(e))??he(t?.error?.(e))??he(r.customError?.(e))??he(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e)){if(u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__")continue;c[u]=e[u]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var vc=/[\uD800-\uDBFF]/;function Re(e){let t=e.length;if(!vc.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function De(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Cr(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function ue(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function Rr(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else zc(e,r,n.value)}}function H(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function je(e,t,r){return H(e,t,r,!1)}function Dr(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return H(this,r,n(this))},set(o){H(this,r,o)}})}return t}function zc(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:H(this,t,r.bind(this))},set(n){H(this,t,n)}})}function $c(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var dt,te=!1,wc={configurable:!0,get(){te=!0;return}};function y(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&dt!==e._zod){dt=void 0;return}dt=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,wc);let o=te;te=!1;try{let i=r(this);if(te)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return te=te||o,i}catch(i){throw delete this[t],te=te||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function kc(e,t,r,n){let o=$c(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var Zc="~constantCatch";function jr(e){let t=()=>e;return t[Zc]=!0,t}var Lr;var bt={value:void 0,enumerable:!1},Fr="captureStackTrace"in Error?Error:null;function Pc(e){let t=Fr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Fr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(d,m){if(!d._zod){bt.value=new i(m);try{Object.defineProperty(d,"_zod",bt)}finally{bt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),x=d._zod.constr.prototype,b=_;while(b&&b!==x)b=Object.getPrototypeOf(b);let E=b??_;if(!c.has(E))c.add(E),Rr(E,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(d){let m=n?.Parent?Pc(l):this;u(m,d);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(n?.Parent&&d instanceof n.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class V extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class be extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Lr=globalThis).__zod_globalConfig??(Lr.__zod_globalConfig={});var N=globalThis.__zod_globalConfig;function F(e){if(e)Object.assign(N,e);return N}function Sc(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,_e,2)),e.message}function Oc(e){this._zod.message=e}var Ic={get:Sc,set:Oc,enumerable:!0,configurable:!0},zt={value:void 0,enumerable:!1},Mr=new WeakSet([Object.prototype,Error.prototype]),Ur=(e,t)=>{e.name="$ZodError",zt.value=t,Object.defineProperty(e,"issues",zt),zt.value=void 0,Object.defineProperty(e,"message",Ic);let r=Object.getPrototypeOf(e);if(!Mr.has(r))Mr.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},Br=p("$ZodError",Ur),La=p("$ZodError",Ur,void 0,{Parent:Error});function Ac(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Jr(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)Ac(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function Gr(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,a=0;while(a<c.length){let l=c[a],f=a===c.length-1;if(l==="_errors"){if(f)u._errors.push(t(s));a++;continue}if(!Object.prototype.hasOwnProperty.call(u,l))Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=u[l];if(f)d._errors.push(t(s));u=d,a++}}}};return n(e),r}function Le(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Fe=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new V;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>ne(a,s,F())));throw ht(u,i?.callee??t),u}return c.value};return t};var Me=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>ne(a,s,F())));throw ht(u,i?.callee??t),u}return c.value};return t};var Ue=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new V;return i.issues.length?Kr(e,i.issues,o):{success:!0,data:i.value}};function Kr(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>ne(o,r,F()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var Be=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Kr(e,i.issues,o):{success:!0,data:i.value}};var Ec=Symbol.for("zod.compile.invalid"),Tc=Symbol.for("zod.compile.fallback"),$t=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Ec)return!0;if(n.definite===!0&&r===void 0)return!1}return Nc(e,t,r)};function Nc(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[Tc]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new V;return i.issues.length===0}var wt=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},Vr=(e)=>{let t=Fe(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,Le(r,s))};return r};var Wr=(e)=>{let t=Fe(e),r=(n,o,i,s)=>t(n,o,i,Le(r,s));return r};var Xr=(e)=>{let t=Me(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,Le(r,s))};return r};var Hr=(e)=>{let t=Me(e),r=async(n,o,i,s)=>await t(n,o,i,Le(r,s));return r};var qr=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ue(e)(t,r,o)};var Yr=(e)=>(t,r,n)=>Ue(e)(t,r,n);var Qr=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Be(e)(t,r,o)};var en=(e)=>async(t,r,n)=>Be(e)(t,r,n);var tn=/^[cC][0-9a-z]{6,}$/,rn=/^[0-9a-z]+$/,nn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,on=/^[0-9a-vA-V]{20}$/,sn=/^[A-Za-z0-9]{27}$/,cn=/^[a-zA-Z0-9_-]{21}$/;function un(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var an=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ln=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zt=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var pn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Cc="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function fn(){return new RegExp(Cc,"u")}var dn=/^(?:(?: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])$/,mn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var hn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_n=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var yn=/^https?$/,bn=/^\+[1-9]\d{6,14}$/;var vn="(?:(?:\\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])))";function Rc(e){return new RegExp(`^${e}$`)}var zn=Rc(vn);function kt(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function $n(e){return new RegExp(`^${kt(e)}$`)}function wn(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${kt({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${kt({precision:e.precision})}`:r;return new RegExp(`^${vn}T(?:${n})$`)}var kn=/^[\s\S]{0,}$/;var Pt=/^-?\d+(?:\.\d+)?$/,Zn=/^(?:true|false)$/i;var Pn=/^[^A-Z]*$/,Sn=/^[^a-z]*$/;var I=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var St=(e)=>{let t=e.value;return!$r(t)&&t.length!==void 0},Je={number:"number",bigint:"bigint",object:"date"},Ot=p("$ZodCheckLessThan",(e,t)=>{I.init(e,t);let r=Je[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:Je[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),It=p("$ZodCheckGreaterThan",(e,t)=>{I.init(e,t);let r=Je[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:Je[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),On=p("$ZodCheckMultipleOf",(e,t)=>{I.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):wr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),In=p("$ZodCheckNumberFormat",(e,t)=>{I.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Ee[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(c<o)s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var An=p("$ZodCheckMaxLength",(e,t)=>{var r;I.init(e,t),(r=e._zod.def).when??(r.when=St),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?Re(o):i)<=t.maximum)return;let c=De(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),En=p("$ZodCheckMinLength",(e,t)=>{var r;I.init(e,t),(r=e._zod.def).when??(r.when=St),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?Re(o):i)>=t.minimum)return;let c=De(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Tn=p("$ZodCheckLengthEquals",(e,t)=>{var r;I.init(e,t),(r=e._zod.def).when??(r.when=St),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?Re(o):i;if(s===t.length)return;let c=De(o),u=s>t.length;n.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ze=p("$ZodCheckStringFormat",(e,t)=>{var r,n;if(I.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),Nn=p("$ZodCheckRegex",(e,t)=>{ze.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Cn=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Pn),ze.init(e,t)}),Rn=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sn),ze.init(e,t)}),Dn=p("$ZodCheckIncludes",(e,t)=>{I.init(e,t);let r=re(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),jn=p("$ZodCheckStartsWith",(e,t)=>{I.init(e,t);let r=new RegExp(`^${re(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ln=p("$ZodCheckEndsWith",(e,t)=>{I.init(e,t);let r=new RegExp(`.*${re(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var Fn=p("$ZodCheckOverwrite",(e,t)=>{I.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class At{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
3
+ `).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
4
+ ${t.join(`
5
+ `)}
6
+ };`)(...Object.values(this.closed))}}var Un={major:4,minor:6,patch:7};var w=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,u,a)=>{if(c.memo)return c;let l=K(c),f;for(let d of u){if(d._zod.def.when){if(Nr(c))continue;if(!d._zod.def.when(c))continue}else if(l)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new V;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(Ce(c.issues,m,e),!l)l=K(c,m)});else{if(c.issues.length===m)continue;if(Ce(c.issues,m,e),!l)l=K(c,m)}}if(f)return f.then(()=>c);return c},s=(c,u,a)=>{if(K(c))return c.aborted=!0,c;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new V;return l.then((f)=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});if(l instanceof Promise)return l.then((f)=>s(f,c,u));return s(l,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new V;return a.then((l)=>i(l,o,u))}return i(a,o,u)}}},{get "~standard"(){return je(this,"~standard",Tt(this))},set "~standard"(e){H(this,"~standard",e)}}),Qn=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>ne(r,t,F()))}:{value:e.value};async function jc(e,t){let r={async:!0};return Qn(await e._zod.run({value:t,issues:[]},r),r)}function Tt(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Qn(n,r)}catch(n){}return jc(e,t)},vendor:"zod",version:1}}var We=p("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??kn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),z=p("$ZodStringFormat",(e,t)=>{ze.init(e,t),We.init(e,t)}),eo=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ln),z.init(e,t)}),to=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Zt(n))}else t.pattern??(t.pattern=Zt());z.init(e,t)}),ro=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=pn),z.init(e,t)}),no=1,Ke=2;function oo(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function Lc(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return oo(e)||Ke;return Fc(e,t)}function Fc(e,t){if(!t.normalize&&t.protocol?.source===yn.source&&!/^https?:\/\//i.test(e))return no;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Ke}return new URL(e)}catch{return Ke}}var Mc=/[\t\n\r]/g;function Bn(e){return e.replace(Mc,"")}function Uc(e,t){return t.lastIndex=0,t.test(e.hostname)}function Bc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var io=p("$ZodURL",(e,t)=>{z.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=Lc(n,t);if(o===no){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Ke){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=Bn(n);return}if(t.hostname&&!Uc(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!Bc(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:Bn(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),so=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=fn()),z.init(e,t)}),co=p("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?cn:un(t.length)),z.init(e,t)}),uo=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=tn),z.init(e,t)}),ao=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rn),z.init(e,t)}),lo=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=nn),z.init(e,t)}),po=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=on),z.init(e,t)}),fo=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=sn),z.init(e,t)}),mo=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=wn(t)),z.init(e,t)}),ho=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zn),z.init(e,t)}),go=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$n(t)),z.init(e,t)}),_o=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=an),z.init(e,t)}),xo=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=dn),z.init(e,t)}),Jc=/^[0-9a-fA-F:.]+$/;function yo(e){if(!Jc.test(e))return!1;return oo(`http://[${e}]`)}var bo=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mn),z.init(e,t),e._zod.check=(r)=>{if(!yo(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var vo=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=hn),z.init(e,t)});function Gc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return yo(r)}var zo=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gn),z.init(e,t),e._zod.check=(r)=>{if(!Gc(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function $o(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Nt=/^[0-9a-zA-Z+/]*={0,2}$/,wo=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Nt),z.init(e,t),e._zod.check=(r)=>{if($o(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Xe=/^[A-Za-z0-9_-]*$/;function Kc(e){if(!Xe.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return $o(r)}var ko=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Xe),z.init(e,t),e._zod.check=(r)=>{if(Kc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Zo=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bn),z.init(e,t)});function Vc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var Po=p("$ZodJWT",(e,t)=>{z.init(e,t),e._zod.check=(r)=>{if(Vc(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Ct=p("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=Pt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),So=p("$ZodNumberFormat",(e,t)=>{In.init(e,t),Ct.init(e,t)}),Oo=p("$ZodBoolean",(e,t)=>{w.init(e,t),e._zod.pattern=Zn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let o=r.value;if(typeof o==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var Io=p("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=(r)=>r}),Ao=p("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Wc(e,t){let r=yt(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map((i)=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let c=t(i.value);if(c>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[u,a]of yt(e._zod.def.checks))if(c>u&&a._zod.def.when(i)){let l=i.issues.length;return a._zod.check(i),i.issues[l].continue=!1,Ce(i.issues,l,e),i}}return o(i,s)}}var Xc=(e)=>Array.isArray(e)?e.length:-1;function Jn(e,t,r){if(e.issues.length)t.issues.push(...Ne(r,e.issues));t.value[r]=e.value}var Eo=p("$ZodArray",(e,t)=>{w.init(e,t);let r=N.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)s.push(l.then((f)=>Jn(f,n,u)));else if(Jn(l,n,u),c&&l.issues.length!==0&&K(l))break}if(s.length)return Promise.all(s).then(()=>n);return n},Wc(e,Xc)});function Ve(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!s&&c&&o==="optional")return;if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...Ne(r,e.issues))}if(!s&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||o==="defaulted"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var Hc=[];function To(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Hc,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=Ar(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function No(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,{optin:f,optout:d}=a,m=0;for(let h in t){if(s&&r.issues.length!==m){if(K(r,m))break;m=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){if(l==="never")c.push(h);continue}if(l==="never"){c.push(h);continue}let _=a.run({value:t[h],issues:[]},n);if(_ instanceof Promise)e.push(_.then((x)=>Ve(x,r,h,t,f,d)));else Ve(_,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var qc=p("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=xe(()=>To(t));y(e,"propValues",(a)=>{let l=a.def.shape,f={};for(let d in l){let m=l[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))j(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=le,s=t.catchall,c,u=N.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{c??(c=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let d=[],m=c.shape,h=l?.abortEarly,_=a.issues.length;for(let x of c.allKeys){if(h&&a.issues.length!==_){if(K(a,_))break;_=a.issues.length}if(x==="__proto__")continue;let b=m[x],E=b._zod.optin,J=b._zod.optout,D=b._zod.run({value:f[x],issues:[]},l);if(D instanceof Promise)d.push(D.then((Z)=>Ve(Z,a,x,f,E,J)));else Ve(D,a,x,f,E,J)}if(!s)return d.length?Promise.all(d).then(()=>a):a;return No(d,f,a,l,o.value,e,h===!0)}}),Co=p("$ZodObjectJIT",(e,t)=>{qc.init(e,t);let r=e._zod.parse,n=xe(()=>To(t)),o=N.memoizer,i=(m)=>{let h=n.value,_=h.symbolKeys,x=new At(["payload","ctx"],{shape:m,inst:e,memo:o,syms:_}),b=(Z)=>`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`,E=(Z,v)=>`
7
+ let ${Z}_ab = false;
8
+ for (let i = 0; i < ${Z}.issues.length; i++) {
9
+ const iss = ${Z}.issues[i];
10
+ iss.path = iss.path ? [${v}, ...iss.path] : [${v}];
11
+ payload.issues.push(iss);
12
+ if (iss.continue !== true) ${Z}_ab = true;
13
+ }
14
+ if (${Z}_ab && ctx && ctx.abortEarly) {
15
+ payload.value = newResult;
16
+ return payload;
17
+ }`;x.write("const input = payload.value;");let J=Object.create(null),D=0;for(let Z of h.allKeys)J[Z]=`key_${D++}`;x.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let Z of h.allKeys){if(Z==="__proto__")continue;let v=J[Z],S=typeof Z==="symbol"?`syms[${_.indexOf(Z)}]`:Pr(Z),W=`${S} in input`,fr=m[Z],lt=fr?._zod?.optin,dr=lt!==void 0,nc=fr?._zod?.optout==="optional";if(x.write(`const ${v} = ${b(S)};`),dr&&nc){let oc=lt==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;x.write(`
18
+ const ${v}_present = ${W};
19
+ if (!${v}.issues.length || ${v}_present) {
20
+ if (${v}.issues.length) {${E(v,S)}
21
+ }
22
+
23
+ if (${oc}) {
24
+ newResult[${S}] = ${v}.value;
25
+ }
26
+ }
27
+
28
+ `)}else if(!dr)x.write(`
29
+ const ${v}_present = ${W};
30
+ if (${v}.issues.length) {${E(v,S)}
31
+ }
32
+ if (!${v}_present && !${v}.issues.length) {
33
+ payload.issues.push({
34
+ code: "invalid_type",
35
+ expected: "nonoptional",
36
+ input: undefined,
37
+ path: [${S}]
38
+ });
39
+ if (ctx && ctx.abortEarly) {
40
+ payload.value = newResult;
41
+ return payload;
42
+ }
43
+ }
44
+
45
+ if (${v}_present) {
46
+ newResult[${S}] = ${v}.value;
47
+ }
48
+
49
+ `);else if(x.write(`
50
+ if (${v}.issues.length) {${E(v,S)}
51
+ }
52
+ `),lt==="defaulted")x.write(`newResult[${S}] = ${v}.value;`);else x.write(`
53
+ if (${v}.value !== undefined || ${W}) {
54
+ newResult[${S}] = ${v}.value;
55
+ }
56
+ `)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()},s,c=le,u=!N.jitless,l=u&&Or.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=n.value);let _=m.value;if(!c(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m;if(u&&l&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return No([],_,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function Gn(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter((i)=>!K(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>ne(s,n,F())))}),t}var Rt=p("$ZodUnion",(e,t)=>{w.init(e,t),y(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),y(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),y(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),y(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>Ae(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}if(!i)return Gn(s,n,e,o);return Promise.all(s).then((c)=>Gn(c,n,e,o))}});function Yc(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||n.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of n)if(t.has(o)){if(o!==void 0)throw Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}var Ro=p("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Rt.init(e,t);let r=e._zod.parse;y(e,"propValues",(o)=>{let i={},s=0;for(let c of o.def.options){let u=c._zod.propValues;if(!u||Object.keys(u).length===0)throw Error(`Invalid discriminated union option at index "${o.def.options.indexOf(c)}"`);if(u[o.def.discriminator]?.has(void 0))s++;for(let[a,l]of Object.entries(u)){if(!Object.prototype.hasOwnProperty.call(i,a))j(i,a,new Set);for(let f of l)i[a].add(f)}}if(!o.def.unionFallback&&s>1)i[o.def.discriminator]?.delete(void 0);return i}),t.options.forEach((o,i)=>{let s=ye(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw Error(`Invalid discriminated union option at index "${i}"`)});let n=xe(()=>Yc(t));e._zod.parse=(o,i)=>{let s=o.value;if(!le(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let c=s?.[t.discriminator],u=n.value.get(c);if(u&&(c!==void 0||i.direction!=="backward"))return u._zod.run(o,i);if(t.unionFallback||i.direction==="backward")return r(o,i);return o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter((a)=>n.value.get(a)!==null),input:s,path:[t.discriminator],inst:e}),o}}),Do=p("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([u,a])=>Kn(r,u,a));return Kn(r,i,s)}});function Et(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(pe(e)&&pe(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=Et(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=Et(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Kn(e,t,r){let n=new Map,o,i=new Map,s=(a,l)=>{let f;if(a.code==="unrecognized_keys"&&!a.path?.length)o??(o=a),f=a.keys;else if(a.code==="invalid_key"&&a.origin==="record"&&a.path?.length===1){let d=String(a.path[0]);if(!i.has(d))i.set(d,a);f=[d]}else return!1;for(let d of f){if(!n.has(d))n.set(d,{});n.get(d)[l]=!0}return!0};for(let a of t.issues)if(!s(a,"l"))e.issues.push(a);for(let a of r.issues)if(!s(a,"r"))e.issues.push(a);let c=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(c.length){let a=o?c.filter((l)=>o.keys.includes(l)):[];if(a.length)e.issues.push({...o,keys:a});for(let l of c)if(!a.includes(l)&&i.has(l))e.issues.push(i.get(l))}let u=Et(t.value,r.value);if(!u.valid){if(K(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var jo=p("$ZodEnum",(e,t)=>{w.init(e,t);let r=ge(t.entries),n=new Set(r);e._zod.values=n,y(e,"pattern",(o)=>{let i=ge(o.def.entries).filter((s)=>Ir.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>re(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;if(n.has(s))return o;return o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),Lo=p("$ZodLiteral",(e,t)=>{w.init(e,t);let r=new Set(t.values);e._zod.values=r,y(e,"pattern",(n)=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map((i)=>typeof i==="string"?re(i):i?re(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;if(r.has(i))return n;return n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var Fo=p("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",N.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new be(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(r.value=s,r));if(o instanceof Promise)throw new V;return r.value=o,r}});function Vn(e,t){return e.value=t.issues.length?void 0:t.value,e}var Dt=p("$ZodOptional",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Ae(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>Vn(r,i));return Vn(r,o)}return t.innerType._zod.run(r,n)}}),Mo=p("$ZodExactOptional",(e,t)=>{Dt.init(e,t),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Uo=p("$ZodNullable",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Ae(n.source)}|null)$`):void 0}),y(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),Bo=p("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Wn(i,t));return Wn(o,t)}});function Wn(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Jo=p("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),Go=p("$ZodNonOptional",(e,t)=>{w.init(e,t),y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Xn(i,e));return Xn(o,e)}});function Xn(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Hn(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>ne(o,n,F()))},input:e.value}),e}var Ko=p("$ZodCatch",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>Hn(r,i,t,n));return Hn(r,o,t,n)}});var Vo=p("$ZodPipe",(e,t)=>{w.init(e,t),y(e,"values",(r)=>r.def.in._zod.values),y(e,"optin",(r)=>r.def.in._zod.optin),y(e,"optout",(r)=>r.def.out._zod.optout),y(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);if(i instanceof Promise)return i.then((s)=>Ge(s,t.in,n));return Ge(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Ge(i,t.out,n));return Ge(o,t.out,n)}});function Ge(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Wo=p("$ZodReadonly",(e,t)=>{w.init(e,t),y(e,"propValues",(r)=>r.def.innerType._zod.propValues),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"optin",(r)=>r.def.innerType?._zod?.optin),y(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(qn);return qn(o)}});function qn(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Xo=p("$ZodCustom",(e,t)=>{I.init(e,t),w.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>Yn(i,r,n,e));Yn(o,r,n,e);return}});function Yn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(ue(o))}}class qo extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Lt="~memo",Ho=[];function Yo(e){return e!==null&&typeof e==="object"}function jt(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Qo=new WeakMap,$e=0,Ye=1,we=2;function Qe(e,t,r){let n=Qo.get(e);if(n!==void 0)return n?we:$e;if(t.has(e))return we;t.add(e);let o=$e,i=(l)=>{if(o!==we&&l?._zod){let f=Qe(l,t,r);if(f>o)o=f}},s=(l,f)=>{let d=$e;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(f&&!h.enumerable)continue;let _=h.get?Ye:h.value?._zod?Qe(h.value,t,r):$e;if(_>d)d=_}return d},c=(l)=>{if(l>o)o=l},u=e._zod.def,a=u.type;switch(a){case"object":{let l=ye(u);c(l?s(l,!0):Ye),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(let l of u.items)i(l);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(let l of u.options)i(l);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{let l=u._cachedInner??(r?e._zod.innerType:void 0);c(l?Qe(l,t,!1):Ye);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in u){let f=Object.getOwnPropertyDescriptor(u,l);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),Qc(e,o)}function Qc(e,t){if(t!==Ye)Qo.set(e,t===we);return t}function eu(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var He,qe=[],tu={alloc(e,t,r){let n=He;if(!n)return r;He=void 0;let o={value:r,issues:null};return n.set(t.value,o),qe.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&ru(i,o.value))throw new qo;return r(o,i)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,a)=>{if(r===void 0){let b=Qe(e,new Set,!1);if(b===$e){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(u,a)}if(b===we||n)r=!0;else n=!0}let l=u.value;if(!Yo(l))return s(u,a);let f=a[Lt];if(!f)f={buckets:new WeakMap,backEdges:void 0},a[Lt]=f;let d;if(o===a)d=i;else d=eu(f,e),o=a,i=d;let m=d.get(l);if(m){if(u.value=m.value,m.issues){if(m.issues.length)u.issues.push(...jt(m.issues))}else u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return u}He=d;let h=qe.length,_=s(u,a);He=void 0;let x=qe.length>h?qe.pop():void 0;if(_ instanceof Promise)return _.then((b)=>{if(x)x.issues=b.issues.length?jt(b.issues):Ho;return b});if(x)x.issues=_.issues.length?jt(_.issues):Ho;return _};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function ei(){return tu}function ru(e,t){let r=e[Lt]?.backEdges;return r!==void 0&&Yo(t)&&r.has(t)}var nu=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return n[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=Cr(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${_t(i.values[0])}`;return`Invalid option: expected one of ${mt(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${mt(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Ft(){return{localeError:nu()}}var ti;class ri{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ou(){return new ri}(ti=globalThis).__zod_globalRegistry??(ti.__zod_globalRegistry=ou());var ae=globalThis.__zod_globalRegistry;function ni(e){if(e.checks)e.checks=[...e.checks];return e}function oi(e,t){return new e(ni({type:"string",...g(t)}))}function ii(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function si(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function ci(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function ui(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function ai(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function li(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function pi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function fi(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function di(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function mi(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function hi(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function gi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function _i(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function xi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function yi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function bi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function vi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function zi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function $i(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function wi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function ki(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function Zi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function Pi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Si(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Oi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function Ii(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Ai(e,t){return new e(ni({type:"number",checks:[],...g(t)}))}function Ei(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function Ti(e,t){return new e({type:"boolean",...g(t)})}function Ni(e){return new e({type:"unknown"})}function Ci(e,t){return new e({type:"never",...g(t)})}function et(e,t){return new Ot({check:"less_than",...g(t),value:e,inclusive:!1})}function ke(e,t){return new Ot({check:"less_than",...g(t),value:e,inclusive:!0})}function tt(e,t){return new It({check:"greater_than",...g(t),value:e,inclusive:!1})}function Ze(e,t){return new It({check:"greater_than",...g(t),value:e,inclusive:!0})}function rt(e,t){return new On({check:"multiple_of",...g(t),value:e})}function nt(e,t){return new An({check:"max_length",...g(t),maximum:e})}function fe(e,t){return new En({check:"min_length",...g(t),minimum:e})}function ot(e,t){return new Tn({check:"length_equals",...g(t),length:e})}function Mt(e,t){return new Nn({check:"string_format",format:"regex",...g(t),pattern:e})}function Ut(e){return new Cn({check:"string_format",format:"lowercase",...g(e)})}function Bt(e){return new Rn({check:"string_format",format:"uppercase",...g(e)})}function Jt(e,t){return new Dn({check:"string_format",format:"includes",...g(t),includes:e})}function Gt(e,t){return new jn({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Kt(e,t){return new Ln({check:"string_format",format:"ends_with",...g(t),suffix:e})}function oe(e){return new Fn({check:"overwrite",tx:e})}function Vt(e){return oe((t)=>t.normalize(e))}function Wt(){return oe((e)=>e.trim())}function Xt(){return oe((e)=>e.toLowerCase())}function Ht(){return oe((e)=>e.toUpperCase())}function qt(){return oe((e)=>Sr(e))}function Ri(e,t,r){return new e({type:"array",element:t,...g(r)})}function Di(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function ji(e,t){let r=iu((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(ue(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=n.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(ue(i))}},e(n.value,n)),t);return r}function iu(e,t){let r=new I({check:"custom",...g(t)});return r._zod.check=e,r}function Pe(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))j(e,n,r[n]);return e}function Qt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??ae,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function q(e,t,r,n,o){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(o);return Object.assign(r,i),!0}function O(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let d=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,l)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;O(f,t,l),t.seen.get(f).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)Pe(s.schema,u);if(t.io==="input"&&A(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Li(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function er(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${Li(m)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:a+Li(l)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);if(c.def={...c.schema},a)c.defId=a;let l=c.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
57
+
58
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let a=e.external.registry.get(s[0])?.id;if(t!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Ui(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;Ui(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Bi=new Set(["type","properties","required","additionalProperties"]),Fi=["oneOf","anyOf"];function Mi(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Yt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!Bi.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let a of t){let l=a.properties?.[s]??Mi(a);if(l===null||l===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(l)))c.push(l)}let u=c.length===1?c[0]:Yt(c)??{allOf:c};j(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((i)=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=Mi(s);if(c&&!i.some((u)=>JSON.stringify(u)===JSON.stringify(c)))i.push(c)}if(i.length===1)o.additionalProperties=i[0];else if(i.length>1)o.additionalProperties={allOf:i}}return o}function su(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Bi)if(o in e)return;let r=t.filter((o)=>Fi.some((i)=>Array.isArray(o[i]))),n=null;if(!r.length)n=Yt(t);else{let o=r[0],i=Fi.find((u)=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter((u)=>u!==o),c=o[i].map((u)=>Yt([...s,u]));if(c.some((u)=>!u))return;n={[i]:c}}if(!n)return;delete e.allOf,Pe(e,n)}function tr(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(c)=>{let u=e.seen.get(c);if(u.ref===null)return;let a=u.def??u.schema,l={...a},f=u.ref;if(u.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))a.allOf=a.allOf??[],a.allOf.push(h);else Pe(a,h);if(Pe(a,l),c._zod.parent===f)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(!(x in l))delete a[x]}if(h.$ref&&m.def)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(x in m.def&&JSON.stringify(a[x])===JSON.stringify(m.def[x]))delete a[x]}}let d=c._zod.parent;if(d&&d!==f){n(d);let m=e.seen.get(d);if(m?.schema.$ref){if(a.$ref=m.schema.$ref,m.def)for(let h in a){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(a[h])===JSON.stringify(m.def[h]))delete a[h]}}}e.override({zodSchema:c,jsonSchema:a,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Ui(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let a of[u.schema,u.def]){let l=a?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);if(f)f.push(a);else c.set(l,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])su(a)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Pe(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&o.id===i)delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;j(s,u.defId,u.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")o.$defs=s;else o.definitions=s;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Se(t,"input",e.processors),output:Se(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function A(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return A(n.element,r);if(n.type==="set")return A(n.valueType,r);if(n.type==="lazy")return A(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return A(n.innerType,r);if(n.type==="intersection")return A(n.left,r)||A(n.right,r);if(n.type==="record"||n.type==="map")return A(n.keyType,r)||A(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return A(n.in,r)||A(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(A(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(A(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(A(o,r))return!0;if(n.rest&&A(n.rest,r))return!0;return!1}return!1}var Ji=(e,t={})=>(r)=>{let n=Qt({...r,processors:t});return O(e,n),er(n,e),tr(n,e)},Se=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:i}=n??{},s=Qt({...o??{},target:i,io:t,processors:r});return O(e,s),er(s,e),tr(s,e)};var de=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},me=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Gi=(e,t)=>{de(e,"minimum",t),me(e,"maximum",t)},Xi=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Hi=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},qi=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Yi=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Ki=(e,t)=>de(e,"minimum",t.minimum),Vi=(e,t)=>me(e,"maximum",t.maximum),Wi=(e)=>(t,r)=>{Yi(t,r.format);let[n,o]=e[r.format];de(t,"minimum",n),me(t,"maximum",o)},cu={greater_than:(e,t)=>de(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>me(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Xi(e,t.value),number_format:Wi(Ee),bigint_format:Wi(xt),min_length:Ki,max_length:Vi,length_equals:(e,t)=>Gi(e,t.length),min_size:Ki,max_size:Vi,size_equals:(e,t)=>Gi(e,t.size),string_format:(e,t)=>{if(Yi(e,t.format),t.pattern)Hi(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>qi(e,t.mime)};function M(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)cu[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;if(o.minimum!==void 0)de(t,"minimum",o.minimum);if(o.exclusiveMinimum!==void 0)de(t,"exclusiveMinimum",o.exclusiveMinimum);if(o.maximum!==void 0)me(t,"maximum",o.maximum);if(o.exclusiveMaximum!==void 0)me(t,"exclusiveMaximum",o.exclusiveMaximum);if(o.multipleOf!==void 0)Xi(t,o.multipleOf);if(o.format!==void 0){if(t.format??(t.format=o.format),o.format.includes("int"))t.isInt=!0}if(o.mime)qi(t,o.mime);for(let i of o.patterns??[])Hi(t,i);return t}var uu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},au=new Map([[Nt,_n],[Xe,xn]]),lu=(e)=>au.get(e)??e,Qi=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:l}=M(e);if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=uu[c]??c,o.format==="")delete o.format;if(c==="time"||l)delete o.format}if(a)o.contentEncoding=a;if(u&&u.size>0){let f=[...u].map(lu);if(f.length===1)o.pattern=f[0].source;else if(f.length>1)o.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},es=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:a,isInt:l}=M(e);o.type=l?"integer":"number";let f=typeof a==="number"&&a>=(i??Number.NEGATIVE_INFINITY),d=typeof u==="number"&&u<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(m)o.minimum=a,o.exclusiveMinimum=!0;else o.exclusiveMinimum=a;else if(typeof i==="number")o.minimum=i;if(d)if(m)o.maximum=u,o.exclusiveMaximum=!0;else o.exclusiveMaximum=u;else if(typeof s==="number")o.maximum=s;if(c){let h=new Set;for(let b of c)if(Number.isFinite(b)&&b!==0)h.add(Math.abs(b));else q(e,t,o,n,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[_,...x]=h;if(_!==void 0)o.multipleOf=_;if(x.length)o.allOf=[...o.allOf??[],...x.map((b)=>({multipleOf:b}))]}},ts=(e,t,r,n)=>{r.type="boolean"};var rs=(e,t,r,n)=>{r.not={}};var ns=(e,t,r,n)=>{};var os=(e,t,r,n)=>{let o=e._zod.def,i=ge(o.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i},is=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(q(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s==="bigint"){if(q(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[s];else r.const=s}else{if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";if(i.every((s)=>typeof s==="boolean"))r.type="boolean";if(i.every((s)=>s===null))r.type="null";r.enum=i}};var ss=(e,t,r,n)=>{q(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var cs=(e,t,r,n)=>{q(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var us=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=M(e);if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=O(i.element,t,{...n,path:[...n.path,"items"]})};function rr(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return rr(t.out);if(t.type==="catch")return rr(t.innerType);return e._zod.optin}var as=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&q(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let a in s)j(o.properties,a,O(s[a],t,{...n,path:[...n.path,"properties",a]}));let u=[];for(let a of Object.keys(s)){let l=i.shape[a];if(t.io==="input"?rr(l)===void 0:l._zod.optout===void 0)u.push(a)}if(u.length>0)o.required=u;if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=O(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},ls=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>O(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)r.oneOf=s;else r.anyOf=s},ps=(e,t,r,n)=>{let o=e._zod.def,i=O(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=O(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=(a)=>("allOf"in a)&&Object.keys(a).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)};var fs=(e,t,r,n)=>{let o=e._zod.def,i=O(o.innerType,t,n),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},ds=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},nr=Symbol();function ms(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>{if(typeof u!=="bigint")return u;return i=!0,null});if(!i)return JSON.parse(s);return q(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),nr}var hs=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=ms(o.defaultValue,e,t,r,n);if(s!==nr)r.default=s},gs=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=ms(o.defaultValue,e,t,r,n);if(s!==nr)r._prefault=s},_s=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{q(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},xs=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;O(s,t,n);let c=t.seen.get(e);c.ref=s},ys=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var or=(e,t,r,n)=>{let o=e._zod.def;O(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var bs=new WeakSet([Object.prototype,Error.prototype]);function it(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var xu=(e,t)=>{Br.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(bs.has(r))return;bs.add(r),it(r,"format",(n)=>(o)=>Gr(n,o)),it(r,"flatten",(n)=>(o)=>Jr(n,o)),it(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,_e,2)}),it(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,_e,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var C=p("ZodError",xu,void 0,{Parent:Error});var vs=Fe(C),zs=Me(C),$s=Ue(C),ws=Be(C),ks=Vr(C),Zs=Wr(C),Ps=Xr(C),Ss=Hr(C),Os=qr(C),Is=Yr(C),As=Qr(C),Es=en(C);function bu(){if(!N.localeError)F(Ft())}function cr(){if(!N.memoizer)F({memoizer:ei()})}var P=p("ZodType",(e,t)=>(bu(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return G(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(xa(e,t))},superRefine(e,t){return this.check(ya(e,t))},overwrite(e){return this.check(oe(e))},optional(){return Cs(this)},exactOptional(){return ia(this)},nullable(){return Rs(this)},nullish(){return Cs(Rs(this))},nonoptional(e){return pa(this,e)},array(){return Fs(this)},or(e){return qu([this,e])},and(e){return ta(this,e)},transform(e){return Ds(this,oa(e))},default(e){return ua(this,e)},prefault(e){return la(this,e)},catch(e){return da(this,e)},pipe(e){return Ds(this,e)},readonly(){return ga(this)},describe(e){let t=this.clone();return ae.add(t,{description:e}),t},meta(...e){if(e.length===0)return ae.get(this);let t=this.clone();return ae.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return je(this,"~standard",{...Tt(this),jsonSchema:{input:Se(this,"input"),output:Se(this,"output")}})},set "~standard"(e){H(this,"~standard",e)},parse:function e(t,r){return vs(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await zs(this,t,r,{callee:e})},safeParse(e,t){return $s(this,e,t)},async safeParseAsync(e,t){return ws(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){H(this,"spa",e)},validate(e,t){return $t(this,e,t)},validateAsync(e,t){return wt(this,e,t)},encode:function e(t,r){return ks(this,t,r,{callee:e})},decode:function e(t,r){return Zs(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Ps(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Ss(this,t,r,{callee:e})},safeEncode(e,t){return Os(this,e,t)},safeDecode(e,t){return Is(this,e,t)},async safeEncodeAsync(e,t){return As(this,e,t)},async safeDecodeAsync(e,t){return Es(this,e,t)},toJSONSchema(e){return Ji(this,{})(e)},get description(){return ae.get(this)?.description},get _def(){return this._zod.def}}),js=p("_ZodString",(e,t)=>{We.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qi(e,r,n,o)},Dr({format:(e)=>M(e).format??null,minLength:(e)=>M(e).minimum??null,maxLength:(e)=>M(e).maximum??null},{regex(...e){return this.check(Mt(...e))},includes(...e){return this.check(Jt(...e))},startsWith(...e){return this.check(Gt(...e))},endsWith(...e){return this.check(Kt(...e))},min(...e){return this.check(fe(...e))},max(...e){return this.check(nt(...e))},length(...e){return this.check(ot(...e))},nonempty(...e){return this.check(fe(1,...e))},lowercase(e){return this.check(Ut(e))},uppercase(e){return this.check(Bt(e))},trim(){return this.check(Wt())},normalize(...e){return this.check(Vt(...e))},toLowerCase(){return this.check(Xt())},toUpperCase(){return this.check(Ht())},slugify(){return this.check(qt())}})),vu=p("ZodString",(e,t)=>{We.init(e,t),js.init(e,t)},{email(e){return this.check(ii(Zu,e))},url(e){return this.check(pi(Su,e))},jwt(e){return this.check(Zi(Bu,e))},emoji(e){return this.check(fi(Ou,e))},guid(e){return this.check(si(Pu,e))},uuid(e){return this.check(ci(st,e))},uuidv4(e){return this.check(ui(st,e))},uuidv6(e){return this.check(ai(st,e))},uuidv7(e){return this.check(li(st,e))},nanoid(e){return this.check(di(Iu,e))},cuid(e){return this.check(mi(Au,e))},cuid2(e){return this.check(hi(Eu,e))},ulid(e){return this.check(gi(Tu,e))},base64(e){return this.check($i(Fu,e))},base64url(e){return this.check(wi(Mu,e))},xid(e){return this.check(_i(Nu,e))},ksuid(e){return this.check(xi(Cu,e))},ipv4(e){return this.check(yi(Ru,e))},ipv6(e){return this.check(bi(Du,e))},cidrv4(e){return this.check(vi(ju,e))},cidrv6(e){return this.check(zi(Lu,e))},e164(e){return this.check(ki(Uu,e))},datetime(e){return this.check(Pi(zu,e))},date(e){return this.check(Si($u,e))},time(e){return this.check(Oi(wu,e))},duration(e){return this.check(Ii(ku,e))}});function R(e){return oi(vu,e)}var k=p("ZodStringFormat",(e,t)=>{z.init(e,t),js.init(e,t)}),zu=p("ZodISODateTime",(e,t)=>{mo.init(e,t),k.init(e,t)}),$u=p("ZodISODate",(e,t)=>{ho.init(e,t),k.init(e,t)}),wu=p("ZodISOTime",(e,t)=>{go.init(e,t),k.init(e,t)}),ku=p("ZodISODuration",(e,t)=>{_o.init(e,t),k.init(e,t)}),Zu=p("ZodEmail",(e,t)=>{ro.init(e,t),k.init(e,t)});var Pu=p("ZodGUID",(e,t)=>{eo.init(e,t),k.init(e,t)});var st=p("ZodUUID",(e,t)=>{to.init(e,t),k.init(e,t)});var Su=p("ZodURL",(e,t)=>{io.init(e,t),k.init(e,t)});var Ou=p("ZodEmoji",(e,t)=>{so.init(e,t),k.init(e,t)});var Iu=p("ZodNanoID",(e,t)=>{co.init(e,t),k.init(e,t)});var Au=p("ZodCUID",(e,t)=>{uo.init(e,t),k.init(e,t)});var Eu=p("ZodCUID2",(e,t)=>{ao.init(e,t),k.init(e,t)});var Tu=p("ZodULID",(e,t)=>{lo.init(e,t),k.init(e,t)});var Nu=p("ZodXID",(e,t)=>{po.init(e,t),k.init(e,t)});var Cu=p("ZodKSUID",(e,t)=>{fo.init(e,t),k.init(e,t)});var Ru=p("ZodIPv4",(e,t)=>{xo.init(e,t),k.init(e,t)});var Du=p("ZodIPv6",(e,t)=>{bo.init(e,t),k.init(e,t)});var ju=p("ZodCIDRv4",(e,t)=>{vo.init(e,t),k.init(e,t)});var Lu=p("ZodCIDRv6",(e,t)=>{zo.init(e,t),k.init(e,t)});var Fu=p("ZodBase64",(e,t)=>{wo.init(e,t),k.init(e,t)});var Mu=p("ZodBase64URL",(e,t)=>{ko.init(e,t),k.init(e,t)});var Uu=p("ZodE164",(e,t)=>{Zo.init(e,t),k.init(e,t)});var Bu=p("ZodJWT",(e,t)=>{Po.init(e,t),k.init(e,t)});var Ls=p("ZodNumber",(e,t)=>{Ct.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>es(e,r,n,o),e.isFinite=!0},Dr({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=M(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=M(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=M(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>M(e).format??null},{gt(e,t){return this.check(tt(e,t))},gte(e,t){return this.check(Ze(e,t))},min(e,t){return this.check(Ze(e,t))},lt(e,t){return this.check(et(e,t))},lte(e,t){return this.check(ke(e,t))},max(e,t){return this.check(ke(e,t))},int(e){return this.check(Ts(e))},safe(e){return this.check(Ts(e))},positive(e){return this.check(tt(0,e))},nonnegative(e){return this.check(Ze(0,e))},negative(e){return this.check(et(0,e))},nonpositive(e){return this.check(ke(0,e))},multipleOf(e,t){return this.check(rt(e,t))},step(e,t){return this.check(rt(e,t))},finite(){return this}}));function ie(e){return Ai(Ls,e)}var Ju=p("ZodNumberFormat",(e,t)=>{So.init(e,t),Ls.init(e,t)});function Ts(e){return Ei(Ju,e)}var Gu=p("ZodBoolean",(e,t)=>{Oo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o)});function U(e){return Ti(Gu,e)}var Ku=p("ZodUnknown",(e,t)=>{Io.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ns(e,r,n,o)});function Ns(){return Ni(Ku)}var Vu=p("ZodNever",(e,t)=>{Ao.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rs(e,r,n,o)});function Wu(e){return Ci(Vu,e)}var Xu=p("ZodArray",(e,t)=>{cr(),Eo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>us(e,r,n,o),e.element=t.element},{min(e,t){return this.check(fe(e,t))},nonempty(e){return this.check(fe(1,e))},max(e,t){return this.check(nt(e,t))},length(e,t){return this.check(ot(e,t))},unwrap(){return this.element}});function Fs(e,t){return Ri(Xu,e,t)}var Hu=p("ZodObject",(e,t)=>{cr(),Co.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>as(e,r,n,o),kc(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return ur(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:Ns()}))},loose(){return this.clone(T(this._zod.def,{catchall:Ns()}))},strict(){return this.clone(T(this._zod.def,{catchall:Wu()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return _c(this,e)},safeExtend(e){return xc(this,e)},merge(e){return yc(this,e)},pick(e){return hc(this,e)},omit(e){return gc(this,e)},partial(...e){return Tr(Us,this,e[0])},exactPartial(...e){return Tr(Bs,this,e[0],"exactPartial")},required(...e){return bc(Js,this,e[0])}});function B(e,t){let r={type:"object",shape:e??{},...g(t)};return new Hu(r)}var Ms=p("ZodUnion",(e,t)=>{Rt.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ls(e,r,n,o),e.options=t.options});function qu(e,t){return new Ms({type:"union",options:e,...g(t)})}var Yu=p("ZodDiscriminatedUnion",(e,t)=>{Ms.init(e,t),Ro.init(e,t)});function Qu(e,t,r){return new Yu({type:"union",options:t,discriminator:e,...g(r)})}var ea=p("ZodIntersection",(e,t)=>{Do.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ps(e,r,n,o)});function ta(e,t){return new ea({type:"intersection",left:e,right:t})}var sr=p("ZodEnum",(e,t)=>{jo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(n,o,i)=>os(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new sr({...t,checks:[],...g(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new sr({...t,checks:[],...g(o),entries:i})}});function ur(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new sr({type:"enum",entries:r,...g(t)})}var ra=p("ZodLiteral",(e,t)=>{Lo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>is(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Y(e,t){return new ra({type:"literal",values:Array.isArray(e)?e:[e],...g(t)})}var na=p("ZodTransform",(e,t)=>{cr(),Fo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cs(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new be(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(ue(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(ue(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function oa(e){return new na({type:"transform",transform:e})}var Us=p("ZodOptional",(e,t)=>{Dt.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>or(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Cs(e){return new Us({type:"optional",innerType:e})}var Bs=p("ZodExactOptional",(e,t)=>{Mo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>or(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ia(e){return new Bs({type:"optional",innerType:e})}var sa=p("ZodNullable",(e,t)=>{Uo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Rs(e){return new sa({type:"nullable",innerType:e})}var ca=p("ZodDefault",(e,t)=>{Bo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ua(e,t){return new ca({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():gt(t)}})}var aa=p("ZodPrefault",(e,t)=>{Jo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function la(e,t){return new aa({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():gt(t)}})}var Js=p("ZodNonOptional",(e,t)=>{Go.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ds(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function pa(e,t){return new Js({type:"nonoptional",innerType:e,...g(t)})}var fa=p("ZodCatch",(e,t)=>{Ko.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_s(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function da(e,t){return new fa({type:"catch",innerType:e,catchValue:typeof t==="function"?t:jr(t)})}var ma=p("ZodPipe",(e,t)=>{Vo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xs(e,r,n,o),e.in=t.in,e.out=t.out});function Ds(e,t){return new ma({type:"pipe",in:e,out:t})}var ha=p("ZodReadonly",(e,t)=>{Wo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ys(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function ga(e){return new ha({type:"readonly",innerType:e})}var _a=p("ZodCustom",(e,t)=>{Xo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ss(e,r,n,o)});function xa(e,t={}){return Di(_a,e,t)}function ya(e,t){return ji(e,t)}var ba=ur(["version","top","git-directory","common-directory","head","remotes","numstat-head","numstat-cached","status","index-identity","refs-identity","config-identity"]);var ct=B({directory:R().min(1).max(4096),gitDirectory:R().min(1).max(4096),commonDirectory:R().min(1).max(4096)}).strict(),ff=B({type:Y("git-status-run-v1"),id:ie().int().positive().max(Number.MAX_SAFE_INTEGER),operation:ba,directory:R().min(1).max(4096),executable:R().min(1).max(4096),repository:ct.optional()}).strict(),df=B({type:Y("git-status-abort-v1"),id:ie().int().positive().max(Number.MAX_SAFE_INTEGER)}).strict(),mf=B({type:Y("git-status-result-v1"),id:ie().int().positive(),code:ie().int(),stdout:R().max(3145728),truncated:U(),cancelled:U(),timedOut:U(),notRepository:U(),stderrPresent:U()}).strict();var Gs=B({kind:ur(["stage","unstage","discard","discardStaged","clean","commit","push","forcePush","pull","fetch","init"]),paths:Fs(R().min(1).max(4096).refine((e)=>!e.includes("\x00"))).max(1024).optional(),message:R().max(65536).refine((e)=>!e.includes("\x00")).optional()}).strict().refine((e)=>new TextEncoder().encode(JSON.stringify(e)).length<=131072);var va=Gs,lr={type:Y("git-action-run-v1"),id:ie().int().positive().max(Number.MAX_SAFE_INTEGER),directory:R().min(1).max(4096),executable:R().min(1).max(4096)},Ks=Qu("operation",[B({...lr,operation:Y("version")}).strict(),B({...lr,operation:Y("has-head"),repository:ct}).strict(),B({...lr,operation:Y("apply"),repository:ct.nullable(),request:va,hasCommit:U()}).strict()]),Vs=B({type:Y("git-action-abort-v1"),id:ie().int().positive()}).strict(),vf=B({type:Y("git-action-result-v1"),id:ie().int().positive(),code:ie().int(),stdout:R().max(196608),started:U(),truncated:U(),cancelled:U(),timedOut:U(),reply:B({ok:U(),message:R().max(98304).nullable(),command:R().max(163840)}).strict().nullable()}).strict();var Ws=["--no-pager","-c","core.fsmonitor=false","-c","gc.auto=0","-c","maintenance.auto=false"],Xs=(e)=>e?[`--git-dir=${e.gitDirectory}`,`--work-tree=${e.directory}`]:[];function Hs(e){let t=/^git version (\d+)\.(\d+)/.exec(e);return!!t&&(+t[1]>2||+t[1]===2&&+t[2]>=36)}var za=(e="1")=>({GIT_OPTIONAL_LOCKS:"0",GIT_LITERAL_PATHSPECS:e,GIT_TERMINAL_PROMPT:"0",GIT_PAGER:"cat",LC_ALL:"C"});function qs(e,t){let r={...process.env,...za()};for(let n of e)delete r[n];if(t)r.GIT_COMMON_DIR=t.commonDirectory;return r}function Ys(e,t,r){let n=Buffer.alloc(0);return(o)=>{if(n=Buffer.concat([n,o]),n.length>e){t();return}for(;;){let i=n.indexOf(10);if(i<0)return;let s=n.subarray(0,i);n=n.subarray(i+1);let c;try{c=JSON.parse(s.toString("utf8"))}catch{t();return}if(r(c)===!1)return}}}var ut=!1,at=!1,Qs=!1,pr,se,rc=()=>process.stdout.write("",()=>process.exit(0)),Q=()=>{if(at=!0,se?.cancel(),!ut)rc()};process.on("SIGTERM",Q);process.on("SIGINT",Q);process.stdin.on("end",Q);process.stdin.on("error",Q);process.stdout.on("error",Q);async function $a(e){let t=e.operation==="version"?null:e.repository;if(![e.directory,e.executable,...Object.values(t??{})].every(tc.isAbsolute)||pr!==void 0&&pr!==e.executable||e.operation!=="version"&&!Qs||e.operation==="apply"&&(e.request.kind==="init"?t!==null:t===null)||t&&e.directory!==t.directory){Q();return}pr=e.executable;let r=!1,n=!1,o=!1,i=!1;se={id:e.id,cancel(){n=!0,se?.child?.kill("SIGTERM")}};let s=(l,f)=>new Promise((d)=>{if(at||n){d({code:127,stdout:"",stderr:"The original Git action was interrupted before launch."});return}let m=qs(["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR","GIT_INDEX_FILE"],t),h=[...Ws,...Xs(t),...l],_=ec.spawn(e.executable,h,{cwd:f,env:{...m,HOME:process.env.HOME,USERPROFILE:process.env.USERPROFILE},stdio:["pipe","pipe","pipe"],windowsHide:!0});se.child=_,_.once("spawn",()=>{i=!0}),_.stdin.on("error",()=>{return}),_.stdin.end();let x=Buffer.alloc(0),b=Buffer.alloc(0),E=!1,J,D=()=>{_.kill("SIGTERM"),J??=setTimeout(()=>_.kill("SIGKILL"),500),J.unref()};se.cancel=()=>{n=!0,D()};let Z=setTimeout(()=>{o=!0,D()},e.operation==="apply"?300000:1e4);Z.unref(),_.stdout.on("data",(S)=>{let W=131072-x.length;if(x=Buffer.concat([x,S.subarray(0,W)]),S.length>W)r=!0,D()}),_.stderr.on("data",(S)=>{let W=65536-b.length;if(b=Buffer.concat([b,S.subarray(0,W)]),S.length>W)r=!0,D()});let v=()=>{E=!0,D()};_.stdout.on("error",v),_.stderr.on("error",v),_.on("error",()=>{E=!0}),_.once("close",(S)=>{if(clearTimeout(Z),J!==void 0)clearTimeout(J);d({code:E?127:S??127,stdout:x.toString("utf8"),stderr:b.toString("utf8")})})}),c,u="",a=null;if(e.operation==="apply")a=await vr(e.request,{repoRoot:e.directory,hasCommit:e.hasCommit},s),c=a.ok?0:1;else{let l=await s(e.operation==="version"?["--version"]:["rev-parse","--verify","--quiet","HEAD"],e.directory);c=l.code,u=l.stdout}if(e.operation==="version"&&c===0&&!r&&!n&&!o)Qs=Hs(u);process.stdout.write(JSON.stringify({type:"git-action-result-v1",id:e.id,code:c,stdout:u,reply:a,started:i,truncated:r,cancelled:n,timedOut:o})+`
59
+ `),se=void 0}var wa=Ys(262144,Q,(e)=>{let t=Vs.safeParse(e);if(t.success){if(se?.id===t.data.id)se.cancel();return}let r=Ks.safeParse(e);if(!r.success||ut)return Q(),!1;ut=!0,$a(r.data).catch(Q).finally(()=>{if(ut=!1,at)rc()})});process.stdin.on("data",(e)=>{if(!at)wa(e)});