UNPKG

@microsoft/agents-copilotstudio-client

Version:

Microsoft Copilot Studio Client for JavaScript. Copilot Studio Client.

1 lines 172 kB
var Ka=Object.create;var In=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Ya=Object.getOwnPropertyNames;var Xa=Object.getPrototypeOf,Qa=Object.prototype.hasOwnProperty;var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ec=(t,e)=>{for(var r in e)In(t,r,{get:e[r],enumerable:!0})},tc=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ya(e))!Qa.call(t,o)&&o!==r&&In(t,o,{get:()=>e[o],enumerable:!(n=Ga(e,o))||n.enumerable});return t};var br=(t,e,r)=>(r=t!=null?Ka(Xa(t)):{},tc(e||!t||!t.__esModule?In(r,"default",{value:t,enumerable:!0}):r,t));var Ji=x((Ly,Wi)=>{var dt=1e3,lt=dt*60,ft=lt*60,Ze=ft*24,yu=Ze*7,gu=Ze*365.25;Wi.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return vu(t);if(r==="number"&&isFinite(t))return e.long?_u(t):bu(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function vu(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*gu;case"weeks":case"week":case"w":return r*yu;case"days":case"day":case"d":return r*Ze;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ft;case"minutes":case"minute":case"mins":case"min":case"m":return r*lt;case"seconds":case"second":case"secs":case"sec":case"s":return r*dt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function bu(t){var e=Math.abs(t);return e>=Ze?Math.round(t/Ze)+"d":e>=ft?Math.round(t/ft)+"h":e>=lt?Math.round(t/lt)+"m":e>=dt?Math.round(t/dt)+"s":t+"ms"}function _u(t){var e=Math.abs(t);return e>=Ze?Lr(t,e,Ze,"day"):e>=ft?Lr(t,e,ft,"hour"):e>=lt?Lr(t,e,lt,"minute"):e>=dt?Lr(t,e,dt,"second"):t+" ms"}function Lr(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Gi=x((My,Ki)=>{function xu(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=o,r.enabled=a,r.humanize=Ji(),r.destroy=u,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let m=0;for(let b=0;b<d.length;b++)m=(m<<5)-m+d.charCodeAt(b),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=e;function r(d){let m,b=null,w,h;function v(..._){if(!v.enabled)return;let S=v,R=Number(new Date),N=R-(m||R);S.diff=N,S.prev=m,S.curr=R,m=R,_[0]=r.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let z=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(te,ye)=>{if(te==="%%")return"%";z++;let je=r.formatters[ye];if(typeof je=="function"){let vr=_[z];te=je.call(S,vr),_.splice(z,1),z--}return te}),r.formatArgs.call(S,_),(S.log||r.log).apply(S,_)}return v.namespace=d,v.useColors=r.useColors(),v.color=r.selectColor(d),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(w!==r.namespaces&&(w=r.namespaces,h=r.enabled(d)),h),set:_=>{b=_}}),typeof r.init=="function"&&r.init(v),v}function n(d,m){let b=r(this.namespace+(typeof m=="undefined"?":":m)+d);return b.log=this.log,b}function o(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let m=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let b of m)b[0]==="-"?r.skips.push(b.slice(1)):r.names.push(b)}function i(d,m){let b=0,w=0,h=-1,v=0;for(;b<d.length;)if(w<m.length&&(m[w]===d[b]||m[w]==="*"))m[w]==="*"?(h=w,v=b,w++):(b++,w++);else if(h!==-1)w=h+1,v++,b=v;else return!1;for(;w<m.length&&m[w]==="*";)w++;return w===m.length}function s(){let d=[...r.names,...r.skips.map(m=>"-"+m)].join(",");return r.enable(""),d}function a(d){for(let m of r.skips)if(i(d,m))return!1;for(let m of r.names)if(i(d,m))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ki.exports=xu});var Yi=x((G,Mr)=>{G.formatArgs=Cu;G.save=Tu;G.load=Su;G.useColors=wu;G.storage=Iu();G.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();G.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function wu(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Cu(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Mr.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}G.log=console.debug||console.log||(()=>{});function Tu(t){try{t?G.storage.setItem("debug",t):G.storage.removeItem("debug")}catch{}}function Su(){let t;try{t=G.storage.getItem("debug")||G.storage.getItem("DEBUG")}catch{}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function Iu(){try{return localStorage}catch{}}Mr.exports=Gi()(G);var{formatters:Au}=Mr.exports;Au.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var er=x(Ue=>{"use strict";var Ou=Ue&&Ue.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.Logger=void 0;Ue.debug=Ru;var Eu=Ou(Yi()),Pu=["info","warn","error","debug"],Fr=class{constructor(e=""){this.loggers={},this.initializeLoggers(e)}initializeLoggers(e){for(let r of Pu){let n=(0,Eu.default)(`${e}:${r}`);n.color=this.getPlatformColor(r),this.loggers[r]=n}}getPlatformColor(e){return{node:{info:"2",warn:"3",error:"1",debug:"4"},browser:{info:"#33CC99",warn:"#CCCC33",error:"#CC3366",debug:"#0066FF"}}[typeof window!="undefined"?"browser":"node"][e]}info(e,...r){this.loggers.info(e,...r)}warn(e,...r){this.loggers.warn(e,...r)}error(e,...r){this.loggers.error(e,...r)}debug(e,...r){this.loggers.debug(e,...r)}};Ue.Logger=Fr;function Ru(t){return new Fr(t)}});var rr=x(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getParsedType=Z.ZodParsedType=Z.objectUtil=Z.util=void 0;var Qn;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let i={};for(let s of o)i[s]=s;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),s={};for(let a of i)s[a]=o[a];return t.objectValues(s)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.push(s);return i},t.find=(o,i)=>{for(let s of o)if(i(s))return s},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(Qn||(Z.util=Qn={}));var ts;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ts||(Z.objectUtil=ts={}));Z.ZodParsedType=Qn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var Uu=t=>{switch(typeof t){case"undefined":return Z.ZodParsedType.undefined;case"string":return Z.ZodParsedType.string;case"number":return Number.isNaN(t)?Z.ZodParsedType.nan:Z.ZodParsedType.number;case"boolean":return Z.ZodParsedType.boolean;case"function":return Z.ZodParsedType.function;case"bigint":return Z.ZodParsedType.bigint;case"symbol":return Z.ZodParsedType.symbol;case"object":return Array.isArray(t)?Z.ZodParsedType.array:t===null?Z.ZodParsedType.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Z.ZodParsedType.promise:typeof Map!="undefined"&&t instanceof Map?Z.ZodParsedType.map:typeof Set!="undefined"&&t instanceof Set?Z.ZodParsedType.set:typeof Date!="undefined"&&t instanceof Date?Z.ZodParsedType.date:Z.ZodParsedType.object;default:return Z.ZodParsedType.unknown}};Z.getParsedType=Uu});var Br=x(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.ZodError=Te.quotelessJson=Te.ZodIssueCode=void 0;var rs=rr();Te.ZodIssueCode=rs.util.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"]);var Nu=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");Te.quotelessJson=Nu;var nr=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(i){return i.message},n={_errors:[]},o=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(o);else if(s.code==="invalid_return_type")o(s.returnTypeError);else if(s.code==="invalid_arguments")o(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,rs.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Te.ZodError=nr;nr.create=t=>new nr(t)});var to=x(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});var $=Br(),Ne=rr(),Du=(t,e)=>{let r;switch(t.code){case $.ZodIssueCode.invalid_type:t.received===Ne.ZodParsedType.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case $.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ne.util.jsonStringifyReplacer)}`;break;case $.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ne.util.joinValues(t.keys,", ")}`;break;case $.ZodIssueCode.invalid_union:r="Invalid input";break;case $.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ne.util.joinValues(t.options)}`;break;case $.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${Ne.util.joinValues(t.options)}, received '${t.received}'`;break;case $.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case $.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case $.ZodIssueCode.invalid_date:r="Invalid date";break;case $.ZodIssueCode.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ne.util.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case $.ZodIssueCode.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case $.ZodIssueCode.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case $.ZodIssueCode.custom:r="Invalid input";break;case $.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case $.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case $.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ne.util.assertNever(t)}return{message:r}};eo.default=Du});var Hr=x(Se=>{"use strict";var Lu=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.defaultErrorMap=void 0;Se.setErrorMap=Mu;Se.getErrorMap=Fu;var ns=Lu(to());Se.defaultErrorMap=ns.default;var os=ns.default;function Mu(t){os=t}function Fu(){return os}});var no=x(k=>{"use strict";var zu=k&&k.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(k,"__esModule",{value:!0});k.isAsync=k.isValid=k.isDirty=k.isAborted=k.OK=k.DIRTY=k.INVALID=k.ParseStatus=k.EMPTY_PATH=k.makeIssue=void 0;k.addIssueToContext=$u;var qu=Hr(),is=zu(to()),Vu=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,i=[...r,...o.path||[]],s={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...o,path:i,message:a}};k.makeIssue=Vu;k.EMPTY_PATH=[];function $u(t,e){let r=(0,qu.getErrorMap)(),n=(0,k.makeIssue)({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===is.default?void 0:is.default].filter(o=>!!o)});t.common.issues.push(n)}var ro=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return k.INVALID;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let i=await o.key,s=await o.value;n.push({key:i,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:i,value:s}=o;if(i.status==="aborted"||s.status==="aborted")return k.INVALID;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||o.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}};k.ParseStatus=ro;k.INVALID=Object.freeze({status:"aborted"});var Bu=t=>({status:"dirty",value:t});k.DIRTY=Bu;var Hu=t=>({status:"valid",value:t});k.OK=Hu;var Wu=t=>t.status==="aborted";k.isAborted=Wu;var Ju=t=>t.status==="dirty";k.isDirty=Ju;var Ku=t=>t.status==="valid";k.isValid=Ku;var Gu=t=>typeof Promise!="undefined"&&t instanceof Promise;k.isAsync=Gu});var as=x(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0})});var us=x(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.errorUtil=void 0;var cs;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(cs||(Wr.errorUtil=cs={}))});var xs=x(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.discriminatedUnion=l.date=l.boolean=l.bigint=l.array=l.any=l.coerce=l.ZodFirstPartyTypeKind=l.late=l.ZodSchema=l.Schema=l.ZodReadonly=l.ZodPipeline=l.ZodBranded=l.BRAND=l.ZodNaN=l.ZodCatch=l.ZodDefault=l.ZodNullable=l.ZodOptional=l.ZodTransformer=l.ZodEffects=l.ZodPromise=l.ZodNativeEnum=l.ZodEnum=l.ZodLiteral=l.ZodLazy=l.ZodFunction=l.ZodSet=l.ZodMap=l.ZodRecord=l.ZodTuple=l.ZodIntersection=l.ZodDiscriminatedUnion=l.ZodUnion=l.ZodObject=l.ZodArray=l.ZodVoid=l.ZodNever=l.ZodUnknown=l.ZodAny=l.ZodNull=l.ZodUndefined=l.ZodSymbol=l.ZodDate=l.ZodBoolean=l.ZodBigInt=l.ZodNumber=l.ZodString=l.ZodType=void 0;l.NEVER=l.void=l.unknown=l.union=l.undefined=l.tuple=l.transformer=l.symbol=l.string=l.strictObject=l.set=l.record=l.promise=l.preprocess=l.pipeline=l.ostring=l.optional=l.onumber=l.oboolean=l.object=l.number=l.nullable=l.null=l.never=l.nativeEnum=l.nan=l.map=l.literal=l.lazy=l.intersection=l.instanceof=l.function=l.enum=l.effect=void 0;l.datetimeRegex=ms;l.custom=ys;var y=Br(),Jr=Hr(),C=us(),f=no(),g=rr(),ne=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}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}},ds=(t,e)=>{if((0,f.isValid)(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new y.ZodError(t.common.issues);return this._error=r,this._error}}};function E(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(s,a)=>{var u,d;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c!=null?c:a.defaultError}:typeof a.data=="undefined"?{message:(u=c!=null?c:n)!=null?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(d=c!=null?c:r)!=null?d:a.defaultError}},description:o}}var P=class{get description(){return this._def.description}_getType(e){return(0,g.getParsedType)(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:(0,g.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new f.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,g.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if((0,f.isAsync)(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!=null?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)},o=this._parseSync({data:e,path:n.path,parent:n});return ds(n,o)}"~validate"(e){var n,o;let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return(0,f.isValid)(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(o=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>(0,f.isValid)(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,g.getParsedType)(e)},o=this._parse({data:e,path:n.path,parent:n}),i=await((0,f.isAsync)(o)?o:Promise.resolve(o));return ds(n,i)}refine(e,r){let n=o=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let s=e(o),a=()=>i.addIssue({code:y.ZodIssueCode.custom,...n(o)});return typeof Promise!="undefined"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new ee({schema:this,typeName:I.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:r=>this["~validate"](r)}}optional(){return re.create(this,this._def)}nullable(){return pe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return be.create(this)}promise(){return Oe.create(this,this._def)}or(e){return Ve.create([this,e],this._def)}and(e){return $e.create(this,e,this._def)}transform(e){return new ee({...E(this._def),schema:this,typeName:I.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ke({...E(this._def),innerType:this,defaultValue:r,typeName:I.ZodDefault})}brand(){return new or({typeName:I.ZodBranded,type:this,...E(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ge({...E(this._def),innerType:this,catchValue:r,typeName:I.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ir.create(this,e)}readonly(){return Ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};l.ZodType=P;l.Schema=P;l.ZodSchema=P;var Yu=/^c[^\s-]{8,}$/i,Xu=/^[0-9a-z]+$/,Qu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ed=/^[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,td=/^[a-z0-9_-]{21}$/i,rd=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,nd=/^[-+]?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)?)??$/,od=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,id="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",oo,sd=/^(?:(?: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])$/,ad=/^(?:(?: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])$/,cd=/^(([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]))$/,ud=/^(([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])$/,dd=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ld=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,fs="((\\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])))",fd=new RegExp(`^${fs}$`);function ps(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function pd(t){return new RegExp(`^${ps(t)}$`)}function ms(t){let e=`${fs}T${ps(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function md(t,e){return!!((e==="v4"||!e)&&sd.test(t)||(e==="v6"||!e)&&cd.test(t))}function hd(t,e){if(!rd.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function yd(t,e){return!!((e==="v4"||!e)&&ad.test(t)||(e==="v6"||!e)&&ud.test(t))}var Ie=class t extends P{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.ZodParsedType.string){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.string,received:i.parsedType}),f.INVALID}let n=new f.ParseStatus,o;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,a=e.data.length<i.value;(s||a)&&(o=this._getOrReturnCtx(e,o),s?(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")od.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"email",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")oo||(oo=new RegExp(id,"u")),oo.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"emoji",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ed.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"uuid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")td.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"nanoid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Yu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cuid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Xu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cuid2",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Qu.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"ulid",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"url",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"regex",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?ms(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?fd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?pd(i).test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?nd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"duration",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?md(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"ip",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?hd(e.data,i.alg)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"jwt",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?yd(e.data,i.version)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"cidr",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?dd.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"base64",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?ld.test(e.data)||(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{validation:"base64url",code:y.ZodIssueCode.invalid_string,message:i.message}),n.dirty()):g.util.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:y.ZodIssueCode.invalid_string,...C.errorUtil.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errorUtil.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!=null?r:!1,local:(n=e==null?void 0:e.local)!=null?n:!1,...C.errorUtil.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,...C.errorUtil.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...C.errorUtil.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...C.errorUtil.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...C.errorUtil.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...C.errorUtil.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...C.errorUtil.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...C.errorUtil.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...C.errorUtil.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...C.errorUtil.errToObj(r)})}nonempty(e){return this.min(1,C.errorUtil.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l.ZodString=Ie;Ie.create=t=>{var e;return new Ie({checks:[],typeName:I.ZodString,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...E(t)})};function gd(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return i%s/10**o}var De=class t extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.ZodParsedType.number){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.number,received:i.parsedType}),f.INVALID}let n,o=new f.ParseStatus;for(let i of this._def.checks)i.kind==="int"?g.util.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?gd(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_finite,message:i.message}),o.dirty()):g.util.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.errorUtil.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.errorUtil.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&g.util.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};l.ZodNumber=De;De.create=t=>new De({checks:[],typeName:I.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...E(t)});var Le=class t extends P{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.ZodParsedType.bigint)return this._getInvalidInput(e);let n,o=new f.ParseStatus;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):g.util.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.bigint,received:r.parsedType}),f.INVALID}gte(e,r){return this.setLimit("min",e,!0,C.errorUtil.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.errorUtil.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.errorUtil.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.errorUtil.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.errorUtil.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.errorUtil.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.errorUtil.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l.ZodBigInt=Le;Le.create=t=>{var e;return new Le({checks:[],typeName:I.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!=null?e:!1,...E(t)})};var Me=class extends P{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.ZodParsedType.boolean){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.boolean,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodBoolean=Me;Me.create=t=>new Me({typeName:I.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...E(t)});var Fe=class t extends P{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.ZodParsedType.date){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.date,received:i.parsedType}),f.INVALID}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(i,{code:y.ZodIssueCode.invalid_date}),f.INVALID}let n=new f.ParseStatus,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(o=this._getOrReturnCtx(e,o),(0,f.addIssueToContext)(o,{code:y.ZodIssueCode.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):g.util.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.errorUtil.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.errorUtil.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};l.ZodDate=Fe;Fe.create=t=>new Fe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:I.ZodDate,...E(t)});var ht=class extends P{_parse(e){if(this._getType(e)!==g.ZodParsedType.symbol){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.symbol,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodSymbol=ht;ht.create=t=>new ht({typeName:I.ZodSymbol,...E(t)});var ze=class extends P{_parse(e){if(this._getType(e)!==g.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.undefined,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodUndefined=ze;ze.create=t=>new ze({typeName:I.ZodUndefined,...E(t)});var qe=class extends P{_parse(e){if(this._getType(e)!==g.ZodParsedType.null){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.null,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodNull=qe;qe.create=t=>new qe({typeName:I.ZodNull,...E(t)});var Ae=class extends P{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,f.OK)(e.data)}};l.ZodAny=Ae;Ae.create=t=>new Ae({typeName:I.ZodAny,...E(t)});var ve=class extends P{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,f.OK)(e.data)}};l.ZodUnknown=ve;ve.create=t=>new ve({typeName:I.ZodUnknown,...E(t)});var ce=class extends P{_parse(e){let r=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.never,received:r.parsedType}),f.INVALID}};l.ZodNever=ce;ce.create=t=>new ce({typeName:I.ZodNever,...E(t)});var yt=class extends P{_parse(e){if(this._getType(e)!==g.ZodParsedType.undefined){let n=this._getOrReturnCtx(e);return(0,f.addIssueToContext)(n,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.void,received:n.parsedType}),f.INVALID}return(0,f.OK)(e.data)}};l.ZodVoid=yt;yt.create=t=>new yt({typeName:I.ZodVoid,...E(t)});var be=class t extends P{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==g.ZodParsedType.array)return(0,f.addIssueToContext)(r,{code:y.ZodIssueCode.invalid_type,expected:g.ZodParsedType.array,received:r.parsedType}),f.INVALID;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&((0,f.addIssueToContext)(r,{code:s?y.ZodIssueCode.too_big:y.ZodIssueCode.too_small,minimum:a?o.exactLength.value:void 0,maximum:s?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&((0,f.addIssueToContext)(r,{code:y.ZodIssueCode.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>o.type._parseAsync(new ne(r,s,r.path,a)))).then(s=>f.ParseStatus.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new ne(r,s,r.path,a)));return f.ParseStatus.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:C.errorUtil.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:C.errorUtil.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:C.errorUtil.toString(r)}})}nonempty(e){return this.min(1,e)}};l.ZodArray=be;be.create=(t,e)=>new be({type:t,minLength:null,maxLength:null,exactLength:null,typeName:I.ZodArray,...E(e)});function mt(t){if(t instanceof Y){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=re.create(mt(n))}return ne