@longzai-intelligence-oxlint/cli 0.1.46 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +52 -52
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -81,9 +81,9 @@ ${L.default.gray(yn+_n.repeat(a+2)+bn)}
81
81
  `);process.stdout.write(I.cursor.move(-999,e.length-1)),process.stdout.write(I.erase.down(e.length))},g=e=>e.replace(/\.+$/,``),_=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},v=(u=``)=>{o=!0,i=Zt(),s=g(u),l=performance.now(),process.stdout.write(`${L.default.gray(V)}
82
82
  `);let d=0,f=0;p(),a=setInterval(()=>{if(r&&s===c)return;h(),c=s;let n=L.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${_(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},y=(t=``,n=0)=>{o=!1,clearInterval(a),h();let r=n===0?L.default.green(pn):n===1?L.default.red(dn):L.default.red(fn);s=g(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${_(l)}
83
83
  `):process.stdout.write(`${r} ${s}
84
- `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Pn={red:e=>L.default.red(e),green:e=>L.default.green(e),yellow:e=>L.default.yellow(e),blue:e=>L.default.blue(e),cyan:e=>L.default.cyan(e),magenta:e=>L.default.magenta(e),gray:e=>L.default.gray(e),bold:e=>L.default.bold(e),dim:e=>L.default.dim(e)},Fn={async select(e,t){let n=await kn({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return Yt(n)&&(jn(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await Dn({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return Yt(n)&&(jn(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await On({message:e,initialValue:t?.defaultValue??!1});return Yt(n)&&(jn(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=Nn();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){An(e,t)},log:{info(e){Mn.info(L.default.blue(e))},success(e){Mn.success(L.default.green(e))},warn(e){Mn.warn(L.default.yellow(e))},error(e){Mn.error(L.default.red(e))},step(e){Mn.step(e)}}};function In(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ln(e,t=`|`){return e.map(e=>or(e)).join(t)}function Rn(e,t){return typeof t==`bigint`?t.toString():t}var zn=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Bn(e){return new zn(e)}function Vn(e){return e==null}function Hn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Un(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Wn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Gn(e){return Wn(e._zod.def)??e._zod.def.shape}function Kn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Un(this,t,e),e},enumerable:!0,configurable:!0})}function qn(e,t,n){t in e?Un(e,t,n):e[t]=n}function Jn(e,t,n,r){let i=Gn(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Kn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):qn(e,a,r?r(n.value,a):n.value))}}function Yn(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Kn(e,n,()=>t[n]):qn(e,n,r.value))}}function H(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Xn(e){return JSON.stringify(e)}function Zn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Qn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function $n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const er=/* @__PURE__*/ Bn(()=>{if(qr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function tr(e){if($n(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return $n(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function nr(e){return tr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const rr=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ar(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(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}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function or(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function sr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const cr={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},lr={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function ur(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Jn(i,e,dr(e,t)),ar(e,H(n,{shape:i,checks:[]}))}function dr(e,t){let n=Gn(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function fr(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(dr(e,t)),a={};return Jn(a,e,Reflect.ownKeys(Gn(e)).filter(e=>!i.has(e))),ar(e,H(n,{shape:a,checks:[]}))}function pr(e,t){if(!tr(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Gn(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ar(e,H(e._zod.def,{shape:mr(e,t)}))}function mr(e,t){let n={};return Jn(n,e,Reflect.ownKeys(Gn(e))),Yn(n,t),n}function hr(e,t){if(!tr(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ar(e,H(e._zod.def,{shape:mr(e,t)}))}function gr(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 n={};return Jn(n,e,Reflect.ownKeys(Gn(e))),Jn(n,t,Reflect.ownKeys(Gn(t))),ar(e,H(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function _r(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(dr(t,n)):void 0,o={};return Jn(o,t,Reflect.ownKeys(Gn(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),ar(t,H(t._zod.def,{shape:o,checks:[]}))}function vr(e,t,n){let r=n?new Set(dr(t,n)):void 0,i={};return Jn(i,t,Reflect.ownKeys(Gn(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),ar(t,H(t._zod.def,{shape:i}))}function yr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function br(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function xr(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Sr(e){return typeof e==`string`?e:e?.message}function Cr(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function wr(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Sr(e.inst?._zod.def?.error?.(e))??Sr(a?.(e))??Sr(t?.error?.(e))??Sr(n.customError?.(e))??Sr(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const Tr=/[\uD800-\uDBFF]/;function Er(e){let t=e.length;if(!Tr.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Dr(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Or(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 t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function kr(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Ar(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Pr(e,n,r.value)}}function jr(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Mr(e,t,n){return jr(e,t,n,!1)}function Nr(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return jr(this,n,r(this))},set(e){jr(this,n,e)}})}return t}function Pr(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:jr(this,t,n.bind(this))},set(e){jr(this,t,e)}})}function Fr(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Ir,Lr=!1;const Rr={configurable:!0,get(){Lr=!0}};function W(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Ir!==e._zod?Ir=void 0:(Ir=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Rr);let e=Lr;Lr=!1;try{let r=n(this);return Lr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Lr||=e,r}catch(n){throw delete this[t],Lr||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function zr(e,t,n,r){let i=Fr(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function Br(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var Vr;const Hr={value:void 0,enumerable:!1};let Ur=`captureStackTrace`in Error?Error:null;function Wr(e){let t=Ur;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ur=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function G(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Hr.value=new a(r);try{Object.defineProperty(n,"_zod",Hr)}finally{Hr.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Ar(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Wr(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Gr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Kr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Vr=globalThis).__zod_globalConfig??(Vr.__zod_globalConfig={});const qr=globalThis.__zod_globalConfig;function Jr(e){return e&&Object.assign(qr,e),qr}function Yr(){let e=this._zod;return e.message??=JSON.stringify(e.def,Rn,2),e.message}function Xr(e){this._zod.message=e}const Zr={get:Yr,set:Xr,enumerable:!0,configurable:!0},Qr={value:void 0,enumerable:!1},$r=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),ei=(e,t)=>{e.name=`$ZodError`,Qr.value=t,Object.defineProperty(e,"issues",Qr),Qr.value=void 0,Object.defineProperty(e,"message",Zr);let n=Object.getPrototypeOf(e);$r.has(n)||($r.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ti=G(`$ZodError`,ei);G(`$ZodError`,ei,void 0,{Parent:Error});function ni(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ri(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ni(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ii(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function ai(e,t){return{callee:t?.callee??e,Err:t?.Err}}const oi=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Gr;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>wr(e,o,Jr())));throw Qn(n,a?.callee??t),n}return s.value};return t},si=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>wr(e,o,Jr())));throw Qn(n,a?.callee??t),n}return s.value};return t},ci=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Gr;return a.issues.length?li(e,a.issues,i):{success:!0,data:a.value}};function li(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>wr(e,n,Jr()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const ui=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?li(e,a.issues,i):{success:!0,data:a.value}},di=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),fi=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),pi=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==di)return!0;if(r.definite===!0&&n===void 0)return!1}return mi(e,t,n)});function mi(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[fi]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Gr;return a.issues.length===0}const hi=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},gi=e=>{let t=oi(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ai(n,a))};return n},_i=e=>{let t=oi(e),n=(e,r,i,a)=>t(e,r,i,ai(n,a));return n},vi=e=>{let t=si(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ai(n,a))};return n},yi=e=>{let t=si(e),n=async(e,r,i,a)=>await t(e,r,i,ai(n,a));return n},bi=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ci(e)(t,n,i)},xi=e=>(t,n,r)=>ci(e)(t,n,r),Si=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ui(e)(t,n,i)},Ci=e=>async(t,n,r)=>ui(e)(t,n,r),wi=/^[cC][0-9a-z]{6,}$/,Ti=/^[0-9a-z]+$/,Ei=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Di=/^[0-9a-vA-V]{20}$/,Oi=/^[A-Za-z0-9]{27}$/,ki=/^[a-zA-Z0-9_-]{21}$/;function Ai(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const ji=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Mi=/^([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})$/,Ni=e=>e?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})$`):/^([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)$/,Pi=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Fi(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const Ii=/^(?:(?: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])$/,Li=/^(([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}|:))$/,Ri=/^((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])$/,zi=/^(([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])$/,Bi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vi=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Hi=/^https?$/,Ui=/^\+[1-9]\d{6,14}$/,Wi=`(?:(?:\\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 Gi(e){return RegExp(`^${e}$`)}const Ki=/*@__PURE__*/ Gi(Wi);function qi(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ji(e){return RegExp(`^${qi(e)}$`)}function Yi(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${qi({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${qi({precision:e.precision})}`:n;return RegExp(`^${Wi}T(?:${r})$`)}const Xi=/^[\s\S]{0,}$/,Zi=/^-?\d+$/,Qi=/^-?\d+(?:\.\d+)?$/,$i=/^[^A-Z]*$/,ea=/^[^a-z]*$/,ta=/*@__PURE__*/ G(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),na=e=>{let t=e.value;return!Vn(t)&&t.length!==void 0},ra=/*@__PURE__*/ G(`$ZodCheckMaxLength`,(e,t)=>{var n;ta.init(e,t),(n=e._zod.def).when??(n.when=na),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Er(r):i)<=t.maximum)return;let a=Dr(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ia=/*@__PURE__*/ G(`$ZodCheckMinLength`,(e,t)=>{var n;ta.init(e,t),(n=e._zod.def).when??(n.when=na),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Er(r):i)>=t.minimum)return;let a=Dr(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),aa=/*@__PURE__*/ G(`$ZodCheckLengthEquals`,(e,t)=>{var n;ta.init(e,t),(n=e._zod.def).when??(n.when=na),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Er(r):i;if(a===t.length)return;let o=Dr(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),oa=/*@__PURE__*/ G(`$ZodCheckStringFormat`,(e,t)=>{var n,r;ta.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),sa=/*@__PURE__*/ G(`$ZodCheckRegex`,(e,t)=>{oa.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ca=/*@__PURE__*/ G(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=$i,oa.init(e,t)}),la=/*@__PURE__*/ G(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ea,oa.init(e,t)}),ua=/*@__PURE__*/ G(`$ZodCheckIncludes`,(e,t)=>{ta.init(e,t);let n=ir(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),da=/*@__PURE__*/ G(`$ZodCheckStartsWith`,(e,t)=>{ta.init(e,t);let n=RegExp(`^${ir(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),fa=/*@__PURE__*/ G(`$ZodCheckEndsWith`,(e,t)=>{ta.init(e,t);let n=RegExp(`.*${ir(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),pa=/*@__PURE__*/ G(`$ZodCheckOverwrite`,(e,t)=>{ta.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var ma=class{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}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
84
+ `),m(),i()};return{start:v,stop:y,message:(e=``)=>{s=g(e??s)}}},Pn={red:e=>L.default.red(e),green:e=>L.default.green(e),yellow:e=>L.default.yellow(e),blue:e=>L.default.blue(e),cyan:e=>L.default.cyan(e),magenta:e=>L.default.magenta(e),gray:e=>L.default.gray(e),bold:e=>L.default.bold(e),dim:e=>L.default.dim(e)},Fn={async select(e,t){let n=await kn({message:e,options:t.map(e=>({value:e.value,label:e.label,hint:e.hint}))});return Yt(n)&&(jn(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async textInput(e,t){let n=await Dn({message:e,placeholder:t?.placeholder,defaultValue:t?.defaultValue});return Yt(n)&&(jn(`操作已取消`),process.exit(0)),typeof n==`string`?n:String(n)},async confirm(e,t){let n=await On({message:e,initialValue:t?.defaultValue??!1});return Yt(n)&&(jn(`操作已取消`),process.exit(0)),typeof n==`boolean`?n:!!n},spinner(){let e=Nn();return{start(t){e.start(t)},stop(t){e.stop(t)}}},note(e,t){An(e,t)},log:{info(e){Mn.info(L.default.blue(e))},success(e){Mn.success(L.default.green(e))},warn(e){Mn.warn(L.default.yellow(e))},error(e){Mn.error(L.default.red(e))},step(e){Mn.step(e)}}};function In(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ln(e,t=`|`){return e.map(e=>or(e)).join(t)}function Rn(e,t){return typeof t==`bigint`?t.toString():t}var zn=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Bn(e){return new zn(e)}function Vn(e){return e==null}function Hn(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Un(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Wn(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Gn(e){return Wn(e._zod.def)??e._zod.def.shape}function Kn(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Un(this,t,e),e},enumerable:!0,configurable:!0})}function qn(e,t,n){t in e?Un(e,t,n):e[t]=n}function Jn(e,t,n,r){let i=Gn(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Kn(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):qn(e,a,r?r(n.value,a):n.value))}}function Yn(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Kn(e,n,()=>t[n]):qn(e,n,r.value))}}function H(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Xn(e){return JSON.stringify(e)}function Zn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const Qn=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function $n(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const er=/* @__PURE__*/ Bn(()=>{if(Jr.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function tr(e){if($n(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return $n(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function nr(e){return tr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const rr=/* @__PURE__*/ new Set([`string`,`number`,`symbol`]);function ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ar(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function U(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}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function or(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function sr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}const cr={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},lr={int64:[/* @__PURE__*/ BigInt(`-9223372036854775808`),/* @__PURE__*/ BigInt(`9223372036854775807`)],uint64:[/* @__PURE__*/ BigInt(0),/* @__PURE__*/ BigInt(`18446744073709551615`)]};function ur(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Jn(i,e,dr(e,t)),ar(e,H(n,{shape:i,checks:[]}))}function dr(e,t){let n=Gn(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function fr(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(dr(e,t)),a={};return Jn(a,e,Reflect.ownKeys(Gn(e)).filter(e=>!i.has(e))),ar(e,H(n,{shape:a,checks:[]}))}function pr(e,t){if(!tr(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Gn(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ar(e,H(e._zod.def,{shape:mr(e,t)}))}function mr(e,t){let n={};return Jn(n,e,Reflect.ownKeys(Gn(e))),Yn(n,t),n}function hr(e,t){if(!tr(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ar(e,H(e._zod.def,{shape:mr(e,t)}))}function gr(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 n={};return Jn(n,e,Reflect.ownKeys(Gn(e))),Jn(n,t,Reflect.ownKeys(Gn(t))),ar(e,H(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function _r(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(dr(t,n)):void 0,o={};return Jn(o,t,Reflect.ownKeys(Gn(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),ar(t,H(t._zod.def,{shape:o,checks:[]}))}function vr(e,t,n){let r=n?new Set(dr(t,n)):void 0,i={};return Jn(i,t,Reflect.ownKeys(Gn(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),ar(t,H(t._zod.def,{shape:i}))}function yr(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function br(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function xr(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Sr(e){return typeof e==`string`?e:e?.message}function Cr(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function wr(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Tr(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Sr(e.inst?._zod.def?.error?.(e))??Sr(a?.(e))??Sr(t?.error?.(e))??Sr(n.customError?.(e))??Sr(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}const Er=/[\uD800-\uDBFF]/;function Dr(e){let t=e.length;if(!Er.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Or(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function kr(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 t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ar(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function jr(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Fr(e,n,r.value)}}function Mr(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Nr(e,t,n){return Mr(e,t,n,!1)}function Pr(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Mr(this,n,r(this))},set(e){Mr(this,n,e)}})}return t}function Fr(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Mr(this,t,n.bind(this))},set(e){Mr(this,t,e)}})}function Ir(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}let Lr,Rr=!1;const zr={configurable:!0,get(){Rr=!0}};function W(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Lr!==e._zod?Lr=void 0:(Lr=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,zr);let e=Rr;Rr=!1;try{let r=n(this);return Rr?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Rr||=e,r}catch(n){throw delete this[t],Rr||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Br(e,t,n,r){let i=Ir(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function Vr(e){let t=()=>e;return t[`~constantCatch`]=!0,t}var Hr;const Ur={value:void 0,enumerable:!1};let Wr=`captureStackTrace`in Error?Error:null;function Gr(e){let t=Wr;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Wr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function G(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=/* @__PURE__ */ new Set}a.prototype=i;let o=n,s=o&&/* @__PURE__ */ new WeakSet;function c(n,r){if(!n._zod){Ur.value=new a(r);try{Object.defineProperty(n,"_zod",Ur)}finally{Ur.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),jr(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Gr(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Kr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},qr=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Hr=globalThis).__zod_globalConfig??(Hr.__zod_globalConfig={});const Jr=globalThis.__zod_globalConfig;function Yr(e){return e&&Object.assign(Jr,e),Jr}function Xr(){let e=this._zod;return e.message??=JSON.stringify(e.def,Rn,2),e.message}function Zr(e){this._zod.message=e}const Qr={get:Xr,set:Zr,enumerable:!0,configurable:!0},$r={value:void 0,enumerable:!1},ei=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]),ti=(e,t)=>{e.name=`$ZodError`,$r.value=t,Object.defineProperty(e,"issues",$r),$r.value=void 0,Object.defineProperty(e,"message",Qr);let n=Object.getPrototypeOf(e);ei.has(n)||(ei.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ni=G(`$ZodError`,ti);G(`$ZodError`,ti,void 0,{Parent:Error});function ri(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function ii(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ri(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ai(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function oi(e,t){return{callee:t?.callee??e,Err:t?.Err}}const si=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Kr;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Tr(e,o,Yr())));throw Qn(n,a?.callee??t),n}return s.value};return t},ci=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Tr(e,o,Yr())));throw Qn(n,a?.callee??t),n}return s.value};return t},li=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Kr;return a.issues.length?ui(e,a.issues,i):{success:!0,data:a.value}};function ui(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Tr(e,n,Yr()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}const di=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?ui(e,a.issues,i):{success:!0,data:a.value}},fi=/* @__PURE__ */ Symbol.for(`zod.compile.invalid`),pi=/* @__PURE__ */ Symbol.for(`zod.compile.fallback`),mi=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==fi)return!0;if(r.definite===!0&&n===void 0)return!1}return hi(e,t,n)});function hi(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[pi]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Kr;return a.issues.length===0}const gi=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},_i=e=>{let t=si(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,oi(n,a))};return n},vi=e=>{let t=si(e),n=(e,r,i,a)=>t(e,r,i,oi(n,a));return n},yi=e=>{let t=ci(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,oi(n,a))};return n},bi=e=>{let t=ci(e),n=async(e,r,i,a)=>await t(e,r,i,oi(n,a));return n},xi=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return li(e)(t,n,i)},Si=e=>(t,n,r)=>li(e)(t,n,r),Ci=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return di(e)(t,n,i)},wi=e=>async(t,n,r)=>di(e)(t,n,r),Ti=/^[cC][0-9a-z]{6,}$/,Ei=/^[0-9a-z]+$/,Di=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Oi=/^[0-9a-vA-V]{20}$/,ki=/^[A-Za-z0-9]{27}$/,Ai=/^[a-zA-Z0-9_-]{21}$/;function ji(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const Mi=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ni=/^([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})$/,Pi=e=>e?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})$`):/^([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)$/,Fi=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Ii(){return RegExp(`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,`u`)}const Li=/^(?:(?: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])$/,Ri=/^(([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}|:))$/,zi=/^((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])$/,Bi=/^(([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])$/,Vi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hi=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ui=/^https?$/,Wi=/^\+[1-9]\d{6,14}$/,Gi=`(?:(?:\\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 Ki(e){return RegExp(`^${e}$`)}const qi=/*@__PURE__*/ Ki(Gi);function Ji(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yi(e){return RegExp(`^${Ji(e)}$`)}function Xi(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ji({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ji({precision:e.precision})}`:n;return RegExp(`^${Gi}T(?:${r})$`)}const Zi=/^[\s\S]{0,}$/,Qi=/^-?\d+$/,$i=/^-?\d+(?:\.\d+)?$/,ea=/^[^A-Z]*$/,ta=/^[^a-z]*$/,na=/*@__PURE__*/ G(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ra=e=>{let t=e.value;return!Vn(t)&&t.length!==void 0},ia=/*@__PURE__*/ G(`$ZodCheckMaxLength`,(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=ra),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Dr(r):i)<=t.maximum)return;let a=Or(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),aa=/*@__PURE__*/ G(`$ZodCheckMinLength`,(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=ra),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Dr(r):i)>=t.minimum)return;let a=Or(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),oa=/*@__PURE__*/ G(`$ZodCheckLengthEquals`,(e,t)=>{var n;na.init(e,t),(n=e._zod.def).when??(n.when=ra),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Dr(r):i;if(a===t.length)return;let o=Or(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),sa=/*@__PURE__*/ G(`$ZodCheckStringFormat`,(e,t)=>{var n,r;na.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ca=/*@__PURE__*/ G(`$ZodCheckRegex`,(e,t)=>{sa.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),la=/*@__PURE__*/ G(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ea,sa.init(e,t)}),ua=/*@__PURE__*/ G(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ta,sa.init(e,t)}),da=/*@__PURE__*/ G(`$ZodCheckIncludes`,(e,t)=>{na.init(e,t);let n=ir(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),fa=/*@__PURE__*/ G(`$ZodCheckStartsWith`,(e,t)=>{na.init(e,t);let n=RegExp(`^${ir(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),pa=/*@__PURE__*/ G(`$ZodCheckEndsWith`,(e,t)=>{na.init(e,t);let n=RegExp(`.*${ir(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),ma=/*@__PURE__*/ G(`$ZodCheckOverwrite`,(e,t)=>{na.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var ha=class{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}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
85
85
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
86
- `)}\n};`)(...Object.values(this.closed))}};const ha={major:4,minor:6,patch:5},K=/*@__PURE__*/ G(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ha;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=yr(t),a;for(let o of n){if(o._zod.def.when){if(br(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Gr;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Cr(t.issues,n,e),i||=yr(t,n))});else{if(t.issues.length===n)continue;Cr(t.issues,n,e),i||=yr(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(yr(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Gr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Gr;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Mr(this,`~standard`,va(this))},set"~standard"(e){jr(this,`~standard`,e)}}),ga=(e,t)=>e.issues.length?{issues:e.issues.map(e=>wr(e,t,Jr()))}:{value:e.value};async function _a(e,t){let n={async:!0};return ga(await e._zod.run({value:t,issues:[]},n),n)}function va(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return ga(r,n)}catch{}return _a(e,t)},vendor:`zod`,version:1}}const ya=/*@__PURE__*/ G(`$ZodString`,(e,t)=>{K.init(e,t),e._zod.pattern=t.pattern??Xi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),q=/*@__PURE__*/ G(`$ZodStringFormat`,(e,t)=>{oa.init(e,t),ya.init(e,t)}),ba=/*@__PURE__*/ G(`$ZodGUID`,(e,t)=>{t.pattern??=Mi,q.init(e,t)}),xa=/*@__PURE__*/ G(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ni(e)}else t.pattern??=Ni();q.init(e,t)}),Sa=/*@__PURE__*/ G(`$ZodEmail`,(e,t)=>{t.pattern??=Pi,q.init(e,t)});function Ca(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function wa(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Ca(e)||2:Ta(e,t)}function Ta(e,t){if(!t.normalize&&t.protocol?.source===Hi.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const Ea=/[\t\n\r]/g;function Da(e){return e.replace(Ea,``)}function Oa(e,t){return t.lastIndex=0,t.test(e.hostname)}function ka(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const Aa=/*@__PURE__*/ G(`$ZodURL`,(e,t)=>{q.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=wa(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Da(r);return}t.hostname&&!Oa(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!ka(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Da(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ja=/*@__PURE__*/ G(`$ZodEmoji`,(e,t)=>{t.pattern??=Fi(),q.init(e,t)}),Ma=/*@__PURE__*/ G(`$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.length===void 0?ki:Ai(t.length),q.init(e,t)}),Na=/*@__PURE__*/ G(`$ZodCUID`,(e,t)=>{t.pattern??=wi,q.init(e,t)}),Pa=/*@__PURE__*/ G(`$ZodCUID2`,(e,t)=>{t.pattern??=Ti,q.init(e,t)}),Fa=/*@__PURE__*/ G(`$ZodULID`,(e,t)=>{t.pattern??=Ei,q.init(e,t)}),Ia=/*@__PURE__*/ G(`$ZodXID`,(e,t)=>{t.pattern??=Di,q.init(e,t)}),La=/*@__PURE__*/ G(`$ZodKSUID`,(e,t)=>{t.pattern??=Oi,q.init(e,t)}),Ra=/*@__PURE__*/ G(`$ZodISODateTime`,(e,t)=>{t.pattern??=Yi(t),q.init(e,t)}),za=/*@__PURE__*/ G(`$ZodISODate`,(e,t)=>{t.pattern??=Ki,q.init(e,t)}),Ba=/*@__PURE__*/ G(`$ZodISOTime`,(e,t)=>{t.pattern??=Ji(t),q.init(e,t)}),Va=/*@__PURE__*/ G(`$ZodISODuration`,(e,t)=>{t.pattern??=ji,q.init(e,t)}),Ha=/*@__PURE__*/ G(`$ZodIPv4`,(e,t)=>{t.pattern??=Ii,q.init(e,t)}),Ua=/^[0-9a-fA-F:.]+$/;function Wa(e){return Ua.test(e)?Ca(`http://[${e}]`):!1}const Ga=/*@__PURE__*/ G(`$ZodIPv6`,(e,t)=>{t.pattern??=Li,q.init(e,t),e._zod.check=n=>{Wa(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Ka=/*@__PURE__*/ G(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ri,q.init(e,t)});function qa(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Wa(n)}const Ja=/*@__PURE__*/ G(`$ZodCIDRv6`,(e,t)=>{t.pattern??=zi,q.init(e,t),e._zod.check=n=>{qa(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Ya(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Xa=/^[0-9a-zA-Z+/]*={0,2}$/,Za=/*@__PURE__*/ G(`$ZodBase64`,(e,t)=>{t.pattern??=Xa,q.init(e,t),e._zod.check=n=>{Ya(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Qa=/^[A-Za-z0-9_-]*$/;function $a(e){if(!Qa.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ya(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const eo=/*@__PURE__*/ G(`$ZodBase64URL`,(e,t)=>{t.pattern??=Qa,q.init(e,t),e._zod.check=n=>{$a(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),to=/*@__PURE__*/ G(`$ZodE164`,(e,t)=>{t.pattern??=Ui,q.init(e,t)});function no(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const ro=/*@__PURE__*/ G(`$ZodJWT`,(e,t)=>{q.init(e,t),e._zod.check=n=>{no(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),io=/*@__PURE__*/ G(`$ZodUnknown`,(e,t)=>{K.init(e,t),e._zod.parse=e=>e}),ao=/*@__PURE__*/ G(`$ZodNever`,(e,t)=>{K.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function oo(e,t,n){e.issues.length&&t.issues.push(...xr(n,e.issues)),t.value[n]=e.value}const so=/*@__PURE__*/ G(`$ZodArray`,(e,t)=>{K.init(e,t);let n=qr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>oo(t,r,e)));else if(oo(c,r,e),s&&c.issues.length!==0&&yr(c))break}return o.length?Promise.all(o).then(()=>r):r}});function co(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...xr(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const lo=[];function uo(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:lo,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=sr(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function fo(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(yr(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>co(e,n,i,t,d,f))):co(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const po=/*@__PURE__*/ G(`$ZodObject`,(e,t)=>{K.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Bn(()=>uo(t));W(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Un(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=$n,o=t.catchall,s,c=qr.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(yr(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>co(n,t,e,r,a,o))):co(s,t,e,r,a,o)}return o?fo(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),mo=/*@__PURE__*/ G(`$ZodObjectJIT`,(e,t)=>{po.init(e,t);let n=e._zod.parse,r=Bn(()=>uo(t)),i=qr.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ma([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
86
+ `)}\n};`)(...Object.values(this.closed))}};const ga={major:4,minor:6,patch:6},K=/*@__PURE__*/ G(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ga;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=yr(t),a;for(let o of n){if(o._zod.def.when){if(br(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Kr;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(wr(t.issues,n,e),i||=yr(t,n))});else{if(t.issues.length===n)continue;wr(t.issues,n,e),i||=yr(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(yr(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Kr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Kr;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Nr(this,`~standard`,ya(this))},set"~standard"(e){Mr(this,`~standard`,e)}}),_a=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Tr(e,t,Yr()))}:{value:e.value};async function va(e,t){let n={async:!0};return _a(await e._zod.run({value:t,issues:[]},n),n)}function ya(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return _a(r,n)}catch{}return va(e,t)},vendor:`zod`,version:1}}const ba=/*@__PURE__*/ G(`$ZodString`,(e,t)=>{K.init(e,t),e._zod.pattern=t.pattern??Zi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),q=/*@__PURE__*/ G(`$ZodStringFormat`,(e,t)=>{sa.init(e,t),ba.init(e,t)}),xa=/*@__PURE__*/ G(`$ZodGUID`,(e,t)=>{t.pattern??=Ni,q.init(e,t)}),Sa=/*@__PURE__*/ G(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Pi(e)}else t.pattern??=Pi();q.init(e,t)}),Ca=/*@__PURE__*/ G(`$ZodEmail`,(e,t)=>{t.pattern??=Fi,q.init(e,t)});function wa(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ta(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?wa(e)||2:Ea(e,t)}function Ea(e,t){if(!t.normalize&&t.protocol?.source===Ui.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}const Da=/[\t\n\r]/g;function Oa(e){return e.replace(Da,``)}function ka(e,t){return t.lastIndex=0,t.test(e.hostname)}function Aa(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}const ja=/*@__PURE__*/ G(`$ZodURL`,(e,t)=>{q.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Ta(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Oa(r);return}t.hostname&&!ka(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Aa(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Oa(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ma=/*@__PURE__*/ G(`$ZodEmoji`,(e,t)=>{t.pattern??=Ii(),q.init(e,t)}),Na=/*@__PURE__*/ G(`$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.length===void 0?Ai:ji(t.length),q.init(e,t)}),Pa=/*@__PURE__*/ G(`$ZodCUID`,(e,t)=>{t.pattern??=Ti,q.init(e,t)}),Fa=/*@__PURE__*/ G(`$ZodCUID2`,(e,t)=>{t.pattern??=Ei,q.init(e,t)}),Ia=/*@__PURE__*/ G(`$ZodULID`,(e,t)=>{t.pattern??=Di,q.init(e,t)}),La=/*@__PURE__*/ G(`$ZodXID`,(e,t)=>{t.pattern??=Oi,q.init(e,t)}),Ra=/*@__PURE__*/ G(`$ZodKSUID`,(e,t)=>{t.pattern??=ki,q.init(e,t)}),za=/*@__PURE__*/ G(`$ZodISODateTime`,(e,t)=>{t.pattern??=Xi(t),q.init(e,t)}),Ba=/*@__PURE__*/ G(`$ZodISODate`,(e,t)=>{t.pattern??=qi,q.init(e,t)}),Va=/*@__PURE__*/ G(`$ZodISOTime`,(e,t)=>{t.pattern??=Yi(t),q.init(e,t)}),Ha=/*@__PURE__*/ G(`$ZodISODuration`,(e,t)=>{t.pattern??=Mi,q.init(e,t)}),Ua=/*@__PURE__*/ G(`$ZodIPv4`,(e,t)=>{t.pattern??=Li,q.init(e,t)}),Wa=/^[0-9a-fA-F:.]+$/;function Ga(e){return Wa.test(e)?wa(`http://[${e}]`):!1}const Ka=/*@__PURE__*/ G(`$ZodIPv6`,(e,t)=>{t.pattern??=Ri,q.init(e,t),e._zod.check=n=>{Ga(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),qa=/*@__PURE__*/ G(`$ZodCIDRv4`,(e,t)=>{t.pattern??=zi,q.init(e,t)});function Ja(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ga(n)}const Ya=/*@__PURE__*/ G(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Bi,q.init(e,t),e._zod.check=n=>{Ja(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Xa(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Za=/^[0-9a-zA-Z+/]*={0,2}$/,Qa=/*@__PURE__*/ G(`$ZodBase64`,(e,t)=>{t.pattern??=Za,q.init(e,t),e._zod.check=n=>{Xa(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),$a=/^[A-Za-z0-9_-]*$/;function eo(e){if(!$a.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Xa(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const to=/*@__PURE__*/ G(`$ZodBase64URL`,(e,t)=>{t.pattern??=$a,q.init(e,t),e._zod.check=n=>{eo(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),no=/*@__PURE__*/ G(`$ZodE164`,(e,t)=>{t.pattern??=Wi,q.init(e,t)});function ro(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const io=/*@__PURE__*/ G(`$ZodJWT`,(e,t)=>{q.init(e,t),e._zod.check=n=>{ro(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ao=/*@__PURE__*/ G(`$ZodUnknown`,(e,t)=>{K.init(e,t),e._zod.parse=e=>e}),oo=/*@__PURE__*/ G(`$ZodNever`,(e,t)=>{K.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function so(e,t){let n=Cr(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Cr(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,wr(n.issues,t,e),n}}return i(n,a)}}const co=e=>Array.isArray(e)?e.length:-1;function lo(e,t,n){e.issues.length&&t.issues.push(...xr(n,e.issues)),t.value[n]=e.value}const uo=/*@__PURE__*/ G(`$ZodArray`,(e,t)=>{K.init(e,t);let n=Jr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>lo(t,r,e)));else if(lo(c,r,e),s&&c.issues.length!==0&&yr(c))break}return o.length?Promise.all(o).then(()=>r):r},so(e,co)});function fo(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...xr(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}const po=[];function mo(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:po,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=sr(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ho(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(yr(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>fo(e,n,i,t,d,f))):fo(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const go=/*@__PURE__*/ G(`$ZodObject`,(e,t)=>{K.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Bn(()=>mo(t));W(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Un(n,e,/* @__PURE__ */ new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=$n,o=t.catchall,s,c=Jr.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(yr(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>fo(n,t,e,r,a,o))):fo(s,t,e,r,a,o)}return o?ho(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),_o=/*@__PURE__*/ G(`$ZodObjectJIT`,(e,t)=>{go.init(e,t);let n=e._zod.parse,r=Bn(()=>mo(t)),i=Jr.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new ha([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
87
87
  let ${e}_ab = false;
88
88
  for (let i = 0; i < ${e}.issues.length; i++) {
89
89
  const iss = ${e}.issues[i];
@@ -133,54 +133,54 @@ ${L.default.gray(yn+_n.repeat(a+2)+bn)}
133
133
  newResult[${r}] = ${n}.value;
134
134
  }
135
135
 
136
- `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=$n,c=!qr.jitless,l=c&&er.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?fo([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ho(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!yr(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>wr(e,r,Jr())))}),t)}const go=/*@__PURE__*/ G(`$ZodUnion`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),W(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),W(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),W(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Hn(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ho(t,r,e,i)):ho(o,r,e,i)}}),_o=/*@__PURE__*/ G(`$ZodIntersection`,(e,t)=>{K.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>yo(e,t,n)):yo(e,i,a)}});function vo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(tr(e)&&tr(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=vo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=vo(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yo(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=vo(t.value,n.value);if(!c.valid){if(yr(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const bo=/*@__PURE__*/ G(`$ZodRecord`,(e,t)=>{K.init(e,t);let n=qr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!tr(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>wr(e,i,Jr())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...xr(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...xr(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Qi.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>wr(e,i,Jr())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...xr(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...xr(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),xo=/*@__PURE__*/ G(`$ZodEnum`,(e,t)=>{K.init(e,t);let n=In(t.entries),r=new Set(n);e._zod.values=r,W(e,`pattern`,e=>{let t=In(e.def.entries).filter(e=>rr.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ir(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),So=/*@__PURE__*/ G(`$ZodTransform`,(e,t)=>{K.init(e,t),e._zod.optin=`optional`,qr.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Kr(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Gr;return n.value=i,n}});function Co(e,t){return e.value=t.issues.length?void 0:t.value,e}const wo=/*@__PURE__*/ G(`$ZodOptional`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,W(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),W(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Hn(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Co(e,t)):Co(e,r)}return t.innerType._zod.run(e,n)}}),To=/*@__PURE__*/ G(`$ZodExactOptional`,(e,t)=>{wo.init(e,t),W(e,`values`,e=>e.def.innerType._zod.values),W(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Eo=/*@__PURE__*/ G(`$ZodNullable`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.innerType._zod.optin),W(e,`optout`,e=>e.def.innerType._zod.optout),W(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Hn(t.source)}|null)$`):void 0}),W(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Do=/*@__PURE__*/ G(`$ZodDefault`,(e,t)=>{K.init(e,t),e._zod.optin=`defaulted`,W(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Oo(e,t)):Oo(r,t)}});function Oo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const ko=/*@__PURE__*/ G(`$ZodPrefault`,(e,t)=>{K.init(e,t),e._zod.optin=`defaulted`,W(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ao=/*@__PURE__*/ G(`$ZodNonOptional`,(e,t)=>{K.init(e,t),W(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>jo(t,e)):jo(i,e)}});function jo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Mo(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>wr(e,r,Jr()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const No=/*@__PURE__*/ G(`$ZodCatch`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),W(e,`optout`,e=>e.def.innerType._zod.optout),W(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Mo(e,r,t,n)):Mo(e,r,t,n)}}),Po=/*@__PURE__*/ G(`$ZodPipe`,(e,t)=>{K.init(e,t),W(e,`values`,e=>e.def.in._zod.values),W(e,`optin`,e=>e.def.in._zod.optin),W(e,`optout`,e=>e.def.out._zod.optout),W(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Fo(e,t.in,n)):Fo(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Fo(e,t.out,n)):Fo(r,t.out,n)}});function Fo(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Io=/*@__PURE__*/ G(`$ZodReadonly`,(e,t)=>{K.init(e,t),W(e,`propValues`,e=>e.def.innerType._zod.propValues),W(e,`values`,e=>e.def.innerType._zod.values),W(e,`optin`,e=>e.def.innerType?._zod?.optin),W(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Lo):Lo(r)}});function Lo(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Ro=/*@__PURE__*/ G(`$ZodCustom`,(e,t)=>{ta.init(e,t),K.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>zo(t,n,r,e));zo(i,n,r,e)}});function zo(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(kr(e))}}var Bo=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Vo=`~memo`,Ho=[];function Uo(e){return typeof e==`object`&&!!e}function Wo(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Go=/*@__PURE__*/ new WeakMap;function Ko(e,t,n){let r=Go.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=Ko(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?Ko(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Wn(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ko(r,t,!1):1);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 e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),qo(e,i)}function qo(e,t){return t!==1&&Go.set(e,t===2),t}function Jo(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let Yo;const Xo=[],Zo={alloc(e,t,n){let r=Yo;if(!r)return n;Yo=void 0;let i={value:n,issues:null};return r.set(t.value,i),Xo.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&$o(n,e.value))throw new Bo;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ko(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Uo(l))return t(s,c);let u=c[Vo];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Vo]=u);let d;i===c?d=a:(d=Jo(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Wo(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Yo=d;let p=Xo.length,m=t(s,c);Yo=void 0;let h=Xo.length>p?Xo.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Wo(e.issues):Ho),e)):(h&&(h.issues=m.issues.length?Wo(m.issues):Ho),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Qo(){return Zo}function $o(e,t){let n=e[Vo]?.backEdges;return n!==void 0&&Uo(t)&&n.has(t)}const es=()=>{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(t){return e[t]??null}let n={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`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Or(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${or(e.values[0])}`:`Invalid option: expected one of ${Ln(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Ln(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function ts(){return{localeError:es()}}var ns,rs=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function is(){return new rs}(ns=globalThis).__zod_globalRegistry??(ns.__zod_globalRegistry=is());const as=globalThis.__zod_globalRegistry;function os(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
137
- function ss(e,t){return new e(os({type:`string`,...U(t)}))}// @__NO_SIDE_EFFECTS__
138
- function cs(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
139
- function ls(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
140
- function us(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
141
- function ds(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...U(t)})}// @__NO_SIDE_EFFECTS__
142
- function fs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...U(t)})}// @__NO_SIDE_EFFECTS__
143
- function ps(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...U(t)})}// @__NO_SIDE_EFFECTS__
144
- function ms(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
145
- function hs(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
146
- function gs(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
147
- function _s(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
148
- function vs(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
149
- function ys(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
150
- function bs(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
151
- function xs(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
152
- function Ss(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
153
- function Cs(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
154
- function ws(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
155
- function Ts(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
156
- function Es(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
157
- function Ds(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
158
- function Os(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
159
- function ks(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
160
- function As(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...U(t)})}// @__NO_SIDE_EFFECTS__
161
- function js(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...U(t)})}// @__NO_SIDE_EFFECTS__
162
- function Ms(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...U(t)})}// @__NO_SIDE_EFFECTS__
163
- function Ns(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...U(t)})}// @__NO_SIDE_EFFECTS__
164
- function Ps(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
165
- function Fs(e,t){return new e({type:`never`,...U(t)})}// @__NO_SIDE_EFFECTS__
166
- function Is(e,t){return new ra({check:`max_length`,...U(t),maximum:e})}// @__NO_SIDE_EFFECTS__
167
- function Ls(e,t){return new ia({check:`min_length`,...U(t),minimum:e})}// @__NO_SIDE_EFFECTS__
168
- function Rs(e,t){return new aa({check:`length_equals`,...U(t),length:e})}// @__NO_SIDE_EFFECTS__
169
- function zs(e,t){return new sa({check:`string_format`,format:`regex`,...U(t),pattern:e})}// @__NO_SIDE_EFFECTS__
170
- function Bs(e){return new ca({check:`string_format`,format:`lowercase`,...U(e)})}// @__NO_SIDE_EFFECTS__
171
- function Vs(e){return new la({check:`string_format`,format:`uppercase`,...U(e)})}// @__NO_SIDE_EFFECTS__
172
- function Hs(e,t){return new ua({check:`string_format`,format:`includes`,...U(t),includes:e})}// @__NO_SIDE_EFFECTS__
173
- function Us(e,t){return new da({check:`string_format`,format:`starts_with`,...U(t),prefix:e})}// @__NO_SIDE_EFFECTS__
174
- function Ws(e,t){return new fa({check:`string_format`,format:`ends_with`,...U(t),suffix:e})}// @__NO_SIDE_EFFECTS__
175
- function Gs(e){return new pa({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
176
- function Ks(e){return/* @__PURE__ */ Gs(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
177
- function qs(){return/* @__PURE__ */ Gs(e=>e.trim())}// @__NO_SIDE_EFFECTS__
178
- function Js(){return/* @__PURE__ */ Gs(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
179
- function Ys(){return/* @__PURE__ */ Gs(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
180
- function Xs(){return/* @__PURE__ */ Gs(e=>Zn(e))}// @__NO_SIDE_EFFECTS__
181
- function Zs(e,t,n){return new e({type:`array`,element:t,...U(n)})}// @__NO_SIDE_EFFECTS__
182
- function Qs(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...U(n)})}// @__NO_SIDE_EFFECTS__
183
- function $s(e,t){let n=/* @__PURE__ */ ec(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(kr(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(kr(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
184
- function ec(e,t){let n=new ta({check:`custom`,...U(t)});return n._zod.check=e,n}function tc(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Un(e,t,n[t]);return e}function nc(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??as,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function rc(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function J(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,J(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&tc(o.schema,c),t.io===`input`&&Y(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ic(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ac(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ic(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ic(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
136
+ `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=$n,c=!Jr.jitless,l=c&&er.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ho([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function vo(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!yr(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Tr(e,r,Yr())))}),t)}const yo=/*@__PURE__*/ G(`$ZodUnion`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),W(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),W(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),W(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Hn(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>vo(t,r,e,i)):vo(o,r,e,i)}}),bo=/*@__PURE__*/ G(`$ZodIntersection`,(e,t)=>{K.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>So(e,t,n)):So(e,i,a)}});function xo(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(tr(e)&&tr(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=xo(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=xo(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function So(e,t,n){let r=/* @__PURE__ */ new Map,i,a=/* @__PURE__ */ new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=xo(t.value,n.value);if(!c.valid){if(yr(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Co=/*@__PURE__*/ G(`$ZodRecord`,(e,t)=>{K.init(e,t);let n=Jr.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!tr(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=/* @__PURE__ */ new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Tr(e,i,Yr())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...xr(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...xr(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&$i.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Tr(e,i,Yr())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...xr(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...xr(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),wo=/*@__PURE__*/ G(`$ZodEnum`,(e,t)=>{K.init(e,t);let n=In(t.entries),r=new Set(n);e._zod.values=r,W(e,`pattern`,e=>{let t=In(e.def.entries).filter(e=>rr.has(typeof e));return RegExp(t.length?`^(${t.map(e=>ir(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),To=/*@__PURE__*/ G(`$ZodTransform`,(e,t)=>{K.init(e,t),e._zod.optin=`optional`,Jr.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qr(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Kr;return n.value=i,n}});function Eo(e,t){return e.value=t.issues.length?void 0:t.value,e}const Do=/*@__PURE__*/ G(`$ZodOptional`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,W(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?/* @__PURE__ */ new Set([...t,void 0]):void 0}),W(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Hn(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Eo(e,t)):Eo(e,r)}return t.innerType._zod.run(e,n)}}),Oo=/*@__PURE__*/ G(`$ZodExactOptional`,(e,t)=>{Do.init(e,t),W(e,`values`,e=>e.def.innerType._zod.values),W(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ko=/*@__PURE__*/ G(`$ZodNullable`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.innerType._zod.optin),W(e,`optout`,e=>e.def.innerType._zod.optout),W(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Hn(t.source)}|null)$`):void 0}),W(e,`values`,e=>e.def.innerType._zod.values?/* @__PURE__ */ new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ao=/*@__PURE__*/ G(`$ZodDefault`,(e,t)=>{K.init(e,t),e._zod.optin=`defaulted`,W(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>jo(e,t)):jo(r,t)}});function jo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Mo=/*@__PURE__*/ G(`$ZodPrefault`,(e,t)=>{K.init(e,t),e._zod.optin=`defaulted`,W(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),No=/*@__PURE__*/ G(`$ZodNonOptional`,(e,t)=>{K.init(e,t),W(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Po(t,e)):Po(i,e)}});function Po(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Fo(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Tr(e,r,Yr()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Io=/*@__PURE__*/ G(`$ZodCatch`,(e,t)=>{K.init(e,t),W(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),W(e,`optout`,e=>e.def.innerType._zod.optout),W(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Fo(e,r,t,n)):Fo(e,r,t,n)}}),Lo=/*@__PURE__*/ G(`$ZodPipe`,(e,t)=>{K.init(e,t),W(e,`values`,e=>e.def.in._zod.values),W(e,`optin`,e=>e.def.in._zod.optin),W(e,`optout`,e=>e.def.out._zod.optout),W(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ro(e,t.in,n)):Ro(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ro(e,t.out,n)):Ro(r,t.out,n)}});function Ro(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const zo=/*@__PURE__*/ G(`$ZodReadonly`,(e,t)=>{K.init(e,t),W(e,`propValues`,e=>e.def.innerType._zod.propValues),W(e,`values`,e=>e.def.innerType._zod.values),W(e,`optin`,e=>e.def.innerType?._zod?.optin),W(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Bo):Bo(r)}});function Bo(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Vo=/*@__PURE__*/ G(`$ZodCustom`,(e,t)=>{na.init(e,t),K.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ho(t,n,r,e));Ho(i,n,r,e)}});function Ho(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ar(e))}}var Uo=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}};const Wo=`~memo`,Go=[];function Ko(e){return typeof e==`object`&&!!e}function qo(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}const Jo=/*@__PURE__*/ new WeakMap;function Yo(e,t,n){let r=Jo.get(e);if(r!==void 0)return r?2:0;if(t.has(e))return 2;t.add(e);let i=0,a=e=>{if(i!==2&&e?._zod){let r=Yo(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=0;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?1:o.value?._zod?Yo(o.value,t,n):0;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Wn(c);s(e?o(e,!0):1),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Yo(r,t,!1):1);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 e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Xo(e,i)}function Xo(e,t){return t!==1&&Jo.set(e,t===2),t}function Zo(e,t){let n=e.buckets.get(t);return n||(n=/* @__PURE__ */ new WeakMap,e.buckets.set(t,n)),n}let Qo;const $o=[],es={alloc(e,t,n){let r=Qo;if(!r)return n;Qo=void 0;let i={value:n,issues:null};return r.set(t.value,i),$o.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ns(n,e.value))throw new Uo;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Yo(e,/* @__PURE__ */ new Set,!1);if(i===0)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===2||r?n=!0:r=!0}let l=s.value;if(!Ko(l))return t(s,c);let u=c[Wo];u||(u={buckets:/* @__PURE__ */ new WeakMap,backEdges:void 0},c[Wo]=u);let d;i===c?d=a:(d=Zo(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...qo(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=/* @__PURE__ */ new WeakSet),u.backEdges.add(f.value)),s;Qo=d;let p=$o.length,m=t(s,c);Qo=void 0;let h=$o.length>p?$o.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?qo(e.issues):Go),e)):(h&&(h.issues=m.issues.length?qo(m.issues):Go),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ts(){return es}function ns(e,t){let n=e[Wo]?.backEdges;return n!==void 0&&Ko(t)&&n.has(t)}const rs=()=>{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(t){return e[t]??null}let n={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`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(kr(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${or(e.values[0])}`:`Invalid option: expected one of ${Ln(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Ln(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function is(){return{localeError:rs()}}var as,os=class{constructor(){this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */ new WeakMap,this._idmap=/* @__PURE__ */ new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ss(){return new os}(as=globalThis).__zod_globalRegistry??(as.__zod_globalRegistry=ss());const cs=globalThis.__zod_globalRegistry;function ls(e){return e.checks&&=[...e.checks],e}// @__NO_SIDE_EFFECTS__
137
+ function us(e,t){return new e(ls({type:`string`,...U(t)}))}// @__NO_SIDE_EFFECTS__
138
+ function ds(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
139
+ function fs(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
140
+ function ps(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
141
+ function ms(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...U(t)})}// @__NO_SIDE_EFFECTS__
142
+ function hs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...U(t)})}// @__NO_SIDE_EFFECTS__
143
+ function gs(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...U(t)})}// @__NO_SIDE_EFFECTS__
144
+ function _s(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
145
+ function vs(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
146
+ function ys(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
147
+ function bs(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
148
+ function xs(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
149
+ function Ss(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
150
+ function Cs(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
151
+ function ws(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
152
+ function Ts(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
153
+ function Es(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
154
+ function Ds(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
155
+ function Os(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
156
+ function ks(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
157
+ function As(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
158
+ function js(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
159
+ function Ms(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...U(t)})}// @__NO_SIDE_EFFECTS__
160
+ function Ns(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...U(t)})}// @__NO_SIDE_EFFECTS__
161
+ function Ps(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...U(t)})}// @__NO_SIDE_EFFECTS__
162
+ function Fs(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...U(t)})}// @__NO_SIDE_EFFECTS__
163
+ function Is(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...U(t)})}// @__NO_SIDE_EFFECTS__
164
+ function Ls(e){return new e({type:`unknown`})}// @__NO_SIDE_EFFECTS__
165
+ function Rs(e,t){return new e({type:`never`,...U(t)})}// @__NO_SIDE_EFFECTS__
166
+ function zs(e,t){return new ia({check:`max_length`,...U(t),maximum:e})}// @__NO_SIDE_EFFECTS__
167
+ function Bs(e,t){return new aa({check:`min_length`,...U(t),minimum:e})}// @__NO_SIDE_EFFECTS__
168
+ function Vs(e,t){return new oa({check:`length_equals`,...U(t),length:e})}// @__NO_SIDE_EFFECTS__
169
+ function Hs(e,t){return new ca({check:`string_format`,format:`regex`,...U(t),pattern:e})}// @__NO_SIDE_EFFECTS__
170
+ function Us(e){return new la({check:`string_format`,format:`lowercase`,...U(e)})}// @__NO_SIDE_EFFECTS__
171
+ function Ws(e){return new ua({check:`string_format`,format:`uppercase`,...U(e)})}// @__NO_SIDE_EFFECTS__
172
+ function Gs(e,t){return new da({check:`string_format`,format:`includes`,...U(t),includes:e})}// @__NO_SIDE_EFFECTS__
173
+ function Ks(e,t){return new fa({check:`string_format`,format:`starts_with`,...U(t),prefix:e})}// @__NO_SIDE_EFFECTS__
174
+ function qs(e,t){return new pa({check:`string_format`,format:`ends_with`,...U(t),suffix:e})}// @__NO_SIDE_EFFECTS__
175
+ function Js(e){return new ma({check:`overwrite`,tx:e})}// @__NO_SIDE_EFFECTS__
176
+ function Ys(e){return/* @__PURE__ */ Js(t=>t.normalize(e))}// @__NO_SIDE_EFFECTS__
177
+ function Xs(){return/* @__PURE__ */ Js(e=>e.trim())}// @__NO_SIDE_EFFECTS__
178
+ function Zs(){return/* @__PURE__ */ Js(e=>e.toLowerCase())}// @__NO_SIDE_EFFECTS__
179
+ function Qs(){return/* @__PURE__ */ Js(e=>e.toUpperCase())}// @__NO_SIDE_EFFECTS__
180
+ function $s(){return/* @__PURE__ */ Js(e=>Zn(e))}// @__NO_SIDE_EFFECTS__
181
+ function ec(e,t,n){return new e({type:`array`,element:t,...U(n)})}// @__NO_SIDE_EFFECTS__
182
+ function tc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...U(n)})}// @__NO_SIDE_EFFECTS__
183
+ function nc(e,t){let n=/* @__PURE__ */ rc(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ar(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Ar(r))}},e(t.value,t)),t);return n}// @__NO_SIDE_EFFECTS__
184
+ function rc(e,t){let n=new na({check:`custom`,...U(t)});return n._zod.check=e,n}function ic(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Un(e,t,n[t]);return e}function ac(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??cs,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:/* @__PURE__ */ new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function oc(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function J(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,J(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&ic(o.schema,c),t.io===`input`&&Y(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function sc(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function cc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=/* @__PURE__ */ new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${sc(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+sc(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
185
185
 
186
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function oc(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;oc(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const sc=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),cc=[`oneOf`,`anyOf`];function lc(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function uc(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!sc.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??lc(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Un(n,r,e.length===1?e[0]:uc(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=lc(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function dc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of sc)if(t in e)return;let n=t.filter(e=>cc.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=uc(t);else{let e=n[0],i=cc.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>uc([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,tc(e,r))}function fc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):tc(i,s),tc(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())oc(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])dc(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}tc(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Un(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:mc(t,`input`,e.processors),output:mc(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Y(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Y(r.element,n);if(r.type===`set`)return Y(r.valueType,n);if(r.type===`lazy`)return Y(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Y(r.innerType,n);if(r.type===`intersection`)return Y(r.left,n)||Y(r.right,n);if(r.type===`record`||r.type===`map`)return Y(r.keyType,n)||Y(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Y(r.in,n)||Y(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Y(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Y(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Y(e,n))return!0;return!!(r.rest&&Y(r.rest,n))}return!1}const pc=(e,t={})=>n=>{let r=nc({...n,processors:t});return J(e,r),ac(r,e),fc(r,e)},mc=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=nc({...i??{},target:a,io:t,processors:n});return J(e,o),ac(o,e),fc(o,e)},hc=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},gc=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},_c=(e,t)=>{hc(e,`minimum`,t),gc(e,`maximum`,t)},vc=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},yc=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},bc=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},xc=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Sc=(e,t)=>hc(e,`minimum`,t.minimum),Cc=(e,t)=>gc(e,`maximum`,t.maximum),wc=e=>(t,n)=>{xc(t,n.format);let[r,i]=e[n.format];hc(t,`minimum`,r),gc(t,`maximum`,i)},Tc={greater_than:(e,t)=>hc(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>gc(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>vc(e,t.value),number_format:wc(cr),bigint_format:wc(lr),min_length:Sc,max_length:Cc,length_equals:(e,t)=>_c(e,t.length),min_size:Sc,max_size:Cc,size_equals:(e,t)=>_c(e,t.size),string_format:(e,t)=>{xc(e,t.format),t.pattern&&yc(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>bc(e,t.mime)};function Ec(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Tc[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&hc(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&hc(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&gc(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&gc(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&vc(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&bc(t,i.mime);for(let e of i.patterns??[])yc(t,e);return t}const Dc={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Oc=/* @__PURE__ */ new Map([[Xa,Bi],[Qa,Vi]]),kc=e=>Oc.get(e)??e,Ac=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Ec(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Dc[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(kc);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},jc=(e,t,n,r)=>{n.not={}},Mc=(e,t,n,r)=>{let i=e._zod.def,a=In(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Nc=(e,t,n,r)=>{rc(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Pc=(e,t,n,r)=>{rc(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Fc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Ec(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=J(a.element,t,{...r,path:[...r.path,`items`]})};function Ic(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ic(t.out):t.type===`catch`?Ic(t.innerType):e._zod.optin}const Lc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&rc(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Un(i.properties,e,J(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Ic(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=J(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Rc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>J(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zc=(e,t,n,r)=>{let i=e._zod.def,a=J(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=J(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Bc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Bc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Bc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Qi:Zi).source)),p}const Vc=/* @__PURE__ */ new WeakMap;function Hc(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Vc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Bc(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Uc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Ec(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=J(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Un(i.patternProperties,kc(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=J(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Vc.get(t);n||(n=[],Vc.set(t,n),t.deferred.push(()=>Hc(t))),n.push(e)}i.additionalProperties=J(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ic(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Wc=(e,t,n,r)=>{let i=e._zod.def,a=J(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Gc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Kc=Symbol();function qc(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(rc(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Kc):JSON.parse(o)}const Jc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=qc(i.defaultValue,e,t,n,r);o!==Kc&&(n.default=o)},Yc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=qc(i.defaultValue,e,t,n,r);o!==Kc&&(n._prefault=o)},Xc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{rc(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Zc=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;J(o,t,r);let s=t.seen.get(e);s.ref=o},Qc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},$c=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},el=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function tl(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const X=/*@__PURE__*/ G(`ZodError`,(e,t)=>{ti.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);el.has(n)||(el.add(n),tl(n,`format`,e=>t=>ii(e,t)),tl(n,`flatten`,e=>t=>ri(e,t)),tl(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Rn,2)}),tl(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Rn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),nl=/* @__PURE__ */ oi(X),rl=/* @__PURE__ */ si(X),il=/* @__PURE__ */ ci(X),al=/* @__PURE__ */ ui(X),ol=/* @__PURE__ */ gi(X),sl=/* @__PURE__ */ _i(X),cl=/* @__PURE__ */ vi(X),ll=/* @__PURE__ */ yi(X),ul=/* @__PURE__ */ bi(X),dl=/* @__PURE__ */ xi(X),fl=/* @__PURE__ */ Si(X),pl=/* @__PURE__ */ Ci(X);function ml(){qr.localeError||Jr(ts())}function hl(){qr.memoizer||Jr({memoizer:Qo()})}const Z=/*@__PURE__*/ G(`ZodType`,(e,t)=>(ml(),K.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(H(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ar(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Tu(e,t))},superRefine(e,t){return this.check(Eu(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Gs(e))},optional(){return su(this)},exactOptional(){return lu(this)},nullable(){return du(this)},nullish(){return su(du(this))},nonoptional(e){return _u(this,e)},array(){return Kl(this)},or(e){return Zl([this,e])},and(e){return $l(this,e)},transform(e){return xu(this,au(e))},default(e){return pu(this,e)},prefault(e){return hu(this,e)},catch(e){return yu(this,e)},pipe(e){return xu(this,e)},readonly(){return Cu(this)},describe(e){let t=this.clone();return as.add(t,{description:e}),t},meta(...e){if(e.length===0)return as.get(this);let t=this.clone();return as.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 Mr(this,`~standard`,{...va(this),jsonSchema:{input:mc(this,`input`),output:mc(this,`output`)}})},set"~standard"(e){jr(this,`~standard`,e)},parse:function e(t,n){return nl(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await rl(this,t,n,{callee:e})},safeParse(e,t){return il(this,e,t)},async safeParseAsync(e,t){return al(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){jr(this,`spa`,e)},validate(e,t){return pi(this,e,t)},validateAsync(e,t){return hi(this,e,t)},encode:function e(t,n){return ol(this,t,n,{callee:e})},decode:function e(t,n){return sl(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await cl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ll(this,t,n,{callee:e})},safeEncode(e,t){return ul(this,e,t)},safeDecode(e,t){return dl(this,e,t)},async safeEncodeAsync(e,t){return fl(this,e,t)},async safeDecodeAsync(e,t){return pl(this,e,t)},toJSONSchema(e){return pc(this,{})(e)},get description(){return as.get(this)?.description},get _def(){return this._zod.def}}),gl=/*@__PURE__*/ G(`_ZodString`,(e,t)=>{ya.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ac(e,t,n,r)},/*@__PURE__*/ Nr({format:e=>Ec(e).format??null,minLength:e=>Ec(e).minimum??null,maxLength:e=>Ec(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ zs(...e))},includes(...e){return this.check(/* @__PURE__ */ Hs(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Us(...e))},endsWith(...e){return this.check(/* @__PURE__ */ Ws(...e))},min(...e){return this.check(/* @__PURE__ */ Ls(...e))},max(...e){return this.check(/* @__PURE__ */ Is(...e))},length(...e){return this.check(/* @__PURE__ */ Rs(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Ls(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Bs(e))},uppercase(e){return this.check(/* @__PURE__ */ Vs(e))},trim(){return this.check(/* @__PURE__ */ qs())},normalize(...e){return this.check(/* @__PURE__ */ Ks(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Js())},toUpperCase(){return this.check(/* @__PURE__ */ Ys())},slugify(){return this.check(/* @__PURE__ */ Xs())}})),_l=/*@__PURE__*/ G(`ZodString`,(e,t)=>{ya.init(e,t),gl.init(e,t)},{email(e){return this.check(/* @__PURE__ */ cs(Sl,e))},url(e){return this.check(/* @__PURE__ */ ms(Tl,e))},jwt(e){return this.check(/* @__PURE__ */ ks(Bl,e))},emoji(e){return this.check(/* @__PURE__ */ hs(El,e))},guid(e){return this.check(/* @__PURE__ */ ls(Cl,e))},uuid(e){return this.check(/* @__PURE__ */ us(wl,e))},uuidv4(e){return this.check(/* @__PURE__ */ ds(wl,e))},uuidv6(e){return this.check(/* @__PURE__ */ fs(wl,e))},uuidv7(e){return this.check(/* @__PURE__ */ ps(wl,e))},nanoid(e){return this.check(/* @__PURE__ */ gs(Dl,e))},cuid(e){return this.check(/* @__PURE__ */ _s(Ol,e))},cuid2(e){return this.check(/* @__PURE__ */ vs(kl,e))},ulid(e){return this.check(/* @__PURE__ */ ys(Al,e))},base64(e){return this.check(/* @__PURE__ */ Es(Ll,e))},base64url(e){return this.check(/* @__PURE__ */ Ds(Rl,e))},xid(e){return this.check(/* @__PURE__ */ bs(jl,e))},ksuid(e){return this.check(/* @__PURE__ */ xs(Ml,e))},ipv4(e){return this.check(/* @__PURE__ */ Ss(Nl,e))},ipv6(e){return this.check(/* @__PURE__ */ Cs(Pl,e))},cidrv4(e){return this.check(/* @__PURE__ */ ws(Fl,e))},cidrv6(e){return this.check(/* @__PURE__ */ Ts(Il,e))},e164(e){return this.check(/* @__PURE__ */ Os(zl,e))},datetime(e){return this.check(/* @__PURE__ */ As(vl,e))},date(e){return this.check(/* @__PURE__ */ js(yl,e))},time(e){return this.check(/* @__PURE__ */ Ms(bl,e))},duration(e){return this.check(/* @__PURE__ */ Ns(xl,e))}});function Q(e){return/* @__PURE__ */ ss(_l,e)}const $=/*@__PURE__*/ G(`ZodStringFormat`,(e,t)=>{q.init(e,t),gl.init(e,t)}),vl=/*@__PURE__*/ G(`ZodISODateTime`,(e,t)=>{Ra.init(e,t),$.init(e,t)}),yl=/*@__PURE__*/ G(`ZodISODate`,(e,t)=>{za.init(e,t),$.init(e,t)}),bl=/*@__PURE__*/ G(`ZodISOTime`,(e,t)=>{Ba.init(e,t),$.init(e,t)}),xl=/*@__PURE__*/ G(`ZodISODuration`,(e,t)=>{Va.init(e,t),$.init(e,t)}),Sl=/*@__PURE__*/ G(`ZodEmail`,(e,t)=>{Sa.init(e,t),$.init(e,t)}),Cl=/*@__PURE__*/ G(`ZodGUID`,(e,t)=>{ba.init(e,t),$.init(e,t)}),wl=/*@__PURE__*/ G(`ZodUUID`,(e,t)=>{xa.init(e,t),$.init(e,t)}),Tl=/*@__PURE__*/ G(`ZodURL`,(e,t)=>{Aa.init(e,t),$.init(e,t)}),El=/*@__PURE__*/ G(`ZodEmoji`,(e,t)=>{ja.init(e,t),$.init(e,t)}),Dl=/*@__PURE__*/ G(`ZodNanoID`,(e,t)=>{Ma.init(e,t),$.init(e,t)}),Ol=/*@__PURE__*/ G(`ZodCUID`,(e,t)=>{Na.init(e,t),$.init(e,t)}),kl=/*@__PURE__*/ G(`ZodCUID2`,(e,t)=>{Pa.init(e,t),$.init(e,t)}),Al=/*@__PURE__*/ G(`ZodULID`,(e,t)=>{Fa.init(e,t),$.init(e,t)}),jl=/*@__PURE__*/ G(`ZodXID`,(e,t)=>{Ia.init(e,t),$.init(e,t)}),Ml=/*@__PURE__*/ G(`ZodKSUID`,(e,t)=>{La.init(e,t),$.init(e,t)}),Nl=/*@__PURE__*/ G(`ZodIPv4`,(e,t)=>{Ha.init(e,t),$.init(e,t)}),Pl=/*@__PURE__*/ G(`ZodIPv6`,(e,t)=>{Ga.init(e,t),$.init(e,t)}),Fl=/*@__PURE__*/ G(`ZodCIDRv4`,(e,t)=>{Ka.init(e,t),$.init(e,t)}),Il=/*@__PURE__*/ G(`ZodCIDRv6`,(e,t)=>{Ja.init(e,t),$.init(e,t)}),Ll=/*@__PURE__*/ G(`ZodBase64`,(e,t)=>{Za.init(e,t),$.init(e,t)}),Rl=/*@__PURE__*/ G(`ZodBase64URL`,(e,t)=>{eo.init(e,t),$.init(e,t)}),zl=/*@__PURE__*/ G(`ZodE164`,(e,t)=>{to.init(e,t),$.init(e,t)}),Bl=/*@__PURE__*/ G(`ZodJWT`,(e,t)=>{ro.init(e,t),$.init(e,t)}),Vl=/*@__PURE__*/ G(`ZodUnknown`,(e,t)=>{io.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Hl(){return/* @__PURE__ */ Ps(Vl)}const Ul=/*@__PURE__*/ G(`ZodNever`,(e,t)=>{ao.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jc(e,t,n,r)});function Wl(e){return/* @__PURE__ */ Fs(Ul,e)}const Gl=/*@__PURE__*/ G(`ZodArray`,(e,t)=>{hl(),so.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fc(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Ls(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Ls(1,e))},max(e,t){return this.check(/* @__PURE__ */ Is(e,t))},length(e,t){return this.check(/* @__PURE__ */ Rs(e,t))},unwrap(){return this.element}});function Kl(e,t){return/* @__PURE__ */ Zs(Gl,e,t)}const ql=/*@__PURE__*/ G(`ZodObject`,(e,t)=>{hl(),mo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r),zr(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ru(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(H(this._zod.def,{catchall:e}))},passthrough(){return this.clone(H(this._zod.def,{catchall:Hl()}))},loose(){return this.clone(H(this._zod.def,{catchall:Hl()}))},strict(){return this.clone(H(this._zod.def,{catchall:Wl()}))},strip(){return this.clone(H(this._zod.def,{catchall:void 0}))},extend(e){return pr(this,e)},safeExtend(e){return hr(this,e)},merge(e){return gr(this,e)},pick(e){return ur(this,e)},omit(e){return fr(this,e)},partial(...e){return _r(ou,this,e[0])},exactPartial(...e){return _r(cu,this,e[0],`exactPartial`)},required(...e){return vr(gu,this,e[0])}});function Jl(e,t){let n={type:`object`,shape:e??{},...U(t)};return new ql(n)}function Yl(e,t){return new ql({type:`object`,shape:e,catchall:Hl(),...U(t)})}const Xl=/*@__PURE__*/ G(`ZodUnion`,(e,t)=>{go.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r),e.options=t.options});function Zl(e,t){return new Xl({type:`union`,options:e,...U(t)})}const Ql=/*@__PURE__*/ G(`ZodIntersection`,(e,t)=>{_o.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zc(e,t,n,r)});function $l(e,t){return new Ql({type:`intersection`,left:e,right:t})}const eu=/*@__PURE__*/ G(`ZodRecord`,(e,t)=>{hl(),bo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function tu(e,t,n){return!t||!t._zod?new eu({type:`record`,keyType:Q(),valueType:e,...U(t)}):new eu({type:`record`,keyType:e,valueType:t,...U(n)})}const nu=/*@__PURE__*/ G(`ZodEnum`,(e,t)=>{xo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mc(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new nu({...t,checks:[],...U(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new nu({...t,checks:[],...U(r),entries:i})}});function ru(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new nu({type:`enum`,entries:n,...U(t)})}const iu=/*@__PURE__*/ G(`ZodTransform`,(e,t)=>{hl(),So.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Kr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(kr(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(kr(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function au(e){return new iu({type:`transform`,transform:e})}const ou=/*@__PURE__*/ G(`ZodOptional`,(e,t)=>{wo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$c(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function su(e){return new ou({type:`optional`,innerType:e})}const cu=/*@__PURE__*/ G(`ZodExactOptional`,(e,t)=>{To.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$c(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lu(e){return new cu({type:`optional`,innerType:e})}const uu=/*@__PURE__*/ G(`ZodNullable`,(e,t)=>{Eo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function du(e){return new uu({type:`nullable`,innerType:e})}const fu=/*@__PURE__*/ G(`ZodDefault`,(e,t)=>{Do.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function pu(e,t){return new fu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():nr(t)}})}const mu=/*@__PURE__*/ G(`ZodPrefault`,(e,t)=>{ko.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hu(e,t){return new mu({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():nr(t)}})}const gu=/*@__PURE__*/ G(`ZodNonOptional`,(e,t)=>{Ao.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _u(e,t){return new gu({type:`nonoptional`,innerType:e,...U(t)})}const vu=/*@__PURE__*/ G(`ZodCatch`,(e,t)=>{No.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function yu(e,t){return new vu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Br(t)})}const bu=/*@__PURE__*/ G(`ZodPipe`,(e,t)=>{Po.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zc(e,t,n,r),e.in=t.in,e.out=t.out});function xu(e,t){return new bu({type:`pipe`,in:e,out:t})}const Su=/*@__PURE__*/ G(`ZodReadonly`,(e,t)=>{Io.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cu(e){return new Su({type:`readonly`,innerType:e})}const wu=/*@__PURE__*/ G(`ZodCustom`,(e,t)=>{Ro.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nc(e,t,n,r)});function Tu(e,t={}){return/* @__PURE__ */ Qs(wu,e,t)}function Eu(e,t){return/* @__PURE__ */ $s(e,t)}const Du=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],Ou=[`dependencies`,`peerDependencies`,`optionalDependencies`],ku=tu(Q(),Q()),Au=Yl({name:Q().optional(),workspaces:Zl([Kl(Q()),Jl({packages:Kl(Q()).optional()})]).optional(),dependencies:ku.optional(),devDependencies:ku.optional(),peerDependencies:ku.optional(),optionalDependencies:ku.optional()});function ju(e){let t=a(e,`utf8`),n=Au.safeParse(JSON.parse(t));if(!n.success)throw Error(`package.json 结构不符合预期:${e}`);return n.data}function Mu(e){return Object.entries(e??{}).filter(([e])=>e.startsWith(`@longzai-intelligence-oxlint/`))}function Nu(e,t){let n=Array.isArray(t)?t:t?.packages??[],r=/* @__PURE__ */ new Set;for(let t of n){let n=new Bun.Glob(`${t}/package.json`);for(let t of n.scanSync({cwd:e}))t.includes(`node_modules/`)||r.add(t)}return[...r].sort()}async function Pu(e,t){let n=ju(s(e,`package.json`));if(n.name===`@longzai-intelligence-oxlint/root`)return{applicable:!1,versionChecked:[],violations:[]};let r=Nu(e,n.workspaces),i=[];for(let t of r){let n=ju(s(e,t));for(let e of Du)for(let[r,a]of Mu(n[e]))i.push({kind:`non-root`,manifestPath:t,field:e,name:r,specifier:a})}for(let e of Ou)for(let[t,r]of Mu(n[e]))i.push({kind:`root-placement`,manifestPath:`package.json`,field:e,name:t,specifier:r});let a=[],o=Mu(n.devDependencies);return await Promise.all(o.map(async([e,n])=>{if(n.startsWith(`workspace:`))return;a.push(e);let r=await t(e);n!==r&&i.push({kind:`version`,manifestPath:`package.json`,field:`devDependencies`,name:e,specifier:n,expected:r})})),{applicable:!0,versionChecked:a,violations:i}}const Fu=Jl({"dist-tags":Jl({latest:Q().optional()})});async function Iu(e){let t=`https://registry.npmjs.org/${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(`registry 查询失败:${e} 响应状态 ${n.status}`);let r=Fu.safeParse(await n.json());if(!r.success)throw Error(`registry 元数据结构异常:${e}`);let i=r.data[`dist-tags`]?.latest;if(!i)throw Error(`registry 元数据缺失 latest 标签:${e}`);return i}const Lu=Yl({cwd:Q().optional(),format:ru([`text`,`json`]).optional()}),Ru={"non-root":`非根声明`,"root-placement":`根位置误置`,version:`版本非最新`};function zu(e){gt(e,{name:`check`,description:`插件域依赖声明检查——仅根 devDependencies 合法且须为 registry 最新版`,options:[{flags:`--cwd <v>`,description:`目标仓根目录,默认当前目录`},{flags:`--format <text|json>`,defaultValue:`text`,description:`输出格式,默认 text`}],schema:Lu,action:async e=>{let t=new lt(ut(e.format)),n=c(e.cwd??`.`),r;try{r=await Pu(n,Iu)}catch(e){t.error(e),process.exit(1)}if(!r.applicable)t.info(`当前仓为插件源仓,声明政策不适用,跳过检查`);else if(r.violations.length===0)t.success({versionChecked:r.versionChecked.length},`[SUCCESS] lzi-oxlint check 通过|根开发依赖 ${r.versionChecked.length} 项全部为最新版且无非根声明`);else{if(e.format===`json`)process.stdout.write(`${JSON.stringify({success:!1,data:{violations:r.violations}},null,2)}\n`);else{let e=r.violations.map(e=>[e.manifestPath,Ru[e.kind]??e.kind,e.name,e.specifier,e.expected??`—`]);t.table([`位置`,`判据`,`包名`,`声明值`,`应然值`],e)}process.stderr.write(`错误: lzi-oxlint check 发现 ${r.violations.length} 项违规|政策:插件域依赖只能声明在根 devDependencies 且必须为最新版\n`),process.exit(1)}}})}const Bu={apiEndpoint:`http://localhost:3000`,defaultSeverity:`warn`,logLevel:`info`};function Vu(){return s(t(),`.lzi`,`oxlint`,`config.json`)}const Hu=Jl({format:ru([`text`,`json`]).default(`text`)});function Uu(e){let t=e.command(`config`).description(`管理 CLI 配置`);gt(t,{name:`init`,description:`初始化默认配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:Hu,action:async e=>{let t=new lt(ut(e.format)),n=Vu(),a=s(n,`..`);r(a)||i(a,{recursive:!0}),o(n,JSON.stringify(Bu,null,2),`utf-8`),mt.success(`配置已初始化`),t.success({configPath:n,config:Bu},`配置初始化成功`)}}),gt(t,{name:`show`,description:`显示当前配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:Hu,action:async e=>{let t=new lt(ut(e.format)),n=Vu();if(!r(n)){t.warn(`配置文件不存在,请先运行 config init`);return}let i=a(n,`utf-8`);t.success(JSON.parse(i),`当前配置`)}})}function Wu(e){return Array.isArray(e)}var Gu=class{filePath;constructor(e){this.filePath=e;let t=s(e,`..`);r(t)||i(t,{recursive:!0}),r(this.filePath)||o(this.filePath,`[]`,`utf-8`)}read(){let e=a(this.filePath,`utf-8`);try{let t=JSON.parse(e);return Wu(t)?t:[]}catch{return[]}}write(e){o(this.filePath,JSON.stringify(e,null,2),`utf-8`)}add(e){let t=this.read();t.push(e),this.write(t)}find(e){return this.read().find(e)}remove(e){let t=this.read().filter(t=>!e(t));this.write(t)}};function Ku(){let e=t();return s(e,`.lzi`,`oxlint`,`rules.json`)}const qu=Jl({format:ru([`text`,`json`]).default(`text`),id:Q().min(1),name:Q().min(1),plugin:Q().min(1),severity:Q().min(1),description:Q(),createdAt:Q()}),Ju=Jl({format:ru([`text`,`json`]).default(`text`),id:Q().optional(),name:Q().optional(),n:Q().optional(),plugin:Q().optional(),p:Q().optional(),severity:Q().optional(),description:Q().optional(),d:Q().optional()});function Yu(e){let t=e.command(`rule`).description(`管理 oxlint 规则记录`);gt(t,{name:`list`,description:`列出所有规则记录`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:Jl({format:ru([`text`,`json`]).default(`text`)}),action:async e=>{let t=new lt(ut(e.format)),n=new Gu(Ku()).read();n.length===0?t.info(`暂无规则记录`):t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],n.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}}),gt(t,{name:`add`,description:`添加规则记录`,options:[{flags:`--id <id>`,description:`规则标识`},{flags:`-n, --name <name>`,description:`规则名称`},{flags:`-p, --plugin <plugin>`,description:`所属插件`},{flags:`--severity <severity>`,description:`严重级别`},{flags:`-d, --description <description>`,description:`规则描述`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:Ju,action:async e=>{let t=new lt(ut(e.format)),n={id:e.id||await ft(`请输入规则标识`),name:e.name||e.n||await ft(`请输入规则名称`),plugin:e.plugin||e.p||await dt(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:e.severity||await dt(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:e.description||e.d||await ft(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=qu.safeParse(n);r.success?(new Gu(Ku()).add(r.data),mt.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)):t.error(/* @__PURE__ */ Error(`规则记录校验失败`))}}),gt(t,{name:`remove`,description:`删除规则记录`,arguments:[{signature:`[id]`,description:`规则标识`}],options:[{flags:`--id <id>`,description:`规则标识`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:Jl({format:ru([`text`,`json`]).default(`text`),id:Q().optional()}),action:async(e,t)=>{let n=new lt(ut(e.format)),r=e.id||t[0]||await ft(`请输入要删除的规则标识`),i=new Gu(Ku());i.find(e=>e.id===r)?await pt(`确认删除规则 ${r} 吗?`)?(i.remove(e=>e.id===r),mt.success(`规则记录已删除`),n.success({id:r},`规则记录删除成功`)):n.info(`已取消删除`):n.warn(`未找到规则标识: ${r}`)}}),t.action(async()=>{await Xu()})}async function Xu(){let e=await dt(`请选择操作`,[{value:`list`,label:`查看规则列表`,hint:`列出所有 oxlint 规则`},{value:`add`,label:`添加规则记录`,hint:`录入新的 oxlint 规则`},{value:`remove`,label:`删除规则记录`,hint:`移除指定规则`}]),t=new lt(`text`),n=new Gu(Ku());if(e===`list`){let e=n.read();if(e.length===0){t.info(`暂无规则记录`);return}t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],e.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}else if(e===`add`){let e={id:await ft(`请输入规则标识`),name:await ft(`请输入规则名称`),plugin:await dt(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:await dt(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:await ft(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=qu.safeParse(e);if(!r.success){t.error(/* @__PURE__ */ Error(`规则记录校验失败`));return}n.add(r.data),mt.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)}else if(e===`remove`){let e=await ft(`请输入要删除的规则标识`);if(!n.find(t=>t.id===e)){t.warn(`未找到规则标识: ${e}`);return}if(!await pt(`确认删除规则 ${e} 吗?`)){t.info(`已取消删除`);return}n.remove(t=>t.id===e),mt.success(`规则记录已删除`),t.success({id:e},`规则记录删除成功`)}}function Zu(e){Yu(e),Uu(e),zu(e)}async function Qu(){let e=ct({name:`lzi-oxlint`,description:`Longzai Intelligence oxlint CLI`,interaction:Fn,color:Pn});Zu(e),await e.parseAsync(process.argv)}await Qu();export{};
186
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function lc(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;lc(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const uc=/* @__PURE__ */ new Set([`type`,`properties`,`required`,`additionalProperties`]),dc=[`oneOf`,`anyOf`];function fc(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function pc(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!uc.has(e))return null;t.push(n)}let n={},r=/* @__PURE__ */ new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??fc(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Un(n,r,e.length===1?e[0]:pc(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=fc(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function mc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of uc)if(t in e)return;let n=t.filter(e=>dc.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=pc(t);else{let e=n[0],i=dc.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>pc([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,ic(e,r))}function hc(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):ic(i,s),ic(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())lc(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])mc(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}ic(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Un(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:_c(t,`input`,e.processors),output:_c(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Y(e,t){let n=t??{seen:/* @__PURE__ */ new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Y(r.element,n);if(r.type===`set`)return Y(r.valueType,n);if(r.type===`lazy`)return Y(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Y(r.innerType,n);if(r.type===`intersection`)return Y(r.left,n)||Y(r.right,n);if(r.type===`record`||r.type===`map`)return Y(r.keyType,n)||Y(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Y(r.in,n)||Y(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Y(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Y(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Y(e,n))return!0;return!!(r.rest&&Y(r.rest,n))}return!1}const gc=(e,t={})=>n=>{let r=ac({...n,processors:t});return J(e,r),cc(r,e),hc(r,e)},_c=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ac({...i??{},target:a,io:t,processors:n});return J(e,o),cc(o,e),hc(o,e)},vc=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},yc=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},bc=(e,t)=>{vc(e,`minimum`,t),yc(e,`maximum`,t)},xc=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Sc=(e,t)=>{e.patterns??=/* @__PURE__ */ new Set,e.patterns.add(t)},Cc=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},wc=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Tc=(e,t)=>vc(e,`minimum`,t.minimum),Ec=(e,t)=>yc(e,`maximum`,t.maximum),Dc=e=>(t,n)=>{wc(t,n.format);let[r,i]=e[n.format];vc(t,`minimum`,r),yc(t,`maximum`,i)},Oc={greater_than:(e,t)=>vc(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>yc(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>xc(e,t.value),number_format:Dc(cr),bigint_format:Dc(lr),min_length:Tc,max_length:Ec,length_equals:(e,t)=>bc(e,t.length),min_size:Tc,max_size:Ec,size_equals:(e,t)=>bc(e,t.size),string_format:(e,t)=>{wc(e,t.format),t.pattern&&Sc(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Cc(e,t.mime)};function kc(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Oc[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&vc(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&vc(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&yc(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&yc(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&xc(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Cc(t,i.mime);for(let e of i.patterns??[])Sc(t,e);return t}const Ac={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},jc=/* @__PURE__ */ new Map([[Za,Vi],[$a,Hi]]),Mc=e=>jc.get(e)??e,Nc=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=kc(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ac[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Mc);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Pc=(e,t,n,r)=>{n.not={}},Fc=(e,t,n,r)=>{let i=e._zod.def,a=In(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Ic=(e,t,n,r)=>{oc(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Lc=(e,t,n,r)=>{oc(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Rc=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=kc(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=J(a.element,t,{...r,path:[...r.path,`items`]})};function zc(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?zc(t.out):t.type===`catch`?zc(t.innerType):e._zod.optin}const Bc=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&oc(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Un(i.properties,e,J(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?zc(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=J(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Vc=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>J(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Hc=(e,t,n,r)=>{let i=e._zod.def,a=J(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=J(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Uc(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Uc(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Uc(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i&&(p.type=`string`,a||(p.pattern=(r.includes(`number`)?$i:Qi).source)),p}const Wc=/* @__PURE__ */ new WeakMap;function Gc(e){let t=/* @__PURE__ */ new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=/* @__PURE__ */ new Map;for(let r of Wc.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Uc(t,a,/* @__PURE__ */ new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}const Kc=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=kc(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=J(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Un(i.patternProperties,Mc(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=J(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Wc.get(t);n||(n=[],Wc.set(t,n),t.deferred.push(()=>Gc(t))),n.push(e)}i.additionalProperties=J(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&zc(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},qc=(e,t,n,r)=>{let i=e._zod.def,a=J(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Jc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Yc=Symbol();function Xc(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(oc(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Yc):JSON.parse(o)}const Zc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Xc(i.defaultValue,e,t,n,r);o!==Yc&&(n.default=o)},Qc=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Xc(i.defaultValue,e,t,n,r);o!==Yc&&(n._prefault=o)},$c=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{oc(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},el=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;J(o,t,r);let s=t.seen.get(e);s.ref=o},tl=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},nl=(e,t,n,r)=>{let i=e._zod.def;J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},rl=/* @__PURE__ */ new WeakSet([Object.prototype,Error.prototype]);function il(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}const X=/*@__PURE__*/ G(`ZodError`,(e,t)=>{ni.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);rl.has(n)||(rl.add(n),il(n,`format`,e=>t=>ai(e,t)),il(n,`flatten`,e=>t=>ii(e,t)),il(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Rn,2)}),il(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Rn,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),al=/* @__PURE__ */ si(X),ol=/* @__PURE__ */ ci(X),sl=/* @__PURE__ */ li(X),cl=/* @__PURE__ */ di(X),ll=/* @__PURE__ */ _i(X),ul=/* @__PURE__ */ vi(X),dl=/* @__PURE__ */ yi(X),fl=/* @__PURE__ */ bi(X),pl=/* @__PURE__ */ xi(X),ml=/* @__PURE__ */ Si(X),hl=/* @__PURE__ */ Ci(X),gl=/* @__PURE__ */ wi(X);function _l(){Jr.localeError||Yr(is())}function vl(){Jr.memoizer||Yr({memoizer:ts()})}const Z=/*@__PURE__*/ G(`ZodType`,(e,t)=>(_l(),K.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(H(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ar(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ou(e,t))},superRefine(e,t){return this.check(ku(e,t))},overwrite(e){return this.check(/* @__PURE__ */ Js(e))},optional(){return uu(this)},exactOptional(){return fu(this)},nullable(){return mu(this)},nullish(){return uu(mu(this))},nonoptional(e){return bu(this,e)},array(){return Yl(this)},or(e){return eu([this,e])},and(e){return nu(this,e)},transform(e){return wu(this,cu(e))},default(e){return gu(this,e)},prefault(e){return vu(this,e)},catch(e){return Su(this,e)},pipe(e){return wu(this,e)},readonly(){return Eu(this)},describe(e){let t=this.clone();return cs.add(t,{description:e}),t},meta(...e){if(e.length===0)return cs.get(this);let t=this.clone();return cs.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 Nr(this,`~standard`,{...ya(this),jsonSchema:{input:_c(this,`input`),output:_c(this,`output`)}})},set"~standard"(e){Mr(this,`~standard`,e)},parse:function e(t,n){return al(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await ol(this,t,n,{callee:e})},safeParse(e,t){return sl(this,e,t)},async safeParseAsync(e,t){return cl(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Mr(this,`spa`,e)},validate(e,t){return mi(this,e,t)},validateAsync(e,t){return gi(this,e,t)},encode:function e(t,n){return ll(this,t,n,{callee:e})},decode:function e(t,n){return ul(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await dl(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await fl(this,t,n,{callee:e})},safeEncode(e,t){return pl(this,e,t)},safeDecode(e,t){return ml(this,e,t)},async safeEncodeAsync(e,t){return hl(this,e,t)},async safeDecodeAsync(e,t){return gl(this,e,t)},toJSONSchema(e){return gc(this,{})(e)},get description(){return cs.get(this)?.description},get _def(){return this._zod.def}}),yl=/*@__PURE__*/ G(`_ZodString`,(e,t)=>{ba.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nc(e,t,n,r)},/*@__PURE__*/ Pr({format:e=>kc(e).format??null,minLength:e=>kc(e).minimum??null,maxLength:e=>kc(e).maximum??null},{regex(...e){return this.check(/* @__PURE__ */ Hs(...e))},includes(...e){return this.check(/* @__PURE__ */ Gs(...e))},startsWith(...e){return this.check(/* @__PURE__ */ Ks(...e))},endsWith(...e){return this.check(/* @__PURE__ */ qs(...e))},min(...e){return this.check(/* @__PURE__ */ Bs(...e))},max(...e){return this.check(/* @__PURE__ */ zs(...e))},length(...e){return this.check(/* @__PURE__ */ Vs(...e))},nonempty(...e){return this.check(/* @__PURE__ */ Bs(1,...e))},lowercase(e){return this.check(/* @__PURE__ */ Us(e))},uppercase(e){return this.check(/* @__PURE__ */ Ws(e))},trim(){return this.check(/* @__PURE__ */ Xs())},normalize(...e){return this.check(/* @__PURE__ */ Ys(...e))},toLowerCase(){return this.check(/* @__PURE__ */ Zs())},toUpperCase(){return this.check(/* @__PURE__ */ Qs())},slugify(){return this.check(/* @__PURE__ */ $s())}})),bl=/*@__PURE__*/ G(`ZodString`,(e,t)=>{ba.init(e,t),yl.init(e,t)},{email(e){return this.check(/* @__PURE__ */ ds(Tl,e))},url(e){return this.check(/* @__PURE__ */ _s(Ol,e))},jwt(e){return this.check(/* @__PURE__ */ Ms(Ul,e))},emoji(e){return this.check(/* @__PURE__ */ vs(kl,e))},guid(e){return this.check(/* @__PURE__ */ fs(El,e))},uuid(e){return this.check(/* @__PURE__ */ ps(Dl,e))},uuidv4(e){return this.check(/* @__PURE__ */ ms(Dl,e))},uuidv6(e){return this.check(/* @__PURE__ */ hs(Dl,e))},uuidv7(e){return this.check(/* @__PURE__ */ gs(Dl,e))},nanoid(e){return this.check(/* @__PURE__ */ ys(Al,e))},cuid(e){return this.check(/* @__PURE__ */ bs(jl,e))},cuid2(e){return this.check(/* @__PURE__ */ xs(Ml,e))},ulid(e){return this.check(/* @__PURE__ */ Ss(Nl,e))},base64(e){return this.check(/* @__PURE__ */ ks(Bl,e))},base64url(e){return this.check(/* @__PURE__ */ As(Vl,e))},xid(e){return this.check(/* @__PURE__ */ Cs(Pl,e))},ksuid(e){return this.check(/* @__PURE__ */ ws(Fl,e))},ipv4(e){return this.check(/* @__PURE__ */ Ts(Il,e))},ipv6(e){return this.check(/* @__PURE__ */ Es(Ll,e))},cidrv4(e){return this.check(/* @__PURE__ */ Ds(Rl,e))},cidrv6(e){return this.check(/* @__PURE__ */ Os(zl,e))},e164(e){return this.check(/* @__PURE__ */ js(Hl,e))},datetime(e){return this.check(/* @__PURE__ */ Ns(xl,e))},date(e){return this.check(/* @__PURE__ */ Ps(Sl,e))},time(e){return this.check(/* @__PURE__ */ Fs(Cl,e))},duration(e){return this.check(/* @__PURE__ */ Is(wl,e))}});function Q(e){return/* @__PURE__ */ us(bl,e)}const $=/*@__PURE__*/ G(`ZodStringFormat`,(e,t)=>{q.init(e,t),yl.init(e,t)}),xl=/*@__PURE__*/ G(`ZodISODateTime`,(e,t)=>{za.init(e,t),$.init(e,t)}),Sl=/*@__PURE__*/ G(`ZodISODate`,(e,t)=>{Ba.init(e,t),$.init(e,t)}),Cl=/*@__PURE__*/ G(`ZodISOTime`,(e,t)=>{Va.init(e,t),$.init(e,t)}),wl=/*@__PURE__*/ G(`ZodISODuration`,(e,t)=>{Ha.init(e,t),$.init(e,t)}),Tl=/*@__PURE__*/ G(`ZodEmail`,(e,t)=>{Ca.init(e,t),$.init(e,t)}),El=/*@__PURE__*/ G(`ZodGUID`,(e,t)=>{xa.init(e,t),$.init(e,t)}),Dl=/*@__PURE__*/ G(`ZodUUID`,(e,t)=>{Sa.init(e,t),$.init(e,t)}),Ol=/*@__PURE__*/ G(`ZodURL`,(e,t)=>{ja.init(e,t),$.init(e,t)}),kl=/*@__PURE__*/ G(`ZodEmoji`,(e,t)=>{Ma.init(e,t),$.init(e,t)}),Al=/*@__PURE__*/ G(`ZodNanoID`,(e,t)=>{Na.init(e,t),$.init(e,t)}),jl=/*@__PURE__*/ G(`ZodCUID`,(e,t)=>{Pa.init(e,t),$.init(e,t)}),Ml=/*@__PURE__*/ G(`ZodCUID2`,(e,t)=>{Fa.init(e,t),$.init(e,t)}),Nl=/*@__PURE__*/ G(`ZodULID`,(e,t)=>{Ia.init(e,t),$.init(e,t)}),Pl=/*@__PURE__*/ G(`ZodXID`,(e,t)=>{La.init(e,t),$.init(e,t)}),Fl=/*@__PURE__*/ G(`ZodKSUID`,(e,t)=>{Ra.init(e,t),$.init(e,t)}),Il=/*@__PURE__*/ G(`ZodIPv4`,(e,t)=>{Ua.init(e,t),$.init(e,t)}),Ll=/*@__PURE__*/ G(`ZodIPv6`,(e,t)=>{Ka.init(e,t),$.init(e,t)}),Rl=/*@__PURE__*/ G(`ZodCIDRv4`,(e,t)=>{qa.init(e,t),$.init(e,t)}),zl=/*@__PURE__*/ G(`ZodCIDRv6`,(e,t)=>{Ya.init(e,t),$.init(e,t)}),Bl=/*@__PURE__*/ G(`ZodBase64`,(e,t)=>{Qa.init(e,t),$.init(e,t)}),Vl=/*@__PURE__*/ G(`ZodBase64URL`,(e,t)=>{to.init(e,t),$.init(e,t)}),Hl=/*@__PURE__*/ G(`ZodE164`,(e,t)=>{no.init(e,t),$.init(e,t)}),Ul=/*@__PURE__*/ G(`ZodJWT`,(e,t)=>{io.init(e,t),$.init(e,t)}),Wl=/*@__PURE__*/ G(`ZodUnknown`,(e,t)=>{ao.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Gl(){return/* @__PURE__ */ Ls(Wl)}const Kl=/*@__PURE__*/ G(`ZodNever`,(e,t)=>{oo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pc(e,t,n,r)});function ql(e){return/* @__PURE__ */ Rs(Kl,e)}const Jl=/*@__PURE__*/ G(`ZodArray`,(e,t)=>{vl(),uo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rc(e,t,n,r),e.element=t.element},{min(e,t){return this.check(/* @__PURE__ */ Bs(e,t))},nonempty(e){return this.check(/* @__PURE__ */ Bs(1,e))},max(e,t){return this.check(/* @__PURE__ */ zs(e,t))},length(e,t){return this.check(/* @__PURE__ */ Vs(e,t))},unwrap(){return this.element}});function Yl(e,t){return/* @__PURE__ */ ec(Jl,e,t)}const Xl=/*@__PURE__*/ G(`ZodObject`,(e,t)=>{vl(),_o.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bc(e,t,n,r),Br(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return ou(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(H(this._zod.def,{catchall:e}))},passthrough(){return this.clone(H(this._zod.def,{catchall:Gl()}))},loose(){return this.clone(H(this._zod.def,{catchall:Gl()}))},strict(){return this.clone(H(this._zod.def,{catchall:ql()}))},strip(){return this.clone(H(this._zod.def,{catchall:void 0}))},extend(e){return pr(this,e)},safeExtend(e){return hr(this,e)},merge(e){return gr(this,e)},pick(e){return ur(this,e)},omit(e){return fr(this,e)},partial(...e){return _r(lu,this,e[0])},exactPartial(...e){return _r(du,this,e[0],`exactPartial`)},required(...e){return vr(yu,this,e[0])}});function Zl(e,t){let n={type:`object`,shape:e??{},...U(t)};return new Xl(n)}function Ql(e,t){return new Xl({type:`object`,shape:e,catchall:Gl(),...U(t)})}const $l=/*@__PURE__*/ G(`ZodUnion`,(e,t)=>{yo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vc(e,t,n,r),e.options=t.options});function eu(e,t){return new $l({type:`union`,options:e,...U(t)})}const tu=/*@__PURE__*/ G(`ZodIntersection`,(e,t)=>{bo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hc(e,t,n,r)});function nu(e,t){return new tu({type:`intersection`,left:e,right:t})}const ru=/*@__PURE__*/ G(`ZodRecord`,(e,t)=>{vl(),Co.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kc(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function iu(e,t,n){return!t||!t._zod?new ru({type:`record`,keyType:Q(),valueType:e,...U(t)}):new ru({type:`record`,keyType:e,valueType:t,...U(n)})}const au=/*@__PURE__*/ G(`ZodEnum`,(e,t)=>{wo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fc(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new au({...t,checks:[],...U(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new au({...t,checks:[],...U(r),entries:i})}});function ou(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new au({type:`enum`,entries:n,...U(t)})}const su=/*@__PURE__*/ G(`ZodTransform`,(e,t)=>{vl(),To.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lc(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new qr(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ar(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Ar(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function cu(e){return new su({type:`transform`,transform:e})}const lu=/*@__PURE__*/ G(`ZodOptional`,(e,t)=>{Do.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uu(e){return new lu({type:`optional`,innerType:e})}const du=/*@__PURE__*/ G(`ZodExactOptional`,(e,t)=>{Oo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fu(e){return new du({type:`optional`,innerType:e})}const pu=/*@__PURE__*/ G(`ZodNullable`,(e,t)=>{ko.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mu(e){return new pu({type:`nullable`,innerType:e})}const hu=/*@__PURE__*/ G(`ZodDefault`,(e,t)=>{Ao.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gu(e,t){return new hu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():nr(t)}})}const _u=/*@__PURE__*/ G(`ZodPrefault`,(e,t)=>{Mo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vu(e,t){return new _u({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():nr(t)}})}const yu=/*@__PURE__*/ G(`ZodNonOptional`,(e,t)=>{No.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jc(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bu(e,t){return new yu({type:`nonoptional`,innerType:e,...U(t)})}const xu=/*@__PURE__*/ G(`ZodCatch`,(e,t)=>{Io.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$c(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Su(e,t){return new xu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Vr(t)})}const Cu=/*@__PURE__*/ G(`ZodPipe`,(e,t)=>{Lo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>el(e,t,n,r),e.in=t.in,e.out=t.out});function wu(e,t){return new Cu({type:`pipe`,in:e,out:t})}const Tu=/*@__PURE__*/ G(`ZodReadonly`,(e,t)=>{zo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eu(e){return new Tu({type:`readonly`,innerType:e})}const Du=/*@__PURE__*/ G(`ZodCustom`,(e,t)=>{Vo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ic(e,t,n,r)});function Ou(e,t={}){return/* @__PURE__ */ tc(Du,e,t)}function ku(e,t){return/* @__PURE__ */ nc(e,t)}const Au=[`dependencies`,`devDependencies`,`peerDependencies`,`optionalDependencies`],ju=[`dependencies`,`peerDependencies`,`optionalDependencies`],Mu=iu(Q(),Q()),Nu=Ql({name:Q().optional(),workspaces:eu([Yl(Q()),Zl({packages:Yl(Q()).optional()})]).optional(),dependencies:Mu.optional(),devDependencies:Mu.optional(),peerDependencies:Mu.optional(),optionalDependencies:Mu.optional()});function Pu(e){let t=a(e,`utf8`),n=Nu.safeParse(JSON.parse(t));if(!n.success)throw Error(`package.json 结构不符合预期:${e}`);return n.data}function Fu(e){return Object.entries(e??{}).filter(([e])=>e.startsWith(`@longzai-intelligence-oxlint/`))}function Iu(e,t){let n=Array.isArray(t)?t:t?.packages??[],r=/* @__PURE__ */ new Set;for(let t of n){let n=new Bun.Glob(`${t}/package.json`);for(let t of n.scanSync({cwd:e}))t.includes(`node_modules/`)||r.add(t)}return[...r].sort()}async function Lu(e,t){let n=Pu(s(e,`package.json`));if(n.name===`@longzai-intelligence-oxlint/root`)return{applicable:!1,versionChecked:[],violations:[]};let r=Iu(e,n.workspaces),i=[];for(let t of r){let n=Pu(s(e,t));for(let e of Au)for(let[r,a]of Fu(n[e]))i.push({kind:`non-root`,manifestPath:t,field:e,name:r,specifier:a})}for(let e of ju)for(let[t,r]of Fu(n[e]))i.push({kind:`root-placement`,manifestPath:`package.json`,field:e,name:t,specifier:r});let a=[],o=Fu(n.devDependencies);return await Promise.all(o.map(async([e,n])=>{if(n.startsWith(`workspace:`))return;a.push(e);let r=await t(e);n!==r&&i.push({kind:`version`,manifestPath:`package.json`,field:`devDependencies`,name:e,specifier:n,expected:r})})),{applicable:!0,versionChecked:a,violations:i}}const Ru=Zl({"dist-tags":Zl({latest:Q().optional()})});async function zu(e){let t=`https://registry.npmjs.org/${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(`registry 查询失败:${e} 响应状态 ${n.status}`);let r=Ru.safeParse(await n.json());if(!r.success)throw Error(`registry 元数据结构异常:${e}`);let i=r.data[`dist-tags`]?.latest;if(!i)throw Error(`registry 元数据缺失 latest 标签:${e}`);return i}const Bu=Ql({cwd:Q().optional(),format:ou([`text`,`json`]).optional()}),Vu={"non-root":`非根声明`,"root-placement":`根位置误置`,version:`版本非最新`};function Hu(e){gt(e,{name:`check`,description:`插件域依赖声明检查——仅根 devDependencies 合法且须为 registry 最新版`,options:[{flags:`--cwd <v>`,description:`目标仓根目录,默认当前目录`},{flags:`--format <text|json>`,defaultValue:`text`,description:`输出格式,默认 text`}],schema:Bu,action:async e=>{let t=new lt(ut(e.format)),n=c(e.cwd??`.`),r;try{r=await Lu(n,zu)}catch(e){t.error(e),process.exit(1)}if(!r.applicable)t.info(`当前仓为插件源仓,声明政策不适用,跳过检查`);else if(r.violations.length===0)t.success({versionChecked:r.versionChecked.length},`[SUCCESS] lzi-oxlint check 通过|根开发依赖 ${r.versionChecked.length} 项全部为最新版且无非根声明`);else{if(e.format===`json`)process.stdout.write(`${JSON.stringify({success:!1,data:{violations:r.violations}},null,2)}\n`);else{let e=r.violations.map(e=>[e.manifestPath,Vu[e.kind]??e.kind,e.name,e.specifier,e.expected??`—`]);t.table([`位置`,`判据`,`包名`,`声明值`,`应然值`],e)}process.stderr.write(`错误: lzi-oxlint check 发现 ${r.violations.length} 项违规|政策:插件域依赖只能声明在根 devDependencies 且必须为最新版\n`),process.exit(1)}}})}const Uu={apiEndpoint:`http://localhost:3000`,defaultSeverity:`warn`,logLevel:`info`};function Wu(){return s(t(),`.lzi`,`oxlint`,`config.json`)}const Gu=Zl({format:ou([`text`,`json`]).default(`text`)});function Ku(e){let t=e.command(`config`).description(`管理 CLI 配置`);gt(t,{name:`init`,description:`初始化默认配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:Gu,action:async e=>{let t=new lt(ut(e.format)),n=Wu(),a=s(n,`..`);r(a)||i(a,{recursive:!0}),o(n,JSON.stringify(Uu,null,2),`utf-8`),mt.success(`配置已初始化`),t.success({configPath:n,config:Uu},`配置初始化成功`)}}),gt(t,{name:`show`,description:`显示当前配置`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:Gu,action:async e=>{let t=new lt(ut(e.format)),n=Wu();if(!r(n)){t.warn(`配置文件不存在,请先运行 config init`);return}let i=a(n,`utf-8`);t.success(JSON.parse(i),`当前配置`)}})}function qu(e){return Array.isArray(e)}var Ju=class{filePath;constructor(e){this.filePath=e;let t=s(e,`..`);r(t)||i(t,{recursive:!0}),r(this.filePath)||o(this.filePath,`[]`,`utf-8`)}read(){let e=a(this.filePath,`utf-8`);try{let t=JSON.parse(e);return qu(t)?t:[]}catch{return[]}}write(e){o(this.filePath,JSON.stringify(e,null,2),`utf-8`)}add(e){let t=this.read();t.push(e),this.write(t)}find(e){return this.read().find(e)}remove(e){let t=this.read().filter(t=>!e(t));this.write(t)}};function Yu(){let e=t();return s(e,`.lzi`,`oxlint`,`rules.json`)}const Xu=Zl({format:ou([`text`,`json`]).default(`text`),id:Q().min(1),name:Q().min(1),plugin:Q().min(1),severity:Q().min(1),description:Q(),createdAt:Q()}),Zu=Zl({format:ou([`text`,`json`]).default(`text`),id:Q().optional(),name:Q().optional(),n:Q().optional(),plugin:Q().optional(),p:Q().optional(),severity:Q().optional(),description:Q().optional(),d:Q().optional()});function Qu(e){let t=e.command(`rule`).description(`管理 oxlint 规则记录`);gt(t,{name:`list`,description:`列出所有规则记录`,options:[{flags:`--format <text|json>`,defaultValue:`text`}],schema:Zl({format:ou([`text`,`json`]).default(`text`)}),action:async e=>{let t=new lt(ut(e.format)),n=new Ju(Yu()).read();n.length===0?t.info(`暂无规则记录`):t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],n.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}}),gt(t,{name:`add`,description:`添加规则记录`,options:[{flags:`--id <id>`,description:`规则标识`},{flags:`-n, --name <name>`,description:`规则名称`},{flags:`-p, --plugin <plugin>`,description:`所属插件`},{flags:`--severity <severity>`,description:`严重级别`},{flags:`-d, --description <description>`,description:`规则描述`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:Zu,action:async e=>{let t=new lt(ut(e.format)),n={id:e.id||await ft(`请输入规则标识`),name:e.name||e.n||await ft(`请输入规则名称`),plugin:e.plugin||e.p||await dt(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:e.severity||await dt(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:e.description||e.d||await ft(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=Xu.safeParse(n);r.success?(new Ju(Yu()).add(r.data),mt.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)):t.error(/* @__PURE__ */ Error(`规则记录校验失败`))}}),gt(t,{name:`remove`,description:`删除规则记录`,arguments:[{signature:`[id]`,description:`规则标识`}],options:[{flags:`--id <id>`,description:`规则标识`},{flags:`--format <text|json>`,defaultValue:`text`}],schema:Zl({format:ou([`text`,`json`]).default(`text`),id:Q().optional()}),action:async(e,t)=>{let n=new lt(ut(e.format)),r=e.id||t[0]||await ft(`请输入要删除的规则标识`),i=new Ju(Yu());i.find(e=>e.id===r)?await pt(`确认删除规则 ${r} 吗?`)?(i.remove(e=>e.id===r),mt.success(`规则记录已删除`),n.success({id:r},`规则记录删除成功`)):n.info(`已取消删除`):n.warn(`未找到规则标识: ${r}`)}}),t.action(async()=>{await $u()})}async function $u(){let e=await dt(`请选择操作`,[{value:`list`,label:`查看规则列表`,hint:`列出所有 oxlint 规则`},{value:`add`,label:`添加规则记录`,hint:`录入新的 oxlint 规则`},{value:`remove`,label:`删除规则记录`,hint:`移除指定规则`}]),t=new lt(`text`),n=new Ju(Yu());if(e===`list`){let e=n.read();if(e.length===0){t.info(`暂无规则记录`);return}t.table([`规则标识`,`规则名称`,`插件`,`严重级别`,`创建时间`],e.map(e=>[e.id,e.name,e.plugin,e.severity,e.createdAt]))}else if(e===`add`){let e={id:await ft(`请输入规则标识`),name:await ft(`请输入规则名称`),plugin:await dt(`请选择所属插件`,[{value:`typescript`,label:`TypeScript`},{value:`unicorn`,label:`Unicorn`},{value:`import`,label:`Import`},{value:`eslint-core`,label:`ESLint Core`},{value:`react`,label:`React`}]),severity:await dt(`请选择严重级别`,[{value:`error`,label:`错误`},{value:`warn`,label:`警告`},{value:`off`,label:`关闭`}]),description:await ft(`请输入规则描述`),createdAt:(/* @__PURE__ */ new Date()).toISOString()},r=Xu.safeParse(e);if(!r.success){t.error(/* @__PURE__ */ Error(`规则记录校验失败`));return}n.add(r.data),mt.success(`规则记录已添加`),t.success(r.data,`规则记录创建成功`)}else if(e===`remove`){let e=await ft(`请输入要删除的规则标识`);if(!n.find(t=>t.id===e)){t.warn(`未找到规则标识: ${e}`);return}if(!await pt(`确认删除规则 ${e} 吗?`)){t.info(`已取消删除`);return}n.remove(t=>t.id===e),mt.success(`规则记录已删除`),t.success({id:e},`规则记录删除成功`)}}function ed(e){Qu(e),Ku(e),Hu(e)}async function td(){let e=ct({name:`lzi-oxlint`,description:`Longzai Intelligence oxlint CLI`,interaction:Fn,color:Pn});ed(e),await e.parseAsync(process.argv)}await td();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-oxlint/cli",
3
- "version": "0.1.46",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "description": "Longzai Intelligence oxlint 工具 CLI",
6
6
  "keywords": [