const e=Object.freeze({status:"aborted"});function t(e,t,n){function s(n,s){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,s);for(const e in a.prototype)e in n||Object.defineProperty(n,e,{value:a.prototype[e].bind(n)});n._zod.constr=a,n._zod.def=s}const i=n?.Parent??Object;class r extends i{}function a(e){var t;const i=n?.Parent?new r:this;s(i,e),(t=i._zod).deferred??(t.deferred=[]);for(const n of i._zod.deferred)n();return i}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(a,"init",{value:s}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}class n extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const s={};function i(e){return e&&Object.assign(s,e),s}function r(e,t){return"bigint"==typeof t?t.toString():t}function a(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function o(e){return null==e}function u(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function c(e,t,n){Object.defineProperty(e,t,{get(){{const s=n();return e[t]=s,s}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function d(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function l(e){return JSON.stringify(e)}const p=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function h(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const f=a(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return(()=>{throw new Error("zod allowsEval: disabled")})(),!0}catch(e){return!1}});function m(e){if(!1===h(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==h(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const _=new Set(["string","number","symbol"]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(e,t,n){const s=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(s._zod.parent=e),s}function g(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const b={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function k(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function w(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function x(e){return"string"==typeof e?e:e?.message}function z(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=x(e.inst?._zod.def?.error?.(e))??x(t?.error?.(e))??x(n.customError?.(e))??x(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function Z(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function T(...e){const[t,n,s]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:s}:{...t}}const $=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,r,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},O=t("$ZodError",$),E=t("$ZodError",$,{Parent:Error});const I=e=>(t,s,r,a)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},u=t._zod.run({value:s,issues:[]},o);if(u instanceof Promise)throw new n;if(u.issues.length){const t=new(a?.Err??e)(u.issues.map(e=>z(e,o,i())));throw p(t,a?.callee),t}return u.value},A=e=>async(t,n,s,r)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(r?.Err??e)(o.issues.map(e=>z(e,a,i())));throw p(t,r?.callee),t}return o.value},N=e=>(t,s,r)=>{const a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:s,issues:[]},a);if(o instanceof Promise)throw new n;return o.issues.length?{success:!1,error:new(e??O)(o.issues.map(e=>z(e,a,i())))}:{success:!0,data:o.value}},S=N(E),j=e=>async(t,n,s)=>{const r=s?Object.assign(s,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},r);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>z(e,r,i())))}:{success:!0,data:a.value}},P=j(E),C=/^[cC][^\s-]{8,}$/,R=/^[0-9a-z]+$/,F=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,M=/^[0-9a-vA-V]{20}$/,D=/^[A-Za-z0-9]{27}$/,U=/^[a-zA-Z0-9_-]{21}$/,L=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,V=/^([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})$/,K=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([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)$/,W=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const B=/^(?:(?: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])$/,q=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,J=/^((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])$/,G=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Y=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,H=/^[A-Za-z0-9_-]*$/,X=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Q=/^\+(?:[0-9]){6,14}[0-9]$/,ee="(?:(?:\\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])))",te=new RegExp(`^${ee}$`);function ne(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const se=/^\d+$/,ie=/^-?\d+(?:\.\d+)?/i,re=/true|false/i,ae=/null/i,oe=/undefined/i,ue=/^[^A-Z]*$/,ce=/^[^a-z]*$/,de=t("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),le={number:"number",bigint:"bigint",object:"date"},pe=t("$ZodCheckLessThan",(e,t)=>{de.init(e,t);const n=le[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),he=t("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);const n=le[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),fe=t("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),me=t("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,r]=b[t.format];e._zod.onattach.push(e=>{const s=e._zod.bag;s.format=t.format,s.minimum=i,s.maximum=r,n&&(s.pattern=se)}),e._zod.check=a=>{const o=a.value;if(n){if(!Number.isInteger(o))return void a.issues.push({expected:s,format:t.format,code:"invalid_type",input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!t.abort}))}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>r&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:r,inst:e})}}),_e=t("$ZodCheckMaxLength",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!o(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const i=Z(s);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ve=t("$ZodCheckMinLength",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!o(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const i=Z(s);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),ye=t("$ZodCheckLengthEquals",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!o(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const s=n.value,i=s.length;if(i===t.length)return;const r=Z(s),a=i>t.length;n.issues.push({origin:r,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ge=t("$ZodCheckStringFormat",(e,t)=>{var n,s;de.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),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})}):(s=e._zod).check??(s.check=()=>{})}),be=t("$ZodCheckRegex",(e,t)=>{ge.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})}}),ke=t("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ue),ge.init(e,t)}),we=t("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ce),ge.init(e,t)}),xe=t("$ZodCheckIncludes",(e,t)=>{de.init(e,t);const n=v(t.includes),s=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(s)}),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})}}),ze=t("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);const n=new RegExp(`^${v(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),Ze=t("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);const n=new RegExp(`.*${v(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(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})}}),Te=t("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class $e{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),s=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const i of s)this.content.push(i)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}const Oe={major:4,minor:0,patch:0},Ee=t("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Oe;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const n of i)for(const t of n._zod.onattach)t(e);if(0===i.length)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,s)=>{let i,r=k(e);for(const a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;const t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&!1===s?.async)throw new n;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(r||(r=k(e,t)))});else{if(e.issues.length===t)continue;r||(r=k(e,t))}}return i?i.then(()=>e):e};e._zod.run=(s,r)=>{const a=e._zod.parse(s,r);if(a instanceof Promise){if(!1===r.async)throw new n;return a.then(e=>t(e,i,r))}return t(a,i,r)}}e["~standard"]={validate:t=>{try{const n=S(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return P(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Ie=t("$ZodString",(e,t)=>{var n;Ee.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ae=t("$ZodStringFormat",(e,t)=>{ge.init(e,t),Ie.init(e,t)}),Ne=t("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=V),Ae.init(e,t)}),Se=t("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=K(e))}else t.pattern??(t.pattern=K());Ae.init(e,t)}),je=t("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=W),Ae.init(e,t)}),Pe=t("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=n=>{try{const s=n.value,i=new URL(s),r=i.href;return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:X.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(!s.endsWith("/")&&r.endsWith("/")?n.value=r.slice(0,-1):n.value=r)}catch(s){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Ce=t("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ae.init(e,t)}),Re=t("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=U),Ae.init(e,t)}),Fe=t("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=C),Ae.init(e,t)}),Me=t("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=R),Ae.init(e,t)}),De=t("$ZodULID",(e,t)=>{t.pattern??(t.pattern=F),Ae.init(e,t)}),Ue=t("$ZodXID",(e,t)=>{t.pattern??(t.pattern=M),Ae.init(e,t)}),Le=t("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=D),Ae.init(e,t)}),Ve=t("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=ne({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${ee}T(?:${s})$`)}(t)),Ae.init(e,t)}),Ke=t("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=te),Ae.init(e,t)}),We=t("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ne(t)}$`)),Ae.init(e,t)}),Be=t("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=L),Ae.init(e,t)}),qe=t("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=B),Ae.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),Je=t("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=q),Ae.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Ge=t("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=J),Ae.init(e,t)}),Ye=t("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=G),Ae.init(e,t),e._zod.check=n=>{const[s,i]=n.value.split("/");try{if(!i)throw new Error;const e=Number(i);if(`${e}`!==i)throw new Error;if(e<0||e>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function He(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Xe=t("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Y),Ae.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{He(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const Qe=t("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=H),Ae.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{(function(e){if(!H.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return He(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),et=t("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Q),Ae.init(e,t)});const tt=t("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[s]=n;if(!s)return!1;const i=JSON.parse(atob(s));return!("typ"in i&&"JWT"!==i?.typ||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),nt=t("$ZodNumber",(e,t)=>{Ee.init(e,t),e._zod.pattern=e._zod.bag.pattern??ie,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Number(n.value)}catch(a){}const i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;const r="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...r?{received:r}:{}}),n}}),st=t("$ZodNumber",(e,t)=>{me.init(e,t),nt.init(e,t)}),it=t("$ZodBoolean",(e,t)=>{Ee.init(e,t),e._zod.pattern=re,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(r){}const i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),rt=t("$ZodUndefined",(e,t)=>{Ee.init(e,t),e._zod.pattern=oe,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const s=t.value;return void 0===s||t.issues.push({expected:"undefined",code:"invalid_type",input:s,inst:e}),t}}),at=t("$ZodNull",(e,t)=>{Ee.init(e,t),e._zod.pattern=ae,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const s=t.value;return null===s||t.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),t}}),ot=t("$ZodAny",(e,t)=>{Ee.init(e,t),e._zod.parse=e=>e}),ut=t("$ZodUnknown",(e,t)=>{Ee.init(e,t),e._zod.parse=e=>e}),ct=t("$ZodNever",(e,t)=>{Ee.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function dt(e,t,n){e.issues.length&&t.issues.push(...w(n,e.issues)),t.value[n]=e.value}const lt=t("$ZodArray",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const r=[];for(let e=0;e<i.length;e++){const a=i[e],o=t.element._zod.run({value:a,issues:[]},s);o instanceof Promise?r.push(o.then(t=>dt(t,n,e))):dt(o,n,e)}return r.length?Promise.all(r).then(()=>n):n}});function pt(e,t,n){e.issues.length&&t.issues.push(...w(n,e.issues)),t.value[n]=e.value}function ht(e,t,n,s){e.issues.length?void 0===s[n]?t.value[n]=n in s?void 0:e.value:t.issues.push(...w(n,e.issues)):void 0===e.value?n in s&&(t.value[n]=void 0):t.value[n]=e.value}const ft=t("$ZodObject",(e,t)=>{Ee.init(e,t);const n=a(()=>{const e=Object.keys(t.shape);for(const i of e)if(!(t.shape[i]instanceof Ee))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const n=(s=t.shape,Object.keys(s).filter(e=>"optional"===s[e]._zod.optin&&"optional"===s[e]._zod.optout));var s;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});c(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const s=e[t]._zod;if(s.values){n[t]??(n[t]=new Set);for(const e of s.values)n[t].add(e)}}return n});let i;const r=h,o=!s.jitless,u=o&&f.value,d=t.catchall;let p;e._zod.parse=(s,a)=>{p??(p=n.value);const c=s.value;if(!r(c))return s.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),s;const h=[];if(o&&u&&!1===a?.async&&!0!==a.jitless)i||(i=(e=>{const t=new $e(["shape","payload","ctx"]),s=n.value,i=e=>{const t=l(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const r=Object.create(null);let a=0;for(const n of s.keys)r[n]="key_"+a++;t.write("const newResult = {}");for(const n of s.keys)if(s.optionalKeys.has(n)){const e=r[n];t.write(`const ${e} = ${i(n)};`);const s=l(n);t.write(`\n        if (${e}.issues.length) {\n          if (input[${s}] === undefined) {\n            if (${s} in input) {\n              newResult[${s}] = undefined;\n            }\n          } else {\n            payload.issues = payload.issues.concat(\n              ${e}.issues.map((iss) => ({\n                ...iss,\n                path: iss.path ? [${s}, ...iss.path] : [${s}],\n              }))\n            );\n          }\n        } else if (${e}.value === undefined) {\n          if (${s} in input) newResult[${s}] = undefined;\n        } else {\n          newResult[${s}] = ${e}.value;\n        }\n        `)}else{const e=r[n];t.write(`const ${e} = ${i(n)};`),t.write(`\n          if (${e}.issues.length) payload.issues = payload.issues.concat(${e}.issues.map(iss => ({\n            ...iss,\n            path: iss.path ? [${l(n)}, ...iss.path] : [${l(n)}]\n          })));`),t.write(`newResult[${l(n)}] = ${e}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,n)=>o(e,t,n)})(t.shape)),s=i(s,a);else{s.value={};const e=p.shape;for(const t of p.keys){const n=e[t],i=n._zod.run({value:c[t],issues:[]},a),r="optional"===n._zod.optin&&"optional"===n._zod.optout;i instanceof Promise?h.push(i.then(e=>r?ht(e,s,t,c):pt(e,s,t))):r?ht(i,s,t,c):pt(i,s,t)}}if(!d)return h.length?Promise.all(h).then(()=>s):s;const f=[],m=p.keySet,_=d._zod,v=_.def.type;for(const e of Object.keys(c)){if(m.has(e))continue;if("never"===v){f.push(e);continue}const t=_.run({value:c[e],issues:[]},a);t instanceof Promise?h.push(t.then(t=>pt(t,s,e))):pt(t,s,e)}return f.length&&s.issues.push({code:"unrecognized_keys",keys:f,input:c,inst:e}),h.length?Promise.all(h).then(()=>s):s}});function mt(e,t,n,s){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>z(e,s,i())))}),t}const _t=t("$ZodUnion",(e,t)=>{Ee.init(e,t),c(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),c(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),c(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),c(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>u(e.source)).join("|")})$`)}}),e._zod.parse=(n,s)=>{let i=!1;const r=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},s);if(t instanceof Promise)r.push(t),i=!0;else{if(0===t.issues.length)return t;r.push(t)}}return i?Promise.all(r).then(t=>mt(t,n,e,s)):mt(r,n,e,s)}}),vt=t("$ZodDiscriminatedUnion",(e,t)=>{_t.init(e,t);const n=e._zod.parse;c(e._zod,"propValues",()=>{const e={};for(const n of t.options){const s=n._zod.propValues;if(!s||0===Object.keys(s).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(s)){e[t]||(e[t]=new Set);for(const s of n)e[t].add(s)}}return e});const s=a(()=>{const e=t.options,n=new Map;for(const s of e){const e=s._zod.propValues[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,s)}}return n});e._zod.parse=(i,r)=>{const a=i.value;if(!h(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;const o=s.value.get(a?.[t.discriminator]);return o?o._zod.run(i,r):t.unionFallback?n(i,r):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[t.discriminator],inst:e}),i)}}),yt=t("$ZodIntersection",(e,t)=>{Ee.init(e,t),e._zod.parse=(e,n)=>{const s=e.value,i=t.left._zod.run({value:s,issues:[]},n),r=t.right._zod.run({value:s,issues:[]},n);return i instanceof Promise||r instanceof Promise?Promise.all([i,r]).then(([t,n])=>bt(e,t,n)):bt(e,i,r)}});function gt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(m(e)&&m(t)){const n=Object.keys(t),s=Object.keys(e).filter(e=>-1!==n.indexOf(e)),i={...e,...t};for(const r of s){const n=gt(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};i[r]=n.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let s=0;s<e.length;s++){const i=gt(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function bt(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),k(e))return e;const s=gt(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const kt=t("$ZodRecord",(e,t)=>{Ee.init(e,t),e._zod.parse=(n,s)=>{const r=n.value;if(!m(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;const a=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;n.value={};for(const e of i)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const i=t.valueType._zod.run({value:r[e],issues:[]},s);i instanceof Promise?a.push(i.then(t=>{t.issues.length&&n.issues.push(...w(e,t.issues)),n.value[e]=t.value})):(i.issues.length&&n.issues.push(...w(e,i.issues)),n.value[e]=i.value)}let o;for(const e in r)i.has(e)||(o=o??[],o.push(e));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:o})}else{n.value={};for(const o of Reflect.ownKeys(r)){if("__proto__"===o)continue;const u=t.keyType._zod.run({value:o,issues:[]},s);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:u.issues.map(e=>z(e,s,i())),input:o,path:[o],inst:e}),n.value[u.value]=u.value;continue}const c=t.valueType._zod.run({value:r[o],issues:[]},s);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...w(o,e.issues)),n.value[u.value]=e.value})):(c.issues.length&&n.issues.push(...w(o,c.issues)),n.value[u.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),wt=t("$ZodEnum",(e,t)=>{Ee.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(e=>_.has(typeof e)).map(e=>"string"==typeof e?v(e):e.toString()).join("|")})$`),e._zod.parse=(t,s)=>{const i=t.value;return e._zod.values.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),xt=t("$ZodLiteral",(e,t)=>{Ee.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?v(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(n,s)=>{const i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),zt=t("$ZodTransform",(e,t)=>{Ee.init(e,t),e._zod.parse=(e,s)=>{const i=t.transform(e.value,e);if(s.async){return(i instanceof Promise?i:Promise.resolve(i)).then(t=>(e.value=t,e))}if(i instanceof Promise)throw new n;return e.value=i,e}}),Zt=t("$ZodOptional",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",e._zod.optout="optional",c(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),c(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${u(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)}),Tt=t("$ZodNullable",(e,t)=>{Ee.init(e,t),c(e._zod,"optin",()=>t.innerType._zod.optin),c(e._zod,"optout",()=>t.innerType._zod.optout),c(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${u(e.source)}|null)$`):void 0}),c(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),$t=t("$ZodDefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",c(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(void 0===e.value)return e.value=t.defaultValue,e;const s=t.innerType._zod.run(e,n);return s instanceof Promise?s.then(e=>Ot(e,t)):Ot(s,t)}});function Ot(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Et=t("$ZodPrefault",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",c(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),It=t("$ZodNonOptional",(e,t)=>{Ee.init(e,t),c(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,s)=>{const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(t=>At(t,e)):At(i,e)}});function At(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Nt=t("$ZodCatch",(e,t)=>{Ee.init(e,t),e._zod.optin="optional",c(e._zod,"optout",()=>t.innerType._zod.optout),c(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{const s=t.innerType._zod.run(e,n);return s instanceof Promise?s.then(s=>(e.value=s.value,s.issues.length&&(e.value=t.catchValue({...e,error:{issues:s.issues.map(e=>z(e,n,i()))},input:e.value}),e.issues=[]),e)):(e.value=s.value,s.issues.length&&(e.value=t.catchValue({...e,error:{issues:s.issues.map(e=>z(e,n,i()))},input:e.value}),e.issues=[]),e)}}),St=t("$ZodPipe",(e,t)=>{Ee.init(e,t),c(e._zod,"values",()=>t.in._zod.values),c(e._zod,"optin",()=>t.in._zod.optin),c(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,n)=>{const s=t.in._zod.run(e,n);return s instanceof Promise?s.then(e=>jt(e,t,n)):jt(s,t,n)}});function jt(e,t,n){return k(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Pt=t("$ZodReadonly",(e,t)=>{Ee.init(e,t),c(e._zod,"propValues",()=>t.innerType._zod.propValues),c(e._zod,"values",()=>t.innerType._zod.values),c(e._zod,"optin",()=>t.innerType._zod.optin),c(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{const s=t.innerType._zod.run(e,n);return s instanceof Promise?s.then(Ct):Ct(s)}});function Ct(e){return e.value=Object.freeze(e.value),e}const Rt=t("$ZodCustom",(e,t)=>{de.init(e,t),Ee.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const s=n.value,i=t.fn(s);if(i instanceof Promise)return i.then(t=>Ft(t,n,s,e));Ft(i,n,s,e)}});function Ft(e,t,n,s){if(!e){const e={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(e.params=s._zod.def.params),t.issues.push(T(e))}}class Mt{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function Dt(){return new Mt}const Ut=Dt();function Lt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Vt(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Kt(e,t){return new pe({check:"less_than",...g(t),value:e,inclusive:!1})}function Wt(e,t){return new pe({check:"less_than",...g(t),value:e,inclusive:!0})}function Bt(e,t){return new he({check:"greater_than",...g(t),value:e,inclusive:!1})}function qt(e,t){return new he({check:"greater_than",...g(t),value:e,inclusive:!0})}function Jt(e,t){return new fe({check:"multiple_of",...g(t),value:e})}function Gt(e,t){return new _e({check:"max_length",...g(t),maximum:e})}function Yt(e,t){return new ve({check:"min_length",...g(t),minimum:e})}function Ht(e,t){return new ye({check:"length_equals",...g(t),length:e})}function Xt(e){return new Te({check:"overwrite",tx:e})}var Qt,en,tn;(en=Qt||(Qt={})).assertEqual=e=>{},en.assertIs=function(e){},en.assertNever=function(e){throw new Error},en.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},en.getValidEnumValues=e=>{const t=en.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(const s of t)n[s]=e[s];return en.objectValues(n)},en.objectValues=e=>en.objectKeys(e).map(function(t){return e[t]}),en.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},en.find=(e,t)=>{for(const n of e)if(t(n))return n},en.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,en.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},en.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(tn||(tn={})).mergeShapes=(e,t)=>({...e,...t});const nn=Qt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),sn=e=>{switch(typeof e){case"undefined":return nn.undefined;case"string":return nn.string;case"number":return Number.isNaN(e)?nn.nan:nn.number;case"boolean":return nn.boolean;case"function":return nn.function;case"bigint":return nn.bigint;case"symbol":return nn.symbol;case"object":return Array.isArray(e)?nn.array:null===e?nn.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?nn.promise:"undefined"!=typeof Map&&e instanceof Map?nn.map:"undefined"!=typeof Set&&e instanceof Set?nn.set:"undefined"!=typeof Date&&e instanceof Date?nn.date:nn.object;default:return nn.unknown}},rn=Qt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class an extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},s=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(s);else if("invalid_return_type"===i.code)s(i.returnTypeError);else if("invalid_arguments"===i.code)s(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,s=0;for(;s<i.path.length;){const n=i.path[s];s===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],s++}}};return s(this),n}static assert(e){if(!(e instanceof an))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Qt.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const s of this.issues)if(s.path.length>0){const n=s.path[0];t[n]=t[n]||[],t[n].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}an.create=e=>new an(e);const on=(e,t)=>{let n;switch(e.code){case rn.invalid_type:n=e.received===nn.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case rn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Qt.jsonStringifyReplacer)}`;break;case rn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Qt.joinValues(e.keys,", ")}`;break;case rn.invalid_union:n="Invalid input";break;case rn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Qt.joinValues(e.options)}`;break;case rn.invalid_enum_value:n=`Invalid enum value. Expected ${Qt.joinValues(e.options)}, received '${e.received}'`;break;case rn.invalid_arguments:n="Invalid function arguments";break;case rn.invalid_return_type:n="Invalid function return type";break;case rn.invalid_date:n="Invalid date";break;case rn.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Qt.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case rn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case rn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case rn.custom:n="Invalid input";break;case rn.invalid_intersection_types:n="Intersection results could not be merged";break;case rn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case rn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Qt.assertNever(e)}return{message:n}};let un=on;function cn(){return un}const dn=e=>{const{data:t,path:n,errorMaps:s,issueData:i}=e,r=[...n,...i.path||[]],a={...i,path:r};if(void 0!==i.message)return{...i,path:r,message:i.message};let o="";const u=s.filter(e=>!!e).slice().reverse();for(const c of u)o=c(a,{data:t,defaultError:o}).message;return{...i,path:r,message:o}};function ln(e,t){const n=cn(),s=dn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===on?void 0:on].filter(e=>!!e)});e.common.issues.push(s)}class pn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if("aborted"===s.status)return hn;"dirty"===s.status&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const e=await s.key,t=await s.value;n.push({key:e,value:t})}return pn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:t,value:i}=s;if("aborted"===t.status)return hn;if("aborted"===i.status)return hn;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!s.alwaysSet||(n[t.value]=i.value)}return{status:e.value,value:n}}}const hn=Object.freeze({status:"aborted"}),fn=e=>({status:"dirty",value:e}),mn=e=>({status:"valid",value:e}),_n=e=>"aborted"===e.status,vn=e=>"dirty"===e.status,yn=e=>"valid"===e.status,gn=e=>"undefined"!=typeof Promise&&e instanceof Promise;var bn,kn;(kn=bn||(bn={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},kn.toString=e=>"string"==typeof e?e:e?.message;class wn{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const xn=(e,t)=>{if(yn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new an(e.common.issues);return this._error=t,this._error}}};function zn(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:s,description:i}=e;if(t&&(n||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(t,i)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??i.defaultError}:void 0===i.data?{message:r??s??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:r??n??i.defaultError}},description:i}}let Zn=class{get description(){return this._def.description}_getType(e){return sn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pn,ctx:{common:e.parent.common,data:e.data,parsedType:sn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(gn(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},s=this._parseSync({data:e,path:n.path,parent:n});return xn(n,s)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return yn(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>yn(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sn(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(gn(s)?s:Promise.resolve(s));return xn(n,i)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,s)=>{const i=e(t),r=()=>s.addIssue({code:rn.custom,...n(t)});return"undefined"!=typeof Promise&&i instanceof Promise?i.then(e=>!!e||(r(),!1)):!!i||(r(),!1)})}refinement(e,t){return this._refinement((n,s)=>!!e(n)||(s.addIssue("function"==typeof t?t(n,s):t),!1))}_refinement(e){return new $s({schema:this,typeName:Ds.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Os.create(this,this._def)}nullable(){return Es.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return us.create(this)}promise(){return Ts.create(this,this._def)}or(e){return ls.create([this,e],this._def)}and(e){return ms.create(this,e,this._def)}transform(e){return new $s({...zn(this._def),schema:this,typeName:Ds.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Is({...zn(this._def),innerType:this,defaultValue:t,typeName:Ds.ZodDefault})}brand(){return new js({typeName:Ds.ZodBranded,type:this,...zn(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new As({...zn(this._def),innerType:this,catchValue:t,typeName:Ds.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ps.create(this,e)}readonly(){return Cs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const Tn=/^c[^\s-]{8,}$/i,$n=/^[0-9a-z]+$/,On=/^[0-9A-HJKMNP-TV-Z]{26}$/i,En=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,In=/^[a-z0-9_-]{21}$/i,An=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Nn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let jn;const Pn=/^(?:(?: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])$/,Cn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Rn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Un="((\\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])))",Ln=new RegExp(`^${Un}$`);function Vn(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function Kn(e){return new RegExp(`^${Vn(e)}$`)}function Wn(e){let t=`${Un}T${Vn(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Bn(e,t){return!("v4"!==t&&t||!Pn.test(e))||!("v6"!==t&&t||!Rn.test(e))}function qn(e,t){if(!An.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(s));return"object"==typeof i&&null!==i&&((!("typ"in i)||"JWT"===i?.typ)&&(!!i.alg&&(!t||i.alg===t)))}catch{return!1}}function Jn(e,t){return!("v4"!==t&&t||!Cn.test(e))||!("v6"!==t&&t||!Fn.test(e))}let Gn=class e extends Zn{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==nn.string){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.string,received:t.parsedType}),hn}const t=new pn;let n;for(const s of this._def.checks)if("min"===s.kind)e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("max"===s.kind)e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),t.dirty());else if("length"===s.kind){const i=e.data.length>s.value,r=e.data.length<s.value;(i||r)&&(n=this._getOrReturnCtx(e,n),i?ln(n,{code:rn.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):r&&ln(n,{code:rn.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),t.dirty())}else if("email"===s.kind)Sn.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"email",code:rn.invalid_string,message:s.message}),t.dirty());else if("emoji"===s.kind)jn||(jn=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),jn.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"emoji",code:rn.invalid_string,message:s.message}),t.dirty());else if("uuid"===s.kind)En.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"uuid",code:rn.invalid_string,message:s.message}),t.dirty());else if("nanoid"===s.kind)In.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"nanoid",code:rn.invalid_string,message:s.message}),t.dirty());else if("cuid"===s.kind)Tn.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"cuid",code:rn.invalid_string,message:s.message}),t.dirty());else if("cuid2"===s.kind)$n.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"cuid2",code:rn.invalid_string,message:s.message}),t.dirty());else if("ulid"===s.kind)On.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"ulid",code:rn.invalid_string,message:s.message}),t.dirty());else if("url"===s.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ln(n,{validation:"url",code:rn.invalid_string,message:s.message}),t.dirty()}else if("regex"===s.kind){s.regex.lastIndex=0;s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"regex",code:rn.invalid_string,message:s.message}),t.dirty())}else if("trim"===s.kind)e.data=e.data.trim();else if("includes"===s.kind)e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),t.dirty());else if("toLowerCase"===s.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===s.kind)e.data=e.data.toUpperCase();else if("startsWith"===s.kind)e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.invalid_string,validation:{startsWith:s.value},message:s.message}),t.dirty());else if("endsWith"===s.kind)e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.invalid_string,validation:{endsWith:s.value},message:s.message}),t.dirty());else if("datetime"===s.kind){Wn(s).test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.invalid_string,validation:"datetime",message:s.message}),t.dirty())}else if("date"===s.kind){Ln.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.invalid_string,validation:"date",message:s.message}),t.dirty())}else if("time"===s.kind){Kn(s).test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.invalid_string,validation:"time",message:s.message}),t.dirty())}else"duration"===s.kind?Nn.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"duration",code:rn.invalid_string,message:s.message}),t.dirty()):"ip"===s.kind?Bn(e.data,s.version)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"ip",code:rn.invalid_string,message:s.message}),t.dirty()):"jwt"===s.kind?qn(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"jwt",code:rn.invalid_string,message:s.message}),t.dirty()):"cidr"===s.kind?Jn(e.data,s.version)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"cidr",code:rn.invalid_string,message:s.message}),t.dirty()):"base64"===s.kind?Mn.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"base64",code:rn.invalid_string,message:s.message}),t.dirty()):"base64url"===s.kind?Dn.test(e.data)||(n=this._getOrReturnCtx(e,n),ln(n,{validation:"base64url",code:rn.invalid_string,message:s.message}),t.dirty()):Qt.assertNever(s);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:rn.invalid_string,...bn.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:"email",...bn.errToObj(e)})}url(e){return this._addCheck({kind:"url",...bn.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...bn.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...bn.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...bn.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...bn.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...bn.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...bn.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...bn.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...bn.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...bn.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...bn.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...bn.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...bn.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...bn.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...bn.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...bn.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...bn.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...bn.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...bn.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...bn.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...bn.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...bn.errToObj(t)})}nonempty(e){return this.min(1,bn.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};function Yn(e,t){const n=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,i=n>s?n:s;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}Gn.create=e=>new Gn({checks:[],typeName:Ds.ZodString,coerce:e?.coerce??!1,...zn(e)});let Hn=class e extends Zn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==nn.number){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.number,received:t.parsedType}),hn}let t;const n=new pn;for(const s of this._def.checks)if("int"===s.kind)Qt.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty());else if("min"===s.kind){(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty())}else if("max"===s.kind){(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty())}else"multipleOf"===s.kind?0!==Yn(e.data,s.value)&&(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.not_finite,message:s.message}),n.dirty()):Qt.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,bn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,bn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,bn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,bn.toString(t))}setLimit(t,n,s,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:s,message:bn.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:"int",message:bn.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:bn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:bn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:bn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:bn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:bn.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:bn.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:bn.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:bn.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&Qt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Hn.create=e=>new Hn({checks:[],typeName:Ds.ZodNumber,coerce:e?.coerce||!1,...zn(e)});class Xn extends Zn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==nn.bigint)return this._getInvalidInput(e);let t;const n=new pn;for(const s of this._def.checks)if("min"===s.kind){(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty())}else if("max"===s.kind){(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty())}else"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),ln(t,{code:rn.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):Qt.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.bigint,received:t.parsedType}),hn}gte(e,t){return this.setLimit("min",e,!0,bn.toString(t))}gt(e,t){return this.setLimit("min",e,!1,bn.toString(t))}lte(e,t){return this.setLimit("max",e,!0,bn.toString(t))}lt(e,t){return this.setLimit("max",e,!1,bn.toString(t))}setLimit(e,t,n,s){return new Xn({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:bn.toString(s)}]})}_addCheck(e){return new Xn({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:bn.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:bn.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:bn.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:bn.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:bn.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Xn.create=e=>new Xn({checks:[],typeName:Ds.ZodBigInt,coerce:e?.coerce??!1,...zn(e)});let Qn=class extends Zn{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==nn.boolean){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.boolean,received:t.parsedType}),hn}return mn(e.data)}};Qn.create=e=>new Qn({typeName:Ds.ZodBoolean,coerce:e?.coerce||!1,...zn(e)});class es extends Zn{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==nn.date){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.date,received:t.parsedType}),hn}if(Number.isNaN(e.data.getTime())){return ln(this._getOrReturnCtx(e),{code:rn.invalid_date}),hn}const t=new pn;let n;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),ln(n,{code:rn.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):Qt.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new es({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:bn.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:bn.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}es.create=e=>new es({checks:[],coerce:e?.coerce||!1,typeName:Ds.ZodDate,...zn(e)});class ts extends Zn{_parse(e){if(this._getType(e)!==nn.symbol){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.symbol,received:t.parsedType}),hn}return mn(e.data)}}ts.create=e=>new ts({typeName:Ds.ZodSymbol,...zn(e)});let ns=class extends Zn{_parse(e){if(this._getType(e)!==nn.undefined){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.undefined,received:t.parsedType}),hn}return mn(e.data)}};ns.create=e=>new ns({typeName:Ds.ZodUndefined,...zn(e)});let ss=class extends Zn{_parse(e){if(this._getType(e)!==nn.null){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.null,received:t.parsedType}),hn}return mn(e.data)}};ss.create=e=>new ss({typeName:Ds.ZodNull,...zn(e)});let is=class extends Zn{constructor(){super(...arguments),this._any=!0}_parse(e){return mn(e.data)}};is.create=e=>new is({typeName:Ds.ZodAny,...zn(e)});let rs=class extends Zn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return mn(e.data)}};rs.create=e=>new rs({typeName:Ds.ZodUnknown,...zn(e)});let as=class extends Zn{_parse(e){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.never,received:t.parsedType}),hn}};as.create=e=>new as({typeName:Ds.ZodNever,...zn(e)});class os extends Zn{_parse(e){if(this._getType(e)!==nn.undefined){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.void,received:t.parsedType}),hn}return mn(e.data)}}os.create=e=>new os({typeName:Ds.ZodVoid,...zn(e)});let us=class e extends Zn{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==nn.array)return ln(t,{code:rn.invalid_type,expected:nn.array,received:t.parsedType}),hn;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,i=t.data.length<s.exactLength.value;(e||i)&&(ln(t,{code:e?rn.too_big:rn.too_small,minimum:i?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(ln(t,{code:rn.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(ln(t,{code:rn.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>s.type._parseAsync(new wn(t,e,t.path,n)))).then(e=>pn.mergeArray(n,e));const i=[...t.data].map((e,n)=>s.type._parseSync(new wn(t,e,t.path,n)));return pn.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:bn.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:bn.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:bn.toString(n)}})}nonempty(e){return this.min(1,e)}};function cs(e){if(e instanceof ds){const t={};for(const n in e.shape){const s=e.shape[n];t[n]=Os.create(cs(s))}return new ds({...e._def,shape:()=>t})}return e instanceof us?new us({...e._def,type:cs(e.element)}):e instanceof Os?Os.create(cs(e.unwrap())):e instanceof Es?Es.create(cs(e.unwrap())):e instanceof _s?_s.create(e.items.map(e=>cs(e))):e}us.create=(e,t)=>new us({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ds.ZodArray,...zn(t)});let ds=class e extends Zn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Qt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==nn.object){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.object,received:t.parsedType}),hn}const{status:t,ctx:n}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),r=[];if(!(this._def.catchall instanceof as&&"strip"===this._def.unknownKeys))for(const o in n.data)i.includes(o)||r.push(o);const a=[];for(const o of i){const e=s[o],t=n.data[o];a.push({key:{status:"valid",value:o},value:e._parse(new wn(n,t,n.path,o)),alwaysSet:o in n.data})}if(this._def.catchall instanceof as){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of r)a.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)r.length>0&&(ln(n,{code:rn.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r){const s=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new wn(n,s,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const n=await t.key,s=await t.value;e.push({key:n,value:s,alwaysSet:t.alwaysSet})}return e}).then(e=>pn.mergeObjectSync(t,e)):pn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(t){return bn.errToObj,new e({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(e,n)=>{const s=this._def.errorMap?.(e,n).message??n.defaultError;return"unrecognized_keys"===e.code?{message:bn.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ds.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){const n={};for(const e of Qt.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){const n={};for(const e of Qt.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return cs(this)}partial(t){const n={};for(const e of Qt.objectKeys(this.shape)){const s=this.shape[e];t&&!t[e]?n[e]=s:n[e]=s.optional()}return new e({...this._def,shape:()=>n})}required(t){const n={};for(const e of Qt.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Os;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return xs(Qt.objectKeys(this.shape))}};ds.create=(e,t)=>new ds({shape:()=>e,unknownKeys:"strip",catchall:as.create(),typeName:Ds.ZodObject,...zn(t)}),ds.strictCreate=(e,t)=>new ds({shape:()=>e,unknownKeys:"strict",catchall:as.create(),typeName:Ds.ZodObject,...zn(t)}),ds.lazycreate=(e,t)=>new ds({shape:e,unknownKeys:"strip",catchall:as.create(),typeName:Ds.ZodObject,...zn(t)});let ls=class extends Zn{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const n=e.map(e=>new an(e.ctx.common.issues));return ln(t,{code:rn.invalid_union,unionErrors:n}),hn});{let e;const s=[];for(const r of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=r._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:n}),n.common.issues.length&&s.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=s.map(e=>new an(e));return ln(t,{code:rn.invalid_union,unionErrors:i}),hn}}get options(){return this._def.options}};ls.create=(e,t)=>new ls({options:e,typeName:Ds.ZodUnion,...zn(t)});const ps=e=>e instanceof ks?ps(e.schema):e instanceof $s?ps(e.innerType()):e instanceof ws?[e.value]:e instanceof zs?e.options:e instanceof Zs?Qt.objectValues(e.enum):e instanceof Is?ps(e._def.innerType):e instanceof ns?[void 0]:e instanceof ss?[null]:e instanceof Os?[void 0,...ps(e.unwrap())]:e instanceof Es?[null,...ps(e.unwrap())]:e instanceof js||e instanceof Cs?ps(e.unwrap()):e instanceof As?ps(e._def.innerType):[];let hs=class e extends Zn{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==nn.object)return ln(t,{code:rn.invalid_type,expected:nn.object,received:t.parsedType}),hn;const n=this.discriminator,s=t.data[n],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(ln(t,{code:rn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),hn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,s){const i=new Map;for(const e of n){const n=ps(e.shape[t]);if(!n.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of n){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,e)}}return new e({typeName:Ds.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...zn(s)})}};function fs(e,t){const n=sn(e),s=sn(t);if(e===t)return{valid:!0,data:e};if(n===nn.object&&s===nn.object){const n=Qt.objectKeys(t),s=Qt.objectKeys(e).filter(e=>-1!==n.indexOf(e)),i={...e,...t};for(const r of s){const n=fs(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(n===nn.array&&s===nn.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let s=0;s<e.length;s++){const i=fs(e[s],t[s]);if(!i.valid)return{valid:!1};n.push(i.data)}return{valid:!0,data:n}}return n===nn.date&&s===nn.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}let ms=class extends Zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(e,s)=>{if(_n(e)||_n(s))return hn;const i=fs(e.value,s.value);return i.valid?((vn(e)||vn(s))&&t.dirty(),{status:t.value,value:i.data}):(ln(n,{code:rn.invalid_intersection_types}),hn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ms.create=(e,t,n)=>new ms({left:e,right:t,typeName:Ds.ZodIntersection,...zn(n)});class _s extends Zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nn.array)return ln(n,{code:rn.invalid_type,expected:nn.array,received:n.parsedType}),hn;if(n.data.length<this._def.items.length)return ln(n,{code:rn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),hn;!this._def.rest&&n.data.length>this._def.items.length&&(ln(n,{code:rn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new wn(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(s).then(e=>pn.mergeArray(t,e)):pn.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new _s({...this._def,rest:e})}}_s.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _s({items:e,typeName:Ds.ZodTuple,rest:null,...zn(t)})};let vs=class e extends Zn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nn.object)return ln(n,{code:rn.invalid_type,expected:nn.object,received:n.parsedType}),hn;const s=[],i=this._def.keyType,r=this._def.valueType;for(const a in n.data)s.push({key:i._parse(new wn(n,a,n.path,a)),value:r._parse(new wn(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?pn.mergeObjectAsync(t,s):pn.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(t,n,s){return new e(n instanceof Zn?{keyType:t,valueType:n,typeName:Ds.ZodRecord,...zn(s)}:{keyType:Gn.create(),valueType:t,typeName:Ds.ZodRecord,...zn(n)})}};class ys extends Zn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nn.map)return ln(n,{code:rn.invalid_type,expected:nn.map,received:n.parsedType}),hn;const s=this._def.keyType,i=this._def.valueType,r=[...n.data.entries()].map(([e,t],r)=>({key:s._parse(new wn(n,e,n.path,[r,"key"])),value:i._parse(new wn(n,t,n.path,[r,"value"]))}));if(n.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of r){const s=await n.key,i=await n.value;if("aborted"===s.status||"aborted"===i.status)return hn;"dirty"!==s.status&&"dirty"!==i.status||t.dirty(),e.set(s.value,i.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of r){const s=n.key,i=n.value;if("aborted"===s.status||"aborted"===i.status)return hn;"dirty"!==s.status&&"dirty"!==i.status||t.dirty(),e.set(s.value,i.value)}return{status:t.value,value:e}}}}ys.create=(e,t,n)=>new ys({valueType:t,keyType:e,typeName:Ds.ZodMap,...zn(n)});class gs extends Zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nn.set)return ln(n,{code:rn.invalid_type,expected:nn.set,received:n.parsedType}),hn;const s=this._def;null!==s.minSize&&n.data.size<s.minSize.value&&(ln(n,{code:rn.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&n.data.size>s.maxSize.value&&(ln(n,{code:rn.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function r(e){const n=new Set;for(const s of e){if("aborted"===s.status)return hn;"dirty"===s.status&&t.dirty(),n.add(s.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map((e,t)=>i._parse(new wn(n,e,n.path,t)));return n.common.async?Promise.all(a).then(e=>r(e)):r(a)}min(e,t){return new gs({...this._def,minSize:{value:e,message:bn.toString(t)}})}max(e,t){return new gs({...this._def,maxSize:{value:e,message:bn.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}gs.create=(e,t)=>new gs({valueType:e,minSize:null,maxSize:null,typeName:Ds.ZodSet,...zn(t)});class bs extends Zn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==nn.function)return ln(t,{code:rn.invalid_type,expected:nn.function,received:t.parsedType}),hn;function n(e,n){return dn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cn(),on].filter(e=>!!e),issueData:{code:rn.invalid_arguments,argumentsError:n}})}function s(e,n){return dn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cn(),on].filter(e=>!!e),issueData:{code:rn.invalid_return_type,returnTypeError:n}})}const i={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Ts){const e=this;return mn(async function(...t){const a=new an([]),o=await e._def.args.parseAsync(t,i).catch(e=>{throw a.addIssue(n(t,e)),a}),u=await Reflect.apply(r,this,o);return await e._def.returns._def.type.parseAsync(u,i).catch(e=>{throw a.addIssue(s(u,e)),a})})}{const e=this;return mn(function(...t){const a=e._def.args.safeParse(t,i);if(!a.success)throw new an([n(t,a.error)]);const o=Reflect.apply(r,this,a.data),u=e._def.returns.safeParse(o,i);if(!u.success)throw new an([s(o,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new bs({...this._def,args:_s.create(e).rest(rs.create())})}returns(e){return new bs({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new bs({args:e||_s.create([]).rest(rs.create()),returns:t||rs.create(),typeName:Ds.ZodFunction,...zn(n)})}}class ks extends Zn{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ks.create=(e,t)=>new ks({getter:e,typeName:Ds.ZodLazy,...zn(t)});let ws=class extends Zn{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ln(t,{received:t.data,code:rn.invalid_literal,expected:this._def.value}),hn}return{status:"valid",value:e.data}}get value(){return this._def.value}};function xs(e,t){return new zs({values:e,typeName:Ds.ZodEnum,...zn(t)})}ws.create=(e,t)=>new ws({value:e,typeName:Ds.ZodLiteral,...zn(t)});let zs=class e extends Zn{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return ln(t,{expected:Qt.joinValues(n),received:t.parsedType,code:rn.invalid_type}),hn}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ln(t,{received:t.data,code:rn.invalid_enum_value,options:n}),hn}return mn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};zs.create=xs;class Zs extends Zn{_parse(e){const t=Qt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==nn.string&&n.parsedType!==nn.number){const e=Qt.objectValues(t);return ln(n,{expected:Qt.joinValues(e),received:n.parsedType,code:rn.invalid_type}),hn}if(this._cache||(this._cache=new Set(Qt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=Qt.objectValues(t);return ln(n,{received:n.data,code:rn.invalid_enum_value,options:e}),hn}return mn(e.data)}get enum(){return this._def.values}}Zs.create=(e,t)=>new Zs({values:e,typeName:Ds.ZodNativeEnum,...zn(t)});class Ts extends Zn{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==nn.promise&&!1===t.common.async)return ln(t,{code:rn.invalid_type,expected:nn.promise,received:t.parsedType}),hn;const n=t.parsedType===nn.promise?t.data:Promise.resolve(t.data);return mn(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ts.create=(e,t)=>new Ts({type:e,typeName:Ds.ZodPromise,...zn(t)});class $s extends Zn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ds.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:e=>{ln(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===s.type){const e=s.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return hn;const s=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===s.status?hn:"dirty"===s.status||"dirty"===t.value?fn(s.value):s});{if("aborted"===t.value)return hn;const s=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===s.status?hn:"dirty"===s.status||"dirty"===t.value?fn(s.value):s}}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===s.status?hn:("dirty"===s.status&&t.dirty(),e(s.value),{status:t.value,value:s.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?hn:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===s.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yn(e))return hn;const r=s.transform(e.value,i);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>yn(e)?Promise.resolve(s.transform(e.value,i)).then(e=>({status:t.value,value:e})):hn)}Qt.assertNever(s)}}$s.create=(e,t,n)=>new $s({schema:e,typeName:Ds.ZodEffects,effect:t,...zn(n)}),$s.createWithPreprocess=(e,t,n)=>new $s({schema:t,effect:{type:"preprocess",transform:e},typeName:Ds.ZodEffects,...zn(n)});let Os=class extends Zn{_parse(e){return this._getType(e)===nn.undefined?mn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Os.create=(e,t)=>new Os({innerType:e,typeName:Ds.ZodOptional,...zn(t)});let Es=class extends Zn{_parse(e){return this._getType(e)===nn.null?mn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Es.create=(e,t)=>new Es({innerType:e,typeName:Ds.ZodNullable,...zn(t)});let Is=class extends Zn{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===nn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Is.create=(e,t)=>new Is({innerType:e,typeName:Ds.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...zn(t)});let As=class extends Zn{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gn(s)?s.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new an(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new an(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};As.create=(e,t)=>new As({innerType:e,typeName:Ds.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...zn(t)});class Ns extends Zn{_parse(e){if(this._getType(e)!==nn.nan){const t=this._getOrReturnCtx(e);return ln(t,{code:rn.invalid_type,expected:nn.nan,received:t.parsedType}),hn}return{status:"valid",value:e.data}}}Ns.create=e=>new Ns({typeName:Ds.ZodNaN,...zn(e)});const Ss=Symbol("zod_brand");class js extends Zn{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ps extends Zn{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?hn:"dirty"===e.status?(t.dirty(),fn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?hn:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Ps({in:e,out:t,typeName:Ds.ZodPipeline})}}let Cs=class extends Zn{_parse(e){const t=this._def.innerType._parse(e),n=e=>(yn(e)&&(e.value=Object.freeze(e.value)),e);return gn(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};function Rs(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Fs(e,t={},n){return e?is.create().superRefine((s,i)=>{const r=e(s);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Rs(t,s),r=e.fatal??n??!0;i.addIssue({code:"custom",...e,fatal:r})}});if(!r){const e=Rs(t,s),r=e.fatal??n??!0;i.addIssue({code:"custom",...e,fatal:r})}}):is.create()}Cs.create=(e,t)=>new Cs({innerType:e,typeName:Ds.ZodReadonly,...zn(t)});const Ms={object:ds.lazycreate};var Ds,Us;(Us=Ds||(Ds={})).ZodString="ZodString",Us.ZodNumber="ZodNumber",Us.ZodNaN="ZodNaN",Us.ZodBigInt="ZodBigInt",Us.ZodBoolean="ZodBoolean",Us.ZodDate="ZodDate",Us.ZodSymbol="ZodSymbol",Us.ZodUndefined="ZodUndefined",Us.ZodNull="ZodNull",Us.ZodAny="ZodAny",Us.ZodUnknown="ZodUnknown",Us.ZodNever="ZodNever",Us.ZodVoid="ZodVoid",Us.ZodArray="ZodArray",Us.ZodObject="ZodObject",Us.ZodUnion="ZodUnion",Us.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Us.ZodIntersection="ZodIntersection",Us.ZodTuple="ZodTuple",Us.ZodRecord="ZodRecord",Us.ZodMap="ZodMap",Us.ZodSet="ZodSet",Us.ZodFunction="ZodFunction",Us.ZodLazy="ZodLazy",Us.ZodLiteral="ZodLiteral",Us.ZodEnum="ZodEnum",Us.ZodEffects="ZodEffects",Us.ZodNativeEnum="ZodNativeEnum",Us.ZodOptional="ZodOptional",Us.ZodNullable="ZodNullable",Us.ZodDefault="ZodDefault",Us.ZodCatch="ZodCatch",Us.ZodPromise="ZodPromise",Us.ZodBranded="ZodBranded",Us.ZodPipeline="ZodPipeline",Us.ZodReadonly="ZodReadonly";const Ls=(e,t={message:`Input not instance of ${e.name}`})=>Fs(t=>t instanceof e,t),Vs=Gn.create,Ks=Hn.create,Ws=Ns.create,Bs=Xn.create,qs=Qn.create,Js=es.create,Gs=ts.create,Ys=ns.create,Hs=ss.create,Xs=is.create,Qs=rs.create,ei=as.create,ti=os.create,ni=us.create,si=ds.create,ii=ds.strictCreate,ri=ls.create,ai=hs.create,oi=ms.create,ui=_s.create,ci=vs.create,di=ys.create,li=gs.create,pi=bs.create,hi=ks.create,fi=ws.create,mi=zs.create,_i=Zs.create,vi=Ts.create,yi=$s.create,gi=Os.create,bi=Es.create,ki=$s.createWithPreprocess,wi=Ps.create,xi={string:e=>Gn.create({...e,coerce:!0}),number:e=>Hn.create({...e,coerce:!0}),boolean:e=>Qn.create({...e,coerce:!0}),bigint:e=>Xn.create({...e,coerce:!0}),date:e=>es.create({...e,coerce:!0})},zi=hn,Zi=Object.freeze(Object.defineProperty({__proto__:null,BRAND:Ss,DIRTY:fn,EMPTY_PATH:[],INVALID:hn,NEVER:zi,OK:mn,ParseStatus:pn,Schema:Zn,ZodAny:is,ZodArray:us,ZodBigInt:Xn,ZodBoolean:Qn,ZodBranded:js,ZodCatch:As,ZodDate:es,ZodDefault:Is,ZodDiscriminatedUnion:hs,ZodEffects:$s,ZodEnum:zs,ZodError:an,get ZodFirstPartyTypeKind(){return Ds},ZodFunction:bs,ZodIntersection:ms,ZodIssueCode:rn,ZodLazy:ks,ZodLiteral:ws,ZodMap:ys,ZodNaN:Ns,ZodNativeEnum:Zs,ZodNever:as,ZodNull:ss,ZodNullable:Es,ZodNumber:Hn,ZodObject:ds,ZodOptional:Os,ZodParsedType:nn,ZodPipeline:Ps,ZodPromise:Ts,ZodReadonly:Cs,ZodRecord:vs,ZodSchema:Zn,ZodSet:gs,ZodString:Gn,ZodSymbol:ts,ZodTransformer:$s,ZodTuple:_s,ZodType:Zn,ZodUndefined:ns,ZodUnion:ls,ZodUnknown:rs,ZodVoid:os,addIssueToContext:ln,any:Xs,array:ni,bigint:Bs,boolean:qs,coerce:xi,custom:Fs,date:Js,datetimeRegex:Wn,defaultErrorMap:on,discriminatedUnion:ai,effect:yi,enum:mi,function:pi,getErrorMap:cn,getParsedType:sn,instanceof:Ls,intersection:oi,isAborted:_n,isAsync:gn,isDirty:vn,isValid:yn,late:Ms,lazy:hi,literal:fi,makeIssue:dn,map:di,nan:Ws,nativeEnum:_i,never:ei,null:Hs,nullable:bi,number:Ks,object:si,get objectUtil(){return tn},oboolean:()=>qs().optional(),onumber:()=>Ks().optional(),optional:gi,ostring:()=>Vs().optional(),pipeline:wi,preprocess:ki,promise:vi,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:ci,set:li,setErrorMap:function(e){un=e},strictObject:ii,string:Vs,symbol:Gs,transformer:yi,tuple:ui,undefined:Ys,union:ri,unknown:Qs,get util(){return Qt},void:ti},Symbol.toStringTag,{value:"Module"})),Ti=t("ZodISODateTime",(e,t)=>{Ve.init(e,t),Vi.init(e,t)});function $i(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}(Ti,e)}const Oi=t("ZodISODate",(e,t)=>{Ke.init(e,t),Vi.init(e,t)});function Ei(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}(Oi,e)}const Ii=t("ZodISOTime",(e,t)=>{We.init(e,t),Vi.init(e,t)});function Ai(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}(Ii,e)}const Ni=t("ZodISODuration",(e,t)=>{Be.init(e,t),Vi.init(e,t)});function Si(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}(Ni,e)}const ji=t("ZodError",(e,t)=>{O.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t){const n=t||function(e){return e.message},s={_errors:[]},i=e=>{for(const t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>i({issues:e}));else if("invalid_key"===t.code)i({issues:t.issues});else if("invalid_element"===t.code)i({issues:t.issues});else if(0===t.path.length)s._errors.push(n(t));else{let e=s,i=0;for(;i<t.path.length;){const s=t.path[i];i===t.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(n(t))):e[s]=e[s]||{_errors:[]},e=e[s],i++}}};return i(e),s}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},s=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:n}}(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Pi=I(ji),Ci=A(ji),Ri=N(ji),Fi=j(ji),Mi=t("ZodType",(e,t)=>(Ee.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>y(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Pi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Ri(e,t,n),e.parseAsync=async(t,n)=>Ci(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Fi(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...g(n)})}(na,e,t)}(t,n)),e.superRefine=t=>e.check(function(e){const t=function(e){const t=new de({check:"custom"});return t._zod.check=e,t}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(T(e,n.value,t._zod.def));else{const s=e;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(T(s))}},e(n.value,n)));return t}(t)),e.overwrite=t=>e.check(Xt(t)),e.optional=()=>Br(e),e.nullable=()=>Jr(e),e.nullish=()=>Br(Jr(e)),e.nonoptional=t=>function(e,t){return new Hr({type:"nonoptional",innerType:e,...g(t)})}(e,t),e.array=()=>$r(e),e.or=t=>Nr([e,t]),e.and=t=>Cr(e,t),e.transform=t=>ea(e,Kr(t)),e.default=t=>{return n=t,new Gr({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.prefault=t=>{return n=t,new Yr({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():n}});var n},e.catch=t=>{return new Xr({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>ea(e,t),e.readonly=()=>new ta({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return Ut.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>Ut.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Ut.get(e);const n=e.clone();return Ut.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Di=t("_ZodString",(e,t)=>{Ie.init(e,t),Mi.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new be({check:"string_format",format:"regex",...g(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new xe({check:"string_format",format:"includes",...g(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new ze({check:"string_format",format:"starts_with",...g(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ze({check:"string_format",format:"ends_with",...g(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Yt(...t)),e.max=(...t)=>e.check(Gt(...t)),e.length=(...t)=>e.check(Ht(...t)),e.nonempty=(...t)=>e.check(Yt(1,...t)),e.lowercase=t=>e.check(function(e){return new ke({check:"string_format",format:"lowercase",...g(e)})}(t)),e.uppercase=t=>e.check(function(e){return new we({check:"string_format",format:"uppercase",...g(e)})}(t)),e.trim=()=>e.check(Xt(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Xt(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Xt(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Xt(e=>e.toUpperCase()))}),Ui=t("ZodString",(e,t)=>{Ie.init(e,t),Di.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}(Ki,t)),e.url=t=>e.check(Vt(qi,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}(cr,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}(Gi,t)),e.guid=t=>e.check(Lt(Wi,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}(Bi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}(Bi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}(Bi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}(Bi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}(Yi,t)),e.guid=t=>e.check(Lt(Wi,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}(Hi,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}(Xi,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}(Qi,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}(ar,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}(or,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}(er,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}(tr,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}(nr,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}(sr,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}(ir,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}(rr,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}(ur,t)),e.datetime=t=>e.check($i(t)),e.date=t=>e.check(Ei(t)),e.time=t=>e.check(Ai(t)),e.duration=t=>e.check(Si(t))});function Li(e){return function(e,t){return new e({type:"string",...g(t)})}(Ui,e)}const Vi=t("ZodStringFormat",(e,t)=>{Ae.init(e,t),Di.init(e,t)}),Ki=t("ZodEmail",(e,t)=>{je.init(e,t),Vi.init(e,t)}),Wi=t("ZodGUID",(e,t)=>{Ne.init(e,t),Vi.init(e,t)}),Bi=t("ZodUUID",(e,t)=>{Se.init(e,t),Vi.init(e,t)}),qi=t("ZodURL",(e,t)=>{Pe.init(e,t),Vi.init(e,t)});function Ji(e){return Vt(qi,e)}const Gi=t("ZodEmoji",(e,t)=>{Ce.init(e,t),Vi.init(e,t)}),Yi=t("ZodNanoID",(e,t)=>{Re.init(e,t),Vi.init(e,t)}),Hi=t("ZodCUID",(e,t)=>{Fe.init(e,t),Vi.init(e,t)}),Xi=t("ZodCUID2",(e,t)=>{Me.init(e,t),Vi.init(e,t)}),Qi=t("ZodULID",(e,t)=>{De.init(e,t),Vi.init(e,t)}),er=t("ZodXID",(e,t)=>{Ue.init(e,t),Vi.init(e,t)}),tr=t("ZodKSUID",(e,t)=>{Le.init(e,t),Vi.init(e,t)}),nr=t("ZodIPv4",(e,t)=>{qe.init(e,t),Vi.init(e,t)}),sr=t("ZodIPv6",(e,t)=>{Je.init(e,t),Vi.init(e,t)}),ir=t("ZodCIDRv4",(e,t)=>{Ge.init(e,t),Vi.init(e,t)}),rr=t("ZodCIDRv6",(e,t)=>{Ye.init(e,t),Vi.init(e,t)}),ar=t("ZodBase64",(e,t)=>{Xe.init(e,t),Vi.init(e,t)}),or=t("ZodBase64URL",(e,t)=>{Qe.init(e,t),Vi.init(e,t)}),ur=t("ZodE164",(e,t)=>{et.init(e,t),Vi.init(e,t)}),cr=t("ZodJWT",(e,t)=>{tt.init(e,t),Vi.init(e,t)}),dr=t("ZodNumber",(e,t)=>{nt.init(e,t),Mi.init(e,t),e.gt=(t,n)=>e.check(Bt(t,n)),e.gte=(t,n)=>e.check(qt(t,n)),e.min=(t,n)=>e.check(qt(t,n)),e.lt=(t,n)=>e.check(Kt(t,n)),e.lte=(t,n)=>e.check(Wt(t,n)),e.max=(t,n)=>e.check(Wt(t,n)),e.int=t=>e.check(hr(t)),e.safe=t=>e.check(hr(t)),e.positive=t=>e.check(Bt(0,t)),e.nonnegative=t=>e.check(qt(0,t)),e.negative=t=>e.check(Kt(0,t)),e.nonpositive=t=>e.check(Wt(0,t)),e.multipleOf=(t,n)=>e.check(Jt(t,n)),e.step=(t,n)=>e.check(Jt(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function lr(e){return function(e,t){return new e({type:"number",checks:[],...g(t)})}(dr,e)}const pr=t("ZodNumberFormat",(e,t)=>{st.init(e,t),dr.init(e,t)});function hr(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}(pr,e)}const fr=t("ZodBoolean",(e,t)=>{it.init(e,t),Mi.init(e,t)});function mr(e){return function(e,t){return new e({type:"boolean",...g(t)})}(fr,e)}const _r=t("ZodUndefined",(e,t)=>{rt.init(e,t),Mi.init(e,t)});function vr(e){return function(e,t){return new e({type:"undefined",...g(t)})}(_r,e)}const yr=t("ZodNull",(e,t)=>{at.init(e,t),Mi.init(e,t)});function gr(e){return function(e,t){return new e({type:"null",...g(t)})}(yr,e)}const br=t("ZodAny",(e,t)=>{ot.init(e,t),Mi.init(e,t)});function kr(){return new br({type:"any"})}const wr=t("ZodUnknown",(e,t)=>{ut.init(e,t),Mi.init(e,t)});function xr(){return new wr({type:"unknown"})}const zr=t("ZodNever",(e,t)=>{ct.init(e,t),Mi.init(e,t)});function Zr(e){return function(e,t){return new e({type:"never",...g(t)})}(zr,e)}const Tr=t("ZodArray",(e,t)=>{lt.init(e,t),Mi.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Yt(t,n)),e.nonempty=t=>e.check(Yt(1,t)),e.max=(t,n)=>e.check(Gt(t,n)),e.length=(t,n)=>e.check(Ht(t,n)),e.unwrap=()=>e.element});function $r(e,t){return function(e,t,n){return new e({type:"array",element:t,...g(n)})}(Tr,e,t)}const Or=t("ZodObject",(e,t)=>{ft.init(e,t),Mi.init(e,t),c(e,"shape",()=>t.shape),e.keyof=()=>Dr(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xr()}),e.loose=()=>e.clone({...e._zod.def,catchall:xr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Zr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!m(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return d(this,"shape",n),n},checks:[]};return y(e,n)}(e,t),e.merge=t=>{return s=t,y(n=e,{...n._zod.def,get shape(){const e={...n._zod.def.shape,...s._zod.def.shape};return d(this,"shape",e),e},catchall:s._zod.def.catchall,checks:[]});var n,s},e.pick=t=>function(e,t){const n={},s=e._zod.def;for(const i in t){if(!(i in s.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=s.shape[i])}return y(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.omit=t=>function(e,t){const n={...e._zod.def.shape},s=e._zod.def;for(const i in t){if(!(i in s.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return y(e,{...e._zod.def,shape:n,checks:[]})}(e,t),e.partial=(...t)=>function(e,t,n){const s=t._zod.def.shape,i={...s};if(n)for(const r in n){if(!(r in s))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(i[r]=e?new e({type:"optional",innerType:s[r]}):s[r])}else for(const r in s)i[r]=e?new e({type:"optional",innerType:s[r]}):s[r];return y(t,{...t._zod.def,shape:i,checks:[]})}(Wr,e,t[0]),e.required=(...t)=>function(e,t,n){const s=t._zod.def.shape,i={...s};if(n)for(const r in n){if(!(r in i))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(i[r]=new e({type:"nonoptional",innerType:s[r]}))}else for(const r in s)i[r]=new e({type:"nonoptional",innerType:s[r]});return y(t,{...t._zod.def,shape:i,checks:[]})}(Hr,e,t[0])});function Er(e,t){const n={type:"object",get shape(){return d(this,"shape",{...e}),this.shape},...g(t)};return new Or(n)}function Ir(e,t){return new Or({type:"object",get shape(){return d(this,"shape",{...e}),this.shape},catchall:xr(),...g(t)})}const Ar=t("ZodUnion",(e,t)=>{_t.init(e,t),Mi.init(e,t),e.options=t.options});function Nr(e,t){return new Ar({type:"union",options:e,...g(t)})}const Sr=t("ZodDiscriminatedUnion",(e,t)=>{Ar.init(e,t),vt.init(e,t)});function jr(e,t,n){return new Sr({type:"union",options:t,discriminator:e,...g(n)})}const Pr=t("ZodIntersection",(e,t)=>{yt.init(e,t),Mi.init(e,t)});function Cr(e,t){return new Pr({type:"intersection",left:e,right:t})}const Rr=t("ZodRecord",(e,t)=>{kt.init(e,t),Mi.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Fr(e,t,n){return new Rr({type:"record",keyType:e,valueType:t,...g(n)})}const Mr=t("ZodEnum",(e,t)=>{wt.init(e,t),Mi.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,s)=>{const i={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);i[r]=t.entries[r]}return new Mr({...t,checks:[],...g(s),entries:i})},e.exclude=(e,s)=>{const i={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete i[t]}return new Mr({...t,checks:[],...g(s),entries:i})}});function Dr(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Mr({type:"enum",entries:n,...g(t)})}const Ur=t("ZodLiteral",(e,t)=>{xt.init(e,t),Mi.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Lr(e,t){return new Ur({type:"literal",values:Array.isArray(e)?e:[e],...g(t)})}const Vr=t("ZodTransform",(e,t)=>{zt.init(e,t),Mi.init(e,t),e._zod.parse=(n,s)=>{n.addIssue=s=>{if("string"==typeof s)n.issues.push(T(s,n.value,t));else{const t=s;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),t.continue??(t.continue=!0),n.issues.push(T(t))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Kr(e){return new Vr({type:"transform",transform:e})}const Wr=t("ZodOptional",(e,t)=>{Zt.init(e,t),Mi.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Br(e){return new Wr({type:"optional",innerType:e})}const qr=t("ZodNullable",(e,t)=>{Tt.init(e,t),Mi.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jr(e){return new qr({type:"nullable",innerType:e})}const Gr=t("ZodDefault",(e,t)=>{$t.init(e,t),Mi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Yr=t("ZodPrefault",(e,t)=>{Et.init(e,t),Mi.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Hr=t("ZodNonOptional",(e,t)=>{It.init(e,t),Mi.init(e,t),e.unwrap=()=>e._zod.def.innerType});const Xr=t("ZodCatch",(e,t)=>{Nt.init(e,t),Mi.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Qr=t("ZodPipe",(e,t)=>{St.init(e,t),Mi.init(e,t),e.in=t.in,e.out=t.out});function ea(e,t){return new Qr({type:"pipe",in:e,out:t})}const ta=t("ZodReadonly",(e,t)=>{Pt.init(e,t),Mi.init(e,t)});const na=t("ZodCustom",(e,t)=>{Rt.init(e,t),Mi.init(e,t)});function sa(e,t){return function(e,t,n){const s=g(n);return s.abort??(s.abort=!0),new e({type:"custom",check:"custom",fn:t,...s})}(na,e??(()=>!0),t)}function ia(e,t){return ea(Kr(e),t)}const ra={custom:"custom"};function aa(e){return function(e,t){return new e({type:"number",coerce:!0,checks:[],...g(t)})}(dr,e)}export{lr as A,$r as B,Nr as C,Fr as D,xr as E,Er as F,ia as G,Dr as H,sa as I,jr as J,$i as K,Cr as L,S as M,vr as N,Zr as O,Ji as P,ra as Q,e as R,aa as S,kr as T,Ls as U,rn as Z,gr as _,ni as a,qs as b,ii as c,ai as d,mi as e,_i as f,Qs as g,xi as h,Hs as i,Ys as j,i as k,fi as l,Xs as m,Ks as n,si as o,ki as p,Ds as q,ci as r,Vs as s,Lr as t,ri as u,Li as v,Ir as w,Br as x,mr as y,Zi as z};
