@openclaw/discord 2026.9.35 → 2026.9.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
var gl=Object.defineProperty;var pa=(e,t)=>{for(var n in t)gl(e,n,{get:t[n],enumerable:!0})};var Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vr={exports:{}};var fa;function da(){return fa?vr.exports:(fa=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(h,f,p){this.fn=h,this.context=f,this.once=p||!1}function a(h,f,p,g,A){if(typeof p!="function")throw new TypeError("The listener must be a function");var U=new i(p,g||h,A),Y=n?n+f:f;return h._events[Y]?h._events[Y].fn?h._events[Y]=[h._events[Y],U]:h._events[Y].push(U):(h._events[Y]=U,h._eventsCount++),h}function c(h,f){--h._eventsCount===0?h._events=new r:delete h._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,g;if(this._eventsCount===0)return f;for(g in p=this._events)t.call(p,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=n?n+f:f,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var A=0,U=g.length,Y=new Array(U);A<U;A++)Y[A]=g[A].fn;return Y},u.prototype.listenerCount=function(f){var p=n?n+f:f,g=this._events[p];return g?g.fn?1:g.length:0},u.prototype.emit=function(f,p,g,A,U,Y){var j=n?n+f:f;if(!this._events[j])return!1;var L=this._events[j],_e=arguments.length,ae,se;if(L.fn){switch(L.once&&this.removeListener(f,L.fn,void 0,!0),_e){case 1:return L.fn.call(L.context),!0;case 2:return L.fn.call(L.context,p),!0;case 3:return L.fn.call(L.context,p,g),!0;case 4:return L.fn.call(L.context,p,g,A),!0;case 5:return L.fn.call(L.context,p,g,A,U),!0;case 6:return L.fn.call(L.context,p,g,A,U,Y),!0}for(se=1,ae=new Array(_e-1);se<_e;se++)ae[se-1]=arguments[se];L.fn.apply(L.context,ae)}else{var Oe=L.length,ve;for(se=0;se<Oe;se++)switch(L[se].once&&this.removeListener(f,L[se].fn,void 0,!0),_e){case 1:L[se].fn.call(L[se].context);break;case 2:L[se].fn.call(L[se].context,p);break;case 3:L[se].fn.call(L[se].context,p,g);break;case 4:L[se].fn.call(L[se].context,p,g,A);break;default:if(!ae)for(ve=1,ae=new Array(_e-1);ve<_e;ve++)ae[ve-1]=arguments[ve];L[se].fn.apply(L[se].context,ae)}}return!0},u.prototype.on=function(f,p,g){return a(this,f,p,g,!1)},u.prototype.once=function(f,p,g){return a(this,f,p,g,!0)},u.prototype.removeListener=function(f,p,g,A){var U=n?n+f:f;if(!this._events[U])return this;if(!p)return c(this,U),this;var Y=this._events[U];if(Y.fn)Y.fn===p&&(!A||Y.once)&&(!g||Y.context===g)&&c(this,U);else{for(var j=0,L=[],_e=Y.length;j<_e;j++)(Y[j].fn!==p||A&&!Y[j].once||g&&Y[j].context!==g)&&L.push(Y[j]);L.length?this._events[U]=L.length===1?L[0]:L:c(this,U)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&c(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(vr),vr.exports)}var vl=da(),Er=ln(vl);var re;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{let a={};for(let c of i)a[c]=c;return a},e.getValidEnumValues=i=>{let a=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),c={};for(let u of a)c[u]=i[u];return e.objectValues(c)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&a.push(c);return a},e.find=(i,a)=>{for(let c of i)if(a(c))return c},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(re||(re={}));var vi;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(vi||(vi={}));var M=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),St=e=>{switch(typeof e){case"undefined":return M.undefined;case"string":return M.string;case"number":return isNaN(e)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(e)?M.array:e===null?M.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?M.promise:typeof Map<"u"&&e instanceof Map?M.map:typeof Set<"u"&&e instanceof Set?M.set:typeof Date<"u"&&e instanceof Date?M.date:M.object;default:return M.unknown}},R=re.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"]),El=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),He=class e extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let u=r,h=0;for(;h<c.path.length;){let f=c.path[h];h===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],h++}}};return i(this),r}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};He.create=e=>new He(e);var pn=(e,t)=>{let n;switch(e.code){case R.invalid_type:e.received===M.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case R.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case R.invalid_union:n="Invalid input";break;case R.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case R.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case R.invalid_arguments:n="Invalid function arguments";break;case R.invalid_return_type:n="Invalid function return type";break;case R.invalid_date:n="Invalid date";break;case R.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(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}"`:re.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case R.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case R.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case R.custom:n="Invalid input";break;case R.invalid_intersection_types:n="Intersection results could not be merged";break;case R.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case R.not_finite:n="Number must be finite";break;default:n=t.defaultError,re.assertNever(e)}return{message:n}},_a=pn;function yl(e){_a=e}function yr(){return _a}var Tr=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],c={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let u="",h=r.filter(f=>!!f).slice().reverse();for(let f of h)u=f(c,{data:t,defaultError:u}).message;return{...i,path:a,message:u}},Tl=[];function P(e,t){let n=yr(),r=Tr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===pn?void 0:pn].filter(i=>!!i)});e.common.issues.push(r)}var we=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if(i.status==="aborted")return K;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n){let a=await i.key,c=await i.value;r.push({key:a,value:c})}return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:a,value:c}=i;if(a.status==="aborted"||c.status==="aborted")return K;a.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(r[a.value]=c.value)}return{status:t.value,value:r}}},K=Object.freeze({status:"aborted"}),cn=e=>({status:"dirty",value:e}),Ue=e=>({status:"valid",value:e}),Ei=e=>e.status==="aborted",yi=e=>e.status==="dirty",Pn=e=>e.status==="valid",Mn=e=>typeof Promise<"u"&&e instanceof Promise;function Sr(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function ga(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var H;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(H||(H={}));var Ln,Un,Ye=class{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ma=(e,t)=>{if(Pn(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;let n=new He(e.common.issues);return this._error=n,this._error}}};function z(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(c,u)=>{var h,f;let{message:p}=e;return c.code==="invalid_enum_value"?{message:p??u.defaultError}:typeof u.data>"u"?{message:(h=p??r)!==null&&h!==void 0?h:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=p??n)!==null&&f!==void 0?f:u.defaultError}},description:i}}var W=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,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)}get description(){return this._def.description}_getType(t){return St(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:St(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new we,ctx:{common:t.parent.common,data:t.data,parsedType:St(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Mn(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:St(t)},a=this._parseSync({data:t,path:i.path,parent:i});return ma(i,a)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:St(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(Mn(i)?i:Promise.resolve(i));return ma(r,a)}refine(t,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{let c=t(i),u=()=>a.addIssue({code:R.custom,...r(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Ve({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ke.create(this,this._def)}nullable(){return tt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _t.create(this,this._def)}promise(){return It.create(this,this._def)}or(t){return Zt.create([this,t],this._def)}and(t){return Ct.create(this,t,this._def)}transform(t){return new Ve({...z(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new zt({...z(this._def),innerType:this,defaultValue:n,typeName:C.ZodDefault})}brand(){return new kn({typeName:C.ZodBranded,type:this,...z(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Wt({...z(this._def),innerType:this,catchValue:n,typeName:C.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Gn.create(this,t)}readonly(){return Qt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Sl=/^c[^\s-]{8,}$/i,bl=/^[0-9a-z]+$/,Al=/^[0-9A-HJKMNP-TV-Z]{26}$/,Il=/^[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,Nl=/^[a-z0-9_-]{21}$/i,wl=/^[-+]?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)?)??$/,Rl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ol="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",gi,xl=/^(?:(?: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])$/,Dl=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ll=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,va="((\\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])))",Ul=new RegExp(`^${va}$`);function Ea(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Pl(e){return new RegExp(`^${Ea(e)}$`)}function ya(e){let t=`${va}T${Ea(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ml(e,t){return!!((t==="v4"||!t)&&xl.test(e)||(t==="v6"||!t)&&Dl.test(e))}var bt=class e extends W{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M.string){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.string,received:a.parsedType}),K}let r=new we,i;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let c=t.data.length>a.value,u=t.data.length<a.value;(c||u)&&(i=this._getOrReturnCtx(t,i),c?P(i,{code:R.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):u&&P(i,{code:R.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Rl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"email",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")gi||(gi=new RegExp(Ol,"u")),gi.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"emoji",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Il.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"uuid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")Nl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"nanoid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Sl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"cuid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")bl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"cuid2",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Al.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"ulid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),P(i,{validation:"url",code:R.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"regex",code:R.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?ya(a).test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Ul.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Pl(a).test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?wl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"duration",code:R.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Ml(t.data,a.version)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"ip",code:R.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Ll.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"base64",code:R.invalid_string,message:a.message}),r.dirty()):re.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:R.invalid_string,...H.errToObj(r)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...H.errToObj(t)})}url(t){return this._addCheck({kind:"url",...H.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...H.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...H.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...H.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...H.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...H.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...H.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...H.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...H.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...H.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...H.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...H.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...H.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...H.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...H.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...H.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...H.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...H.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...H.errToObj(n)})}nonempty(t){return this.min(1,H.errToObj(t))}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(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};bt.create=e=>{var t;return new bt({checks:[],typeName:C.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...z(e)})};function kl(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=parseInt(e.toFixed(i).replace(".","")),c=parseInt(t.toFixed(i).replace(".",""));return a%c/Math.pow(10,i)}var Bt=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==M.number){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.number,received:a.parsedType}),K}let r,i=new we;for(let a of this._def.checks)a.kind==="int"?re.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),P(r,{code:R.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?kl(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),P(r,{code:R.not_finite,message:a.message}),i.dirty()):re.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:H.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:H.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&re.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Bt.create=e=>new Bt({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...z(e)});var Ht=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==M.bigint){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.bigint,received:a.parsedType}),K}let r,i=new we;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):re.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Ht.create=e=>{var t;return new Ht({checks:[],typeName:C.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...z(e)})};var Vt=class extends W{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M.boolean){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.boolean,received:r.parsedType}),K}return Ue(t.data)}};Vt.create=e=>new Vt({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...z(e)});var jt=class e extends W{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M.date){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.date,received:a.parsedType}),K}if(isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_date}),K}let r=new we,i;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):re.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:H.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:H.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};jt.create=e=>new jt({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...z(e)});var fn=class extends W{_parse(t){if(this._getType(t)!==M.symbol){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.symbol,received:r.parsedType}),K}return Ue(t.data)}};fn.create=e=>new fn({typeName:C.ZodSymbol,...z(e)});var Ft=class extends W{_parse(t){if(this._getType(t)!==M.undefined){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.undefined,received:r.parsedType}),K}return Ue(t.data)}};Ft.create=e=>new Ft({typeName:C.ZodUndefined,...z(e)});var qt=class extends W{_parse(t){if(this._getType(t)!==M.null){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.null,received:r.parsedType}),K}return Ue(t.data)}};qt.create=e=>new qt({typeName:C.ZodNull,...z(e)});var At=class extends W{constructor(){super(...arguments),this._any=!0}_parse(t){return Ue(t.data)}};At.create=e=>new At({typeName:C.ZodAny,...z(e)});var ht=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ue(t.data)}};ht.create=e=>new ht({typeName:C.ZodUnknown,...z(e)});var Qe=class extends W{_parse(t){let n=this._getOrReturnCtx(t);return P(n,{code:R.invalid_type,expected:M.never,received:n.parsedType}),K}};Qe.create=e=>new Qe({typeName:C.ZodNever,...z(e)});var dn=class extends W{_parse(t){if(this._getType(t)!==M.undefined){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.void,received:r.parsedType}),K}return Ue(t.data)}};dn.create=e=>new dn({typeName:C.ZodVoid,...z(e)});var _t=class e extends W{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==M.array)return P(n,{code:R.invalid_type,expected:M.array,received:n.parsedType}),K;if(i.exactLength!==null){let c=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;(c||u)&&(P(n,{code:c?R.too_big:R.too_small,minimum:u?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(P(n,{code:R.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(P(n,{code:R.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,u)=>i.type._parseAsync(new Ye(n,c,n.path,u)))).then(c=>we.mergeArray(r,c));let a=[...n.data].map((c,u)=>i.type._parseSync(new Ye(n,c,n.path,u)));return we.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:H.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:H.toString(n)}})}nonempty(t){return this.min(1,t)}};_t.create=(e,t)=>new _t({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...z(t)});function un(e){if(e instanceof ke){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ke.create(un(r))}return new ke({...e._def,shape:()=>t})}else return e instanceof _t?new _t({...e._def,type:un(e.element)}):e instanceof Ke?Ke.create(un(e.unwrap())):e instanceof tt?tt.create(un(e.unwrap())):e instanceof et?et.create(e.items.map(t=>un(t))):e}var ke=class e extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=re.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==M.object){let f=this._getOrReturnCtx(t);return P(f,{code:R.invalid_type,expected:M.object,received:f.parsedType}),K}let{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Qe&&this._def.unknownKeys==="strip"))for(let f in i.data)c.includes(f)||u.push(f);let h=[];for(let f of c){let p=a[f],g=i.data[f];h.push({key:{status:"valid",value:f},value:p._parse(new Ye(i,g,i.path,f)),alwaysSet:f in i.data})}if(this._def.catchall instanceof Qe){let f=this._def.unknownKeys;if(f==="passthrough")for(let p of u)h.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(f==="strict")u.length>0&&(P(i,{code:R.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let p of u){let g=i.data[p];h.push({key:{status:"valid",value:p},value:f._parse(new Ye(i,g,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let f=[];for(let p of h){let g=await p.key,A=await p.value;f.push({key:g,value:A,alwaysSet:p.alwaysSet})}return f}).then(f=>we.mergeObjectSync(r,f)):we.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(t){return H.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,a,c,u;let h=(c=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,n,r).message)!==null&&c!==void 0?c:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=H.errToObj(t).message)!==null&&u!==void 0?u:h}:{message:h}}}:{}})}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:C.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return re.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return re.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return un(this)}partial(t){let n={};return re.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return re.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Ke;)a=a._def.innerType;n[r]=a}}),new e({...this._def,shape:()=>n})}keyof(){return Ta(re.objectKeys(this.shape))}};ke.create=(e,t)=>new ke({shape:()=>e,unknownKeys:"strip",catchall:Qe.create(),typeName:C.ZodObject,...z(t)});ke.strictCreate=(e,t)=>new ke({shape:()=>e,unknownKeys:"strict",catchall:Qe.create(),typeName:C.ZodObject,...z(t)});ke.lazycreate=(e,t)=>new ke({shape:e,unknownKeys:"strip",catchall:Qe.create(),typeName:C.ZodObject,...z(t)});var Zt=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(let u of a)if(u.result.status==="valid")return u.result;for(let u of a)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let c=a.map(u=>new He(u.ctx.common.issues));return P(n,{code:R.invalid_union,unionErrors:c}),K}if(n.common.async)return Promise.all(r.map(async a=>{let c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let a,c=[];for(let h of r){let f={...n,common:{...n.common,issues:[]},parent:null},p=h._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let u=c.map(h=>new He(h));return P(n,{code:R.invalid_union,unionErrors:u}),K}}get options(){return this._def.options}};Zt.create=(e,t)=>new Zt({options:e,typeName:C.ZodUnion,...z(t)});var mt=e=>e instanceof Kt?mt(e.schema):e instanceof Ve?mt(e.innerType()):e instanceof Yt?[e.value]:e instanceof $t?e.options:e instanceof Xt?re.objectValues(e.enum):e instanceof zt?mt(e._def.innerType):e instanceof Ft?[void 0]:e instanceof qt?[null]:e instanceof Ke?[void 0,...mt(e.unwrap())]:e instanceof tt?[null,...mt(e.unwrap())]:e instanceof kn||e instanceof Qt?mt(e.unwrap()):e instanceof Wt?mt(e._def.innerType):[],br=class e extends W{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==M.object)return P(n,{code:R.invalid_type,expected:M.object,received:n.parsedType}),K;let r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(P(n,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),K)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let a of n){let c=mt(a.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of c){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,a)}}return new e({typeName:C.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...z(r)})}};function Ti(e,t){let n=St(e),r=St(t);if(e===t)return{valid:!0,data:e};if(n===M.object&&r===M.object){let i=re.objectKeys(t),a=re.objectKeys(e).filter(u=>i.indexOf(u)!==-1),c={...e,...t};for(let u of a){let h=Ti(e[u],t[u]);if(!h.valid)return{valid:!1};c[u]=h.data}return{valid:!0,data:c}}else if(n===M.array&&r===M.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let a=0;a<e.length;a++){let c=e[a],u=t[a],h=Ti(c,u);if(!h.valid)return{valid:!1};i.push(h.data)}return{valid:!0,data:i}}else return n===M.date&&r===M.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ct=class extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(a,c)=>{if(Ei(a)||Ei(c))return K;let u=Ti(a.value,c.value);return u.valid?((yi(a)||yi(c))&&n.dirty(),{status:n.value,value:u.data}):(P(r,{code:R.invalid_intersection_types}),K)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,c])=>i(a,c)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Ct.create=(e,t,n)=>new Ct({left:e,right:t,typeName:C.ZodIntersection,...z(n)});var et=class e extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.array)return P(r,{code:R.invalid_type,expected:M.array,received:r.parsedType}),K;if(r.data.length<this._def.items.length)return P(r,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),K;!this._def.rest&&r.data.length>this._def.items.length&&(P(r,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...r.data].map((c,u)=>{let h=this._def.items[u]||this._def.rest;return h?h._parse(new Ye(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(a).then(c=>we.mergeArray(n,c)):we.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};et.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new et({items:e,typeName:C.ZodTuple,rest:null,...z(t)})};var Ar=class e extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.object)return P(r,{code:R.invalid_type,expected:M.object,received:r.parsedType}),K;let i=[],a=this._def.keyType,c=this._def.valueType;for(let u in r.data)i.push({key:a._parse(new Ye(r,u,r.path,u)),value:c._parse(new Ye(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?we.mergeObjectAsync(n,i):we.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof W?new e({keyType:t,valueType:n,typeName:C.ZodRecord,...z(r)}):new e({keyType:bt.create(),valueType:t,typeName:C.ZodRecord,...z(n)})}},mn=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.map)return P(r,{code:R.invalid_type,expected:M.map,received:r.parsedType}),K;let i=this._def.keyType,a=this._def.valueType,c=[...r.data.entries()].map(([u,h],f)=>({key:i._parse(new Ye(r,u,r.path,[f,"key"])),value:a._parse(new Ye(r,h,r.path,[f,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let h of c){let f=await h.key,p=await h.value;if(f.status==="aborted"||p.status==="aborted")return K;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let h of c){let f=h.key,p=h.value;if(f.status==="aborted"||p.status==="aborted")return K;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}}}};mn.create=(e,t,n)=>new mn({valueType:t,keyType:e,typeName:C.ZodMap,...z(n)});var hn=class e extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.set)return P(r,{code:R.invalid_type,expected:M.set,received:r.parsedType}),K;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(P(r,{code:R.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(P(r,{code:R.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let a=this._def.valueType;function c(h){let f=new Set;for(let p of h){if(p.status==="aborted")return K;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}let u=[...r.data.values()].map((h,f)=>a._parse(new Ye(r,h,r.path,f)));return r.common.async?Promise.all(u).then(h=>c(h)):c(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:H.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};hn.create=(e,t)=>new hn({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...z(t)});var Ir=class e extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==M.function)return P(n,{code:R.invalid_type,expected:M.function,received:n.parsedType}),K;function r(u,h){return Tr({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yr(),pn].filter(f=>!!f),issueData:{code:R.invalid_arguments,argumentsError:h}})}function i(u,h){return Tr({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yr(),pn].filter(f=>!!f),issueData:{code:R.invalid_return_type,returnTypeError:h}})}let a={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof It){let u=this;return Ue(async function(...h){let f=new He([]),p=await u._def.args.parseAsync(h,a).catch(U=>{throw f.addIssue(r(h,U)),f}),g=await Reflect.apply(c,this,p);return await u._def.returns._def.type.parseAsync(g,a).catch(U=>{throw f.addIssue(i(g,U)),f})})}else{let u=this;return Ue(function(...h){let f=u._def.args.safeParse(h,a);if(!f.success)throw new He([r(h,f.error)]);let p=Reflect.apply(c,this,f.data),g=u._def.returns.safeParse(p,a);if(!g.success)throw new He([i(p,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:et.create(t).rest(ht.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||et.create([]).rest(ht.create()),returns:n||ht.create(),typeName:C.ZodFunction,...z(r)})}},Kt=class extends W{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Kt.create=(e,t)=>new Kt({getter:e,typeName:C.ZodLazy,...z(t)});var Yt=class extends W{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return P(n,{received:n.data,code:R.invalid_literal,expected:this._def.value}),K}return{status:"valid",value:t.data}}get value(){return this._def.value}};Yt.create=(e,t)=>new Yt({value:e,typeName:C.ZodLiteral,...z(t)});function Ta(e,t){return new $t({values:e,typeName:C.ZodEnum,...z(t)})}var $t=class e extends W{constructor(){super(...arguments),Ln.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return P(n,{expected:re.joinValues(r),received:n.parsedType,code:R.invalid_type}),K}if(Sr(this,Ln)||ga(this,Ln,new Set(this._def.values)),!Sr(this,Ln).has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return P(n,{received:n.data,code:R.invalid_enum_value,options:r}),K}return Ue(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};Ln=new WeakMap;$t.create=Ta;var Xt=class extends W{constructor(){super(...arguments),Un.set(this,void 0)}_parse(t){let n=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==M.string&&r.parsedType!==M.number){let i=re.objectValues(n);return P(r,{expected:re.joinValues(i),received:r.parsedType,code:R.invalid_type}),K}if(Sr(this,Un)||ga(this,Un,new Set(re.getValidEnumValues(this._def.values))),!Sr(this,Un).has(t.data)){let i=re.objectValues(n);return P(r,{received:r.data,code:R.invalid_enum_value,options:i}),K}return Ue(t.data)}get enum(){return this._def.values}};Un=new WeakMap;Xt.create=(e,t)=>new Xt({values:e,typeName:C.ZodNativeEnum,...z(t)});var It=class extends W{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==M.promise&&n.common.async===!1)return P(n,{code:R.invalid_type,expected:M.promise,received:n.parsedType}),K;let r=n.parsedType===M.promise?n.data:Promise.resolve(n.data);return Ue(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};It.create=(e,t)=>new It({type:e,typeName:C.ZodPromise,...z(t)});var Ve=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:c=>{P(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let c=i.transform(r.data,a);if(r.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return K;let h=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return h.status==="aborted"?K:h.status==="dirty"||n.value==="dirty"?cn(h.value):h});{if(n.value==="aborted")return K;let u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?K:u.status==="dirty"||n.value==="dirty"?cn(u.value):u}}if(i.type==="refinement"){let c=u=>{let h=i.refinement(u,a);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){let u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?K:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?K:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Pn(c))return c;let u=i.transform(c.value,a);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>Pn(c)?Promise.resolve(i.transform(c.value,a)).then(u=>({status:n.value,value:u})):c);re.assertNever(i)}};Ve.create=(e,t,n)=>new Ve({schema:e,typeName:C.ZodEffects,effect:t,...z(n)});Ve.createWithPreprocess=(e,t,n)=>new Ve({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...z(n)});var Ke=class extends W{_parse(t){return this._getType(t)===M.undefined?Ue(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ke.create=(e,t)=>new Ke({innerType:e,typeName:C.ZodOptional,...z(t)});var tt=class extends W{_parse(t){return this._getType(t)===M.null?Ue(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};tt.create=(e,t)=>new tt({innerType:e,typeName:C.ZodNullable,...z(t)});var zt=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};zt.create=(e,t)=>new zt({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...z(t)});var Wt=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Mn(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new He(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new He(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Wt.create=(e,t)=>new Wt({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...z(t)});var _n=class extends W{_parse(t){if(this._getType(t)!==M.nan){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.nan,received:r.parsedType}),K}return{status:"valid",value:t.data}}};_n.create=e=>new _n({typeName:C.ZodNaN,...z(e)});var Gl=Symbol("zod_brand"),kn=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Gn=class e extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?K:a.status==="dirty"?(n.dirty(),cn(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?K:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:C.ZodPipeline})}},Qt=class extends W{_parse(t){let n=this._def.innerType._parse(t),r=i=>(Pn(i)&&(i.value=Object.freeze(i.value)),i);return Mn(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Qt.create=(e,t)=>new Qt({innerType:e,typeName:C.ZodReadonly,...z(t)});function Nr(e,t={},n){return e?At.create().superRefine((r,i)=>{var a,c;if(!e(r)){let u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,h=(c=(a=u.fatal)!==null&&a!==void 0?a:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...f,fatal:h})}}):At.create()}var Bl={object:ke.lazycreate},C;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(C||(C={}));var Hl=(e,t={message:`Input not instance of ${e.name}`})=>Nr(n=>n instanceof e,t),v=bt.create,G=Bt.create,Vl=_n.create,Si=Ht.create,q=Vt.create,jl=jt.create,Fl=fn.create,ql=Ft.create,gn=qt.create,Zl=At.create,Jt=ht.create,Cl=Qe.create,Kl=dn.create,ne=_t.create,O=ke.create,Yl=ke.strictCreate,Bn=Zt.create,$l=br.create,Xl=Ct.create,zl=et.create,Wl=Ar.create,Ql=mn.create,Jl=hn.create,eu=Ir.create,tu=Kt.create,pe=Yt.create,nu=$t.create,gt=Xt.create,ru=It.create,ha=Ve.create,bi=Ke.create,iu=tt.create,Ai=Ve.createWithPreprocess,au=Gn.create,su=()=>v().optional(),ou=()=>G().optional(),lu=()=>q().optional(),uu={string:(e=>bt.create({...e,coerce:!0})),number:(e=>Bt.create({...e,coerce:!0})),boolean:(e=>Vt.create({...e,coerce:!0})),bigint:(e=>Ht.create({...e,coerce:!0})),date:(e=>jt.create({...e,coerce:!0}))},cu=K,d=Object.freeze({__proto__:null,defaultErrorMap:pn,setErrorMap:yl,getErrorMap:yr,makeIssue:Tr,EMPTY_PATH:Tl,addIssueToContext:P,ParseStatus:we,INVALID:K,DIRTY:cn,OK:Ue,isAborted:Ei,isDirty:yi,isValid:Pn,isAsync:Mn,get util(){return re},get objectUtil(){return vi},ZodParsedType:M,getParsedType:St,ZodType:W,datetimeRegex:ya,ZodString:bt,ZodNumber:Bt,ZodBigInt:Ht,ZodBoolean:Vt,ZodDate:jt,ZodSymbol:fn,ZodUndefined:Ft,ZodNull:qt,ZodAny:At,ZodUnknown:ht,ZodNever:Qe,ZodVoid:dn,ZodArray:_t,ZodObject:ke,ZodUnion:Zt,ZodDiscriminatedUnion:br,ZodIntersection:Ct,ZodTuple:et,ZodRecord:Ar,ZodMap:mn,ZodSet:hn,ZodFunction:Ir,ZodLazy:Kt,ZodLiteral:Yt,ZodEnum:$t,ZodNativeEnum:Xt,ZodPromise:It,ZodEffects:Ve,ZodTransformer:Ve,ZodOptional:Ke,ZodNullable:tt,ZodDefault:zt,ZodCatch:Wt,ZodNaN:_n,BRAND:Gl,ZodBranded:kn,ZodPipeline:Gn,ZodReadonly:Qt,custom:Nr,Schema:W,ZodSchema:W,late:Bl,get ZodFirstPartyTypeKind(){return C},coerce:uu,any:Zl,array:ne,bigint:Si,boolean:q,date:jl,discriminatedUnion:$l,effect:ha,enum:nu,function:eu,instanceof:Hl,intersection:Xl,lazy:tu,literal:pe,map:Ql,nan:Vl,nativeEnum:gt,never:Cl,null:gn,nullable:iu,number:G,object:O,oboolean:lu,onumber:ou,optional:bi,ostring:su,pipeline:au,preprocess:Ai,promise:ru,record:Wl,set:Jl,strictObject:Yl,string:v,symbol:Fl,transformer:ha,tuple:zl,undefined:ql,union:Bn,unknown:Jt,void:Kl,NEVER:cu,ZodIssueCode:R,quotelessJson:El,ZodError:He});var wr={exports:{}};var Sa;function ba(){return Sa?wr.exports:(Sa=1,(function(e){var t=(function(n){var r=1e7,i=7,a=9007199254740992,c=Y(a),u="0123456789abcdefghijklmnopqrstuvwxyz",h=typeof BigInt=="function";function f(s,l,_,y){return typeof s>"u"?f[0]:typeof l<"u"?+l==10&&!_?Z(s):ir(s,l,_,y):Z(s)}function p(s,l){this.value=s,this.sign=l,this.isSmall=!1}p.prototype=Object.create(f.prototype);function g(s){this.value=s,this.sign=s<0,this.isSmall=!0}g.prototype=Object.create(f.prototype);function A(s){this.value=s}A.prototype=Object.create(f.prototype);function U(s){return-a<s&&s<a}function Y(s){return s<1e7?[s]:s<1e14?[s%1e7,Math.floor(s/1e7)]:[s%1e7,Math.floor(s/1e7)%1e7,Math.floor(s/1e14)]}function j(s){L(s);var l=s.length;if(l<4&&st(s,c)<0)switch(l){case 0:return 0;case 1:return s[0];case 2:return s[0]+s[1]*r;default:return s[0]+(s[1]+s[2]*r)*r}return s}function L(s){for(var l=s.length;s[--l]===0;);s.length=l+1}function _e(s){for(var l=new Array(s),_=-1;++_<s;)l[_]=0;return l}function ae(s){return s>0?Math.floor(s):Math.ceil(s)}function se(s,l){var _=s.length,y=l.length,S=new Array(_),T=0,I=r,N,w;for(w=0;w<y;w++)N=s[w]+l[w]+T,T=N>=I?1:0,S[w]=N-T*I;for(;w<_;)N=s[w]+T,T=N===I?1:0,S[w++]=N-T*I;return T>0&&S.push(T),S}function Oe(s,l){return s.length>=l.length?se(s,l):se(l,s)}function ve(s,l){var _=s.length,y=new Array(_),S=r,T,I;for(I=0;I<_;I++)T=s[I]-S+l,l=Math.floor(T/S),y[I]=T-l*S,l+=1;for(;l>0;)y[I++]=l%S,l=Math.floor(l/S);return y}p.prototype.add=function(s){var l=Z(s);if(this.sign!==l.sign)return this.subtract(l.negate());var _=this.value,y=l.value;return l.isSmall?new p(ve(_,Math.abs(y)),this.sign):new p(Oe(_,y),this.sign)},p.prototype.plus=p.prototype.add,g.prototype.add=function(s){var l=Z(s),_=this.value;if(_<0!==l.sign)return this.subtract(l.negate());var y=l.value;if(l.isSmall){if(U(_+y))return new g(_+y);y=Y(Math.abs(y))}return new p(ve(y,Math.abs(_)),_<0)},g.prototype.plus=g.prototype.add,A.prototype.add=function(s){return new A(this.value+Z(s).value)},A.prototype.plus=A.prototype.add;function Fe(s,l){var _=s.length,y=l.length,S=new Array(_),T=0,I=r,N,w;for(N=0;N<y;N++)w=s[N]-T-l[N],w<0?(w+=I,T=1):T=0,S[N]=w;for(N=y;N<_;N++){if(w=s[N]-T,w<0)w+=I;else{S[N++]=w;break}S[N]=w}for(;N<_;N++)S[N]=s[N];return L(S),S}function Ae(s,l,_){var y;return st(s,l)>=0?y=Fe(s,l):(y=Fe(l,s),_=!_),y=j(y),typeof y=="number"?(_&&(y=-y),new g(y)):new p(y,_)}function Be(s,l,_){var y=s.length,S=new Array(y),T=-l,I=r,N,w;for(N=0;N<y;N++)w=s[N]+T,T=Math.floor(w/I),w%=I,S[N]=w<0?w+I:w;return S=j(S),typeof S=="number"?(_&&(S=-S),new g(S)):new p(S,_)}p.prototype.subtract=function(s){var l=Z(s);if(this.sign!==l.sign)return this.add(l.negate());var _=this.value,y=l.value;return l.isSmall?Be(_,Math.abs(y),this.sign):Ae(_,y,this.sign)},p.prototype.minus=p.prototype.subtract,g.prototype.subtract=function(s){var l=Z(s),_=this.value;if(_<0!==l.sign)return this.add(l.negate());var y=l.value;return l.isSmall?new g(_-y):Be(y,Math.abs(_),_>=0)},g.prototype.minus=g.prototype.subtract,A.prototype.subtract=function(s){return new A(this.value-Z(s).value)},A.prototype.minus=A.prototype.subtract,p.prototype.negate=function(){return new p(this.value,!this.sign)},g.prototype.negate=function(){var s=this.sign,l=new g(-this.value);return l.sign=!s,l},A.prototype.negate=function(){return new A(-this.value)},p.prototype.abs=function(){return new p(this.value,!1)},g.prototype.abs=function(){return new g(Math.abs(this.value))},A.prototype.abs=function(){return new A(this.value>=0?this.value:-this.value)};function Xe(s,l){var _=s.length,y=l.length,S=_+y,T=_e(S),I=r,N,w,F,te,$;for(F=0;F<_;++F){te=s[F];for(var ie=0;ie<y;++ie)$=l[ie],N=te*$+T[F+ie],w=Math.floor(N/I),T[F+ie]=N-w*I,T[F+ie+1]+=w}return L(T),T}function qe(s,l){var _=s.length,y=new Array(_),S=r,T=0,I,N;for(N=0;N<_;N++)I=s[N]*l+T,T=Math.floor(I/S),y[N]=I-T*S;for(;T>0;)y[N++]=T%S,T=Math.floor(T/S);return y}function xe(s,l){for(var _=[];l-- >0;)_.push(0);return _.concat(s)}function ue(s,l){var _=Math.max(s.length,l.length);if(_<=30)return Xe(s,l);_=Math.ceil(_/2);var y=s.slice(_),S=s.slice(0,_),T=l.slice(_),I=l.slice(0,_),N=ue(S,I),w=ue(y,T),F=ue(Oe(S,y),Oe(I,T)),te=Oe(Oe(N,xe(Fe(Fe(F,N),w),_)),xe(w,2*_));return L(te),te}function ni(s,l){return-.012*s-.012*l+15e-6*s*l>0}p.prototype.multiply=function(s){var l=Z(s),_=this.value,y=l.value,S=this.sign!==l.sign,T;if(l.isSmall){if(y===0)return f[0];if(y===1)return this;if(y===-1)return this.negate();if(T=Math.abs(y),T<r)return new p(qe(_,T),S);y=Y(T)}return ni(_.length,y.length)?new p(ue(_,y),S):new p(Xe(_,y),S)},p.prototype.times=p.prototype.multiply;function Xn(s,l,_){return s<r?new p(qe(l,s),_):new p(Xe(l,Y(s)),_)}g.prototype._multiplyBySmall=function(s){return U(s.value*this.value)?new g(s.value*this.value):Xn(Math.abs(s.value),Y(Math.abs(this.value)),this.sign!==s.sign)},p.prototype._multiplyBySmall=function(s){return s.value===0?f[0]:s.value===1?this:s.value===-1?this.negate():Xn(Math.abs(s.value),this.value,this.sign!==s.sign)},g.prototype.multiply=function(s){return Z(s)._multiplyBySmall(this)},g.prototype.times=g.prototype.multiply,A.prototype.multiply=function(s){return new A(this.value*Z(s).value)},A.prototype.times=A.prototype.multiply;function zn(s){var l=s.length,_=_e(l+l),y=r,S,T,I,N,w;for(I=0;I<l;I++){N=s[I],T=0-N*N;for(var F=I;F<l;F++)w=s[F],S=2*(N*w)+_[I+F]+T,T=Math.floor(S/y),_[I+F]=S-T*y;_[I+l]=T}return L(_),_}p.prototype.square=function(){return new p(zn(this.value),!1)},g.prototype.square=function(){var s=this.value*this.value;return U(s)?new g(s):new p(zn(Y(Math.abs(this.value))),!1)},A.prototype.square=function(s){return new A(this.value*this.value)};function ri(s,l){var _=s.length,y=l.length,S=r,T=_e(l.length),I=l[y-1],N=Math.ceil(S/(2*I)),w=qe(s,N),F=qe(l,N),te,$,ie,De,Ie,wn,Rn;for(w.length<=_&&w.push(0),F.push(0),I=F[y-1],$=_-y;$>=0;$--){for(te=S-1,w[$+y]!==I&&(te=Math.floor((w[$+y]*S+w[$+y-1])/I)),ie=0,De=0,wn=F.length,Ie=0;Ie<wn;Ie++)ie+=te*F[Ie],Rn=Math.floor(ie/S),De+=w[$+Ie]-(ie-Rn*S),ie=Rn,De<0?(w[$+Ie]=De+S,De=-1):(w[$+Ie]=De,De=0);for(;De!==0;){for(te-=1,ie=0,Ie=0;Ie<wn;Ie++)ie+=w[$+Ie]-S+F[Ie],ie<0?(w[$+Ie]=ie+S,ie=0):(w[$+Ie]=ie,ie=1);De+=ie}T[$]=te}return w=Wn(w,N)[0],[j(T),j(w)]}function ii(s,l){for(var _=s.length,y=l.length,S=[],T=[],I=r,N,w,F,te,$;_;){if(T.unshift(s[--_]),L(T),st(T,l)<0){S.push(0);continue}w=T.length,F=T[w-1]*I+T[w-2],te=l[y-1]*I+l[y-2],w>y&&(F=(F+1)*I),N=Math.ceil(F/te);do{if($=qe(l,N),st($,T)<=0)break;N--}while(N);S.push(N),T=Fe(T,$)}return S.reverse(),[j(S),j(T)]}function Wn(s,l){var _=s.length,y=_e(_),S=r,T,I,N,w;for(N=0,T=_-1;T>=0;--T)w=N*S+s[T],I=ae(w/l),N=w-I*l,y[T]=I|0;return[y,N|0]}function at(s,l){var _,y=Z(l);if(h)return[new A(s.value/y.value),new A(s.value%y.value)];var S=s.value,T=y.value,I;if(T===0)throw new Error("Cannot divide by zero");if(s.isSmall)return y.isSmall?[new g(ae(S/T)),new g(S%T)]:[f[0],s];if(y.isSmall){if(T===1)return[s,f[0]];if(T==-1)return[s.negate(),f[0]];var N=Math.abs(T);if(N<r){_=Wn(S,N),I=j(_[0]);var w=_[1];return s.sign&&(w=-w),typeof I=="number"?(s.sign!==y.sign&&(I=-I),[new g(I),new g(w)]):[new p(I,s.sign!==y.sign),new g(w)]}T=Y(N)}var F=st(S,T);if(F===-1)return[f[0],s];if(F===0)return[f[s.sign===y.sign?1:-1],f[0]];S.length+T.length<=200?_=ri(S,T):_=ii(S,T),I=_[0];var te=s.sign!==y.sign,$=_[1],ie=s.sign;return typeof I=="number"?(te&&(I=-I),I=new g(I)):I=new p(I,te),typeof $=="number"?(ie&&($=-$),$=new g($)):$=new p($,ie),[I,$]}p.prototype.divmod=function(s){var l=at(this,s);return{quotient:l[0],remainder:l[1]}},A.prototype.divmod=g.prototype.divmod=p.prototype.divmod,p.prototype.divide=function(s){return at(this,s)[0]},A.prototype.over=A.prototype.divide=function(s){return new A(this.value/Z(s).value)},g.prototype.over=g.prototype.divide=p.prototype.over=p.prototype.divide,p.prototype.mod=function(s){return at(this,s)[1]},A.prototype.mod=A.prototype.remainder=function(s){return new A(this.value%Z(s).value)},g.prototype.remainder=g.prototype.mod=p.prototype.remainder=p.prototype.mod,p.prototype.pow=function(s){var l=Z(s),_=this.value,y=l.value,S,T,I;if(y===0)return f[1];if(_===0)return f[0];if(_===1)return f[1];if(_===-1)return l.isEven()?f[1]:f[-1];if(l.sign)return f[0];if(!l.isSmall)throw new Error("The exponent "+l.toString()+" is too large.");if(this.isSmall&&U(S=Math.pow(_,y)))return new g(ae(S));for(T=this,I=f[1];y&!0&&(I=I.times(T),--y),y!==0;)y/=2,T=T.square();return I},g.prototype.pow=p.prototype.pow,A.prototype.pow=function(s){var l=Z(s),_=this.value,y=l.value,S=BigInt(0),T=BigInt(1),I=BigInt(2);if(y===S)return f[1];if(_===S)return f[0];if(_===T)return f[1];if(_===BigInt(-1))return l.isEven()?f[1]:f[-1];if(l.isNegative())return new A(S);for(var N=this,w=f[1];(y&T)===T&&(w=w.times(N),--y),y!==S;)y/=I,N=N.square();return w},p.prototype.modPow=function(s,l){if(s=Z(s),l=Z(l),l.isZero())throw new Error("Cannot take modPow with modulus 0");var _=f[1],y=this.mod(l);for(s.isNegative()&&(s=s.multiply(f[-1]),y=y.modInv(l));s.isPositive();){if(y.isZero())return f[0];s.isOdd()&&(_=_.multiply(y).mod(l)),s=s.divide(2),y=y.square().mod(l)}return _},A.prototype.modPow=g.prototype.modPow=p.prototype.modPow;function st(s,l){if(s.length!==l.length)return s.length>l.length?1:-1;for(var _=s.length-1;_>=0;_--)if(s[_]!==l[_])return s[_]>l[_]?1:-1;return 0}p.prototype.compareAbs=function(s){var l=Z(s),_=this.value,y=l.value;return l.isSmall?1:st(_,y)},g.prototype.compareAbs=function(s){var l=Z(s),_=Math.abs(this.value),y=l.value;return l.isSmall?(y=Math.abs(y),_===y?0:_>y?1:-1):-1},A.prototype.compareAbs=function(s){var l=this.value,_=Z(s).value;return l=l>=0?l:-l,_=_>=0?_:-_,l===_?0:l>_?1:-1},p.prototype.compare=function(s){if(s===1/0)return-1;if(s===-1/0)return 1;var l=Z(s),_=this.value,y=l.value;return this.sign!==l.sign?l.sign?1:-1:l.isSmall?this.sign?-1:1:st(_,y)*(this.sign?-1:1)},p.prototype.compareTo=p.prototype.compare,g.prototype.compare=function(s){if(s===1/0)return-1;if(s===-1/0)return 1;var l=Z(s),_=this.value,y=l.value;return l.isSmall?_==y?0:_>y?1:-1:_<0!==l.sign?_<0?-1:1:_<0?1:-1},g.prototype.compareTo=g.prototype.compare,A.prototype.compare=function(s){if(s===1/0)return-1;if(s===-1/0)return 1;var l=this.value,_=Z(s).value;return l===_?0:l>_?1:-1},A.prototype.compareTo=A.prototype.compare,p.prototype.equals=function(s){return this.compare(s)===0},A.prototype.eq=A.prototype.equals=g.prototype.eq=g.prototype.equals=p.prototype.eq=p.prototype.equals,p.prototype.notEquals=function(s){return this.compare(s)!==0},A.prototype.neq=A.prototype.notEquals=g.prototype.neq=g.prototype.notEquals=p.prototype.neq=p.prototype.notEquals,p.prototype.greater=function(s){return this.compare(s)>0},A.prototype.gt=A.prototype.greater=g.prototype.gt=g.prototype.greater=p.prototype.gt=p.prototype.greater,p.prototype.lesser=function(s){return this.compare(s)<0},A.prototype.lt=A.prototype.lesser=g.prototype.lt=g.prototype.lesser=p.prototype.lt=p.prototype.lesser,p.prototype.greaterOrEquals=function(s){return this.compare(s)>=0},A.prototype.geq=A.prototype.greaterOrEquals=g.prototype.geq=g.prototype.greaterOrEquals=p.prototype.geq=p.prototype.greaterOrEquals,p.prototype.lesserOrEquals=function(s){return this.compare(s)<=0},A.prototype.leq=A.prototype.lesserOrEquals=g.prototype.leq=g.prototype.lesserOrEquals=p.prototype.leq=p.prototype.lesserOrEquals,p.prototype.isEven=function(){return(this.value[0]&1)===0},g.prototype.isEven=function(){return(this.value&1)===0},A.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},p.prototype.isOdd=function(){return(this.value[0]&1)===1},g.prototype.isOdd=function(){return(this.value&1)===1},A.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},p.prototype.isPositive=function(){return!this.sign},g.prototype.isPositive=function(){return this.value>0},A.prototype.isPositive=g.prototype.isPositive,p.prototype.isNegative=function(){return this.sign},g.prototype.isNegative=function(){return this.value<0},A.prototype.isNegative=g.prototype.isNegative,p.prototype.isUnit=function(){return!1},g.prototype.isUnit=function(){return Math.abs(this.value)===1},A.prototype.isUnit=function(){return this.abs().value===BigInt(1)},p.prototype.isZero=function(){return!1},g.prototype.isZero=function(){return this.value===0},A.prototype.isZero=function(){return this.value===BigInt(0)},p.prototype.isDivisibleBy=function(s){var l=Z(s);return l.isZero()?!1:l.isUnit()?!0:l.compareAbs(2)===0?this.isEven():this.mod(l).isZero()},A.prototype.isDivisibleBy=g.prototype.isDivisibleBy=p.prototype.isDivisibleBy;function Qn(s){var l=s.abs();if(l.isUnit())return!1;if(l.equals(2)||l.equals(3)||l.equals(5))return!0;if(l.isEven()||l.isDivisibleBy(3)||l.isDivisibleBy(5))return!1;if(l.lesser(49))return!0}function An(s,l){for(var _=s.prev(),y=_,S=0,T,I,N;y.isEven();)y=y.divide(2),S++;e:for(I=0;I<l.length;I++)if(!s.lesser(l[I])&&(N=t(l[I]).modPow(y,s),!(N.isUnit()||N.equals(_)))){for(T=S-1;T!=0;T--){if(N=N.square().mod(s),N.isUnit())return!1;if(N.equals(_))continue e}return!1}return!0}p.prototype.isPrime=function(s){var l=Qn(this);if(l!==n)return l;var _=this.abs(),y=_.bitLength();if(y<=64)return An(_,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var S=Math.log(2)*y.toJSNumber(),T=Math.ceil(s===!0?2*Math.pow(S,2):S),I=[],N=0;N<T;N++)I.push(t(N+2));return An(_,I)},A.prototype.isPrime=g.prototype.isPrime=p.prototype.isPrime,p.prototype.isProbablePrime=function(s,l){var _=Qn(this);if(_!==n)return _;for(var y=this.abs(),S=s===n?5:s,T=[],I=0;I<S;I++)T.push(t.randBetween(2,y.minus(2),l));return An(y,T)},A.prototype.isProbablePrime=g.prototype.isProbablePrime=p.prototype.isProbablePrime,p.prototype.modInv=function(s){for(var l=t.zero,_=t.one,y=Z(s),S=this.abs(),T,I,N;!S.isZero();)T=y.divide(S),I=l,N=y,l=_,y=S,_=I.subtract(T.multiply(_)),S=N.subtract(T.multiply(S));if(!y.isUnit())throw new Error(this.toString()+" and "+s.toString()+" are not co-prime");return l.compare(0)===-1&&(l=l.add(s)),this.isNegative()?l.negate():l},A.prototype.modInv=g.prototype.modInv=p.prototype.modInv,p.prototype.next=function(){var s=this.value;return this.sign?Be(s,1,this.sign):new p(ve(s,1),this.sign)},g.prototype.next=function(){var s=this.value;return s+1<a?new g(s+1):new p(c,!1)},A.prototype.next=function(){return new A(this.value+BigInt(1))},p.prototype.prev=function(){var s=this.value;return this.sign?new p(ve(s,1),!0):Be(s,1,this.sign)},g.prototype.prev=function(){var s=this.value;return s-1>-a?new g(s-1):new p(c,!0)},A.prototype.prev=function(){return new A(this.value-BigInt(1))};for(var ze=[1];2*ze[ze.length-1]<=r;)ze.push(2*ze[ze.length-1]);var Ut=ze.length,ot=ze[Ut-1];function Jn(s){return Math.abs(s)<=r}p.prototype.shiftLeft=function(s){var l=Z(s).toJSNumber();if(!Jn(l))throw new Error(String(l)+" is too large for shifting.");if(l<0)return this.shiftRight(-l);var _=this;if(_.isZero())return _;for(;l>=Ut;)_=_.multiply(ot),l-=Ut-1;return _.multiply(ze[l])},A.prototype.shiftLeft=g.prototype.shiftLeft=p.prototype.shiftLeft,p.prototype.shiftRight=function(s){var l,_=Z(s).toJSNumber();if(!Jn(_))throw new Error(String(_)+" is too large for shifting.");if(_<0)return this.shiftLeft(-_);for(var y=this;_>=Ut;){if(y.isZero()||y.isNegative()&&y.isUnit())return y;l=at(y,ot),y=l[1].isNegative()?l[0].prev():l[0],_-=Ut-1}return l=at(y,ze[_]),l[1].isNegative()?l[0].prev():l[0]},A.prototype.shiftRight=g.prototype.shiftRight=p.prototype.shiftRight;function In(s,l,_){l=Z(l);for(var y=s.isNegative(),S=l.isNegative(),T=y?s.not():s,I=S?l.not():l,N=0,w=0,F=null,te=null,$=[];!T.isZero()||!I.isZero();)F=at(T,ot),N=F[1].toJSNumber(),y&&(N=ot-1-N),te=at(I,ot),w=te[1].toJSNumber(),S&&(w=ot-1-w),T=F[0],I=te[0],$.push(_(N,w));for(var ie=_(y?1:0,S?1:0)!==0?t(-1):t(0),De=$.length-1;De>=0;De-=1)ie=ie.multiply(ot).add(t($[De]));return ie}p.prototype.not=function(){return this.negate().prev()},A.prototype.not=g.prototype.not=p.prototype.not,p.prototype.and=function(s){return In(this,s,function(l,_){return l&_})},A.prototype.and=g.prototype.and=p.prototype.and,p.prototype.or=function(s){return In(this,s,function(l,_){return l|_})},A.prototype.or=g.prototype.or=p.prototype.or,p.prototype.xor=function(s){return In(this,s,function(l,_){return l^_})},A.prototype.xor=g.prototype.xor=p.prototype.xor;var oe=1<<30,er=(r&-r)*(r&-r)|oe;function rn(s){var l=s.value,_=typeof l=="number"?l|oe:typeof l=="bigint"?l|BigInt(oe):l[0]+l[1]*r|er;return _&-_}function We(s,l){if(l.compareTo(s)<=0){var _=We(s,l.square(l)),y=_.p,S=_.e,T=y.multiply(l);return T.compareTo(s)<=0?{p:T,e:S*2+1}:{p:y,e:S*2}}return{p:t(1),e:0}}p.prototype.bitLength=function(){var s=this;return s.compareTo(t(0))<0&&(s=s.negate().subtract(t(1))),s.compareTo(t(0))===0?t(0):t(We(s,t(2)).e).add(t(1))},A.prototype.bitLength=g.prototype.bitLength=p.prototype.bitLength;function Nn(s,l){return s=Z(s),l=Z(l),s.greater(l)?s:l}function an(s,l){return s=Z(s),l=Z(l),s.lesser(l)?s:l}function tr(s,l){if(s=Z(s).abs(),l=Z(l).abs(),s.equals(l))return s;if(s.isZero())return l;if(l.isZero())return s;for(var _=f[1],y,S;s.isEven()&&l.isEven();)y=an(rn(s),rn(l)),s=s.divide(y),l=l.divide(y),_=_.multiply(y);for(;s.isEven();)s=s.divide(rn(s));do{for(;l.isEven();)l=l.divide(rn(l));s.greater(l)&&(S=l,l=s,s=S),l=l.subtract(s)}while(!l.isZero());return _.isUnit()?s:s.multiply(_)}function nr(s,l){return s=Z(s).abs(),l=Z(l).abs(),s.divide(tr(s,l)).multiply(l)}function rr(s,l,_){s=Z(s),l=Z(l);var y=_||Math.random,S=an(s,l),T=Nn(s,l),I=T.subtract(S).add(1);if(I.isSmall)return S.add(Math.floor(y()*I));for(var N=Pt(I,r).value,w=[],F=!0,te=0;te<N.length;te++){var $=F?N[te]+(te+1<N.length?N[te+1]/r:0):r,ie=ae(y()*$);w.push(ie),ie<N[te]&&(F=!1)}return S.add(f.fromArray(w,r,!1))}var ir=function(s,l,_,y){_=_||u,s=String(s),y||(s=s.toLowerCase(),_=_.toLowerCase());var S=s.length,T,I=Math.abs(l),N={};for(T=0;T<_.length;T++)N[_[T]]=T;for(T=0;T<S;T++){var w=s[T];if(w!=="-"&&w in N&&N[w]>=I){if(w==="1"&&I===1)continue;throw new Error(w+" is not a valid digit in base "+l+".")}}l=Z(l);var F=[],te=s[0]==="-";for(T=te?1:0;T<s.length;T++){var w=s[T];if(w in N)F.push(Z(N[w]));else if(w==="<"){var $=T;do T++;while(s[T]!==">"&&T<s.length);F.push(Z(s.slice($+1,T)))}else throw new Error(w+" is not a valid character")}return ar(F,l,te)};function ar(s,l,_){var y=f[0],S=f[1],T;for(T=s.length-1;T>=0;T--)y=y.add(s[T].times(S)),S=S.times(l);return _?y.negate():y}function ai(s,l){return l=l||u,s<l.length?l[s]:"<"+s+">"}function Pt(s,l){if(l=t(l),l.isZero()){if(s.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(l.equals(-1)){if(s.isZero())return{value:[0],isNegative:!1};if(s.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-s.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var _=Array.apply(null,Array(s.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return _.unshift([1]),{value:[].concat.apply([],_),isNegative:!1}}var y=!1;if(s.isNegative()&&l.isPositive()&&(y=!0,s=s.abs()),l.isUnit())return s.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(s.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:y};for(var S=[],T=s,I;T.isNegative()||T.compareAbs(l)>=0;){I=T.divmod(l),T=I.quotient;var N=I.remainder;N.isNegative()&&(N=l.minus(N).abs(),T=T.next()),S.push(N.toJSNumber())}return S.push(T.toJSNumber()),{value:S.reverse(),isNegative:y}}function sr(s,l,_){var y=Pt(s,l);return(y.isNegative?"-":"")+y.value.map(function(S){return ai(S,_)}).join("")}p.prototype.toArray=function(s){return Pt(this,s)},g.prototype.toArray=function(s){return Pt(this,s)},A.prototype.toArray=function(s){return Pt(this,s)},p.prototype.toString=function(s,l){if(s===n&&(s=10),s!==10||l)return sr(this,s,l);for(var _=this.value,y=_.length,S=String(_[--y]),T="0000000",I;--y>=0;)I=String(_[y]),S+=T.slice(I.length)+I;var N=this.sign?"-":"";return N+S},g.prototype.toString=function(s,l){return s===n&&(s=10),s!=10||l?sr(this,s,l):String(this.value)},A.prototype.toString=g.prototype.toString,A.prototype.toJSON=p.prototype.toJSON=g.prototype.toJSON=function(){return this.toString()},p.prototype.valueOf=function(){return parseInt(this.toString(),10)},p.prototype.toJSNumber=p.prototype.valueOf,g.prototype.valueOf=function(){return this.value},g.prototype.toJSNumber=g.prototype.valueOf,A.prototype.valueOf=A.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function or(s){if(U(+s)){var l=+s;if(l===ae(l))return h?new A(BigInt(l)):new g(l);throw new Error("Invalid integer: "+s)}var _=s[0]==="-";_&&(s=s.slice(1));var y=s.split(/e/i);if(y.length>2)throw new Error("Invalid integer: "+y.join("e"));if(y.length===2){var S=y[1];if(S[0]==="+"&&(S=S.slice(1)),S=+S,S!==ae(S)||!U(S))throw new Error("Invalid integer: "+S+" is not a valid exponent.");var T=y[0],I=T.indexOf(".");if(I>=0&&(S-=T.length-I-1,T=T.slice(0,I)+T.slice(I+1)),S<0)throw new Error("Cannot include negative exponent part for integers");T+=new Array(S+1).join("0"),s=T}var N=/^([0-9][0-9]*)$/.test(s);if(!N)throw new Error("Invalid integer: "+s);if(h)return new A(BigInt(_?"-"+s:s));for(var w=[],F=s.length,te=i,$=F-te;F>0;)w.push(+s.slice($,F)),$-=te,$<0&&($=0),F-=te;return L(w),new p(w,_)}function si(s){if(h)return new A(BigInt(s));if(U(s)){if(s!==ae(s))throw new Error(s+" is not an integer.");return new g(s)}return or(s.toString())}function Z(s){return typeof s=="number"?si(s):typeof s=="string"?or(s):typeof s=="bigint"?new A(s):s}for(var lt=0;lt<1e3;lt++)f[lt]=Z(lt),lt>0&&(f[-lt]=Z(-lt));return f.one=f[1],f.zero=f[0],f.minusOne=f[-1],f.max=Nn,f.min=an,f.gcd=tr,f.lcm=nr,f.isInstance=function(s){return s instanceof p||s instanceof g||s instanceof A},f.randBetween=rr,f.fromArray=function(s,l,_){return ar(s.map(Z),Z(l||10),_)},f})();e.hasOwnProperty("exports")&&(e.exports=t)})(wr),wr.exports)}var pu=ba(),Rr=ln(pu);var Aa=64,Ii=16,Nt=Aa/Ii;function fu(){try{return!0}catch{return!1}}function du(e,t,n){let r=0;for(let i=0;i<n;i++){let a=e[t+i];if(a===void 0)break;r+=a*16**i}return r}function Ia(e){let t=[];for(let n=0;n<e.length;n++){let r=Number(e[n]);for(let i=0;r||i<t.length;i++)r+=(t[i]||0)*10,t[i]=r%16,r=(r-t[i])/16}return t}function mu(e){let t=Ia(e),n=Array(Nt);for(let r=0;r<Nt;r++)n[Nt-1-r]=du(t,r*Nt,Nt);return n}var Hn=class e{static fromString(t){return new e(mu(t),t)}static fromBit(t){let n=Array(Nt),r=Math.floor(t/Ii);for(let i=0;i<Nt;i++)n[Nt-1-i]=i===r?1<<t-r*Ii:0;return new e(n)}constructor(t,n){this.parts=t,this.str=n}and({parts:t}){return new e(this.parts.map((n,r)=>n&t[r]))}or({parts:t}){return new e(this.parts.map((n,r)=>n|t[r]))}xor({parts:t}){return new e(this.parts.map((n,r)=>n^t[r]))}not(){return new e(this.parts.map(t=>~t))}equals({parts:t}){return this.parts.every((n,r)=>n===t[r])}toString(){if(this.str!=null)return this.str;let t=new Array(Aa/4);return this.parts.forEach((n,r)=>{let i=Ia(n.toString());for(let a=0;a<4;a++)t[a+r*4]=i[3-a]||0}),this.str=Rr.fromArray(t,16).toString()}toJSON(){return this.toString()}},wt=fu();wt&&BigInt.prototype.toJSON==null&&(BigInt.prototype.toJSON=function(){return this.toString()});var Or={},Na=wt?function(t){return BigInt(t)}:function(t){return t instanceof Hn?t:(typeof t=="number"&&(t=t.toString()),Or[t]!=null||(Or[t]=Hn.fromString(t)),Or[t])},Se=Na(0),xr=wt?function(t=Se,n=Se){return t&n}:function(t=Se,n=Se){return t.and(n)},wa=wt?function(t=Se,n=Se){return t|n}:function(t=Se,n=Se){return t.or(n)},hu=wt?function(t=Se,n=Se){return t^n}:function(t=Se,n=Se){return t.xor(n)},_u=wt?function(t=Se){return~t}:function(t=Se){return t.not()},Ni=wt?function(t,n){return t===n}:function(t,n){return t==null||n==null?t==n:t.equals(n)};function gu(...e){let t=e[0];for(let n=1;n<e.length;n++)t=wa(t,e[n]);return t}function vu(e,t){return Ni(xr(e,t),t)}function Eu(e,t){return!Ni(xr(e,t),Se)}function yu(e,t){return t===Se?e:wa(e,t)}function Tu(e,t){return t===Se?e:hu(e,xr(e,t))}var Su=wt?function(t){return BigInt(1)<<BigInt(t)}:function(t){return Hn.fromBit(t)},V={combine:gu,add:yu,remove:Tu,filter:xr,invert:_u,has:vu,hasAny:Eu,equals:Ni,deserialize:Na,getFlag:Su};var wi;(function(e){e[e.CLOSE_NORMAL=1e3]="CLOSE_NORMAL",e[e.CLOSE_UNSUPPORTED=1003]="CLOSE_UNSUPPORTED",e[e.CLOSE_ABNORMAL=1006]="CLOSE_ABNORMAL",e[e.INVALID_CLIENTID=4e3]="INVALID_CLIENTID",e[e.INVALID_ORIGIN=4001]="INVALID_ORIGIN",e[e.RATELIMITED=4002]="RATELIMITED",e[e.TOKEN_REVOKED=4003]="TOKEN_REVOKED",e[e.INVALID_VERSION=4004]="INVALID_VERSION",e[e.INVALID_ENCODING=4005]="INVALID_ENCODING"})(wi||(wi={}));var Vn;(function(e){e[e.INVALID_PAYLOAD=4e3]="INVALID_PAYLOAD",e[e.INVALID_COMMAND=4002]="INVALID_COMMAND",e[e.INVALID_GUILD=4003]="INVALID_GUILD",e[e.INVALID_EVENT=4004]="INVALID_EVENT",e[e.INVALID_CHANNEL=4005]="INVALID_CHANNEL",e[e.INVALID_PERMISSIONS=4006]="INVALID_PERMISSIONS",e[e.INVALID_CLIENTID=4007]="INVALID_CLIENTID",e[e.INVALID_ORIGIN=4008]="INVALID_ORIGIN",e[e.INVALID_TOKEN=4009]="INVALID_TOKEN",e[e.INVALID_USER=4010]="INVALID_USER"})(Vn||(Vn={}));var jn;(function(e){e.LANDSCAPE="landscape",e.PORTRAIT="portrait"})(jn||(jn={}));var Ge;(function(e){e.MOBILE="mobile",e.DESKTOP="desktop"})(Ge||(Ge={}));var bu=Object.freeze({CREATE_INSTANT_INVITE:V.getFlag(0),KICK_MEMBERS:V.getFlag(1),BAN_MEMBERS:V.getFlag(2),ADMINISTRATOR:V.getFlag(3),MANAGE_CHANNELS:V.getFlag(4),MANAGE_GUILD:V.getFlag(5),ADD_REACTIONS:V.getFlag(6),VIEW_AUDIT_LOG:V.getFlag(7),PRIORITY_SPEAKER:V.getFlag(8),STREAM:V.getFlag(9),VIEW_CHANNEL:V.getFlag(10),SEND_MESSAGES:V.getFlag(11),SEND_TTS_MESSAGES:V.getFlag(12),MANAGE_MESSAGES:V.getFlag(13),EMBED_LINKS:V.getFlag(14),ATTACH_FILES:V.getFlag(15),READ_MESSAGE_HISTORY:V.getFlag(16),MENTION_EVERYONE:V.getFlag(17),USE_EXTERNAL_EMOJIS:V.getFlag(18),VIEW_GUILD_INSIGHTS:V.getFlag(19),CONNECT:V.getFlag(20),SPEAK:V.getFlag(21),MUTE_MEMBERS:V.getFlag(22),DEAFEN_MEMBERS:V.getFlag(23),MOVE_MEMBERS:V.getFlag(24),USE_VAD:V.getFlag(25),CHANGE_NICKNAME:V.getFlag(26),MANAGE_NICKNAMES:V.getFlag(27),MANAGE_ROLES:V.getFlag(28),MANAGE_WEBHOOKS:V.getFlag(29),MANAGE_GUILD_EXPRESSIONS:V.getFlag(30),USE_APPLICATION_COMMANDS:V.getFlag(31),REQUEST_TO_SPEAK:V.getFlag(32),MANAGE_EVENTS:V.getFlag(33),MANAGE_THREADS:V.getFlag(34),CREATE_PUBLIC_THREADS:V.getFlag(35),CREATE_PRIVATE_THREADS:V.getFlag(36),USE_EXTERNAL_STICKERS:V.getFlag(37),SEND_MESSAGES_IN_THREADS:V.getFlag(38),USE_EMBEDDED_ACTIVITIES:V.getFlag(39),MODERATE_MEMBERS:V.getFlag(40),VIEW_CREATOR_MONETIZATION_ANALYTICS:V.getFlag(41),USE_SOUNDBOARD:V.getFlag(42),CREATE_GUILD_EXPRESSIONS:V.getFlag(43),CREATE_EVENTS:V.getFlag(44),USE_EXTERNAL_SOUNDS:V.getFlag(45),SEND_VOICE_MESSAGES:V.getFlag(46),SEND_POLLS:V.getFlag(49),USE_EXTERNAL_APPS:V.getFlag(50)}),Ri=-1,Ra=250;var Vr={};pa(Vr,{Activity:()=>Rt,Attachment:()=>Ga,CertifiedDevice:()=>ju,CertifiedDeviceTypeObject:()=>Wa,Channel:()=>Mr,ChannelMention:()=>ka,ChannelTypesObject:()=>vn,Commands:()=>D,DISPATCH:()=>Li,Embed:()=>qa,EmbedAuthor:()=>ja,EmbedField:()=>Fa,EmbedFooter:()=>Ba,EmbedProvider:()=>Va,Emoji:()=>Pr,Entitlement:()=>En,EntitlementTypesObject:()=>Ja,Guild:()=>Vu,GuildMember:()=>Cn,GuildMemberRPC:()=>Pi,Image:()=>Ur,KeyTypesObject:()=>Xa,LayoutMode:()=>Zu,LayoutModeTypeObject:()=>Hr,Message:()=>ki,MessageActivity:()=>Ca,MessageApplication:()=>Ka,MessageReference:()=>Ya,Orientation:()=>qu,OrientationLockState:()=>Fu,OrientationLockStateTypeObject:()=>es,OrientationTypeObject:()=>Br,PermissionOverwrite:()=>Ua,PermissionOverwriteTypeObject:()=>La,PresenceUpdate:()=>Pa,Reaction:()=>Za,ReceiveFramePayload:()=>Je,Relationship:()=>Ui,Role:()=>Ma,Scopes:()=>Hu,ScopesObject:()=>xa,ShortcutKey:()=>kr,Sku:()=>Bi,SkuTypeObject:()=>Qa,Status:()=>Zn,StatusObject:()=>Da,ThermalState:()=>Hi,ThermalStateTypeObject:()=>ts,User:()=>nt,UserVoiceState:()=>Kn,Video:()=>Ha,VoiceDevice:()=>$a,VoiceSettingModeTypeObject:()=>za,VoiceSettingsIO:()=>Gr,VoiceSettingsMode:()=>Gi,VoiceState:()=>Mi});function ye(e){return Ai(t=>{var n;let[r]=(n=Object.entries(e).find(([,i])=>i===t))!==null&&n!==void 0?n:[];return t!=null&&r===void 0?e.UNHANDLED:t},v().or(G()))}function Dr(e){let t=Nr().transform(n=>{let r=e.safeParse(n);return r.success?r.data:e._def.defaultValue()});return t.overlayType=e,t}var Oi=d.object({image_url:d.string()}).describe('Response for "INITIATE_IMAGE_UPLOAD" Command'),Au=d.object({mediaUrl:d.string().max(1024)}).describe('Request for "OPEN_SHARE_MOMENT_DIALOG" Command'),Iu=d.object({access_token:d.union([d.string(),d.null()]).optional()}).describe('Request for "AUTHENTICATE" Command'),qn=d.object({access_token:d.string(),user:d.object({username:d.string(),discriminator:d.string(),id:d.string(),avatar:d.union([d.string(),d.null()]).optional(),public_flags:d.number(),global_name:d.union([d.string(),d.null()]).optional()}),scopes:d.array(Dr(d.enum(["identify","identify.premium","email","connections","guilds","guilds.join","guilds.members.read","guilds.channels.read","gdm.join","bot","rpc","rpc.notifications.read","rpc.voice.read","rpc.voice.write","rpc.video.read","rpc.video.write","rpc.screenshare.read","rpc.screenshare.write","rpc.activities.write","webhook.incoming","messages.read","applications.builds.upload","applications.builds.read","applications.commands","applications.commands.permissions.update","applications.commands.update","applications.store.update","applications.entitlements","activities.read","activities.write","activities.invites.write","relationships.read","relationships.write","voice","dm_channels.read","role_connections.write","presences.read","presences.write","openid","dm_channels.messages.read","dm_channels.messages.write","gateway.connect","account.global_name.update","payment_sources.country_code","sdk.social_layer_presence","sdk.social_layer","lobbies.write","application_identities.write"]).or(d.literal(-1)).default(-1))),expires:d.string(),application:d.object({description:d.string(),icon:d.union([d.string(),d.null()]).optional(),id:d.string(),rpc_origins:d.array(d.string()).optional(),name:d.string()})}).describe('Response for "AUTHENTICATE" Command'),xi=d.object({participants:d.array(d.object({id:d.string(),username:d.string(),global_name:d.union([d.string(),d.null()]).optional(),discriminator:d.string(),avatar:d.union([d.string(),d.null()]).optional(),flags:d.number(),bot:d.boolean(),avatar_decoration_data:d.union([d.object({asset:d.union([d.string(),d.null()]).optional(),skuId:d.string().optional(),expiresAt:d.number().optional()}),d.null()]).optional(),premium_type:d.union([d.number(),d.null()]).optional(),nickname:d.string().optional()}))}).describe('Response for "GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS" Command'),Nu=d.object({command:d.string(),options:d.array(d.object({name:d.string(),value:d.string()})).optional(),content:d.string().max(2e3).optional(),require_launch_channel:d.boolean().optional(),preview_image:d.object({height:d.number(),url:d.string(),width:d.number()}).optional(),components:d.array(d.object({type:d.literal(1),components:d.array(d.object({type:d.literal(2),style:d.number().gte(1).lte(5),label:d.string().max(80).optional(),custom_id:d.string().max(100).describe("Developer-defined identifier for the button; max 100 characters").optional()})).max(5).optional()})).optional(),pid:d.number().optional()}).describe('Request for "SHARE_INTERACTION" Command'),wu=d.object({success:d.boolean()}).describe('Response for "SHARE_INTERACTION" Command'),Ru=d.object({custom_id:d.string().max(64).optional(),message:d.string().max(1e3),link_id:d.string().max(64).optional()}).describe('Request for "SHARE_LINK" Command'),Ou=d.object({success:d.boolean(),didCopyLink:d.boolean(),didSendMessage:d.boolean()}).describe('Response for "SHARE_LINK" Command'),Di=d.object({relationships:d.array(d.object({type:d.number(),user:d.object({id:d.string(),username:d.string(),global_name:d.union([d.string(),d.null()]).optional(),discriminator:d.string(),avatar:d.union([d.string(),d.null()]).optional(),flags:d.number(),bot:d.boolean(),avatar_decoration_data:d.union([d.object({asset:d.union([d.string(),d.null()]).optional(),skuId:d.string().optional(),expiresAt:d.number().optional()}),d.null()]).optional(),premium_type:d.union([d.number(),d.null()]).optional()}),presence:d.object({status:d.string(),activity:d.union([d.object({session_id:d.string().optional(),type:d.number().optional(),name:d.string(),url:d.union([d.string(),d.null()]).optional(),application_id:d.string().optional(),status_display_type:d.number().optional(),state:d.string().optional(),state_url:d.string().optional(),details:d.string().optional(),details_url:d.string().optional(),emoji:d.union([d.object({name:d.string(),id:d.union([d.string(),d.null()]).optional(),animated:d.union([d.boolean(),d.null()]).optional()}),d.null()]).optional(),assets:d.object({large_image:d.string().optional(),large_text:d.string().optional(),large_url:d.string().optional(),small_image:d.string().optional(),small_text:d.string().optional(),small_url:d.string().optional()}).optional(),timestamps:d.object({start:d.number().optional(),end:d.number().optional()}).optional(),party:d.object({id:d.string().optional(),size:d.array(d.number()).min(2).max(2).optional(),privacy:d.number().optional()}).optional(),secrets:d.object({match:d.string().optional(),join:d.string().optional()}).optional(),sync_id:d.string().optional(),created_at:d.number().optional(),instance:d.boolean().optional(),flags:d.number().optional(),metadata:d.object({}).optional(),platform:d.string().optional(),supported_platforms:d.array(d.string()).optional(),buttons:d.array(d.string()).optional(),hangStatus:d.string().optional()}),d.null()]).optional()}).optional()}))}).describe('Response for "GET_RELATIONSHIPS" Command'),xu=d.object({user_id:d.string(),content:d.string().min(0).max(1024).optional()}).describe('Request for "INVITE_USER_EMBEDDED" Command'),Du=d.object({id:d.string().max(64)}).describe('Request for "GET_USER" Command'),Lu=d.union([d.object({id:d.string(),username:d.string(),global_name:d.union([d.string(),d.null()]).optional(),discriminator:d.string(),avatar:d.union([d.string(),d.null()]).optional(),flags:d.number(),bot:d.boolean(),avatar_decoration_data:d.union([d.object({asset:d.union([d.string(),d.null()]).optional(),skuId:d.string().optional(),expiresAt:d.number().optional()}),d.null()]).optional(),premium_type:d.union([d.number(),d.null()]).optional()}),d.null()]),Uu=d.object({quest_id:d.string()}).describe('Request for "GET_QUEST_ENROLLMENT_STATUS" Command'),Pu=d.object({quest_id:d.string(),is_enrolled:d.boolean(),enrolled_at:d.union([d.string(),d.null()]).optional()}).describe('Response for "GET_QUEST_ENROLLMENT_STATUS" Command'),Mu=d.object({quest_id:d.string()}).describe('Request for "QUEST_START_TIMER" Command'),ku=d.object({success:d.boolean()}).describe('Response for "QUEST_START_TIMER" Command'),Gu=d.object({quest_id:d.string(),enrolled_at:d.union([d.string(),d.null()]).optional(),completed_at:d.union([d.string(),d.null()]).optional(),external_cta_url:d.string()}).describe('Response for "GET_QUEST" Command'),Bu=d.object({ticket:d.string()}).describe('Response for "REQUEST_PROXY_TICKET_REFRESH" Command'),Q;(function(e){e.INITIATE_IMAGE_UPLOAD="INITIATE_IMAGE_UPLOAD",e.OPEN_SHARE_MOMENT_DIALOG="OPEN_SHARE_MOMENT_DIALOG",e.AUTHENTICATE="AUTHENTICATE",e.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS="GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS",e.SHARE_INTERACTION="SHARE_INTERACTION",e.SHARE_LINK="SHARE_LINK",e.GET_RELATIONSHIPS="GET_RELATIONSHIPS",e.INVITE_USER_EMBEDDED="INVITE_USER_EMBEDDED",e.GET_USER="GET_USER",e.GET_QUEST_ENROLLMENT_STATUS="GET_QUEST_ENROLLMENT_STATUS",e.QUEST_START_TIMER="QUEST_START_TIMER",e.GET_QUEST="GET_QUEST",e.REQUEST_PROXY_TICKET_REFRESH="REQUEST_PROXY_TICKET_REFRESH"})(Q||(Q={}));var Oa=d.object({}).optional().nullable(),Fn=d.void(),Lr={[Q.INITIATE_IMAGE_UPLOAD]:{request:Fn,response:Oi},[Q.OPEN_SHARE_MOMENT_DIALOG]:{request:Au,response:Oa},[Q.AUTHENTICATE]:{request:Iu,response:qn},[Q.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS]:{request:Fn,response:xi},[Q.SHARE_INTERACTION]:{request:Nu,response:wu},[Q.SHARE_LINK]:{request:Ru,response:Ou},[Q.GET_RELATIONSHIPS]:{request:Fn,response:Di},[Q.INVITE_USER_EMBEDDED]:{request:xu,response:Oa},[Q.GET_USER]:{request:Du,response:Lu},[Q.GET_QUEST_ENROLLMENT_STATUS]:{request:Uu,response:Pu},[Q.QUEST_START_TIMER]:{request:Mu,response:ku},[Q.GET_QUEST]:{request:Fn,response:Gu},[Q.REQUEST_PROXY_TICKET_REFRESH]:{request:Fn,response:Bu}};var Li="DISPATCH",D;(function(e){e.AUTHORIZE="AUTHORIZE",e.GET_GUILDS="GET_GUILDS",e.GET_GUILD="GET_GUILD",e.GET_CHANNEL="GET_CHANNEL",e.GET_CHANNELS="GET_CHANNELS",e.SELECT_VOICE_CHANNEL="SELECT_VOICE_CHANNEL",e.SELECT_TEXT_CHANNEL="SELECT_TEXT_CHANNEL",e.SUBSCRIBE="SUBSCRIBE",e.UNSUBSCRIBE="UNSUBSCRIBE",e.CAPTURE_SHORTCUT="CAPTURE_SHORTCUT",e.SET_CERTIFIED_DEVICES="SET_CERTIFIED_DEVICES",e.SET_ACTIVITY="SET_ACTIVITY",e.GET_SKUS="GET_SKUS",e.GET_ENTITLEMENTS="GET_ENTITLEMENTS",e.GET_SKUS_EMBEDDED="GET_SKUS_EMBEDDED",e.GET_ENTITLEMENTS_EMBEDDED="GET_ENTITLEMENTS_EMBEDDED",e.START_PURCHASE="START_PURCHASE",e.SET_CONFIG="SET_CONFIG",e.SEND_ANALYTICS_EVENT="SEND_ANALYTICS_EVENT",e.USER_SETTINGS_GET_LOCALE="USER_SETTINGS_GET_LOCALE",e.OPEN_EXTERNAL_LINK="OPEN_EXTERNAL_LINK",e.ENCOURAGE_HW_ACCELERATION="ENCOURAGE_HW_ACCELERATION",e.CAPTURE_LOG="CAPTURE_LOG",e.SET_ORIENTATION_LOCK_STATE="SET_ORIENTATION_LOCK_STATE",e.OPEN_INVITE_DIALOG="OPEN_INVITE_DIALOG",e.GET_PLATFORM_BEHAVIORS="GET_PLATFORM_BEHAVIORS",e.GET_CHANNEL_PERMISSIONS="GET_CHANNEL_PERMISSIONS",e.AUTHENTICATE="AUTHENTICATE",e.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS="GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS",e.GET_QUEST="GET_QUEST",e.GET_QUEST_ENROLLMENT_STATUS="GET_QUEST_ENROLLMENT_STATUS",e.GET_RELATIONSHIPS="GET_RELATIONSHIPS",e.GET_USER="GET_USER",e.INITIATE_IMAGE_UPLOAD="INITIATE_IMAGE_UPLOAD",e.INVITE_USER_EMBEDDED="INVITE_USER_EMBEDDED",e.OPEN_SHARE_MOMENT_DIALOG="OPEN_SHARE_MOMENT_DIALOG",e.QUEST_START_TIMER="QUEST_START_TIMER",e.REQUEST_PROXY_TICKET_REFRESH="REQUEST_PROXY_TICKET_REFRESH",e.SHARE_INTERACTION="SHARE_INTERACTION",e.SHARE_LINK="SHARE_LINK"})(D||(D={}));var Je=O({cmd:v(),data:Jt(),evt:gn(),nonce:v()}).passthrough(),xa=Object.assign(Object.assign({},qn.shape.scopes.element.overlayType._def.innerType.options[0].Values),{UNHANDLED:-1}),Hu=ye(xa),Ui=Di.shape.relationships.element,nt=O({id:v(),username:v(),discriminator:v(),global_name:v().optional().nullable(),avatar:v().optional().nullable(),avatar_decoration_data:O({asset:v(),sku_id:v().optional()}).nullable(),bot:q(),flags:G().optional().nullable(),premium_type:G().optional().nullable()}),Cn=O({user:nt,nick:v().optional().nullable(),roles:ne(v()),joined_at:v(),deaf:q(),mute:q()}),Pi=O({user_id:v(),nick:v().optional().nullable(),guild_id:v(),avatar:v().optional().nullable(),avatar_decoration_data:O({asset:v(),sku_id:v().optional().nullable()}).optional().nullable(),color_string:v().optional().nullable()}),Pr=O({id:v(),name:v().optional().nullable(),roles:ne(v()).optional().nullable(),user:nt.optional().nullable(),require_colons:q().optional().nullable(),managed:q().optional().nullable(),animated:q().optional().nullable(),available:q().optional().nullable()}),Mi=O({mute:q(),deaf:q(),self_mute:q(),self_deaf:q(),suppress:q()}),Kn=O({mute:q(),nick:v(),user:nt,voice_state:Mi,volume:G()}),Da={UNHANDLED:-1,IDLE:"idle",DND:"dnd",ONLINE:"online",OFFLINE:"offline"},Zn=ye(Da),Rt=O({name:v(),type:G(),url:v().optional().nullable(),created_at:G().optional().nullable(),timestamps:O({start:G(),end:G()}).partial().optional().nullable(),application_id:v().optional().nullable(),details:v().optional().nullable(),details_url:v().url().optional().nullable(),state:v().optional().nullable(),state_url:v().url().optional().nullable(),emoji:Pr.optional().nullable(),party:O({id:v().optional().nullable(),size:ne(G()).optional().nullable()}).optional().nullable(),assets:O({large_image:v().nullable(),large_text:v().nullable(),large_url:v().url().optional().nullable(),small_image:v().nullable(),small_text:v().nullable(),small_url:v().url().optional().nullable()}).partial().optional().nullable(),secrets:O({join:v(),match:v()}).partial().optional().nullable(),instance:q().optional().nullable(),flags:G().optional().nullable()}),La={UNHANDLED:-1,ROLE:0,MEMBER:1},Ua=O({id:v(),type:ye(La),allow:v(),deny:v()}),vn={UNHANDLED:-1,DM:1,GROUP_DM:3,GUILD_TEXT:0,GUILD_VOICE:2,GUILD_CATEGORY:4,GUILD_ANNOUNCEMENT:5,GUILD_STORE:6,ANNOUNCEMENT_THREAD:10,PUBLIC_THREAD:11,PRIVATE_THREAD:12,GUILD_STAGE_VOICE:13,GUILD_DIRECTORY:14,GUILD_FORUM:15},Mr=O({id:v(),type:ye(vn),guild_id:v().optional().nullable(),position:G().optional().nullable(),permission_overwrites:ne(Ua).optional().nullable(),name:v().optional().nullable(),topic:v().optional().nullable(),nsfw:q().optional().nullable(),last_message_id:v().optional().nullable(),bitrate:G().optional().nullable(),user_limit:G().optional().nullable(),rate_limit_per_user:G().optional().nullable(),recipients:ne(nt).optional().nullable(),icon:v().optional().nullable(),owner_id:v().optional().nullable(),application_id:v().optional().nullable(),parent_id:v().optional().nullable(),last_pin_timestamp:v().optional().nullable()}),Pa=O({user:nt,guild_id:v(),status:Zn,activities:ne(Rt),client_status:O({desktop:Zn,mobile:Zn,web:Zn}).partial()}),Ma=O({id:v(),name:v(),color:G(),hoist:q(),position:G(),permissions:v(),managed:q(),mentionable:q()}),Vu=O({id:v(),name:v(),owner_id:v(),icon:v().nullable(),icon_hash:v().optional().nullable(),splash:v().nullable(),discovery_splash:v().nullable(),owner:q().optional().nullable(),permissions:v().optional().nullable(),region:v(),afk_channel_id:v().nullable(),afk_timeout:G(),widget_enabled:q().optional().nullable(),widget_channel_id:v().optional().nullable(),verification_level:G(),default_message_notifications:G(),explicit_content_filter:G(),roles:ne(Ma),emojis:ne(Pr),features:ne(v()),mfa_level:G(),application_id:v().nullable(),system_channel_id:v().nullable(),system_channel_flags:G(),rules_channel_id:v().nullable(),joined_at:v().optional().nullable(),large:q().optional().nullable(),unavailable:q().optional().nullable(),member_count:G().optional().nullable(),voice_states:ne(Mi).optional().nullable(),members:ne(Cn).optional().nullable(),channels:ne(Mr).optional().nullable(),presences:ne(Pa).optional().nullable(),max_presences:G().optional().nullable(),max_members:G().optional().nullable(),vanity_url_code:v().nullable(),description:v().nullable(),banner:v().nullable(),premium_tier:G(),premium_subscription_count:G().optional().nullable(),preferred_locale:v(),public_updates_channel_id:v().nullable(),max_video_channel_users:G().optional().nullable(),approximate_member_count:G().optional().nullable(),approximate_presence_count:G().optional().nullable()}),ka=O({id:v(),guild_id:v(),type:G(),name:v()}),Ga=O({id:v(),filename:v(),size:G(),url:v(),proxy_url:v(),height:G().optional().nullable(),width:G().optional().nullable()}),Ba=O({text:v(),icon_url:v().optional().nullable(),proxy_icon_url:v().optional().nullable()}),Ur=O({url:v().optional().nullable(),proxy_url:v().optional().nullable(),height:G().optional().nullable(),width:G().optional().nullable()}),Ha=Ur.omit({proxy_url:!0}),Va=O({name:v().optional().nullable(),url:v().optional().nullable()}),ja=O({name:v().optional().nullable(),url:v().optional().nullable(),icon_url:v().optional().nullable(),proxy_icon_url:v().optional().nullable()}),Fa=O({name:v(),value:v(),inline:q()}),qa=O({title:v().optional().nullable(),type:v().optional().nullable(),description:v().optional().nullable(),url:v().optional().nullable(),timestamp:v().optional().nullable(),color:G().optional().nullable(),footer:Ba.optional().nullable(),image:Ur.optional().nullable(),thumbnail:Ur.optional().nullable(),video:Ha.optional().nullable(),provider:Va.optional().nullable(),author:ja.optional().nullable(),fields:ne(Fa).optional().nullable()}),Za=O({count:G(),me:q(),emoji:Pr}),Ca=O({type:G(),party_id:v().optional().nullable()}),Ka=O({id:v(),cover_image:v().optional().nullable(),description:v(),icon:v().optional().nullable(),name:v()}),Ya=O({message_id:v().optional().nullable(),channel_id:v().optional().nullable(),guild_id:v().optional().nullable()}),ki=O({id:v(),channel_id:v(),guild_id:v().optional().nullable(),author:nt.optional().nullable(),member:Cn.optional().nullable(),content:v(),timestamp:v(),edited_timestamp:v().optional().nullable(),tts:q(),mention_everyone:q(),mentions:ne(nt),mention_roles:ne(v()),mention_channels:ne(ka),attachments:ne(Ga),embeds:ne(qa),reactions:ne(Za).optional().nullable(),nonce:Bn([v(),G()]).optional().nullable(),pinned:q(),webhook_id:v().optional().nullable(),type:G(),activity:Ca.optional().nullable(),application:Ka.optional().nullable(),message_reference:Ya.optional().nullable(),flags:G().optional().nullable(),stickers:ne(Jt()).optional().nullable(),referenced_message:Jt().optional().nullable()}),$a=O({id:v(),name:v()}),Xa={UNHANDLED:-1,KEYBOARD_KEY:0,MOUSE_BUTTON:1,KEYBOARD_MODIFIER_KEY:2,GAMEPAD_BUTTON:3},kr=O({type:ye(Xa),code:G(),name:v()}),za={UNHANDLED:-1,PUSH_TO_TALK:"PUSH_TO_TALK",VOICE_ACTIVITY:"VOICE_ACTIVITY"},Gi=O({type:ye(za),auto_threshold:q(),threshold:G(),shortcut:ne(kr),delay:G()}),Gr=O({device_id:v(),volume:G(),available_devices:ne($a)}),Wa={UNHANDLED:-1,AUDIO_INPUT:"AUDIO_INPUT",AUDIO_OUTPUT:"AUDIO_OUTPUT",VIDEO_INPUT:"VIDEO_INPUT"},ju=O({type:ye(Wa),id:v(),vendor:O({name:v(),url:v()}),model:O({name:v(),url:v()}),related:ne(v()),echo_cancellation:q().optional().nullable(),noise_suppression:q().optional().nullable(),automatic_gain_control:q().optional().nullable(),hardware_mute:q().optional().nullable()}),Qa={UNHANDLED:-1,APPLICATION:1,DLC:2,CONSUMABLE:3,BUNDLE:4,SUBSCRIPTION:5},Bi=O({id:v(),name:v(),type:ye(Qa),price:O({amount:G(),currency:v()}),application_id:v(),flags:G(),release_date:v().nullable()}),Ja={UNHANDLED:-1,PURCHASE:1,PREMIUM_SUBSCRIPTION:2,DEVELOPER_GIFT:3,TEST_MODE_PURCHASE:4,FREE_PURCHASE:5,USER_GIFT:6,PREMIUM_PURCHASE:7},En=O({id:v(),sku_id:v(),application_id:v(),user_id:v(),gift_code_flags:G(),type:ye(Ja),gifter_user_id:v().optional().nullable(),branches:ne(v()).optional().nullable(),starts_at:v().optional().nullable(),ends_at:v().optional().nullable(),parent_id:v().optional().nullable(),consumed:q().optional().nullable(),deleted:q().optional().nullable(),gift_code_batch_id:v().optional().nullable()}),es={UNHANDLED:-1,UNLOCKED:1,PORTRAIT:2,LANDSCAPE:3},Fu=ye(es),ts={UNHANDLED:-1,NOMINAL:0,FAIR:1,SERIOUS:2,CRITICAL:3},Hi=ye(ts),Br={UNHANDLED:-1,PORTRAIT:0,LANDSCAPE:1},qu=ye(Br),Hr={UNHANDLED:-1,FOCUSED:0,PIP:1,GRID:2},Zu=ye(Hr);var Yn="ERROR",J;(function(e){e.READY="READY",e.VOICE_STATE_UPDATE="VOICE_STATE_UPDATE",e.SPEAKING_START="SPEAKING_START",e.SPEAKING_STOP="SPEAKING_STOP",e.ACTIVITY_LAYOUT_MODE_UPDATE="ACTIVITY_LAYOUT_MODE_UPDATE",e.ORIENTATION_UPDATE="ORIENTATION_UPDATE",e.CURRENT_USER_UPDATE="CURRENT_USER_UPDATE",e.CURRENT_GUILD_MEMBER_UPDATE="CURRENT_GUILD_MEMBER_UPDATE",e.ENTITLEMENT_CREATE="ENTITLEMENT_CREATE",e.THERMAL_STATE_UPDATE="THERMAL_STATE_UPDATE",e.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE="ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE",e.RELATIONSHIP_UPDATE="RELATIONSHIP_UPDATE",e.ACTIVITY_JOIN="ACTIVITY_JOIN",e.QUEST_ENROLLMENT_STATUS_UPDATE="QUEST_ENROLLMENT_STATUS_UPDATE"})(J||(J={}));var Re=Je.extend({evt:gt(J),nonce:v().nullable(),cmd:pe(Li),data:O({}).passthrough()}),Vi=Je.extend({evt:pe(Yn),data:O({code:G(),message:v().optional()}).passthrough(),cmd:gt(D),nonce:v().nullable()}),Cu=Re.extend({evt:v()}),ns=Bn([Re,Cu,Vi]);function rs(e){let t=e.evt;if(!(t in J))throw new Error(`Unrecognized event type ${e.evt}`);return Ku[t].payload.parse(e)}var Ku={[J.READY]:{payload:Re.extend({evt:pe(J.READY),data:O({v:G(),config:O({cdn_host:v().optional(),api_endpoint:v(),environment:v()}),user:O({id:v(),username:v(),discriminator:v(),avatar:v().optional()}).optional()})})},[J.VOICE_STATE_UPDATE]:{payload:Re.extend({evt:pe(J.VOICE_STATE_UPDATE),data:Kn}),subscribeArgs:O({channel_id:v()})},[J.SPEAKING_START]:{payload:Re.extend({evt:pe(J.SPEAKING_START),data:O({lobby_id:v().optional(),channel_id:v().optional(),user_id:v()})}),subscribeArgs:O({lobby_id:v().nullable().optional(),channel_id:v().nullable().optional()})},[J.SPEAKING_STOP]:{payload:Re.extend({evt:pe(J.SPEAKING_STOP),data:O({lobby_id:v().optional(),channel_id:v().optional(),user_id:v()})}),subscribeArgs:O({lobby_id:v().nullable().optional(),channel_id:v().nullable().optional()})},[J.ACTIVITY_LAYOUT_MODE_UPDATE]:{payload:Re.extend({evt:pe(J.ACTIVITY_LAYOUT_MODE_UPDATE),data:O({layout_mode:ye(Hr)})})},[J.ORIENTATION_UPDATE]:{payload:Re.extend({evt:pe(J.ORIENTATION_UPDATE),data:O({screen_orientation:ye(Br),orientation:gt(jn)})})},[J.CURRENT_USER_UPDATE]:{payload:Re.extend({evt:pe(J.CURRENT_USER_UPDATE),data:nt})},[J.CURRENT_GUILD_MEMBER_UPDATE]:{payload:Re.extend({evt:pe(J.CURRENT_GUILD_MEMBER_UPDATE),data:Pi}),subscribeArgs:O({guild_id:v()})},[J.ENTITLEMENT_CREATE]:{payload:Re.extend({evt:pe(J.ENTITLEMENT_CREATE),data:O({entitlement:En})})},[J.THERMAL_STATE_UPDATE]:{payload:Re.extend({evt:pe(J.THERMAL_STATE_UPDATE),data:O({thermal_state:Hi})})},[J.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE]:{payload:Re.extend({evt:pe(J.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE),data:O({participants:xi.shape.participants})})},[J.RELATIONSHIP_UPDATE]:{payload:Re.extend({evt:pe(J.RELATIONSHIP_UPDATE),data:Ui})},[J.ACTIVITY_JOIN]:{payload:Re.extend({evt:pe(J.ACTIVITY_JOIN),data:O({applicationId:v(),secret:v()})})},[J.QUEST_ENROLLMENT_STATUS_UPDATE]:{payload:Re.extend({evt:pe(J.QUEST_ENROLLMENT_STATUS_UPDATE),data:O({quest_id:v(),is_enrolled:q(),enrolled_at:v().date()})})}};var qi={};pa(qi,{AuthenticateResponse:()=>qn,AuthorizeResponse:()=>jr,CaptureShortcutResponse:()=>ps,EmptyResponse:()=>xt,EncourageHardwareAccelerationResponse:()=>$r,GetChannelPermissionsResponse:()=>Xr,GetChannelResponse:()=>Ot,GetChannelsResponse:()=>os,GetEntitlementsResponse:()=>Zr,GetGuildResponse:()=>ss,GetGuildsResponse:()=>as,GetPlatformBehaviorsResponse:()=>Wr,GetSkusResponse:()=>qr,InitiateImageUploadResponse:()=>Oi,NullableChannelResponse:()=>Yu,OpenExternalLinkResponse:()=>zr,ResponseFrame:()=>ji,SelectTextChannelResponse:()=>us,SelectVoiceChannelResponse:()=>ls,SetActivityResponse:()=>Fr,SetConfigResponse:()=>Kr,StartPurchaseResponse:()=>Cr,SubscribeResponse:()=>cs,UserSettingsGetLocaleResponse:()=>Yr,VoiceSettingsResponse:()=>$u,parseResponsePayload:()=>Fi});function is(e,t){throw t}var xt=O({}).nullable(),jr=O({code:v()}),as=O({guilds:ne(O({id:v(),name:v()}))}),ss=O({id:v(),name:v(),icon_url:v().optional(),members:ne(Cn)}),Ot=O({id:v(),type:ye(vn),guild_id:v().optional().nullable(),name:v().optional().nullable(),topic:v().optional().nullable(),bitrate:G().optional().nullable(),user_limit:G().optional().nullable(),position:G().optional().nullable(),voice_states:ne(Kn),messages:ne(ki)}),os=O({channels:ne(Mr)}),Yu=Ot.nullable(),ls=Ot.nullable(),us=Ot.nullable(),$u=O({input:Gr,output:Gr,mode:Gi,automatic_gain_control:q(),echo_cancellation:q(),noise_suppression:q(),qos:q(),silence_warning:q(),deaf:q(),mute:q()}),cs=O({evt:v()}),ps=O({shortcut:kr}),Fr=Rt,qr=O({skus:ne(Bi)}),Zr=O({entitlements:ne(En)}),Cr=ne(En).nullable(),Kr=O({use_interactive_pip:q()}),Yr=O({locale:v()}),$r=O({enabled:q()}),Xr=O({permissions:Si().or(v())}),zr=Dr(O({opened:q().or(gn())}).default({opened:null})),Wr=O({iosKeyboardResizesView:bi(q())}),ji=Je.extend({cmd:gt(D),evt:gn()});function Xu({cmd:e,data:t}){switch(e){case D.AUTHORIZE:return jr.parse(t);case D.CAPTURE_SHORTCUT:return ps.parse(t);case D.ENCOURAGE_HW_ACCELERATION:return $r.parse(t);case D.GET_CHANNEL:return Ot.parse(t);case D.GET_CHANNELS:return os.parse(t);case D.GET_CHANNEL_PERMISSIONS:return Xr.parse(t);case D.GET_GUILD:return ss.parse(t);case D.GET_GUILDS:return as.parse(t);case D.GET_PLATFORM_BEHAVIORS:return Wr.parse(t);case D.GET_CHANNEL:return Ot.parse(t);case D.SELECT_TEXT_CHANNEL:return us.parse(t);case D.SELECT_VOICE_CHANNEL:return ls.parse(t);case D.SET_ACTIVITY:return Fr.parse(t);case D.GET_SKUS_EMBEDDED:return qr.parse(t);case D.GET_ENTITLEMENTS_EMBEDDED:return Zr.parse(t);case D.SET_CONFIG:return Kr.parse(t);case D.START_PURCHASE:return Cr.parse(t);case D.SUBSCRIBE:case D.UNSUBSCRIBE:return cs.parse(t);case D.USER_SETTINGS_GET_LOCALE:return Yr.parse(t);case D.OPEN_EXTERNAL_LINK:return zr.parse(t);case D.SET_ORIENTATION_LOCK_STATE:case D.SET_CERTIFIED_DEVICES:case D.SEND_ANALYTICS_EVENT:case D.OPEN_INVITE_DIALOG:case D.CAPTURE_LOG:case D.GET_SKUS:case D.GET_ENTITLEMENTS:return xt.parse(t);case D.AUTHENTICATE:case D.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS:case D.GET_QUEST:case D.GET_QUEST_ENROLLMENT_STATUS:case D.GET_RELATIONSHIPS:case D.GET_USER:case D.INITIATE_IMAGE_UPLOAD:case D.INVITE_USER_EMBEDDED:case D.OPEN_SHARE_MOMENT_DIALOG:case D.QUEST_START_TIMER:case D.REQUEST_PROXY_TICKET_REFRESH:case D.SHARE_INTERACTION:case D.SHARE_LINK:let{response:n}=Lr[e];return n.parse(t);default:is(e,new Error(`Unrecognized command ${e}`))}}function Fi(e){return Object.assign(Object.assign({},e),{data:Xu(e)})}O({frame_id:v(),platform:gt(Ge).optional().nullable()});O({v:pe(1),encoding:pe("json").optional(),client_id:v(),frame_id:v()});var fs=O({code:G(),message:v().optional()}),zu=O({evt:v().nullable(),nonce:v().nullable(),data:Jt().nullable(),cmd:v()}).passthrough();function ds(e){let t=zu.parse(e);return t.evt!=null?t.evt===Yn?Vi.parse(t):rs(ns.parse(t)):Fi(ji.passthrough().parse(t))}function le(e,t,n,r=()=>{}){let i=Je.extend({cmd:pe(t),data:n});return async a=>{let c=await e({cmd:t,args:a,transfer:r(a)});return i.parse(c).data}}function fe(e,t=()=>{}){let n=Lr[e].response,r=Je.extend({cmd:pe(e),data:n});return i=>async a=>{let c=await i({cmd:e,args:a,transfer:t(a)});return r.parse(c).data}}var ms=e=>le(e,D.AUTHORIZE,jr);var hs=e=>le(e,D.CAPTURE_LOG,xt);var _s=e=>le(e,D.ENCOURAGE_HW_ACCELERATION,$r);var gs=e=>le(e,D.GET_CHANNEL,Ot);var vs=e=>le(e,D.GET_ENTITLEMENTS_EMBEDDED,Zr);var Es=e=>le(e,D.GET_SKUS_EMBEDDED,qr);var ys=e=>le(e,D.GET_CHANNEL_PERMISSIONS,Xr);var Ts=e=>le(e,D.GET_PLATFORM_BEHAVIORS,Wr);var Ss=e=>le(e,D.OPEN_EXTERNAL_LINK,zr);var bs=e=>le(e,D.OPEN_INVITE_DIALOG,xt);Rt.pick({state:!0,state_url:!0,details:!0,details_url:!0,timestamps:!0,assets:!0,party:!0,secrets:!0,instance:!0,type:!0}).extend({type:Rt.shape.type.optional(),instance:Rt.shape.instance.optional()}).nullable();var As=e=>le(e,D.SET_ACTIVITY,Fr);var Is=e=>le(e,D.SET_CONFIG,Kr);function Ns({sendCommand:e,cmd:t,response:n,fallbackTransform:r,transferTransform:i=()=>{}}){let a=Je.extend({cmd:pe(t),data:n});return async c=>{try{let u=await e({cmd:t,args:c,transfer:i(c)});return a.parse(u).data}catch(u){if(u.code===Vn.INVALID_PAYLOAD){let h=r(c),f=await e({cmd:t,args:h,transfer:i(h)});return a.parse(f).data}else throw u}}}var Wu=e=>({lock_state:e.lock_state,picture_in_picture_lock_state:e.picture_in_picture_lock_state}),ws=e=>Ns({sendCommand:e,cmd:D.SET_ORIENTATION_LOCK_STATE,response:xt,fallbackTransform:Wu});var Rs=e=>le(e,D.START_PURCHASE,Cr);var Os=e=>le(e,D.USER_SETTINGS_GET_LOCALE,Yr);var xs=fe(Q.AUTHENTICATE);var Zi=fe(Q.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS);var Ds=fe(Q.GET_QUEST);var Ls=fe(Q.GET_QUEST_ENROLLMENT_STATUS);var Us=fe(Q.GET_RELATIONSHIPS);var Ps=fe(Q.GET_USER);var Ms=fe(Q.INITIATE_IMAGE_UPLOAD);var ks=fe(Q.INVITE_USER_EMBEDDED);var Gs=fe(Q.OPEN_SHARE_MOMENT_DIALOG);var Bs=fe(Q.QUEST_START_TIMER);var Hs=fe(Q.REQUEST_PROXY_TICKET_REFRESH);var Vs=fe(Q.SHARE_INTERACTION);var js=fe(Q.SHARE_LINK);function Fs(e){return{authorize:ms(e),captureLog:hs(e),encourageHardwareAcceleration:_s(e),getChannel:gs(e),getChannelPermissions:ys(e),getEntitlements:vs(e),getPlatformBehaviors:Ts(e),getSkus:Es(e),openExternalLink:Ss(e),openInviteDialog:bs(e),setActivity:As(e),setConfig:Is(e),setOrientationLockState:ws(e),startPurchase:Rs(e),userSettingsGetLocale:Os(e),getInstanceConnectedParticipants:Zi(e),authenticate:xs(e),getActivityInstanceConnectedParticipants:Zi(e),getQuest:Ds(e),getQuestEnrollmentStatus:Ls(e),getRelationships:Us(e),getUser:Ps(e),initiateImageUpload:Ms(e),inviteUserEmbedded:ks(e),openShareMomentDialog:Gs(e),questStartTimer:Bs(e),requestProxyTicketRefresh:Hs(e),shareInteraction:Vs(e),shareLink:js(e)}}var Qr=class extends Error{constructor(t,n=""){super(n),this.code=t,this.message=n,this.name="Discord SDK Error"}};function Jr(){return{disableConsoleLogOverride:!1}}var qs=["log","warn","debug","info","error"];function Zs(e,t,n){let r=e[t],i=e;r&&(e[t]=function(){let a=[].slice.call(arguments),c=""+a.join(" ");n(t,c),r.apply(i,a)})}var Cs="2.5.0";var Qu=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ci={randomUUID:Qu};var Ki,Ju=new Uint8Array(16);function Ks(){if(!Ki){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ki=crypto.getRandomValues.bind(crypto)}return Ki(Ju)}var be=[];for(let e=0;e<256;++e)be.push((e+256).toString(16).slice(1));function Ys(e,t=0){return(be[e[t+0]]+be[e[t+1]]+be[e[t+2]]+be[e[t+3]]+"-"+be[e[t+4]]+be[e[t+5]]+"-"+be[e[t+6]]+be[e[t+7]]+"-"+be[e[t+8]]+be[e[t+9]]+"-"+be[e[t+10]]+be[e[t+11]]+be[e[t+12]]+be[e[t+13]]+be[e[t+14]]+be[e[t+15]]).toLowerCase()}function Yi(e,t,n){if(Ci.randomUUID&&!t&&!e)return Ci.randomUUID();e=e||{};let r=e.random??e.rng?.()??Ks();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ys(r)}var vt;(function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.FRAME=1]="FRAME",e[e.CLOSE=2]="CLOSE",e[e.HELLO=3]="HELLO"})(vt||(vt={}));var ec=new Set(tc());function tc(){return typeof window>"u"?[]:[window.location.origin,"https://discord.com","https://discordapp.com","https://ptb.discord.com","https://ptb.discordapp.com","https://canary.discord.com","https://canary.discordapp.com","https://staging.discord.co","http://localhost:3333","https://pax.discord.com","null"]}function nc(){var e;return[(e=window.parent.opener)!==null&&e!==void 0?e:window.parent,document.referrer?document.referrer:"*"]}var $i=class{getTransfer(t){var n;switch(t.cmd){case D.SUBSCRIBE:case D.UNSUBSCRIBE:return;default:return(n=t.transfer)!==null&&n!==void 0?n:void 0}}constructor(t,n){if(this.sdkVersion=Cs,this.mobileAppVersion=null,this.source=null,this.sourceOrigin="",this.eventBus=new Er,this.pendingCommands=new Map,this.sendCommand=u=>{var h;if(this.source==null)throw new Error("Attempting to send message before initialization");let f=Yi();return(h=this.source)===null||h===void 0||h.postMessage([vt.FRAME,Object.assign(Object.assign({},u),{nonce:f})],this.sourceOrigin,this.getTransfer(u)),new Promise((g,A)=>{this.pendingCommands.set(f,{resolve:g,reject:A})})},this.commands=Fs(this.sendCommand),this.handleMessage=u=>{if(!ec.has(u.origin))return;let h=u.data;if(!Array.isArray(h))return;let[f,p]=h;switch(f){case vt.HELLO:return;case vt.CLOSE:return this.handleClose(p);case vt.HANDSHAKE:return this.handleHandshake();case vt.FRAME:return this.handleFrame(p);default:throw new Error("Invalid message format")}},this.isReady=!1,this.clientId=t,this.configuration=n??Jr(),typeof window<"u"&&window.addEventListener("message",this.handleMessage),typeof window>"u"){this.frameId="",this.instanceId="",this.customId=null,this.referrerId=null,this.platform=Ge.DESKTOP,this.guildId=null,this.channelId=null,this.locationId=null;return}let r=new URLSearchParams(this._getSearch()),i=r.get("frame_id");if(!i)throw new Error("frame_id query param is not defined");this.frameId=i;let a=r.get("instance_id");if(!a)throw new Error("instance_id query param is not defined");this.instanceId=a;let c=r.get("platform");if(c){if(c!==Ge.DESKTOP&&c!==Ge.MOBILE)throw new Error(`Invalid query param "platform" of "${c}". Valid values are "${Ge.DESKTOP}" or "${Ge.MOBILE}"`)}else throw new Error("platform query param is not defined");this.platform=c,this.customId=r.get("custom_id"),this.referrerId=r.get("referrer_id"),this.guildId=r.get("guild_id"),this.channelId=r.get("channel_id"),this.locationId=r.get("location_id"),this.mobileAppVersion=r.get("mobile_app_version"),[this.source,this.sourceOrigin]=nc(),this.addOnReadyListener(),this.handshake()}close(t,n){var r;window.removeEventListener("message",this.handleMessage);let i=Yi();(r=this.source)===null||r===void 0||r.postMessage([vt.CLOSE,{code:t,message:n,nonce:i}],this.sourceOrigin)}async subscribe(t,n,...r){let[i]=r,a=this.eventBus.listenerCount(t),c=this.eventBus.on(t,n);return Object.values(J).includes(t)&&t!==J.READY&&a===0&&await this.sendCommand({cmd:D.SUBSCRIBE,args:i,evt:t}),c}async unsubscribe(t,n,...r){let[i]=r;return t!==J.READY&&this.eventBus.listenerCount(t)===1&&await this.sendCommand({cmd:D.UNSUBSCRIBE,evt:t,args:i}),this.eventBus.off(t,n)}async ready(){this.isReady||await new Promise(t=>{this.eventBus.once(J.READY,t)})}parseMajorMobileVersion(){if(this.mobileAppVersion&&this.mobileAppVersion.includes("."))try{return parseInt(this.mobileAppVersion.split(".")[0])}catch{return Ri}return Ri}handshake(){var t;let n={v:1,encoding:"json",client_id:this.clientId,frame_id:this.frameId},r=this.parseMajorMobileVersion();(this.platform===Ge.DESKTOP||r>=Ra)&&(n.sdk_version=this.sdkVersion),(t=this.source)===null||t===void 0||t.postMessage([vt.HANDSHAKE,n],this.sourceOrigin)}addOnReadyListener(){this.eventBus.once(J.READY,()=>{this.overrideConsoleLogging(),this.isReady=!0})}overrideConsoleLogging(){if(this.configuration.disableConsoleLogOverride)return;let t=(n,r)=>{this.commands.captureLog({level:n,message:r})};qs.forEach(n=>{Zs(console,n,t)})}handleClose(t){fs.parse(t)}handleHandshake(){}handleFrame(t){var n,r;let i;try{i=ds(t)}catch(a){console.error("Failed to parse",t),console.error(a);return}if(i.cmd==="DISPATCH")this.eventBus.emit(i.evt,i.data);else{if(i.evt===Yn){if(i.nonce!=null){(n=this.pendingCommands.get(i.nonce))===null||n===void 0||n.reject(i.data),this.pendingCommands.delete(i.nonce);return}this.eventBus.emit("error",new Qr(i.data.code,i.data.message))}if(i.nonce==null){console.error("Missing nonce",t);return}(r=this.pendingCommands.get(i.nonce))===null||r===void 0||r.resolve(i),this.pendingCommands.delete(i.nonce)}}_getSearch(){return typeof window>"u"?"":window.location.search}};function rc(e,t){return V.has(V.deserialize(t),e)}var ic={can:rc};var yn=1e9,ac={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Wi,me=!0,$e="[DecimalError] ",tn=$e+"Invalid argument: ",zi=$e+"Exponent out of range: ",Tn=Math.floor,en=Math.pow,sc=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,je,Te=1e7,de=7,zs=9007199254740991,ei=Tn(zs/de),k={};k.absoluteValue=k.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};k.comparedTo=k.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};k.decimalPlaces=k.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*de;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};k.dividedBy=k.div=function(e){return Et(this,new this.constructor(e))};k.dividedToIntegerBy=k.idiv=function(e){var t=this,n=t.constructor;return ce(Et(t,new n(e),0,1),n.precision)};k.equals=k.eq=function(e){return!this.cmp(e)};k.exponent=function(){return Ee(this)};k.greaterThan=k.gt=function(e){return this.cmp(e)>0};k.greaterThanOrEqualTo=k.gte=function(e){return this.cmp(e)>=0};k.isInteger=k.isint=function(){return this.e>this.d.length-2};k.isNegative=k.isneg=function(){return this.s<0};k.isPositive=k.ispos=function(){return this.s>0};k.isZero=function(){return this.s===0};k.lessThan=k.lt=function(e){return this.cmp(e)<0};k.lessThanOrEqualTo=k.lte=function(e){return this.cmp(e)<1};k.logarithm=k.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(je))throw Error($e+"NaN");if(n.s<1)throw Error($e+(n.s?"NaN":"-Infinity"));return n.eq(je)?new r(0):(me=!1,t=Et($n(n,a),$n(e,a),a),me=!0,ce(t,i))};k.minus=k.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Js(t,e):Ws(t,(e.s=-e.s,e))};k.modulo=k.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error($e+"NaN");return n.s?(me=!1,t=Et(n,e,0,1).times(e),me=!0,n.minus(t)):ce(new r(n),i)};k.naturalExponential=k.exp=function(){return Qs(this)};k.naturalLogarithm=k.ln=function(){return $n(this)};k.negated=k.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};k.plus=k.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ws(t,e):Js(t,(e.s=-e.s,e))};k.precision=k.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(tn+e);if(t=Ee(i)+1,r=i.d.length-1,n=r*de+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};k.squareRoot=k.sqrt=function(){var e,t,n,r,i,a,c,u=this,h=u.constructor;if(u.s<1){if(!u.s)return new h(0);throw Error($e+"NaN")}for(e=Ee(u),me=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=rt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Tn((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new h(t)):r=new h(i.toString()),n=h.precision,i=c=n+3;;)if(a=r,r=a.plus(Et(u,a,c+2)).times(.5),rt(a.d).slice(0,c)===(t=rt(r.d)).slice(0,c)){if(t=t.slice(c-3,c+1),i==c&&t=="4999"){if(ce(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;c+=4}return me=!0,ce(r,n)};k.times=k.mul=function(e){var t,n,r,i,a,c,u,h,f,p=this,g=p.constructor,A=p.d,U=(e=new g(e)).d;if(!p.s||!e.s)return new g(0);for(e.s*=p.s,n=p.e+e.e,h=A.length,f=U.length,h<f&&(a=A,A=U,U=a,c=h,h=f,f=c),a=[],c=h+f,r=c;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=h+r;i>r;)u=a[i]+U[r]*A[i-r-1]+t,a[i--]=u%Te|0,t=u/Te|0;a[i]=(a[i]+t)%Te|0}for(;!a[--c];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,me?ce(e,g.precision):e};k.toDecimalPlaces=k.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(it(e,0,yn),t===void 0?t=r.rounding:it(t,0,8),ce(n,e+Ee(n)+1,t))};k.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=nn(r,!0):(it(e,0,yn),t===void 0?t=i.rounding:it(t,0,8),r=ce(new i(r),e+1,t),n=nn(r,!0,e+1)),n};k.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?nn(i):(it(e,0,yn),t===void 0?t=a.rounding:it(t,0,8),r=ce(new a(i),e+Ee(i)+1,t),n=nn(r.abs(),!1,e+Ee(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};k.toInteger=k.toint=function(){var e=this,t=e.constructor;return ce(new t(e),Ee(e)+1,t.rounding)};k.toNumber=function(){return+this};k.toPower=k.pow=function(e){var t,n,r,i,a,c,u=this,h=u.constructor,f=12,p=+(e=new h(e));if(!e.s)return new h(je);if(u=new h(u),!u.s){if(e.s<1)throw Error($e+"Infinity");return u}if(u.eq(je))return u;if(r=h.precision,e.eq(je))return ce(u,r);if(t=e.e,n=e.d.length-1,c=t>=n,a=u.s,c){if((n=p<0?-p:p)<=zs){for(i=new h(je),t=Math.ceil(r/de+4),me=!1;n%2&&(i=i.times(u),Xs(i.d,t)),n=Tn(n/2),n!==0;)u=u.times(u),Xs(u.d,t);return me=!0,e.s<0?new h(je).div(i):ce(i,r)}}else if(a<0)throw Error($e+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,me=!1,i=e.times($n(u,r+f)),me=!0,i=Qs(i),i.s=a,i};k.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Ee(i),r=nn(i,n<=a.toExpNeg||n>=a.toExpPos)):(it(e,1,yn),t===void 0?t=a.rounding:it(t,0,8),i=ce(new a(i),e,t),n=Ee(i),r=nn(i,e<=n||n<=a.toExpNeg,e)),r};k.toSignificantDigits=k.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(it(e,1,yn),t===void 0?t=r.rounding:it(t,0,8)),ce(new r(n),e,t)};k.toString=k.valueOf=k.val=k.toJSON=k[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ee(e),n=e.constructor;return nn(e,t<=n.toExpNeg||t>=n.toExpPos)};function Ws(e,t){var n,r,i,a,c,u,h,f,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),me?ce(t,g):t;if(h=e.d,f=t.d,c=e.e,i=t.e,h=h.slice(),a=c-i,a){for(a<0?(r=h,a=-a,u=f.length):(r=f,i=c,u=h.length),c=Math.ceil(g/de),u=c>u?c+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=h.length,a=f.length,u-a<0&&(a=u,r=f,f=h,h=r),n=0;a;)n=(h[--a]=h[a]+f[a]+n)/Te|0,h[a]%=Te;for(n&&(h.unshift(n),++i),u=h.length;h[--u]==0;)h.pop();return t.d=h,t.e=i,me?ce(t,g):t}function it(e,t,n){if(e!==~~e||e<t||e>n)throw Error(tn+e)}function rt(e){var t,n,r,i=e.length-1,a="",c=e[0];if(i>0){for(a+=c,t=1;t<i;t++)r=e[t]+"",n=de-r.length,n&&(a+=Dt(n)),a+=r;c=e[t],r=c+"",n=de-r.length,n&&(a+=Dt(n))}else if(c===0)return"0";for(;c%10===0;)c/=10;return a+c}var Et=(function(){function e(r,i){var a,c=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+c,r[u]=a%Te|0,c=a/Te|0;return c&&r.unshift(c),r}function t(r,i,a,c){var u,h;if(a!=c)h=a>c?1:-1;else for(u=h=0;u<a;u++)if(r[u]!=i[u]){h=r[u]>i[u]?1:-1;break}return h}function n(r,i,a){for(var c=0;a--;)r[a]-=c,c=r[a]<i[a]?1:0,r[a]=c*Te+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,c){var u,h,f,p,g,A,U,Y,j,L,_e,ae,se,Oe,ve,Fe,Ae,Be,Xe=r.constructor,qe=r.s==i.s?1:-1,xe=r.d,ue=i.d;if(!r.s)return new Xe(r);if(!i.s)throw Error($e+"Division by zero");for(h=r.e-i.e,Ae=ue.length,ve=xe.length,U=new Xe(qe),Y=U.d=[],f=0;ue[f]==(xe[f]||0);)++f;if(ue[f]>(xe[f]||0)&&--h,a==null?ae=a=Xe.precision:c?ae=a+(Ee(r)-Ee(i))+1:ae=a,ae<0)return new Xe(0);if(ae=ae/de+2|0,f=0,Ae==1)for(p=0,ue=ue[0],ae++;(f<ve||p)&&ae--;f++)se=p*Te+(xe[f]||0),Y[f]=se/ue|0,p=se%ue|0;else{for(p=Te/(ue[0]+1)|0,p>1&&(ue=e(ue,p),xe=e(xe,p),Ae=ue.length,ve=xe.length),Oe=Ae,j=xe.slice(0,Ae),L=j.length;L<Ae;)j[L++]=0;Be=ue.slice(),Be.unshift(0),Fe=ue[0],ue[1]>=Te/2&&++Fe;do p=0,u=t(ue,j,Ae,L),u<0?(_e=j[0],Ae!=L&&(_e=_e*Te+(j[1]||0)),p=_e/Fe|0,p>1?(p>=Te&&(p=Te-1),g=e(ue,p),A=g.length,L=j.length,u=t(g,j,A,L),u==1&&(p--,n(g,Ae<A?Be:ue,A))):(p==0&&(u=p=1),g=ue.slice()),A=g.length,A<L&&g.unshift(0),n(j,g,L),u==-1&&(L=j.length,u=t(ue,j,Ae,L),u<1&&(p++,n(j,Ae<L?Be:ue,L))),L=j.length):u===0&&(p++,j=[0]),Y[f++]=p,u&&j[0]?j[L++]=xe[Oe]||0:(j=[xe[Oe]],L=1);while((Oe++<ve||j[0]!==void 0)&&ae--)}return Y[0]||Y.shift(),U.e=h,ce(U,c?a+Ee(U)+1:a)}})();function Qs(e,t){var n,r,i,a,c,u,h=0,f=0,p=e.constructor,g=p.precision;if(Ee(e)>16)throw Error(zi+Ee(e));if(!e.s)return new p(je);for(t==null?(me=!1,u=g):u=t,c=new p(.03125);e.abs().gte(.1);)e=e.times(c),f+=5;for(r=Math.log(en(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(je),p.precision=u;;){if(i=ce(i.times(e),u),n=n.times(++h),c=a.plus(Et(i,n,u)),rt(c.d).slice(0,u)===rt(a.d).slice(0,u)){for(;f--;)a=ce(a.times(a),u);return p.precision=g,t==null?(me=!0,ce(a,g)):a}a=c}}function Ee(e){for(var t=e.e*de,n=e.d[0];n>=10;n/=10)t++;return t}function Xi(e,t,n){if(t>e.LN10.sd())throw me=!0,n&&(e.precision=n),Error($e+"LN10 precision limit exceeded");return ce(new e(e.LN10),t)}function Dt(e){for(var t="";e--;)t+="0";return t}function $n(e,t){var n,r,i,a,c,u,h,f,p,g=1,A=10,U=e,Y=U.d,j=U.constructor,L=j.precision;if(U.s<1)throw Error($e+(U.s?"NaN":"-Infinity"));if(U.eq(je))return new j(0);if(t==null?(me=!1,f=L):f=t,U.eq(10))return t==null&&(me=!0),Xi(j,f);if(f+=A,j.precision=f,n=rt(Y),r=n.charAt(0),a=Ee(U),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)U=U.times(e),n=rt(U.d),r=n.charAt(0),g++;a=Ee(U),r>1?(U=new j("0."+n),a++):U=new j(r+"."+n.slice(1))}else return h=Xi(j,f+2,L).times(a+""),U=$n(new j(r+"."+n.slice(1)),f-A).plus(h),j.precision=L,t==null?(me=!0,ce(U,L)):U;for(u=c=U=Et(U.minus(je),U.plus(je),f),p=ce(U.times(U),f),i=3;;){if(c=ce(c.times(p),f),h=u.plus(Et(c,new j(i),f)),rt(h.d).slice(0,f)===rt(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(Xi(j,f+2,L).times(a+""))),u=Et(u,new j(g),f),j.precision=L,t==null?(me=!0,ce(u,L)):u;u=h,i+=2}}function $s(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Tn(n/de),e.d=[],r=(n+1)%de,n<0&&(r+=de),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=de;r<i;)e.d.push(+t.slice(r,r+=de));t=t.slice(r),r=de-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),me&&(e.e>ei||e.e<-ei))throw Error(zi+n)}else e.s=0,e.e=0,e.d=[0];return e}function ce(e,t,n){var r,i,a,c,u,h,f,p,g=e.d;for(c=1,a=g[0];a>=10;a/=10)c++;if(r=t-c,r<0)r+=de,i=t,f=g[p=0];else{if(p=Math.ceil((r+1)/de),a=g.length,p>=a)return e;for(f=a=g[p],c=1;a>=10;a/=10)c++;r%=de,i=r-de+c}if(n!==void 0&&(a=en(10,c-i-1),u=f/a%10|0,h=t<0||g[p+1]!==void 0||f%a,h=n<4?(u||h)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||h||n==6&&(r>0?i>0?f/en(10,c-i):0:g[p-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return h?(a=Ee(e),g.length=1,t=t-a-1,g[0]=en(10,(de-t%de)%de),e.e=Tn(-t/de)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(r==0?(g.length=p,a=1,p--):(g.length=p+1,a=en(10,de-r),g[p]=i>0?(f/en(10,c-i)%en(10,i)|0)*a:0),h)for(;;)if(p==0){(g[0]+=a)==Te&&(g[0]=1,++e.e);break}else{if(g[p]+=a,g[p]!=Te)break;g[p--]=0,a=1}for(r=g.length;g[--r]===0;)g.pop();if(me&&(e.e>ei||e.e<-ei))throw Error(zi+Ee(e));return e}function Js(e,t){var n,r,i,a,c,u,h,f,p,g,A=e.constructor,U=A.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new A(e),me?ce(t,U):t;if(h=e.d,g=t.d,r=t.e,f=e.e,h=h.slice(),c=f-r,c){for(p=c<0,p?(n=h,c=-c,u=g.length):(n=g,r=f,u=h.length),i=Math.max(Math.ceil(U/de),u)+2,c>i&&(c=i,n.length=1),n.reverse(),i=c;i--;)n.push(0);n.reverse()}else{for(i=h.length,u=g.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(h[i]!=g[i]){p=h[i]<g[i];break}c=0}for(p&&(n=h,h=g,g=n,t.s=-t.s),u=h.length,i=g.length-u;i>0;--i)h[u++]=0;for(i=g.length;i>c;){if(h[--i]<g[i]){for(a=i;a&&h[--a]===0;)h[a]=Te-1;--h[a],h[i]+=Te}h[i]-=g[i]}for(;h[--u]===0;)h.pop();for(;h[0]===0;h.shift())--r;return h[0]?(t.d=h,t.e=r,me?ce(t,U):t):new A(0)}function nn(e,t,n){var r,i=Ee(e),a=rt(e.d),c=a.length;return t?(n&&(r=n-c)>0?a=a.charAt(0)+"."+a.slice(1)+Dt(r):c>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Dt(-i-1)+a,n&&(r=n-c)>0&&(a+=Dt(r))):i>=c?(a+=Dt(i+1-c),n&&(r=n-i-1)>0&&(a=a+"."+Dt(r))):((r=i+1)<c&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-c)>0&&(i+1===c&&(a+="."),a+=Dt(r))),e.s<0?"-"+a:a}function Xs(e,t){if(e.length>t)return e.length=t,!0}function eo(e){var t,n,r;function i(a){var c=this;if(!(c instanceof i))return new i(a);if(c.constructor=i,a instanceof i){c.s=a.s,c.e=a.e,c.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(tn+a);if(a>0)c.s=1;else if(a<0)a=-a,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(a===~~a&&a<1e7){c.e=0,c.d=[a];return}return $s(c,a.toString())}else if(typeof a!="string")throw Error(tn+a);if(a.charCodeAt(0)===45?(a=a.slice(1),c.s=-1):c.s=1,sc.test(a))$s(c,a);else throw Error(tn+a)}if(i.prototype=k,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=eo,i.config=i.set=oc,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function oc(e){if(!e||typeof e!="object")throw Error($e+"Object expected");var t,n,r,i=["precision",1,yn,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Tn(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(tn+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(tn+n+": "+r);return this}var Wi=eo(ac);je=new Wi(1);var to=Wi;var E;(function(e){e.AED="aed",e.AFN="afn",e.ALL="all",e.AMD="amd",e.ANG="ang",e.AOA="aoa",e.ARS="ars",e.AUD="aud",e.AWG="awg",e.AZN="azn",e.BAM="bam",e.BBD="bbd",e.BDT="bdt",e.BGN="bgn",e.BHD="bhd",e.BIF="bif",e.BMD="bmd",e.BND="bnd",e.BOB="bob",e.BOV="bov",e.BRL="brl",e.BSD="bsd",e.BTN="btn",e.BWP="bwp",e.BYN="byn",e.BYR="byr",e.BZD="bzd",e.CAD="cad",e.CDF="cdf",e.CHE="che",e.CHF="chf",e.CHW="chw",e.CLF="clf",e.CLP="clp",e.CNY="cny",e.COP="cop",e.COU="cou",e.CRC="crc",e.CUC="cuc",e.CUP="cup",e.CVE="cve",e.CZK="czk",e.DJF="djf",e.DKK="dkk",e.DOP="dop",e.DZD="dzd",e.EGP="egp",e.ERN="ern",e.ETB="etb",e.EUR="eur",e.FJD="fjd",e.FKP="fkp",e.GBP="gbp",e.GEL="gel",e.GHS="ghs",e.GIP="gip",e.GMD="gmd",e.GNF="gnf",e.GTQ="gtq",e.GYD="gyd",e.HKD="hkd",e.HNL="hnl",e.HRK="hrk",e.HTG="htg",e.HUF="huf",e.IDR="idr",e.ILS="ils",e.INR="inr",e.IQD="iqd",e.IRR="irr",e.ISK="isk",e.JMD="jmd",e.JOD="jod",e.JPY="jpy",e.KES="kes",e.KGS="kgs",e.KHR="khr",e.KMF="kmf",e.KPW="kpw",e.KRW="krw",e.KWD="kwd",e.KYD="kyd",e.KZT="kzt",e.LAK="lak",e.LBP="lbp",e.LKR="lkr",e.LRD="lrd",e.LSL="lsl",e.LTL="ltl",e.LVL="lvl",e.LYD="lyd",e.MAD="mad",e.MDL="mdl",e.MGA="mga",e.MKD="mkd",e.MMK="mmk",e.MNT="mnt",e.MOP="mop",e.MRO="mro",e.MUR="mur",e.MVR="mvr",e.MWK="mwk",e.MXN="mxn",e.MXV="mxv",e.MYR="myr",e.MZN="mzn",e.NAD="nad",e.NGN="ngn",e.NIO="nio",e.NOK="nok",e.NPR="npr",e.NZD="nzd",e.OMR="omr",e.PAB="pab",e.PEN="pen",e.PGK="pgk",e.PHP="php",e.PKR="pkr",e.PLN="pln",e.PYG="pyg",e.QAR="qar",e.RON="ron",e.RSD="rsd",e.RUB="rub",e.RWF="rwf",e.SAR="sar",e.SBD="sbd",e.SCR="scr",e.SDG="sdg",e.SEK="sek",e.SGD="sgd",e.SHP="shp",e.SLL="sll",e.SOS="sos",e.SRD="srd",e.SSP="ssp",e.STD="std",e.SVC="svc",e.SYP="syp",e.SZL="szl",e.THB="thb",e.TJS="tjs",e.TMT="tmt",e.TND="tnd",e.TOP="top",e.TRY="try",e.TTD="ttd",e.TWD="twd",e.TZS="tzs",e.UAH="uah",e.UGX="ugx",e.USD="usd",e.USN="usn",e.USS="uss",e.UYI="uyi",e.UYU="uyu",e.UZS="uzs",e.VEF="vef",e.VND="vnd",e.VUV="vuv",e.WST="wst",e.XAF="xaf",e.XAG="xag",e.XAU="xau",e.XBA="xba",e.XBB="xbb",e.XBC="xbc",e.XBD="xbd",e.XCD="xcd",e.XDR="xdr",e.XFU="xfu",e.XOF="xof",e.XPD="xpd",e.XPF="xpf",e.XPT="xpt",e.XSU="xsu",e.XTS="xts",e.XUA="xua",e.YER="yer",e.ZAR="zar",e.ZMW="zmw",e.ZWL="zwl"})(E||(E={}));var no={[E.AED]:2,[E.AFN]:2,[E.ALL]:2,[E.AMD]:2,[E.ANG]:2,[E.AOA]:2,[E.ARS]:2,[E.AUD]:2,[E.AWG]:2,[E.AZN]:2,[E.BAM]:2,[E.BBD]:2,[E.BDT]:2,[E.BGN]:2,[E.BHD]:3,[E.BIF]:0,[E.BMD]:2,[E.BND]:2,[E.BOB]:2,[E.BOV]:2,[E.BRL]:2,[E.BSD]:2,[E.BTN]:2,[E.BWP]:2,[E.BYR]:0,[E.BYN]:2,[E.BZD]:2,[E.CAD]:2,[E.CDF]:2,[E.CHE]:2,[E.CHF]:2,[E.CHW]:2,[E.CLF]:0,[E.CLP]:0,[E.CNY]:2,[E.COP]:2,[E.COU]:2,[E.CRC]:2,[E.CUC]:2,[E.CUP]:2,[E.CVE]:2,[E.CZK]:2,[E.DJF]:0,[E.DKK]:2,[E.DOP]:2,[E.DZD]:2,[E.EGP]:2,[E.ERN]:2,[E.ETB]:2,[E.EUR]:2,[E.FJD]:2,[E.FKP]:2,[E.GBP]:2,[E.GEL]:2,[E.GHS]:2,[E.GIP]:2,[E.GMD]:2,[E.GNF]:0,[E.GTQ]:2,[E.GYD]:2,[E.HKD]:2,[E.HNL]:2,[E.HRK]:2,[E.HTG]:2,[E.HUF]:2,[E.IDR]:2,[E.ILS]:2,[E.INR]:2,[E.IQD]:3,[E.IRR]:2,[E.ISK]:0,[E.JMD]:2,[E.JOD]:3,[E.JPY]:0,[E.KES]:2,[E.KGS]:2,[E.KHR]:2,[E.KMF]:0,[E.KPW]:2,[E.KRW]:0,[E.KWD]:3,[E.KYD]:2,[E.KZT]:2,[E.LAK]:2,[E.LBP]:2,[E.LKR]:2,[E.LRD]:2,[E.LSL]:2,[E.LTL]:2,[E.LVL]:2,[E.LYD]:3,[E.MAD]:2,[E.MDL]:2,[E.MGA]:2,[E.MKD]:2,[E.MMK]:2,[E.MNT]:2,[E.MOP]:2,[E.MRO]:2,[E.MUR]:2,[E.MVR]:2,[E.MWK]:2,[E.MXN]:2,[E.MXV]:2,[E.MYR]:2,[E.MZN]:2,[E.NAD]:2,[E.NGN]:2,[E.NIO]:2,[E.NOK]:2,[E.NPR]:2,[E.NZD]:2,[E.OMR]:3,[E.PAB]:2,[E.PEN]:2,[E.PGK]:2,[E.PHP]:2,[E.PKR]:2,[E.PLN]:2,[E.PYG]:0,[E.QAR]:2,[E.RON]:2,[E.RSD]:2,[E.RUB]:2,[E.RWF]:0,[E.SAR]:2,[E.SBD]:2,[E.SCR]:2,[E.SDG]:2,[E.SEK]:2,[E.SGD]:2,[E.SHP]:2,[E.SLL]:2,[E.SOS]:2,[E.SRD]:2,[E.SSP]:2,[E.STD]:2,[E.SVC]:2,[E.SYP]:2,[E.SZL]:2,[E.THB]:2,[E.TJS]:2,[E.TMT]:2,[E.TND]:3,[E.TOP]:2,[E.TRY]:2,[E.TTD]:2,[E.TWD]:2,[E.TZS]:2,[E.UAH]:2,[E.UGX]:0,[E.USD]:2,[E.USN]:2,[E.USS]:2,[E.UYI]:0,[E.UYU]:2,[E.UZS]:2,[E.VEF]:2,[E.VND]:0,[E.VUV]:0,[E.WST]:2,[E.XAF]:0,[E.XAG]:0,[E.XAU]:0,[E.XBA]:0,[E.XBB]:0,[E.XBC]:0,[E.XBD]:0,[E.XCD]:2,[E.XDR]:0,[E.XFU]:0,[E.XOF]:0,[E.XPD]:0,[E.XPF]:0,[E.XPT]:0,[E.XSU]:0,[E.XTS]:0,[E.XUA]:0,[E.YER]:2,[E.ZAR]:2,[E.ZMW]:2,[E.ZWL]:2};function lc(e,t="en-US"){let{amount:n,currency:r}=e;return Intl.NumberFormat(t,{style:"currency",currency:r}).format(uc(n,r))}function uc(e,t){let n=no[t];return n==null?(console.warn(`Unexpected currency ${t}`),e):new to(e).dividedBy(10**n).toNumber()}var cc={formatPrice:lc};var Sn={exports:{}};Sn.exports;var ro;function io(){return ro?Sn.exports:(ro=1,(function(e,t){var n=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,c=2,u=1/0,h=9007199254740991,f="[object Arguments]",p="[object Array]",g="[object Boolean]",A="[object Date]",U="[object Error]",Y="[object Function]",j="[object GeneratorFunction]",L="[object Map]",_e="[object Number]",ae="[object Object]",se="[object Promise]",Oe="[object RegExp]",ve="[object Set]",Fe="[object String]",Ae="[object Symbol]",Be="[object WeakMap]",Xe="[object ArrayBuffer]",qe="[object DataView]",xe="[object Float32Array]",ue="[object Float64Array]",ni="[object Int8Array]",Xn="[object Int16Array]",zn="[object Int32Array]",ri="[object Uint8Array]",ii="[object Uint8ClampedArray]",Wn="[object Uint16Array]",at="[object Uint32Array]",st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qn=/^\w*$/,An=/^\./,ze=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ut=/[\\^$.*+?()[\]{}|]/g,ot=/\\(\\)?/g,Jn=/^\[object .+?Constructor\]$/,In=/^(?:0|[1-9]\d*)$/,oe={};oe[xe]=oe[ue]=oe[ni]=oe[Xn]=oe[zn]=oe[ri]=oe[ii]=oe[Wn]=oe[at]=!0,oe[f]=oe[p]=oe[Xe]=oe[g]=oe[qe]=oe[A]=oe[U]=oe[Y]=oe[L]=oe[_e]=oe[ae]=oe[Oe]=oe[ve]=oe[Fe]=oe[Be]=!1;var er=typeof Dn=="object"&&Dn&&Dn.Object===Object&&Dn,rn=typeof self=="object"&&self&&self.Object===Object&&self,We=er||rn||Function("return this")(),Nn=t&&!t.nodeType&&t,an=Nn&&!0&&e&&!e.nodeType&&e,tr=an&&an.exports===Nn,nr=tr&&er.process,rr=(function(){try{return nr&&nr.binding("util")}catch{}})(),ir=rr&&rr.isTypedArray;function ar(o,m){for(var b=-1,x=o?o.length:0;++b<x&&m(o[b],b,o)!==!1;);return o}function ai(o,m){for(var b=-1,x=o?o.length:0;++b<x;)if(m(o[b],b,o))return!0;return!1}function Pt(o){return function(m){return m?.[o]}}function sr(o,m){for(var b=-1,x=Array(o);++b<o;)x[b]=m(b);return x}function or(o){return function(m){return o(m)}}function si(o,m){return o?.[m]}function Z(o){var m=!1;if(o!=null&&typeof o.toString!="function")try{m=!!(o+"")}catch{}return m}function lt(o){var m=-1,b=Array(o.size);return o.forEach(function(x,X){b[++m]=[X,x]}),b}function s(o,m){return function(b){return o(m(b))}}function l(o){var m=-1,b=Array(o.size);return o.forEach(function(x){b[++m]=x}),b}var _=Array.prototype,y=Function.prototype,S=Object.prototype,T=We["__core-js_shared__"],I=(function(){var o=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),N=y.toString,w=S.hasOwnProperty,F=S.toString,te=RegExp("^"+N.call(w).replace(Ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=We.Symbol,ie=We.Uint8Array,De=s(Object.getPrototypeOf,Object),Ie=Object.create,wn=S.propertyIsEnumerable,Rn=_.splice,co=s(Object.keys,Object),oi=sn(We,"DataView"),On=sn(We,"Map"),li=sn(We,"Promise"),ui=sn(We,"Set"),ci=sn(We,"WeakMap"),xn=sn(Object,"create"),po=kt(oi),fo=kt(On),mo=kt(li),ho=kt(ui),_o=kt(ci),lr=$?$.prototype:void 0,pi=lr?lr.valueOf:void 0,Ji=lr?lr.toString:void 0;function Mt(o){var m=-1,b=o?o.length:0;for(this.clear();++m<b;){var x=o[m];this.set(x[0],x[1])}}function go(){this.__data__=xn?xn(null):{}}function vo(o){return this.has(o)&&delete this.__data__[o]}function Eo(o){var m=this.__data__;if(xn){var b=m[o];return b===i?void 0:b}return w.call(m,o)?m[o]:void 0}function yo(o){var m=this.__data__;return xn?m[o]!==void 0:w.call(m,o)}function To(o,m){var b=this.__data__;return b[o]=xn&&m===void 0?i:m,this}Mt.prototype.clear=go,Mt.prototype.delete=vo,Mt.prototype.get=Eo,Mt.prototype.has=yo,Mt.prototype.set=To;function ut(o){var m=-1,b=o?o.length:0;for(this.clear();++m<b;){var x=o[m];this.set(x[0],x[1])}}function So(){this.__data__=[]}function bo(o){var m=this.__data__,b=cr(m,o);if(b<0)return!1;var x=m.length-1;return b==x?m.pop():Rn.call(m,b,1),!0}function Ao(o){var m=this.__data__,b=cr(m,o);return b<0?void 0:m[b][1]}function Io(o){return cr(this.__data__,o)>-1}function No(o,m){var b=this.__data__,x=cr(b,o);return x<0?b.push([o,m]):b[x][1]=m,this}ut.prototype.clear=So,ut.prototype.delete=bo,ut.prototype.get=Ao,ut.prototype.has=Io,ut.prototype.set=No;function ct(o){var m=-1,b=o?o.length:0;for(this.clear();++m<b;){var x=o[m];this.set(x[0],x[1])}}function wo(){this.__data__={hash:new Mt,map:new(On||ut),string:new Mt}}function Ro(o){return pr(this,o).delete(o)}function Oo(o){return pr(this,o).get(o)}function xo(o){return pr(this,o).has(o)}function Do(o,m){return pr(this,o).set(o,m),this}ct.prototype.clear=wo,ct.prototype.delete=Ro,ct.prototype.get=Oo,ct.prototype.has=xo,ct.prototype.set=Do;function ur(o){var m=-1,b=o?o.length:0;for(this.__data__=new ct;++m<b;)this.add(o[m])}function Lo(o){return this.__data__.set(o,i),this}function Uo(o){return this.__data__.has(o)}ur.prototype.add=ur.prototype.push=Lo,ur.prototype.has=Uo;function pt(o){this.__data__=new ut(o)}function Po(){this.__data__=new ut}function Mo(o){return this.__data__.delete(o)}function ko(o){return this.__data__.get(o)}function Go(o){return this.__data__.has(o)}function Bo(o,m){var b=this.__data__;if(b instanceof ut){var x=b.__data__;if(!On||x.length<n-1)return x.push([o,m]),this;b=this.__data__=new ct(x)}return b.set(o,m),this}pt.prototype.clear=Po,pt.prototype.delete=Mo,pt.prototype.get=ko,pt.prototype.has=Go,pt.prototype.set=Bo;function Ho(o,m){var b=ft(o)||oa(o)?sr(o.length,String):[],x=b.length,X=!!x;for(var B in o)w.call(o,B)&&!(X&&(B=="length"||ra(B,x)))&&b.push(B);return b}function cr(o,m){for(var b=o.length;b--;)if(sa(o[b][0],m))return b;return-1}function Vo(o){return on(o)?Ie(o):{}}var jo=tl();function Fo(o,m){return o&&jo(o,m,hr)}function ea(o,m){m=fr(m,o)?[m]:ta(m);for(var b=0,x=m.length;o!=null&&b<x;)o=o[dr(m[b++])];return b&&b==x?o:void 0}function qo(o){return F.call(o)}function Zo(o,m){return o!=null&&m in Object(o)}function fi(o,m,b,x,X){return o===m?!0:o==null||m==null||!on(o)&&!mr(m)?o!==o&&m!==m:Co(o,m,fi,b,x,X)}function Co(o,m,b,x,X,B){var ee=ft(o),ge=ft(m),he=p,Ne=p;ee||(he=yt(o),he=he==f?ae:he),ge||(Ne=yt(m),Ne=Ne==f?ae:Ne);var Pe=he==ae&&!Z(o),Me=Ne==ae&&!Z(m),Le=he==Ne;if(Le&&!Pe)return B||(B=new pt),ee||ua(o)?na(o,m,b,x,X,B):nl(o,m,he,b,x,X,B);if(!(X&c)){var Ze=Pe&&w.call(o,"__wrapped__"),Ce=Me&&w.call(m,"__wrapped__");if(Ze||Ce){var Tt=Ze?o.value():o,dt=Ce?m.value():m;return B||(B=new pt),b(Tt,dt,x,X,B)}}return Le?(B||(B=new pt),rl(o,m,b,x,X,B)):!1}function Ko(o,m,b,x){var X=b.length,B=X;if(o==null)return!B;for(o=Object(o);X--;){var ee=b[X];if(ee[2]?ee[1]!==o[ee[0]]:!(ee[0]in o))return!1}for(;++X<B;){ee=b[X];var ge=ee[0],he=o[ge],Ne=ee[1];if(ee[2]){if(he===void 0&&!(ge in o))return!1}else{var Pe=new pt,Me;if(!(Me===void 0?fi(Ne,he,x,a|c,Pe):Me))return!1}}return!0}function Yo(o){if(!on(o)||ol(o))return!1;var m=mi(o)||Z(o)?te:Jn;return m.test(kt(o))}function $o(o){return mr(o)&&hi(o.length)&&!!oe[F.call(o)]}function Xo(o){return typeof o=="function"?o:o==null?hl:typeof o=="object"?ft(o)?Qo(o[0],o[1]):Wo(o):_l(o)}function zo(o){if(!ll(o))return co(o);var m=[];for(var b in Object(o))w.call(o,b)&&b!="constructor"&&m.push(b);return m}function Wo(o){var m=il(o);return m.length==1&&m[0][2]?aa(m[0][0],m[0][1]):function(b){return b===o||Ko(b,o,m)}}function Qo(o,m){return fr(o)&&ia(m)?aa(dr(o),m):function(b){var x=fl(b,o);return x===void 0&&x===m?dl(b,o):fi(m,x,void 0,a|c)}}function Jo(o){return function(m){return ea(m,o)}}function el(o){if(typeof o=="string")return o;if(_i(o))return Ji?Ji.call(o):"";var m=o+"";return m=="0"&&1/o==-u?"-0":m}function ta(o){return ft(o)?o:ul(o)}function tl(o){return function(m,b,x){for(var X=-1,B=Object(m),ee=x(m),ge=ee.length;ge--;){var he=ee[++X];if(b(B[he],he,B)===!1)break}return m}}function na(o,m,b,x,X,B){var ee=X&c,ge=o.length,he=m.length;if(ge!=he&&!(ee&&he>ge))return!1;var Ne=B.get(o);if(Ne&&B.get(m))return Ne==m;var Pe=-1,Me=!0,Le=X&a?new ur:void 0;for(B.set(o,m),B.set(m,o);++Pe<ge;){var Ze=o[Pe],Ce=m[Pe];if(x)var Tt=ee?x(Ce,Ze,Pe,m,o,B):x(Ze,Ce,Pe,o,m,B);if(Tt!==void 0){if(Tt)continue;Me=!1;break}if(Le){if(!ai(m,function(dt,Gt){if(!Le.has(Gt)&&(Ze===dt||b(Ze,dt,x,X,B)))return Le.add(Gt)})){Me=!1;break}}else if(!(Ze===Ce||b(Ze,Ce,x,X,B))){Me=!1;break}}return B.delete(o),B.delete(m),Me}function nl(o,m,b,x,X,B,ee){switch(b){case qe:if(o.byteLength!=m.byteLength||o.byteOffset!=m.byteOffset)return!1;o=o.buffer,m=m.buffer;case Xe:return!(o.byteLength!=m.byteLength||!x(new ie(o),new ie(m)));case g:case A:case _e:return sa(+o,+m);case U:return o.name==m.name&&o.message==m.message;case Oe:case Fe:return o==m+"";case L:var ge=lt;case ve:var he=B&c;if(ge||(ge=l),o.size!=m.size&&!he)return!1;var Ne=ee.get(o);if(Ne)return Ne==m;B|=a,ee.set(o,m);var Pe=na(ge(o),ge(m),x,X,B,ee);return ee.delete(o),Pe;case Ae:if(pi)return pi.call(o)==pi.call(m)}return!1}function rl(o,m,b,x,X,B){var ee=X&c,ge=hr(o),he=ge.length,Ne=hr(m),Pe=Ne.length;if(he!=Pe&&!ee)return!1;for(var Me=he;Me--;){var Le=ge[Me];if(!(ee?Le in m:w.call(m,Le)))return!1}var Ze=B.get(o);if(Ze&&B.get(m))return Ze==m;var Ce=!0;B.set(o,m),B.set(m,o);for(var Tt=ee;++Me<he;){Le=ge[Me];var dt=o[Le],Gt=m[Le];if(x)var ca=ee?x(Gt,dt,Le,m,o,B):x(dt,Gt,Le,o,m,B);if(!(ca===void 0?dt===Gt||b(dt,Gt,x,X,B):ca)){Ce=!1;break}Tt||(Tt=Le=="constructor")}if(Ce&&!Tt){var _r=o.constructor,gr=m.constructor;_r!=gr&&"constructor"in o&&"constructor"in m&&!(typeof _r=="function"&&_r instanceof _r&&typeof gr=="function"&&gr instanceof gr)&&(Ce=!1)}return B.delete(o),B.delete(m),Ce}function pr(o,m){var b=o.__data__;return sl(m)?b[typeof m=="string"?"string":"hash"]:b.map}function il(o){for(var m=hr(o),b=m.length;b--;){var x=m[b],X=o[x];m[b]=[x,X,ia(X)]}return m}function sn(o,m){var b=si(o,m);return Yo(b)?b:void 0}var yt=qo;(oi&&yt(new oi(new ArrayBuffer(1)))!=qe||On&&yt(new On)!=L||li&&yt(li.resolve())!=se||ui&&yt(new ui)!=ve||ci&&yt(new ci)!=Be)&&(yt=function(o){var m=F.call(o),b=m==ae?o.constructor:void 0,x=b?kt(b):void 0;if(x)switch(x){case po:return qe;case fo:return L;case mo:return se;case ho:return ve;case _o:return Be}return m});function al(o,m,b){m=fr(m,o)?[m]:ta(m);for(var x,X=-1,ee=m.length;++X<ee;){var B=dr(m[X]);if(!(x=o!=null&&b(o,B)))break;o=o[B]}if(x)return x;var ee=o?o.length:0;return!!ee&&hi(ee)&&ra(B,ee)&&(ft(o)||oa(o))}function ra(o,m){return m=m??h,!!m&&(typeof o=="number"||In.test(o))&&o>-1&&o%1==0&&o<m}function fr(o,m){if(ft(o))return!1;var b=typeof o;return b=="number"||b=="symbol"||b=="boolean"||o==null||_i(o)?!0:Qn.test(o)||!st.test(o)||m!=null&&o in Object(m)}function sl(o){var m=typeof o;return m=="string"||m=="number"||m=="symbol"||m=="boolean"?o!=="__proto__":o===null}function ol(o){return!!I&&I in o}function ll(o){var m=o&&o.constructor,b=typeof m=="function"&&m.prototype||S;return o===b}function ia(o){return o===o&&!on(o)}function aa(o,m){return function(b){return b==null?!1:b[o]===m&&(m!==void 0||o in Object(b))}}var ul=di(function(o){o=pl(o);var m=[];return An.test(o)&&m.push(""),o.replace(ze,function(b,x,X,B){m.push(X?B.replace(ot,"$1"):x||b)}),m});function dr(o){if(typeof o=="string"||_i(o))return o;var m=o+"";return m=="0"&&1/o==-u?"-0":m}function kt(o){if(o!=null){try{return N.call(o)}catch{}try{return o+""}catch{}}return""}function di(o,m){if(typeof o!="function"||m&&typeof m!="function")throw new TypeError(r);var b=function(){var x=arguments,X=m?m.apply(this,x):x[0],B=b.cache;if(B.has(X))return B.get(X);var ee=o.apply(this,x);return b.cache=B.set(X,ee),ee};return b.cache=new(di.Cache||ct),b}di.Cache=ct;function sa(o,m){return o===m||o!==o&&m!==m}function oa(o){return cl(o)&&w.call(o,"callee")&&(!wn.call(o,"callee")||F.call(o)==f)}var ft=Array.isArray;function la(o){return o!=null&&hi(o.length)&&!mi(o)}function cl(o){return mr(o)&&la(o)}function mi(o){var m=on(o)?F.call(o):"";return m==Y||m==j}function hi(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=h}function on(o){var m=typeof o;return!!o&&(m=="object"||m=="function")}function mr(o){return!!o&&typeof o=="object"}function _i(o){return typeof o=="symbol"||mr(o)&&F.call(o)==Ae}var ua=ir?or(ir):$o;function pl(o){return o==null?"":el(o)}function fl(o,m,b){var x=o==null?void 0:ea(o,m);return x===void 0?b:x}function dl(o,m){return o!=null&&al(o,m,Zo)}function hr(o){return la(o)?Ho(o):zo(o)}function ml(o,m,b){var x=ft(o)||ua(o);if(m=Xo(m),b==null)if(x||on(o)){var X=o.constructor;x?b=ft(o)?new X:[]:b=mi(X)?Vo(De(o)):{}}else b={};return(x?ar:Fo)(o,function(B,ee,ge){return m(b,B,ee,ge)}),b}function hl(o){return o}function _l(o){return fr(o)?Pt(dr(o)):Jo(o)}e.exports=ml})(Sn,Sn.exports),Sn.exports)}var pc=io(),ao=ln(pc);var Qi=class{constructor(t,n,r,i){this.platform=Ge.DESKTOP,this.instanceId="123456789012345678",this.configuration=Jr(),this.source=null,this.sourceOrigin="",this.sdkVersion="mock",this.mobileAppVersion="unknown",this.frameId="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",this.eventBus=new Er,this.clientId=t,this.commands=this._updateCommandMocks({}),this.guildId=n,this.channelId=r,this.locationId=i,this.customId=null,this.referrerId=null}_updateCommandMocks(t){return this.commands=ao(Object.assign({},fc,t),(n,r,i)=>{n[i]=async(...a)=>(console.info(`DiscordSDKMock: ${String(i)}(${JSON.stringify(a)})`),await r(...a))}),this.commands}emitReady(){this.emitEvent("READY",void 0)}close(...t){console.info(`DiscordSDKMock: close(${JSON.stringify(t)})`)}ready(){return Promise.resolve()}async subscribe(t,n,...r){return await this.eventBus.on(t,n)}async unsubscribe(t,n,...r){return await this.eventBus.off(t,n)}emitEvent(t,n){this.eventBus.emit(t,n)}},fc={authorize:()=>Promise.resolve({code:"mock_code"}),setActivity:()=>Promise.resolve({name:"mock_activity_name",type:0}),getChannel:()=>Promise.resolve({id:"mock_channel_id",name:"mock_channel_name",type:vn.GUILD_TEXT,voice_states:[],messages:[]}),getSkus:()=>Promise.resolve({skus:[]}),getEntitlements:()=>Promise.resolve({entitlements:[]}),startPurchase:()=>Promise.resolve([]),setConfig:()=>Promise.resolve({use_interactive_pip:!1}),userSettingsGetLocale:()=>Promise.resolve({locale:""}),openExternalLink:()=>Promise.resolve({opened:!1}),encourageHardwareAcceleration:()=>Promise.resolve({enabled:!0}),captureLog:()=>Promise.resolve(null),setOrientationLockState:()=>Promise.resolve(null),openInviteDialog:()=>Promise.resolve(null),getPlatformBehaviors:()=>Promise.resolve({iosKeyboardResizesView:!0}),getChannelPermissions:()=>Promise.resolve({permissions:Rr(1234567890)}),getInstanceConnectedParticipants:()=>Promise.resolve({participants:[]}),openShareMomentDialog:()=>Promise.resolve(null),authenticate:()=>Promise.resolve({access_token:"mock_token",user:{username:"mock_user_username",discriminator:"mock_user_discriminator",id:"mock_user_id",avatar:null,public_flags:1},scopes:[],expires:new Date(2121,1,1).toString(),application:{description:"mock_app_description",icon:"mock_app_icon",id:"mock_app_id",name:"mock_app_name"}}),shareLink:()=>Promise.resolve({success:!1,didSendMessage:!1,didCopyLink:!1}),initiateImageUpload:()=>Promise.resolve({image_url:"https://assets-global.website-files.com/6257adef93867e50d84d30e2/636e0b52aa9e99b832574a53_full_logo_blurple_RGB.png"}),getRelationships:()=>Promise.resolve({relationships:[{type:1,user:{username:"mock_friend_username",flags:0,bot:!1,discriminator:"mock_friend_discriminator",id:"mock_friend_id_1",avatar:null}},{type:1,user:{username:"mock_friend_username_with_nickname",flags:0,bot:!1,discriminator:"mock_friend_discriminator_with_nickname",id:"mock_friend_id_2",avatar:null},nickname:"mock_friend_nickname_for_user"},{type:1,user:{username:"mock_friend_username_with_since",flags:0,bot:!1,discriminator:"mock_friend_discriminator_with_since",id:"mock_friend_id_3",avatar:null},since:"2021-06-29T00:32:37.180813+00:00"}]}),inviteUserEmbedded:()=>Promise.resolve(null),getUser:()=>Promise.resolve({username:"mock_friend_username",flags:0,bot:!1,discriminator:"mock_friend_discriminator",id:"mock_friend_id_1",avatar:null}),getQuestEnrollmentStatus:()=>Promise.resolve({quest_id:"mock_quest_id",is_enrolled:!1,enrolled_at:null}),questStartTimer:()=>Promise.resolve({success:!0}),getActivityInstanceConnectedParticipants:()=>Promise.resolve({participants:[]}),shareInteraction:()=>Promise.resolve({success:!1}),requestProxyTicketRefresh:()=>Promise.resolve({ticket:"mock_ticket"}),getQuest:()=>Promise.resolve({quest_id:"mock_quest_id",external_cta_url:"mock_external_cta_url",enrolled_at:null,completed_at:null})};function so(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var oo=/\{([a-z]+)\}/g;function dc(e){let t=e.replace(oo,(n,r)=>`(?<${r}>[\\w-]+)`);return new RegExp(`${t}(/|$)`)}function lo({originalURL:e,prefix:t,prefixHost:n,target:r}){let i=new URL(`https://${r}`),a=dc(i.host.replace(/%7B/g,"{").replace(/%7D/g,"}")),c=e.toString().match(a);if(c==null)return e;let u=new URL(e.toString());u.host=n,u.pathname=t.replace(oo,(f,p)=>{var g;let A=(g=c.groups)===null||g===void 0?void 0:g[p];if(A==null)throw new Error("Misconfigured route.");return A});let h=e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname;return u.pathname+=u.pathname.endsWith("/")?h:"/"+h,u.pathname=u.pathname.replace(i.pathname,""),e.pathname.endsWith("/")&&!u.pathname.endsWith("/")&&(u.pathname+="/"),u}function bn(e,t=window.location.protocol,n=window.location.host){return new URL(e,`${t}//${n}`)}function mc(e,{patchFetch:t=!0,patchWebSocket:n=!0,patchXhr:r=!0,patchSrcAttributes:i=!1}={}){if(!(typeof window>"u")){if(t){let a=window.fetch;window.fetch=function(c,u){if(c instanceof Request){let f=Lt({url:bn(c.url),mappings:e}),p=u??{},g=so(p,["url"]);return Object.keys(Request.prototype).forEach(A=>{if(A!=="url")try{g[A]=c[A]}catch(U){console.warn(`Remapping fetch request key "${A}" failed`,U)}}),new Promise((A,U)=>{try{c.blob().then(Y=>{c.method.toUpperCase()!=="HEAD"&&c.method.toUpperCase()!=="GET"&&Y.size>0&&(g.body=Y),A(a(new Request(f,g)))})}catch(Y){U(Y)}})}let h=Lt({url:c instanceof URL?c:bn(c),mappings:e});return a(h,u)}}if(n){class a extends WebSocket{constructor(u,h){let f=Lt({url:u instanceof URL?u:bn(u),mappings:e});super(f,h)}}window.WebSocket=a}if(r){let a=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(c,u,h,f,p){let g=Lt({url:bn(u),mappings:e});a.apply(this,[c,g,h,f,p])}}if(i){let a=function(h){for(let f of h)f.type==="attributes"&&f.attributeName==="src"?ti(f.target,e):f.type==="childList"&&f.addedNodes.forEach(p=>{ti(p,e),uo(p,e)})},c=new MutationObserver(a),u={attributeFilter:["src"],childList:!0,subtree:!0};c.observe(window.document,u),window.document.querySelectorAll("[src]").forEach(h=>{ti(h,e)})}}}function uo(e,t){e.hasChildNodes()&&e.childNodes.forEach(n=>{ti(n,t),uo(n,t)})}function ti(e,t){if(e instanceof HTMLElement&&e.hasAttribute("src")){let n=e.getAttribute("src"),r=bn(n??"");if(r.host===window.location.host)return;if(e.tagName.toLowerCase()==="script")hc(e,{url:r,mappings:t});else{let i=Lt({url:r,mappings:t}).toString();i!==n&&e.setAttribute("src",i)}}}function hc(e,{url:t,mappings:n}){let r=Lt({url:t,mappings:n});if(t.toString()!==r.toString()){let i=document.createElement(e.tagName);i.innerHTML=e.innerHTML;for(let a of e.attributes)i.setAttribute(a.name,a.value);i.setAttribute("src",Lt({url:t,mappings:n}).toString()),e.after(i),e.remove()}}function Lt({url:e,mappings:t}){let n=new URL(e.toString());for(let r of t){let i=lo({originalURL:n,prefix:r.prefix,target:r.target,prefixHost:window.location.host});if(i!=null&&i?.toString()!==e.toString())return i}return n}var{Commands:Lm}=Vr;export{Lm as Commands,Vr as Common,$i as DiscordSDK,Qi as DiscordSDKMock,J as Events,jn as Orientation,ic as PermissionUtils,bu as Permissions,Ge as Platform,cc as PriceUtils,wi as RPCCloseCodes,Vn as RPCErrorCodes,qi as Responses,Lt as attemptRemap,mc as patchUrlMappings};
|
|
1
|
+
var gl=Object.defineProperty;var pa=(e,t)=>{for(var n in t)gl(e,n,{get:t[n],enumerable:!0})};var Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vr={exports:{}};var fa;function da(){return fa?vr.exports:(fa=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(h,f,p){this.fn=h,this.context=f,this.once=p||!1}function a(h,f,p,g,A){if(typeof p!="function")throw new TypeError("The listener must be a function");var U=new i(p,g||h,A),Y=n?n+f:f;return h._events[Y]?h._events[Y].fn?h._events[Y]=[h._events[Y],U]:h._events[Y].push(U):(h._events[Y]=U,h._eventsCount++),h}function c(h,f){--h._eventsCount===0?h._events=new r:delete h._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],p,g;if(this._eventsCount===0)return f;for(g in p=this._events)t.call(p,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},u.prototype.listeners=function(f){var p=n?n+f:f,g=this._events[p];if(!g)return[];if(g.fn)return[g.fn];for(var A=0,U=g.length,Y=new Array(U);A<U;A++)Y[A]=g[A].fn;return Y},u.prototype.listenerCount=function(f){var p=n?n+f:f,g=this._events[p];return g?g.fn?1:g.length:0},u.prototype.emit=function(f,p,g,A,U,Y){var j=n?n+f:f;if(!this._events[j])return!1;var L=this._events[j],_e=arguments.length,ae,se;if(L.fn){switch(L.once&&this.removeListener(f,L.fn,void 0,!0),_e){case 1:return L.fn.call(L.context),!0;case 2:return L.fn.call(L.context,p),!0;case 3:return L.fn.call(L.context,p,g),!0;case 4:return L.fn.call(L.context,p,g,A),!0;case 5:return L.fn.call(L.context,p,g,A,U),!0;case 6:return L.fn.call(L.context,p,g,A,U,Y),!0}for(se=1,ae=new Array(_e-1);se<_e;se++)ae[se-1]=arguments[se];L.fn.apply(L.context,ae)}else{var Oe=L.length,ve;for(se=0;se<Oe;se++)switch(L[se].once&&this.removeListener(f,L[se].fn,void 0,!0),_e){case 1:L[se].fn.call(L[se].context);break;case 2:L[se].fn.call(L[se].context,p);break;case 3:L[se].fn.call(L[se].context,p,g);break;case 4:L[se].fn.call(L[se].context,p,g,A);break;default:if(!ae)for(ve=1,ae=new Array(_e-1);ve<_e;ve++)ae[ve-1]=arguments[ve];L[se].fn.apply(L[se].context,ae)}}return!0},u.prototype.on=function(f,p,g){return a(this,f,p,g,!1)},u.prototype.once=function(f,p,g){return a(this,f,p,g,!0)},u.prototype.removeListener=function(f,p,g,A){var U=n?n+f:f;if(!this._events[U])return this;if(!p)return c(this,U),this;var Y=this._events[U];if(Y.fn)Y.fn===p&&(!A||Y.once)&&(!g||Y.context===g)&&c(this,U);else{for(var j=0,L=[],_e=Y.length;j<_e;j++)(Y[j].fn!==p||A&&!Y[j].once||g&&Y[j].context!==g)&&L.push(Y[j]);L.length?this._events[U]=L.length===1?L[0]:L:c(this,U)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&c(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(vr),vr.exports)}var vl=da(),Er=ln(vl);var re;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{let a={};for(let c of i)a[c]=c;return a},e.getValidEnumValues=i=>{let a=e.objectKeys(i).filter(u=>typeof i[i[u]]!="number"),c={};for(let u of a)c[u]=i[u];return e.objectValues(c)},e.objectValues=i=>e.objectKeys(i).map(function(a){return i[a]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let c in i)Object.prototype.hasOwnProperty.call(i,c)&&a.push(c);return a},e.find=(i,a)=>{for(let c of i)if(a(c))return c},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(a)}e.joinValues=r,e.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(re||(re={}));var vi;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(vi||(vi={}));var M=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),St=e=>{switch(typeof e){case"undefined":return M.undefined;case"string":return M.string;case"number":return isNaN(e)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(e)?M.array:e===null?M.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?M.promise:typeof Map<"u"&&e instanceof Map?M.map:typeof Set<"u"&&e instanceof Set?M.set:typeof Date<"u"&&e instanceof Date?M.date:M.object;default:return M.unknown}},R=re.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"]),El=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),He=class e extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(let c of a.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let u=r,h=0;for(;h<c.path.length;){let f=c.path[h];h===c.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(n(c))):u[f]=u[f]||{_errors:[]},u=u[f],h++}}};return i(this),r}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};He.create=e=>new He(e);var pn=(e,t)=>{let n;switch(e.code){case R.invalid_type:e.received===M.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case R.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case R.invalid_union:n="Invalid input";break;case R.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case R.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case R.invalid_arguments:n="Invalid function arguments";break;case R.invalid_return_type:n="Invalid function return type";break;case R.invalid_date:n="Invalid date";break;case R.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(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}"`:re.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case R.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case R.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case R.custom:n="Invalid input";break;case R.invalid_intersection_types:n="Intersection results could not be merged";break;case R.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case R.not_finite:n="Number must be finite";break;default:n=t.defaultError,re.assertNever(e)}return{message:n}},_a=pn;function yl(e){_a=e}function yr(){return _a}var Tr=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],c={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let u="",h=r.filter(f=>!!f).slice().reverse();for(let f of h)u=f(c,{data:t,defaultError:u}).message;return{...i,path:a,message:u}},Tl=[];function P(e,t){let n=yr(),r=Tr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===pn?void 0:pn].filter(i=>!!i)});e.common.issues.push(r)}var we=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let i of n){if(i.status==="aborted")return q;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let i of n){let a=await i.key,c=await i.value;r.push({key:a,value:c})}return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let i of n){let{key:a,value:c}=i;if(a.status==="aborted"||c.status==="aborted")return q;a.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(r[a.value]=c.value)}return{status:t.value,value:r}}},q=Object.freeze({status:"aborted"}),cn=e=>({status:"dirty",value:e}),Ue=e=>({status:"valid",value:e}),Ei=e=>e.status==="aborted",yi=e=>e.status==="dirty",Pn=e=>e.status==="valid",Mn=e=>typeof Promise<"u"&&e instanceof Promise;function Sr(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function ga(e,t,n,r,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var H;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(H||(H={}));var Ln,Un,Ye=class{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ma=(e,t)=>{if(Pn(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;let n=new He(e.common.issues);return this._error=n,this._error}}};function z(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(c,u)=>{var h,f;let{message:p}=e;return c.code==="invalid_enum_value"?{message:p??u.defaultError}:typeof u.data>"u"?{message:(h=p??r)!==null&&h!==void 0?h:u.defaultError}:c.code!=="invalid_type"?{message:u.defaultError}:{message:(f=p??n)!==null&&f!==void 0?f:u.defaultError}},description:i}}var W=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,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)}get description(){return this._def.description}_getType(t){return St(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:St(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new we,ctx:{common:t.parent.common,data:t.data,parsedType:St(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Mn(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let i={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:St(t)},a=this._parseSync({data:t,path:i.path,parent:i});return ma(i,a)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:St(t)},i=this._parse({data:t,path:r.path,parent:r}),a=await(Mn(i)?i:Promise.resolve(i));return ma(r,a)}refine(t,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{let c=t(i),u=()=>a.addIssue({code:R.custom,...r(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(u(),!1)):c?!0:(u(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Ve({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ke.create(this,this._def)}nullable(){return tt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _t.create(this,this._def)}promise(){return It.create(this,this._def)}or(t){return Zt.create([this,t],this._def)}and(t){return Ct.create(this,t,this._def)}transform(t){return new Ve({...z(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new zt({...z(this._def),innerType:this,defaultValue:n,typeName:K.ZodDefault})}brand(){return new kn({typeName:K.ZodBranded,type:this,...z(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Wt({...z(this._def),innerType:this,catchValue:n,typeName:K.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Gn.create(this,t)}readonly(){return Qt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Sl=/^c[^\s-]{8,}$/i,bl=/^[0-9a-z]+$/,Al=/^[0-9A-HJKMNP-TV-Z]{26}$/,Il=/^[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,Nl=/^[a-z0-9_-]{21}$/i,wl=/^[-+]?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)?)??$/,Rl=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ol="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",gi,xl=/^(?:(?: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])$/,Dl=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ll=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,va="((\\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])))",Ul=new RegExp(`^${va}$`);function Ea(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Pl(e){return new RegExp(`^${Ea(e)}$`)}function ya(e){let t=`${va}T${Ea(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ml(e,t){return!!((t==="v4"||!t)&&xl.test(e)||(t==="v6"||!t)&&Dl.test(e))}var bt=class e extends W{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==M.string){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.string,received:a.parsedType}),q}let r=new we,i;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")t.data.length>a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let c=t.data.length>a.value,u=t.data.length<a.value;(c||u)&&(i=this._getOrReturnCtx(t,i),c?P(i,{code:R.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):u&&P(i,{code:R.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Rl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"email",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")gi||(gi=new RegExp(Ol,"u")),gi.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"emoji",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Il.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"uuid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")Nl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"nanoid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Sl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"cuid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")bl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"cuid2",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Al.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"ulid",code:R.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),P(i,{validation:"url",code:R.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"regex",code:R.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?ya(a).test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Ul.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Pl(a).test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{code:R.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?wl.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"duration",code:R.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Ml(t.data,a.version)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"ip",code:R.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Ll.test(t.data)||(i=this._getOrReturnCtx(t,i),P(i,{validation:"base64",code:R.invalid_string,message:a.message}),r.dirty()):re.assertNever(a);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:R.invalid_string,...H.errToObj(r)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...H.errToObj(t)})}url(t){return this._addCheck({kind:"url",...H.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...H.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...H.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...H.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...H.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...H.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...H.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...H.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...H.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,local:(r=t?.local)!==null&&r!==void 0?r:!1,...H.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...H.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...H.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...H.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...H.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...H.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...H.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...H.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...H.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...H.errToObj(n)})}nonempty(t){return this.min(1,H.errToObj(t))}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(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};bt.create=e=>{var t;return new bt({checks:[],typeName:K.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...z(e)})};function kl(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,a=parseInt(e.toFixed(i).replace(".","")),c=parseInt(t.toFixed(i).replace(".",""));return a%c/Math.pow(10,i)}var Bt=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==M.number){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.number,received:a.parsedType}),q}let r,i=new we;for(let a of this._def.checks)a.kind==="int"?re.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),P(r,{code:R.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?kl(t.data,a.value)!==0&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),P(r,{code:R.not_finite,message:a.message}),i.dirty()):re.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:H.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:H.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:H.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:H.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:H.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:H.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:H.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:H.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&re.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Bt.create=e=>new Bt({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...z(e)});var Ht=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==M.bigint){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.bigint,received:a.parsedType}),q}let r,i=new we;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),P(r,{code:R.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):re.assertNever(a);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,H.toString(n))}gt(t,n){return this.setLimit("min",t,!1,H.toString(n))}lte(t,n){return this.setLimit("max",t,!0,H.toString(n))}lt(t,n){return this.setLimit("max",t,!1,H.toString(n))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:H.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:H.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:H.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:H.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:H.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Ht.create=e=>{var t;return new Ht({checks:[],typeName:K.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...z(e)})};var Vt=class extends W{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==M.boolean){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.boolean,received:r.parsedType}),q}return Ue(t.data)}};Vt.create=e=>new Vt({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...z(e)});var jt=class e extends W{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==M.date){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_type,expected:M.date,received:a.parsedType}),q}if(isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return P(a,{code:R.invalid_date}),q}let r=new we,i;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(i=this._getOrReturnCtx(t,i),P(i,{code:R.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):re.assertNever(a);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:H.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:H.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};jt.create=e=>new jt({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...z(e)});var fn=class extends W{_parse(t){if(this._getType(t)!==M.symbol){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.symbol,received:r.parsedType}),q}return Ue(t.data)}};fn.create=e=>new fn({typeName:K.ZodSymbol,...z(e)});var Ft=class extends W{_parse(t){if(this._getType(t)!==M.undefined){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.undefined,received:r.parsedType}),q}return Ue(t.data)}};Ft.create=e=>new Ft({typeName:K.ZodUndefined,...z(e)});var qt=class extends W{_parse(t){if(this._getType(t)!==M.null){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.null,received:r.parsedType}),q}return Ue(t.data)}};qt.create=e=>new qt({typeName:K.ZodNull,...z(e)});var At=class extends W{constructor(){super(...arguments),this._any=!0}_parse(t){return Ue(t.data)}};At.create=e=>new At({typeName:K.ZodAny,...z(e)});var ht=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ue(t.data)}};ht.create=e=>new ht({typeName:K.ZodUnknown,...z(e)});var Qe=class extends W{_parse(t){let n=this._getOrReturnCtx(t);return P(n,{code:R.invalid_type,expected:M.never,received:n.parsedType}),q}};Qe.create=e=>new Qe({typeName:K.ZodNever,...z(e)});var dn=class extends W{_parse(t){if(this._getType(t)!==M.undefined){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.void,received:r.parsedType}),q}return Ue(t.data)}};dn.create=e=>new dn({typeName:K.ZodVoid,...z(e)});var _t=class e extends W{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==M.array)return P(n,{code:R.invalid_type,expected:M.array,received:n.parsedType}),q;if(i.exactLength!==null){let c=n.data.length>i.exactLength.value,u=n.data.length<i.exactLength.value;if(c||u){if(P(n,{code:c?R.too_big:R.too_small,minimum:u?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),c)return q;r.dirty()}}if(i.minLength!==null&&n.data.length<i.minLength.value&&(P(n,{code:R.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value)return P(n,{code:R.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),q;if(n.common.async)return Promise.all([...n.data].map((c,u)=>i.type._parseAsync(new Ye(n,c,n.path,u)))).then(c=>we.mergeArray(r,c));let a=[...n.data].map((c,u)=>i.type._parseSync(new Ye(n,c,n.path,u)));return we.mergeArray(r,a)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:H.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:H.toString(n)}})}nonempty(t){return this.min(1,t)}};_t.create=(e,t)=>new _t({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...z(t)});function un(e){if(e instanceof ke){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ke.create(un(r))}return new ke({...e._def,shape:()=>t})}else return e instanceof _t?new _t({...e._def,type:un(e.element)}):e instanceof Ke?Ke.create(un(e.unwrap())):e instanceof tt?tt.create(un(e.unwrap())):e instanceof et?et.create(e.items.map(t=>un(t))):e}var ke=class e extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=re.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==M.object){let f=this._getOrReturnCtx(t);return P(f,{code:R.invalid_type,expected:M.object,received:f.parsedType}),q}let{status:r,ctx:i}=this._processInputParams(t),{shape:a,keys:c}=this._getCached(),u=[];if(!(this._def.catchall instanceof Qe&&this._def.unknownKeys==="strip"))for(let f in i.data)c.includes(f)||u.push(f);let h=[];for(let f of c){let p=a[f],g=i.data[f];h.push({key:{status:"valid",value:f},value:p._parse(new Ye(i,g,i.path,f)),alwaysSet:f in i.data})}if(this._def.catchall instanceof Qe){let f=this._def.unknownKeys;if(f==="passthrough")for(let p of u)h.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(f==="strict")u.length>0&&(P(i,{code:R.unrecognized_keys,keys:u}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let f=this._def.catchall;for(let p of u){let g=i.data[p];h.push({key:{status:"valid",value:p},value:f._parse(new Ye(i,g,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let f=[];for(let p of h){let g=await p.key,A=await p.value;f.push({key:g,value:A,alwaysSet:p.alwaysSet})}return f}).then(f=>we.mergeObjectSync(r,f)):we.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(t){return H.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,a,c,u;let h=(c=(a=(i=this._def).errorMap)===null||a===void 0?void 0:a.call(i,n,r).message)!==null&&c!==void 0?c:r.defaultError;return n.code==="unrecognized_keys"?{message:(u=H.errToObj(t).message)!==null&&u!==void 0?u:h}:{message:h}}}:{}})}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:K.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return re.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return re.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return un(this)}partial(t){let n={};return re.objectKeys(this.shape).forEach(r=>{let i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return re.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Ke;)a=a._def.innerType;n[r]=a}}),new e({...this._def,shape:()=>n})}keyof(){return Ta(re.objectKeys(this.shape))}};ke.create=(e,t)=>new ke({shape:()=>e,unknownKeys:"strip",catchall:Qe.create(),typeName:K.ZodObject,...z(t)});ke.strictCreate=(e,t)=>new ke({shape:()=>e,unknownKeys:"strict",catchall:Qe.create(),typeName:K.ZodObject,...z(t)});ke.lazycreate=(e,t)=>new ke({shape:e,unknownKeys:"strip",catchall:Qe.create(),typeName:K.ZodObject,...z(t)});var Zt=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function i(a){for(let u of a)if(u.result.status==="valid")return u.result;for(let u of a)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let c=a.map(u=>new He(u.ctx.common.issues));return P(n,{code:R.invalid_union,unionErrors:c}),q}if(n.common.async)return Promise.all(r.map(async a=>{let c={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let a,c=[];for(let h of r){let f={...n,common:{...n.common,issues:[]},parent:null},p=h._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:f}),f.common.issues.length&&c.push(f.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;let u=c.map(h=>new He(h));return P(n,{code:R.invalid_union,unionErrors:u}),q}}get options(){return this._def.options}};Zt.create=(e,t)=>new Zt({options:e,typeName:K.ZodUnion,...z(t)});var mt=e=>e instanceof Kt?mt(e.schema):e instanceof Ve?mt(e.innerType()):e instanceof Yt?[e.value]:e instanceof $t?e.options:e instanceof Xt?re.objectValues(e.enum):e instanceof zt?mt(e._def.innerType):e instanceof Ft?[void 0]:e instanceof qt?[null]:e instanceof Ke?[void 0,...mt(e.unwrap())]:e instanceof tt?[null,...mt(e.unwrap())]:e instanceof kn||e instanceof Qt?mt(e.unwrap()):e instanceof Wt?mt(e._def.innerType):[],br=class e extends W{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==M.object)return P(n,{code:R.invalid_type,expected:M.object,received:n.parsedType}),q;let r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(P(n,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let a of n){let c=mt(a.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of c){if(i.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);i.set(u,a)}}return new e({typeName:K.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...z(r)})}};function Ti(e,t){let n=St(e),r=St(t);if(e===t)return{valid:!0,data:e};if(n===M.object&&r===M.object){let i=re.objectKeys(t),a=re.objectKeys(e).filter(u=>i.indexOf(u)!==-1),c={...e,...t};for(let u of a){let h=Ti(e[u],t[u]);if(!h.valid)return{valid:!1};c[u]=h.data}return{valid:!0,data:c}}else if(n===M.array&&r===M.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let a=0;a<e.length;a++){let c=e[a],u=t[a],h=Ti(c,u);if(!h.valid)return{valid:!1};i.push(h.data)}return{valid:!0,data:i}}else return n===M.date&&r===M.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ct=class extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=(a,c)=>{if(Ei(a)||Ei(c))return q;let u=Ti(a.value,c.value);return u.valid?((yi(a)||yi(c))&&n.dirty(),{status:n.value,value:u.data}):(P(r,{code:R.invalid_intersection_types}),q)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,c])=>i(a,c)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Ct.create=(e,t,n)=>new Ct({left:e,right:t,typeName:K.ZodIntersection,...z(n)});var et=class e extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.array)return P(r,{code:R.invalid_type,expected:M.array,received:r.parsedType}),q;if(r.data.length<this._def.items.length)return P(r,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q;!this._def.rest&&r.data.length>this._def.items.length&&(P(r,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let a=[...r.data].map((c,u)=>{let h=this._def.items[u]||this._def.rest;return h?h._parse(new Ye(r,c,r.path,u)):null}).filter(c=>!!c);return r.common.async?Promise.all(a).then(c=>we.mergeArray(n,c)):we.mergeArray(n,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};et.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new et({items:e,typeName:K.ZodTuple,rest:null,...z(t)})};var Ar=class e extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.object)return P(r,{code:R.invalid_type,expected:M.object,received:r.parsedType}),q;let i=[],a=this._def.keyType,c=this._def.valueType;for(let u in r.data)i.push({key:a._parse(new Ye(r,u,r.path,u)),value:c._parse(new Ye(r,r.data[u],r.path,u)),alwaysSet:u in r.data});return r.common.async?we.mergeObjectAsync(n,i):we.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof W?new e({keyType:t,valueType:n,typeName:K.ZodRecord,...z(r)}):new e({keyType:bt.create(),valueType:t,typeName:K.ZodRecord,...z(n)})}},mn=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.map)return P(r,{code:R.invalid_type,expected:M.map,received:r.parsedType}),q;let i=this._def.keyType,a=this._def.valueType,c=[...r.data.entries()].map(([u,h],f)=>({key:i._parse(new Ye(r,u,r.path,[f,"key"])),value:a._parse(new Ye(r,h,r.path,[f,"value"]))}));if(r.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let h of c){let f=await h.key,p=await h.value;if(f.status==="aborted"||p.status==="aborted")return q;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let h of c){let f=h.key,p=h.value;if(f.status==="aborted"||p.status==="aborted")return q;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),u.set(f.value,p.value)}return{status:n.value,value:u}}}};mn.create=(e,t,n)=>new mn({valueType:t,keyType:e,typeName:K.ZodMap,...z(n)});var hn=class e extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==M.set)return P(r,{code:R.invalid_type,expected:M.set,received:r.parsedType}),q;let i=this._def;if(i.minSize!==null&&r.data.size<i.minSize.value&&(P(r,{code:R.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value)return P(r,{code:R.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),q;let a=this._def.valueType;function c(h){let f=new Set;for(let p of h){if(p.status==="aborted")return q;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}let u=[...r.data.values()].map((h,f)=>a._parse(new Ye(r,h,r.path,f)));return r.common.async?Promise.all(u).then(h=>c(h)):c(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:H.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};hn.create=(e,t)=>new hn({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...z(t)});var Ir=class e extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==M.function)return P(n,{code:R.invalid_type,expected:M.function,received:n.parsedType}),q;function r(u,h){return Tr({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yr(),pn].filter(f=>!!f),issueData:{code:R.invalid_arguments,argumentsError:h}})}function i(u,h){return Tr({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yr(),pn].filter(f=>!!f),issueData:{code:R.invalid_return_type,returnTypeError:h}})}let a={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof It){let u=this;return Ue(async function(...h){let f=new He([]),p=await u._def.args.parseAsync(h,a).catch(U=>{throw f.addIssue(r(h,U)),f}),g=await Reflect.apply(c,this,p);return await u._def.returns._def.type.parseAsync(g,a).catch(U=>{throw f.addIssue(i(g,U)),f})})}else{let u=this;return Ue(function(...h){let f=u._def.args.safeParse(h,a);if(!f.success)throw new He([r(h,f.error)]);let p=Reflect.apply(c,this,f.data),g=u._def.returns.safeParse(p,a);if(!g.success)throw new He([i(p,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:et.create(t).rest(ht.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||et.create([]).rest(ht.create()),returns:n||ht.create(),typeName:K.ZodFunction,...z(r)})}},Kt=class extends W{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Kt.create=(e,t)=>new Kt({getter:e,typeName:K.ZodLazy,...z(t)});var Yt=class extends W{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return P(n,{received:n.data,code:R.invalid_literal,expected:this._def.value}),q}return{status:"valid",value:t.data}}get value(){return this._def.value}};Yt.create=(e,t)=>new Yt({value:e,typeName:K.ZodLiteral,...z(t)});function Ta(e,t){return new $t({values:e,typeName:K.ZodEnum,...z(t)})}var $t=class e extends W{constructor(){super(...arguments),Ln.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return P(n,{expected:re.joinValues(r),received:n.parsedType,code:R.invalid_type}),q}if(Sr(this,Ln)||ga(this,Ln,new Set(this._def.values)),!Sr(this,Ln).has(t.data)){let n=this._getOrReturnCtx(t),r=this._def.values;return P(n,{received:n.data,code:R.invalid_enum_value,options:r}),q}return Ue(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}};Ln=new WeakMap;$t.create=Ta;var Xt=class extends W{constructor(){super(...arguments),Un.set(this,void 0)}_parse(t){let n=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==M.string&&r.parsedType!==M.number){let i=re.objectValues(n);return P(r,{expected:re.joinValues(i),received:r.parsedType,code:R.invalid_type}),q}if(Sr(this,Un)||ga(this,Un,new Set(re.getValidEnumValues(this._def.values))),!Sr(this,Un).has(t.data)){let i=re.objectValues(n);return P(r,{received:r.data,code:R.invalid_enum_value,options:i}),q}return Ue(t.data)}get enum(){return this._def.values}};Un=new WeakMap;Xt.create=(e,t)=>new Xt({values:e,typeName:K.ZodNativeEnum,...z(t)});var It=class extends W{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==M.promise&&n.common.async===!1)return P(n,{code:R.invalid_type,expected:M.promise,received:n.parsedType}),q;let r=n.parsedType===M.promise?n.data:Promise.resolve(n.data);return Ue(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};It.create=(e,t)=>new It({type:e,typeName:K.ZodPromise,...z(t)});var Ve=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,a={addIssue:c=>{P(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let c=i.transform(r.data,a);if(r.common.async)return Promise.resolve(c).then(async u=>{if(n.value==="aborted")return q;let h=await this._def.schema._parseAsync({data:u,path:r.path,parent:r});return h.status==="aborted"?q:h.status==="dirty"||n.value==="dirty"?cn(h.value):h});{if(n.value==="aborted")return q;let u=this._def.schema._parseSync({data:c,path:r.path,parent:r});return u.status==="aborted"?q:u.status==="dirty"||n.value==="dirty"?cn(u.value):u}}if(i.type==="refinement"){let c=u=>{let h=i.refinement(u,a);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(r.common.async===!1){let u=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return u.status==="aborted"?q:(u.status==="dirty"&&n.dirty(),c(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(u=>u.status==="aborted"?q:(u.status==="dirty"&&n.dirty(),c(u.value).then(()=>({status:n.value,value:u.value}))))}if(i.type==="transform")if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Pn(c))return c;let u=i.transform(c.value,a);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>Pn(c)?Promise.resolve(i.transform(c.value,a)).then(u=>({status:n.value,value:u})):c);re.assertNever(i)}};Ve.create=(e,t,n)=>new Ve({schema:e,typeName:K.ZodEffects,effect:t,...z(n)});Ve.createWithPreprocess=(e,t,n)=>new Ve({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...z(n)});var Ke=class extends W{_parse(t){return this._getType(t)===M.undefined?Ue(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ke.create=(e,t)=>new Ke({innerType:e,typeName:K.ZodOptional,...z(t)});var tt=class extends W{_parse(t){return this._getType(t)===M.null?Ue(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};tt.create=(e,t)=>new tt({innerType:e,typeName:K.ZodNullable,...z(t)});var zt=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};zt.create=(e,t)=>new zt({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...z(t)});var Wt=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Mn(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new He(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new He(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Wt.create=(e,t)=>new Wt({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...z(t)});var _n=class extends W{_parse(t){if(this._getType(t)!==M.nan){let r=this._getOrReturnCtx(t);return P(r,{code:R.invalid_type,expected:M.nan,received:r.parsedType}),q}return{status:"valid",value:t.data}}};_n.create=e=>new _n({typeName:K.ZodNaN,...z(e)});var Gl=Symbol("zod_brand"),kn=class extends W{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Gn=class e extends W{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?q:a.status==="dirty"?(n.dirty(),cn(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?q:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:K.ZodPipeline})}},Qt=class extends W{_parse(t){let n=this._def.innerType._parse(t),r=i=>(Pn(i)&&(i.value=Object.freeze(i.value)),i);return Mn(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Qt.create=(e,t)=>new Qt({innerType:e,typeName:K.ZodReadonly,...z(t)});function Nr(e,t={},n){return e?At.create().superRefine((r,i)=>{var a,c;if(!e(r)){let u=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,h=(c=(a=u.fatal)!==null&&a!==void 0?a:n)!==null&&c!==void 0?c:!0,f=typeof u=="string"?{message:u}:u;i.addIssue({code:"custom",...f,fatal:h})}}):At.create()}var Bl={object:ke.lazycreate},K;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(K||(K={}));var Hl=(e,t={message:`Input not instance of ${e.name}`})=>Nr(n=>n instanceof e,t),v=bt.create,G=Bt.create,Vl=_n.create,Si=Ht.create,Z=Vt.create,jl=jt.create,Fl=fn.create,ql=Ft.create,gn=qt.create,Zl=At.create,Jt=ht.create,Cl=Qe.create,Kl=dn.create,ne=_t.create,O=ke.create,Yl=ke.strictCreate,Bn=Zt.create,$l=br.create,Xl=Ct.create,zl=et.create,Wl=Ar.create,Ql=mn.create,Jl=hn.create,eu=Ir.create,tu=Kt.create,pe=Yt.create,nu=$t.create,gt=Xt.create,ru=It.create,ha=Ve.create,bi=Ke.create,iu=tt.create,Ai=Ve.createWithPreprocess,au=Gn.create,su=()=>v().optional(),ou=()=>G().optional(),lu=()=>Z().optional(),uu={string:(e=>bt.create({...e,coerce:!0})),number:(e=>Bt.create({...e,coerce:!0})),boolean:(e=>Vt.create({...e,coerce:!0})),bigint:(e=>Ht.create({...e,coerce:!0})),date:(e=>jt.create({...e,coerce:!0}))},cu=q,d=Object.freeze({__proto__:null,defaultErrorMap:pn,setErrorMap:yl,getErrorMap:yr,makeIssue:Tr,EMPTY_PATH:Tl,addIssueToContext:P,ParseStatus:we,INVALID:q,DIRTY:cn,OK:Ue,isAborted:Ei,isDirty:yi,isValid:Pn,isAsync:Mn,get util(){return re},get objectUtil(){return vi},ZodParsedType:M,getParsedType:St,ZodType:W,datetimeRegex:ya,ZodString:bt,ZodNumber:Bt,ZodBigInt:Ht,ZodBoolean:Vt,ZodDate:jt,ZodSymbol:fn,ZodUndefined:Ft,ZodNull:qt,ZodAny:At,ZodUnknown:ht,ZodNever:Qe,ZodVoid:dn,ZodArray:_t,ZodObject:ke,ZodUnion:Zt,ZodDiscriminatedUnion:br,ZodIntersection:Ct,ZodTuple:et,ZodRecord:Ar,ZodMap:mn,ZodSet:hn,ZodFunction:Ir,ZodLazy:Kt,ZodLiteral:Yt,ZodEnum:$t,ZodNativeEnum:Xt,ZodPromise:It,ZodEffects:Ve,ZodTransformer:Ve,ZodOptional:Ke,ZodNullable:tt,ZodDefault:zt,ZodCatch:Wt,ZodNaN:_n,BRAND:Gl,ZodBranded:kn,ZodPipeline:Gn,ZodReadonly:Qt,custom:Nr,Schema:W,ZodSchema:W,late:Bl,get ZodFirstPartyTypeKind(){return K},coerce:uu,any:Zl,array:ne,bigint:Si,boolean:Z,date:jl,discriminatedUnion:$l,effect:ha,enum:nu,function:eu,instanceof:Hl,intersection:Xl,lazy:tu,literal:pe,map:Ql,nan:Vl,nativeEnum:gt,never:Cl,null:gn,nullable:iu,number:G,object:O,oboolean:lu,onumber:ou,optional:bi,ostring:su,pipeline:au,preprocess:Ai,promise:ru,record:Wl,set:Jl,strictObject:Yl,string:v,symbol:Fl,transformer:ha,tuple:zl,undefined:ql,union:Bn,unknown:Jt,void:Kl,NEVER:cu,ZodIssueCode:R,quotelessJson:El,ZodError:He});var wr={exports:{}};var Sa;function ba(){return Sa?wr.exports:(Sa=1,(function(e){var t=(function(n){var r=1e7,i=7,a=9007199254740992,c=Y(a),u="0123456789abcdefghijklmnopqrstuvwxyz",h=typeof BigInt=="function";function f(s,l,_,y){return typeof s>"u"?f[0]:typeof l<"u"?+l==10&&!_?C(s):ir(s,l,_,y):C(s)}function p(s,l){this.value=s,this.sign=l,this.isSmall=!1}p.prototype=Object.create(f.prototype);function g(s){this.value=s,this.sign=s<0,this.isSmall=!0}g.prototype=Object.create(f.prototype);function A(s){this.value=s}A.prototype=Object.create(f.prototype);function U(s){return-a<s&&s<a}function Y(s){return s<1e7?[s]:s<1e14?[s%1e7,Math.floor(s/1e7)]:[s%1e7,Math.floor(s/1e7)%1e7,Math.floor(s/1e14)]}function j(s){L(s);var l=s.length;if(l<4&&st(s,c)<0)switch(l){case 0:return 0;case 1:return s[0];case 2:return s[0]+s[1]*r;default:return s[0]+(s[1]+s[2]*r)*r}return s}function L(s){for(var l=s.length;s[--l]===0;);s.length=l+1}function _e(s){for(var l=new Array(s),_=-1;++_<s;)l[_]=0;return l}function ae(s){return s>0?Math.floor(s):Math.ceil(s)}function se(s,l){var _=s.length,y=l.length,S=new Array(_),T=0,I=r,N,w;for(w=0;w<y;w++)N=s[w]+l[w]+T,T=N>=I?1:0,S[w]=N-T*I;for(;w<_;)N=s[w]+T,T=N===I?1:0,S[w++]=N-T*I;return T>0&&S.push(T),S}function Oe(s,l){return s.length>=l.length?se(s,l):se(l,s)}function ve(s,l){var _=s.length,y=new Array(_),S=r,T,I;for(I=0;I<_;I++)T=s[I]-S+l,l=Math.floor(T/S),y[I]=T-l*S,l+=1;for(;l>0;)y[I++]=l%S,l=Math.floor(l/S);return y}p.prototype.add=function(s){var l=C(s);if(this.sign!==l.sign)return this.subtract(l.negate());var _=this.value,y=l.value;return l.isSmall?new p(ve(_,Math.abs(y)),this.sign):new p(Oe(_,y),this.sign)},p.prototype.plus=p.prototype.add,g.prototype.add=function(s){var l=C(s),_=this.value;if(_<0!==l.sign)return this.subtract(l.negate());var y=l.value;if(l.isSmall){if(U(_+y))return new g(_+y);y=Y(Math.abs(y))}return new p(ve(y,Math.abs(_)),_<0)},g.prototype.plus=g.prototype.add,A.prototype.add=function(s){return new A(this.value+C(s).value)},A.prototype.plus=A.prototype.add;function Fe(s,l){var _=s.length,y=l.length,S=new Array(_),T=0,I=r,N,w;for(N=0;N<y;N++)w=s[N]-T-l[N],w<0?(w+=I,T=1):T=0,S[N]=w;for(N=y;N<_;N++){if(w=s[N]-T,w<0)w+=I;else{S[N++]=w;break}S[N]=w}for(;N<_;N++)S[N]=s[N];return L(S),S}function Ae(s,l,_){var y;return st(s,l)>=0?y=Fe(s,l):(y=Fe(l,s),_=!_),y=j(y),typeof y=="number"?(_&&(y=-y),new g(y)):new p(y,_)}function Be(s,l,_){var y=s.length,S=new Array(y),T=-l,I=r,N,w;for(N=0;N<y;N++)w=s[N]+T,T=Math.floor(w/I),w%=I,S[N]=w<0?w+I:w;return S=j(S),typeof S=="number"?(_&&(S=-S),new g(S)):new p(S,_)}p.prototype.subtract=function(s){var l=C(s);if(this.sign!==l.sign)return this.add(l.negate());var _=this.value,y=l.value;return l.isSmall?Be(_,Math.abs(y),this.sign):Ae(_,y,this.sign)},p.prototype.minus=p.prototype.subtract,g.prototype.subtract=function(s){var l=C(s),_=this.value;if(_<0!==l.sign)return this.add(l.negate());var y=l.value;return l.isSmall?new g(_-y):Be(y,Math.abs(_),_>=0)},g.prototype.minus=g.prototype.subtract,A.prototype.subtract=function(s){return new A(this.value-C(s).value)},A.prototype.minus=A.prototype.subtract,p.prototype.negate=function(){return new p(this.value,!this.sign)},g.prototype.negate=function(){var s=this.sign,l=new g(-this.value);return l.sign=!s,l},A.prototype.negate=function(){return new A(-this.value)},p.prototype.abs=function(){return new p(this.value,!1)},g.prototype.abs=function(){return new g(Math.abs(this.value))},A.prototype.abs=function(){return new A(this.value>=0?this.value:-this.value)};function Xe(s,l){var _=s.length,y=l.length,S=_+y,T=_e(S),I=r,N,w,F,te,$;for(F=0;F<_;++F){te=s[F];for(var ie=0;ie<y;++ie)$=l[ie],N=te*$+T[F+ie],w=Math.floor(N/I),T[F+ie]=N-w*I,T[F+ie+1]+=w}return L(T),T}function qe(s,l){var _=s.length,y=new Array(_),S=r,T=0,I,N;for(N=0;N<_;N++)I=s[N]*l+T,T=Math.floor(I/S),y[N]=I-T*S;for(;T>0;)y[N++]=T%S,T=Math.floor(T/S);return y}function xe(s,l){for(var _=[];l-- >0;)_.push(0);return _.concat(s)}function ue(s,l){var _=Math.max(s.length,l.length);if(_<=30)return Xe(s,l);_=Math.ceil(_/2);var y=s.slice(_),S=s.slice(0,_),T=l.slice(_),I=l.slice(0,_),N=ue(S,I),w=ue(y,T),F=ue(Oe(S,y),Oe(I,T)),te=Oe(Oe(N,xe(Fe(Fe(F,N),w),_)),xe(w,2*_));return L(te),te}function ni(s,l){return-.012*s-.012*l+15e-6*s*l>0}p.prototype.multiply=function(s){var l=C(s),_=this.value,y=l.value,S=this.sign!==l.sign,T;if(l.isSmall){if(y===0)return f[0];if(y===1)return this;if(y===-1)return this.negate();if(T=Math.abs(y),T<r)return new p(qe(_,T),S);y=Y(T)}return ni(_.length,y.length)?new p(ue(_,y),S):new p(Xe(_,y),S)},p.prototype.times=p.prototype.multiply;function Xn(s,l,_){return s<r?new p(qe(l,s),_):new p(Xe(l,Y(s)),_)}g.prototype._multiplyBySmall=function(s){return U(s.value*this.value)?new g(s.value*this.value):Xn(Math.abs(s.value),Y(Math.abs(this.value)),this.sign!==s.sign)},p.prototype._multiplyBySmall=function(s){return s.value===0?f[0]:s.value===1?this:s.value===-1?this.negate():Xn(Math.abs(s.value),this.value,this.sign!==s.sign)},g.prototype.multiply=function(s){return C(s)._multiplyBySmall(this)},g.prototype.times=g.prototype.multiply,A.prototype.multiply=function(s){return new A(this.value*C(s).value)},A.prototype.times=A.prototype.multiply;function zn(s){var l=s.length,_=_e(l+l),y=r,S,T,I,N,w;for(I=0;I<l;I++){N=s[I],T=0-N*N;for(var F=I;F<l;F++)w=s[F],S=2*(N*w)+_[I+F]+T,T=Math.floor(S/y),_[I+F]=S-T*y;_[I+l]=T}return L(_),_}p.prototype.square=function(){return new p(zn(this.value),!1)},g.prototype.square=function(){var s=this.value*this.value;return U(s)?new g(s):new p(zn(Y(Math.abs(this.value))),!1)},A.prototype.square=function(s){return new A(this.value*this.value)};function ri(s,l){var _=s.length,y=l.length,S=r,T=_e(l.length),I=l[y-1],N=Math.ceil(S/(2*I)),w=qe(s,N),F=qe(l,N),te,$,ie,De,Ie,wn,Rn;for(w.length<=_&&w.push(0),F.push(0),I=F[y-1],$=_-y;$>=0;$--){for(te=S-1,w[$+y]!==I&&(te=Math.floor((w[$+y]*S+w[$+y-1])/I)),ie=0,De=0,wn=F.length,Ie=0;Ie<wn;Ie++)ie+=te*F[Ie],Rn=Math.floor(ie/S),De+=w[$+Ie]-(ie-Rn*S),ie=Rn,De<0?(w[$+Ie]=De+S,De=-1):(w[$+Ie]=De,De=0);for(;De!==0;){for(te-=1,ie=0,Ie=0;Ie<wn;Ie++)ie+=w[$+Ie]-S+F[Ie],ie<0?(w[$+Ie]=ie+S,ie=0):(w[$+Ie]=ie,ie=1);De+=ie}T[$]=te}return w=Wn(w,N)[0],[j(T),j(w)]}function ii(s,l){for(var _=s.length,y=l.length,S=[],T=[],I=r,N,w,F,te,$;_;){if(T.unshift(s[--_]),L(T),st(T,l)<0){S.push(0);continue}w=T.length,F=T[w-1]*I+T[w-2],te=l[y-1]*I+l[y-2],w>y&&(F=(F+1)*I),N=Math.ceil(F/te);do{if($=qe(l,N),st($,T)<=0)break;N--}while(N);S.push(N),T=Fe(T,$)}return S.reverse(),[j(S),j(T)]}function Wn(s,l){var _=s.length,y=_e(_),S=r,T,I,N,w;for(N=0,T=_-1;T>=0;--T)w=N*S+s[T],I=ae(w/l),N=w-I*l,y[T]=I|0;return[y,N|0]}function at(s,l){var _,y=C(l);if(h)return[new A(s.value/y.value),new A(s.value%y.value)];var S=s.value,T=y.value,I;if(T===0)throw new Error("Cannot divide by zero");if(s.isSmall)return y.isSmall?[new g(ae(S/T)),new g(S%T)]:[f[0],s];if(y.isSmall){if(T===1)return[s,f[0]];if(T==-1)return[s.negate(),f[0]];var N=Math.abs(T);if(N<r){_=Wn(S,N),I=j(_[0]);var w=_[1];return s.sign&&(w=-w),typeof I=="number"?(s.sign!==y.sign&&(I=-I),[new g(I),new g(w)]):[new p(I,s.sign!==y.sign),new g(w)]}T=Y(N)}var F=st(S,T);if(F===-1)return[f[0],s];if(F===0)return[f[s.sign===y.sign?1:-1],f[0]];S.length+T.length<=200?_=ri(S,T):_=ii(S,T),I=_[0];var te=s.sign!==y.sign,$=_[1],ie=s.sign;return typeof I=="number"?(te&&(I=-I),I=new g(I)):I=new p(I,te),typeof $=="number"?(ie&&($=-$),$=new g($)):$=new p($,ie),[I,$]}p.prototype.divmod=function(s){var l=at(this,s);return{quotient:l[0],remainder:l[1]}},A.prototype.divmod=g.prototype.divmod=p.prototype.divmod,p.prototype.divide=function(s){return at(this,s)[0]},A.prototype.over=A.prototype.divide=function(s){return new A(this.value/C(s).value)},g.prototype.over=g.prototype.divide=p.prototype.over=p.prototype.divide,p.prototype.mod=function(s){return at(this,s)[1]},A.prototype.mod=A.prototype.remainder=function(s){return new A(this.value%C(s).value)},g.prototype.remainder=g.prototype.mod=p.prototype.remainder=p.prototype.mod,p.prototype.pow=function(s){var l=C(s),_=this.value,y=l.value,S,T,I;if(y===0)return f[1];if(_===0)return f[0];if(_===1)return f[1];if(_===-1)return l.isEven()?f[1]:f[-1];if(l.sign)return f[0];if(!l.isSmall)throw new Error("The exponent "+l.toString()+" is too large.");if(this.isSmall&&U(S=Math.pow(_,y)))return new g(ae(S));for(T=this,I=f[1];y&!0&&(I=I.times(T),--y),y!==0;)y/=2,T=T.square();return I},g.prototype.pow=p.prototype.pow,A.prototype.pow=function(s){var l=C(s),_=this.value,y=l.value,S=BigInt(0),T=BigInt(1),I=BigInt(2);if(y===S)return f[1];if(_===S)return f[0];if(_===T)return f[1];if(_===BigInt(-1))return l.isEven()?f[1]:f[-1];if(l.isNegative())return new A(S);for(var N=this,w=f[1];(y&T)===T&&(w=w.times(N),--y),y!==S;)y/=I,N=N.square();return w},p.prototype.modPow=function(s,l){if(s=C(s),l=C(l),l.isZero())throw new Error("Cannot take modPow with modulus 0");var _=f[1],y=this.mod(l);for(s.isNegative()&&(s=s.multiply(f[-1]),y=y.modInv(l));s.isPositive();){if(y.isZero())return f[0];s.isOdd()&&(_=_.multiply(y).mod(l)),s=s.divide(2),y=y.square().mod(l)}return _},A.prototype.modPow=g.prototype.modPow=p.prototype.modPow;function st(s,l){if(s.length!==l.length)return s.length>l.length?1:-1;for(var _=s.length-1;_>=0;_--)if(s[_]!==l[_])return s[_]>l[_]?1:-1;return 0}p.prototype.compareAbs=function(s){var l=C(s),_=this.value,y=l.value;return l.isSmall?1:st(_,y)},g.prototype.compareAbs=function(s){var l=C(s),_=Math.abs(this.value),y=l.value;return l.isSmall?(y=Math.abs(y),_===y?0:_>y?1:-1):-1},A.prototype.compareAbs=function(s){var l=this.value,_=C(s).value;return l=l>=0?l:-l,_=_>=0?_:-_,l===_?0:l>_?1:-1},p.prototype.compare=function(s){if(s===1/0)return-1;if(s===-1/0)return 1;var l=C(s),_=this.value,y=l.value;return this.sign!==l.sign?l.sign?1:-1:l.isSmall?this.sign?-1:1:st(_,y)*(this.sign?-1:1)},p.prototype.compareTo=p.prototype.compare,g.prototype.compare=function(s){if(s===1/0)return-1;if(s===-1/0)return 1;var l=C(s),_=this.value,y=l.value;return l.isSmall?_==y?0:_>y?1:-1:_<0!==l.sign?_<0?-1:1:_<0?1:-1},g.prototype.compareTo=g.prototype.compare,A.prototype.compare=function(s){if(s===1/0)return-1;if(s===-1/0)return 1;var l=this.value,_=C(s).value;return l===_?0:l>_?1:-1},A.prototype.compareTo=A.prototype.compare,p.prototype.equals=function(s){return this.compare(s)===0},A.prototype.eq=A.prototype.equals=g.prototype.eq=g.prototype.equals=p.prototype.eq=p.prototype.equals,p.prototype.notEquals=function(s){return this.compare(s)!==0},A.prototype.neq=A.prototype.notEquals=g.prototype.neq=g.prototype.notEquals=p.prototype.neq=p.prototype.notEquals,p.prototype.greater=function(s){return this.compare(s)>0},A.prototype.gt=A.prototype.greater=g.prototype.gt=g.prototype.greater=p.prototype.gt=p.prototype.greater,p.prototype.lesser=function(s){return this.compare(s)<0},A.prototype.lt=A.prototype.lesser=g.prototype.lt=g.prototype.lesser=p.prototype.lt=p.prototype.lesser,p.prototype.greaterOrEquals=function(s){return this.compare(s)>=0},A.prototype.geq=A.prototype.greaterOrEquals=g.prototype.geq=g.prototype.greaterOrEquals=p.prototype.geq=p.prototype.greaterOrEquals,p.prototype.lesserOrEquals=function(s){return this.compare(s)<=0},A.prototype.leq=A.prototype.lesserOrEquals=g.prototype.leq=g.prototype.lesserOrEquals=p.prototype.leq=p.prototype.lesserOrEquals,p.prototype.isEven=function(){return(this.value[0]&1)===0},g.prototype.isEven=function(){return(this.value&1)===0},A.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},p.prototype.isOdd=function(){return(this.value[0]&1)===1},g.prototype.isOdd=function(){return(this.value&1)===1},A.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},p.prototype.isPositive=function(){return!this.sign},g.prototype.isPositive=function(){return this.value>0},A.prototype.isPositive=g.prototype.isPositive,p.prototype.isNegative=function(){return this.sign},g.prototype.isNegative=function(){return this.value<0},A.prototype.isNegative=g.prototype.isNegative,p.prototype.isUnit=function(){return!1},g.prototype.isUnit=function(){return Math.abs(this.value)===1},A.prototype.isUnit=function(){return this.abs().value===BigInt(1)},p.prototype.isZero=function(){return!1},g.prototype.isZero=function(){return this.value===0},A.prototype.isZero=function(){return this.value===BigInt(0)},p.prototype.isDivisibleBy=function(s){var l=C(s);return l.isZero()?!1:l.isUnit()?!0:l.compareAbs(2)===0?this.isEven():this.mod(l).isZero()},A.prototype.isDivisibleBy=g.prototype.isDivisibleBy=p.prototype.isDivisibleBy;function Qn(s){var l=s.abs();if(l.isUnit())return!1;if(l.equals(2)||l.equals(3)||l.equals(5))return!0;if(l.isEven()||l.isDivisibleBy(3)||l.isDivisibleBy(5))return!1;if(l.lesser(49))return!0}function An(s,l){for(var _=s.prev(),y=_,S=0,T,I,N;y.isEven();)y=y.divide(2),S++;e:for(I=0;I<l.length;I++)if(!s.lesser(l[I])&&(N=t(l[I]).modPow(y,s),!(N.isUnit()||N.equals(_)))){for(T=S-1;T!=0;T--){if(N=N.square().mod(s),N.isUnit())return!1;if(N.equals(_))continue e}return!1}return!0}p.prototype.isPrime=function(s){var l=Qn(this);if(l!==n)return l;var _=this.abs(),y=_.bitLength();if(y<=64)return An(_,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var S=Math.log(2)*y.toJSNumber(),T=Math.ceil(s===!0?2*Math.pow(S,2):S),I=[],N=0;N<T;N++)I.push(t(N+2));return An(_,I)},A.prototype.isPrime=g.prototype.isPrime=p.prototype.isPrime,p.prototype.isProbablePrime=function(s,l){var _=Qn(this);if(_!==n)return _;for(var y=this.abs(),S=s===n?5:s,T=[],I=0;I<S;I++)T.push(t.randBetween(2,y.minus(2),l));return An(y,T)},A.prototype.isProbablePrime=g.prototype.isProbablePrime=p.prototype.isProbablePrime,p.prototype.modInv=function(s){for(var l=t.zero,_=t.one,y=C(s),S=this.abs(),T,I,N;!S.isZero();)T=y.divide(S),I=l,N=y,l=_,y=S,_=I.subtract(T.multiply(_)),S=N.subtract(T.multiply(S));if(!y.isUnit())throw new Error(this.toString()+" and "+s.toString()+" are not co-prime");return l.compare(0)===-1&&(l=l.add(s)),this.isNegative()?l.negate():l},A.prototype.modInv=g.prototype.modInv=p.prototype.modInv,p.prototype.next=function(){var s=this.value;return this.sign?Be(s,1,this.sign):new p(ve(s,1),this.sign)},g.prototype.next=function(){var s=this.value;return s+1<a?new g(s+1):new p(c,!1)},A.prototype.next=function(){return new A(this.value+BigInt(1))},p.prototype.prev=function(){var s=this.value;return this.sign?new p(ve(s,1),!0):Be(s,1,this.sign)},g.prototype.prev=function(){var s=this.value;return s-1>-a?new g(s-1):new p(c,!0)},A.prototype.prev=function(){return new A(this.value-BigInt(1))};for(var ze=[1];2*ze[ze.length-1]<=r;)ze.push(2*ze[ze.length-1]);var Ut=ze.length,ot=ze[Ut-1];function Jn(s){return Math.abs(s)<=r}p.prototype.shiftLeft=function(s){var l=C(s).toJSNumber();if(!Jn(l))throw new Error(String(l)+" is too large for shifting.");if(l<0)return this.shiftRight(-l);var _=this;if(_.isZero())return _;for(;l>=Ut;)_=_.multiply(ot),l-=Ut-1;return _.multiply(ze[l])},A.prototype.shiftLeft=g.prototype.shiftLeft=p.prototype.shiftLeft,p.prototype.shiftRight=function(s){var l,_=C(s).toJSNumber();if(!Jn(_))throw new Error(String(_)+" is too large for shifting.");if(_<0)return this.shiftLeft(-_);for(var y=this;_>=Ut;){if(y.isZero()||y.isNegative()&&y.isUnit())return y;l=at(y,ot),y=l[1].isNegative()?l[0].prev():l[0],_-=Ut-1}return l=at(y,ze[_]),l[1].isNegative()?l[0].prev():l[0]},A.prototype.shiftRight=g.prototype.shiftRight=p.prototype.shiftRight;function In(s,l,_){l=C(l);for(var y=s.isNegative(),S=l.isNegative(),T=y?s.not():s,I=S?l.not():l,N=0,w=0,F=null,te=null,$=[];!T.isZero()||!I.isZero();)F=at(T,ot),N=F[1].toJSNumber(),y&&(N=ot-1-N),te=at(I,ot),w=te[1].toJSNumber(),S&&(w=ot-1-w),T=F[0],I=te[0],$.push(_(N,w));for(var ie=_(y?1:0,S?1:0)!==0?t(-1):t(0),De=$.length-1;De>=0;De-=1)ie=ie.multiply(ot).add(t($[De]));return ie}p.prototype.not=function(){return this.negate().prev()},A.prototype.not=g.prototype.not=p.prototype.not,p.prototype.and=function(s){return In(this,s,function(l,_){return l&_})},A.prototype.and=g.prototype.and=p.prototype.and,p.prototype.or=function(s){return In(this,s,function(l,_){return l|_})},A.prototype.or=g.prototype.or=p.prototype.or,p.prototype.xor=function(s){return In(this,s,function(l,_){return l^_})},A.prototype.xor=g.prototype.xor=p.prototype.xor;var oe=1<<30,er=(r&-r)*(r&-r)|oe;function rn(s){var l=s.value,_=typeof l=="number"?l|oe:typeof l=="bigint"?l|BigInt(oe):l[0]+l[1]*r|er;return _&-_}function We(s,l){if(l.compareTo(s)<=0){var _=We(s,l.square(l)),y=_.p,S=_.e,T=y.multiply(l);return T.compareTo(s)<=0?{p:T,e:S*2+1}:{p:y,e:S*2}}return{p:t(1),e:0}}p.prototype.bitLength=function(){var s=this;return s.compareTo(t(0))<0&&(s=s.negate().subtract(t(1))),s.compareTo(t(0))===0?t(0):t(We(s,t(2)).e).add(t(1))},A.prototype.bitLength=g.prototype.bitLength=p.prototype.bitLength;function Nn(s,l){return s=C(s),l=C(l),s.greater(l)?s:l}function an(s,l){return s=C(s),l=C(l),s.lesser(l)?s:l}function tr(s,l){if(s=C(s).abs(),l=C(l).abs(),s.equals(l))return s;if(s.isZero())return l;if(l.isZero())return s;for(var _=f[1],y,S;s.isEven()&&l.isEven();)y=an(rn(s),rn(l)),s=s.divide(y),l=l.divide(y),_=_.multiply(y);for(;s.isEven();)s=s.divide(rn(s));do{for(;l.isEven();)l=l.divide(rn(l));s.greater(l)&&(S=l,l=s,s=S),l=l.subtract(s)}while(!l.isZero());return _.isUnit()?s:s.multiply(_)}function nr(s,l){return s=C(s).abs(),l=C(l).abs(),s.divide(tr(s,l)).multiply(l)}function rr(s,l,_){s=C(s),l=C(l);var y=_||Math.random,S=an(s,l),T=Nn(s,l),I=T.subtract(S).add(1);if(I.isSmall)return S.add(Math.floor(y()*I));for(var N=Pt(I,r).value,w=[],F=!0,te=0;te<N.length;te++){var $=F?N[te]+(te+1<N.length?N[te+1]/r:0):r,ie=ae(y()*$);w.push(ie),ie<N[te]&&(F=!1)}return S.add(f.fromArray(w,r,!1))}var ir=function(s,l,_,y){_=_||u,s=String(s),y||(s=s.toLowerCase(),_=_.toLowerCase());var S=s.length,T,I=Math.abs(l),N={};for(T=0;T<_.length;T++)N[_[T]]=T;for(T=0;T<S;T++){var w=s[T];if(w!=="-"&&w in N&&N[w]>=I){if(w==="1"&&I===1)continue;throw new Error(w+" is not a valid digit in base "+l+".")}}l=C(l);var F=[],te=s[0]==="-";for(T=te?1:0;T<s.length;T++){var w=s[T];if(w in N)F.push(C(N[w]));else if(w==="<"){var $=T;do T++;while(s[T]!==">"&&T<s.length);F.push(C(s.slice($+1,T)))}else throw new Error(w+" is not a valid character")}return ar(F,l,te)};function ar(s,l,_){var y=f[0],S=f[1],T;for(T=s.length-1;T>=0;T--)y=y.add(s[T].times(S)),S=S.times(l);return _?y.negate():y}function ai(s,l){return l=l||u,s<l.length?l[s]:"<"+s+">"}function Pt(s,l){if(l=t(l),l.isZero()){if(s.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(l.equals(-1)){if(s.isZero())return{value:[0],isNegative:!1};if(s.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-s.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var _=Array.apply(null,Array(s.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return _.unshift([1]),{value:[].concat.apply([],_),isNegative:!1}}var y=!1;if(s.isNegative()&&l.isPositive()&&(y=!0,s=s.abs()),l.isUnit())return s.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(s.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:y};for(var S=[],T=s,I;T.isNegative()||T.compareAbs(l)>=0;){I=T.divmod(l),T=I.quotient;var N=I.remainder;N.isNegative()&&(N=l.minus(N).abs(),T=T.next()),S.push(N.toJSNumber())}return S.push(T.toJSNumber()),{value:S.reverse(),isNegative:y}}function sr(s,l,_){var y=Pt(s,l);return(y.isNegative?"-":"")+y.value.map(function(S){return ai(S,_)}).join("")}p.prototype.toArray=function(s){return Pt(this,s)},g.prototype.toArray=function(s){return Pt(this,s)},A.prototype.toArray=function(s){return Pt(this,s)},p.prototype.toString=function(s,l){if(s===n&&(s=10),s!==10||l)return sr(this,s,l);for(var _=this.value,y=_.length,S=String(_[--y]),T="0000000",I;--y>=0;)I=String(_[y]),S+=T.slice(I.length)+I;var N=this.sign?"-":"";return N+S},g.prototype.toString=function(s,l){return s===n&&(s=10),s!=10||l?sr(this,s,l):String(this.value)},A.prototype.toString=g.prototype.toString,A.prototype.toJSON=p.prototype.toJSON=g.prototype.toJSON=function(){return this.toString()},p.prototype.valueOf=function(){return parseInt(this.toString(),10)},p.prototype.toJSNumber=p.prototype.valueOf,g.prototype.valueOf=function(){return this.value},g.prototype.toJSNumber=g.prototype.valueOf,A.prototype.valueOf=A.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function or(s){if(U(+s)){var l=+s;if(l===ae(l))return h?new A(BigInt(l)):new g(l);throw new Error("Invalid integer: "+s)}var _=s[0]==="-";_&&(s=s.slice(1));var y=s.split(/e/i);if(y.length>2)throw new Error("Invalid integer: "+y.join("e"));if(y.length===2){var S=y[1];if(S[0]==="+"&&(S=S.slice(1)),S=+S,S!==ae(S)||!U(S))throw new Error("Invalid integer: "+S+" is not a valid exponent.");var T=y[0],I=T.indexOf(".");if(I>=0&&(S-=T.length-I-1,T=T.slice(0,I)+T.slice(I+1)),S<0)throw new Error("Cannot include negative exponent part for integers");T+=new Array(S+1).join("0"),s=T}var N=/^([0-9][0-9]*)$/.test(s);if(!N)throw new Error("Invalid integer: "+s);if(h)return new A(BigInt(_?"-"+s:s));for(var w=[],F=s.length,te=i,$=F-te;F>0;)w.push(+s.slice($,F)),$-=te,$<0&&($=0),F-=te;return L(w),new p(w,_)}function si(s){if(h)return new A(BigInt(s));if(U(s)){if(s!==ae(s))throw new Error(s+" is not an integer.");return new g(s)}return or(s.toString())}function C(s){return typeof s=="number"?si(s):typeof s=="string"?or(s):typeof s=="bigint"?new A(s):s}for(var lt=0;lt<1e3;lt++)f[lt]=C(lt),lt>0&&(f[-lt]=C(-lt));return f.one=f[1],f.zero=f[0],f.minusOne=f[-1],f.max=Nn,f.min=an,f.gcd=tr,f.lcm=nr,f.isInstance=function(s){return s instanceof p||s instanceof g||s instanceof A},f.randBetween=rr,f.fromArray=function(s,l,_){return ar(s.map(C),C(l||10),_)},f})();e.hasOwnProperty("exports")&&(e.exports=t)})(wr),wr.exports)}var pu=ba(),Rr=ln(pu);var Aa=64,Ii=16,Nt=Aa/Ii;function fu(){try{return!0}catch{return!1}}function du(e,t,n){let r=0;for(let i=0;i<n;i++){let a=e[t+i];if(a===void 0)break;r+=a*16**i}return r}function Ia(e){let t=[];for(let n=0;n<e.length;n++){let r=Number(e[n]);for(let i=0;r||i<t.length;i++)r+=(t[i]||0)*10,t[i]=r%16,r=(r-t[i])/16}return t}function mu(e){let t=Ia(e),n=Array(Nt);for(let r=0;r<Nt;r++)n[Nt-1-r]=du(t,r*Nt,Nt);return n}var Hn=class e{static fromString(t){return new e(mu(t),t)}static fromBit(t){let n=Array(Nt),r=Math.floor(t/Ii);for(let i=0;i<Nt;i++)n[Nt-1-i]=i===r?1<<t-r*Ii:0;return new e(n)}constructor(t,n){this.parts=t,this.str=n}and({parts:t}){return new e(this.parts.map((n,r)=>n&t[r]))}or({parts:t}){return new e(this.parts.map((n,r)=>n|t[r]))}xor({parts:t}){return new e(this.parts.map((n,r)=>n^t[r]))}not(){return new e(this.parts.map(t=>~t))}equals({parts:t}){return this.parts.every((n,r)=>n===t[r])}toString(){if(this.str!=null)return this.str;let t=new Array(Aa/4);return this.parts.forEach((n,r)=>{let i=Ia(n.toString());for(let a=0;a<4;a++)t[a+r*4]=i[3-a]||0}),this.str=Rr.fromArray(t,16).toString()}toJSON(){return this.toString()}},wt=fu();wt&&BigInt.prototype.toJSON==null&&(BigInt.prototype.toJSON=function(){return this.toString()});var Or={},Na=wt?function(t){return BigInt(t)}:function(t){return t instanceof Hn?t:(typeof t=="number"&&(t=t.toString()),Or[t]!=null||(Or[t]=Hn.fromString(t)),Or[t])},Se=Na(0),xr=wt?function(t=Se,n=Se){return t&n}:function(t=Se,n=Se){return t.and(n)},wa=wt?function(t=Se,n=Se){return t|n}:function(t=Se,n=Se){return t.or(n)},hu=wt?function(t=Se,n=Se){return t^n}:function(t=Se,n=Se){return t.xor(n)},_u=wt?function(t=Se){return~t}:function(t=Se){return t.not()},Ni=wt?function(t,n){return t===n}:function(t,n){return t==null||n==null?t==n:t.equals(n)};function gu(...e){let t=e[0];for(let n=1;n<e.length;n++)t=wa(t,e[n]);return t}function vu(e,t){return Ni(xr(e,t),t)}function Eu(e,t){return!Ni(xr(e,t),Se)}function yu(e,t){return t===Se?e:wa(e,t)}function Tu(e,t){return t===Se?e:hu(e,xr(e,t))}var Su=wt?function(t){return BigInt(1)<<BigInt(t)}:function(t){return Hn.fromBit(t)},V={combine:gu,add:yu,remove:Tu,filter:xr,invert:_u,has:vu,hasAny:Eu,equals:Ni,deserialize:Na,getFlag:Su};var wi;(function(e){e[e.CLOSE_NORMAL=1e3]="CLOSE_NORMAL",e[e.CLOSE_UNSUPPORTED=1003]="CLOSE_UNSUPPORTED",e[e.CLOSE_ABNORMAL=1006]="CLOSE_ABNORMAL",e[e.INVALID_CLIENTID=4e3]="INVALID_CLIENTID",e[e.INVALID_ORIGIN=4001]="INVALID_ORIGIN",e[e.RATELIMITED=4002]="RATELIMITED",e[e.TOKEN_REVOKED=4003]="TOKEN_REVOKED",e[e.INVALID_VERSION=4004]="INVALID_VERSION",e[e.INVALID_ENCODING=4005]="INVALID_ENCODING"})(wi||(wi={}));var Vn;(function(e){e[e.INVALID_PAYLOAD=4e3]="INVALID_PAYLOAD",e[e.INVALID_COMMAND=4002]="INVALID_COMMAND",e[e.INVALID_GUILD=4003]="INVALID_GUILD",e[e.INVALID_EVENT=4004]="INVALID_EVENT",e[e.INVALID_CHANNEL=4005]="INVALID_CHANNEL",e[e.INVALID_PERMISSIONS=4006]="INVALID_PERMISSIONS",e[e.INVALID_CLIENTID=4007]="INVALID_CLIENTID",e[e.INVALID_ORIGIN=4008]="INVALID_ORIGIN",e[e.INVALID_TOKEN=4009]="INVALID_TOKEN",e[e.INVALID_USER=4010]="INVALID_USER"})(Vn||(Vn={}));var jn;(function(e){e.LANDSCAPE="landscape",e.PORTRAIT="portrait"})(jn||(jn={}));var Ge;(function(e){e.MOBILE="mobile",e.DESKTOP="desktop"})(Ge||(Ge={}));var bu=Object.freeze({CREATE_INSTANT_INVITE:V.getFlag(0),KICK_MEMBERS:V.getFlag(1),BAN_MEMBERS:V.getFlag(2),ADMINISTRATOR:V.getFlag(3),MANAGE_CHANNELS:V.getFlag(4),MANAGE_GUILD:V.getFlag(5),ADD_REACTIONS:V.getFlag(6),VIEW_AUDIT_LOG:V.getFlag(7),PRIORITY_SPEAKER:V.getFlag(8),STREAM:V.getFlag(9),VIEW_CHANNEL:V.getFlag(10),SEND_MESSAGES:V.getFlag(11),SEND_TTS_MESSAGES:V.getFlag(12),MANAGE_MESSAGES:V.getFlag(13),EMBED_LINKS:V.getFlag(14),ATTACH_FILES:V.getFlag(15),READ_MESSAGE_HISTORY:V.getFlag(16),MENTION_EVERYONE:V.getFlag(17),USE_EXTERNAL_EMOJIS:V.getFlag(18),VIEW_GUILD_INSIGHTS:V.getFlag(19),CONNECT:V.getFlag(20),SPEAK:V.getFlag(21),MUTE_MEMBERS:V.getFlag(22),DEAFEN_MEMBERS:V.getFlag(23),MOVE_MEMBERS:V.getFlag(24),USE_VAD:V.getFlag(25),CHANGE_NICKNAME:V.getFlag(26),MANAGE_NICKNAMES:V.getFlag(27),MANAGE_ROLES:V.getFlag(28),MANAGE_WEBHOOKS:V.getFlag(29),MANAGE_GUILD_EXPRESSIONS:V.getFlag(30),USE_APPLICATION_COMMANDS:V.getFlag(31),REQUEST_TO_SPEAK:V.getFlag(32),MANAGE_EVENTS:V.getFlag(33),MANAGE_THREADS:V.getFlag(34),CREATE_PUBLIC_THREADS:V.getFlag(35),CREATE_PRIVATE_THREADS:V.getFlag(36),USE_EXTERNAL_STICKERS:V.getFlag(37),SEND_MESSAGES_IN_THREADS:V.getFlag(38),USE_EMBEDDED_ACTIVITIES:V.getFlag(39),MODERATE_MEMBERS:V.getFlag(40),VIEW_CREATOR_MONETIZATION_ANALYTICS:V.getFlag(41),USE_SOUNDBOARD:V.getFlag(42),CREATE_GUILD_EXPRESSIONS:V.getFlag(43),CREATE_EVENTS:V.getFlag(44),USE_EXTERNAL_SOUNDS:V.getFlag(45),SEND_VOICE_MESSAGES:V.getFlag(46),SEND_POLLS:V.getFlag(49),USE_EXTERNAL_APPS:V.getFlag(50)}),Ri=-1,Ra=250;var Vr={};pa(Vr,{Activity:()=>Rt,Attachment:()=>Ga,CertifiedDevice:()=>ju,CertifiedDeviceTypeObject:()=>Wa,Channel:()=>Mr,ChannelMention:()=>ka,ChannelTypesObject:()=>vn,Commands:()=>D,DISPATCH:()=>Li,Embed:()=>qa,EmbedAuthor:()=>ja,EmbedField:()=>Fa,EmbedFooter:()=>Ba,EmbedProvider:()=>Va,Emoji:()=>Pr,Entitlement:()=>En,EntitlementTypesObject:()=>Ja,Guild:()=>Vu,GuildMember:()=>Cn,GuildMemberRPC:()=>Pi,Image:()=>Ur,KeyTypesObject:()=>Xa,LayoutMode:()=>Zu,LayoutModeTypeObject:()=>Hr,Message:()=>ki,MessageActivity:()=>Ca,MessageApplication:()=>Ka,MessageReference:()=>Ya,Orientation:()=>qu,OrientationLockState:()=>Fu,OrientationLockStateTypeObject:()=>es,OrientationTypeObject:()=>Br,PermissionOverwrite:()=>Ua,PermissionOverwriteTypeObject:()=>La,PresenceUpdate:()=>Pa,Reaction:()=>Za,ReceiveFramePayload:()=>Je,Relationship:()=>Ui,Role:()=>Ma,Scopes:()=>Hu,ScopesObject:()=>xa,ShortcutKey:()=>kr,Sku:()=>Bi,SkuTypeObject:()=>Qa,Status:()=>Zn,StatusObject:()=>Da,ThermalState:()=>Hi,ThermalStateTypeObject:()=>ts,User:()=>nt,UserVoiceState:()=>Kn,Video:()=>Ha,VoiceDevice:()=>$a,VoiceSettingModeTypeObject:()=>za,VoiceSettingsIO:()=>Gr,VoiceSettingsMode:()=>Gi,VoiceState:()=>Mi});function ye(e){return Ai(t=>{var n;let[r]=(n=Object.entries(e).find(([,i])=>i===t))!==null&&n!==void 0?n:[];return t!=null&&r===void 0?e.UNHANDLED:t},v().or(G()))}function Dr(e){let t=Nr().transform(n=>{let r=e.safeParse(n);return r.success?r.data:e._def.defaultValue()});return t.overlayType=e,t}var Oi=d.object({image_url:d.string()}).describe('Response for "INITIATE_IMAGE_UPLOAD" Command'),Au=d.object({mediaUrl:d.string().max(1024)}).describe('Request for "OPEN_SHARE_MOMENT_DIALOG" Command'),Iu=d.object({access_token:d.union([d.string(),d.null()]).optional()}).describe('Request for "AUTHENTICATE" Command'),qn=d.object({access_token:d.string(),user:d.object({username:d.string(),discriminator:d.string(),id:d.string(),avatar:d.union([d.string(),d.null()]).optional(),public_flags:d.number(),global_name:d.union([d.string(),d.null()]).optional()}),scopes:d.array(Dr(d.enum(["identify","identify.premium","email","connections","guilds","guilds.join","guilds.members.read","guilds.channels.read","gdm.join","bot","rpc","rpc.notifications.read","rpc.voice.read","rpc.voice.write","rpc.video.read","rpc.video.write","rpc.screenshare.read","rpc.screenshare.write","rpc.activities.write","webhook.incoming","messages.read","applications.builds.upload","applications.builds.read","applications.commands","applications.commands.permissions.update","applications.commands.update","applications.store.update","applications.entitlements","activities.read","activities.write","activities.invites.write","relationships.read","relationships.write","voice","dm_channels.read","role_connections.write","presences.read","presences.write","openid","dm_channels.messages.read","dm_channels.messages.write","gateway.connect","account.global_name.update","payment_sources.country_code","sdk.social_layer_presence","sdk.social_layer","lobbies.write","application_identities.write"]).or(d.literal(-1)).default(-1))),expires:d.string(),application:d.object({description:d.string(),icon:d.union([d.string(),d.null()]).optional(),id:d.string(),rpc_origins:d.array(d.string()).optional(),name:d.string()})}).describe('Response for "AUTHENTICATE" Command'),xi=d.object({participants:d.array(d.object({id:d.string(),username:d.string(),global_name:d.union([d.string(),d.null()]).optional(),discriminator:d.string(),avatar:d.union([d.string(),d.null()]).optional(),flags:d.number(),bot:d.boolean(),avatar_decoration_data:d.union([d.object({asset:d.union([d.string(),d.null()]).optional(),skuId:d.string().optional(),expiresAt:d.number().optional()}),d.null()]).optional(),premium_type:d.union([d.number(),d.null()]).optional(),nickname:d.string().optional()}))}).describe('Response for "GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS" Command'),Nu=d.object({command:d.string(),options:d.array(d.object({name:d.string(),value:d.string()})).optional(),content:d.string().max(2e3).optional(),require_launch_channel:d.boolean().optional(),preview_image:d.object({height:d.number(),url:d.string(),width:d.number()}).optional(),components:d.array(d.object({type:d.literal(1),components:d.array(d.object({type:d.literal(2),style:d.number().gte(1).lte(5),label:d.string().max(80).optional(),custom_id:d.string().max(100).describe("Developer-defined identifier for the button; max 100 characters").optional()})).max(5).optional()})).optional(),pid:d.number().optional()}).describe('Request for "SHARE_INTERACTION" Command'),wu=d.object({success:d.boolean()}).describe('Response for "SHARE_INTERACTION" Command'),Ru=d.object({custom_id:d.string().max(64).optional(),message:d.string().max(1e3),link_id:d.string().max(64).optional()}).describe('Request for "SHARE_LINK" Command'),Ou=d.object({success:d.boolean(),didCopyLink:d.boolean(),didSendMessage:d.boolean()}).describe('Response for "SHARE_LINK" Command'),Di=d.object({relationships:d.array(d.object({type:d.number(),user:d.object({id:d.string(),username:d.string(),global_name:d.union([d.string(),d.null()]).optional(),discriminator:d.string(),avatar:d.union([d.string(),d.null()]).optional(),flags:d.number(),bot:d.boolean(),avatar_decoration_data:d.union([d.object({asset:d.union([d.string(),d.null()]).optional(),skuId:d.string().optional(),expiresAt:d.number().optional()}),d.null()]).optional(),premium_type:d.union([d.number(),d.null()]).optional()}),presence:d.object({status:d.string(),activity:d.union([d.object({session_id:d.string().optional(),type:d.number().optional(),name:d.string(),url:d.union([d.string(),d.null()]).optional(),application_id:d.string().optional(),status_display_type:d.number().optional(),state:d.string().optional(),state_url:d.string().optional(),details:d.string().optional(),details_url:d.string().optional(),emoji:d.union([d.object({name:d.string(),id:d.union([d.string(),d.null()]).optional(),animated:d.union([d.boolean(),d.null()]).optional()}),d.null()]).optional(),assets:d.object({large_image:d.string().optional(),large_text:d.string().optional(),large_url:d.string().optional(),small_image:d.string().optional(),small_text:d.string().optional(),small_url:d.string().optional()}).optional(),timestamps:d.object({start:d.number().optional(),end:d.number().optional()}).optional(),party:d.object({id:d.string().optional(),size:d.array(d.number()).min(2).max(2).optional(),privacy:d.number().optional()}).optional(),secrets:d.object({match:d.string().optional(),join:d.string().optional()}).optional(),sync_id:d.string().optional(),created_at:d.number().optional(),instance:d.boolean().optional(),flags:d.number().optional(),metadata:d.object({}).optional(),platform:d.string().optional(),supported_platforms:d.array(d.string()).optional(),buttons:d.array(d.string()).optional(),hangStatus:d.string().optional()}),d.null()]).optional()}).optional()}))}).describe('Response for "GET_RELATIONSHIPS" Command'),xu=d.object({user_id:d.string(),content:d.string().min(0).max(1024).optional()}).describe('Request for "INVITE_USER_EMBEDDED" Command'),Du=d.object({id:d.string().max(64)}).describe('Request for "GET_USER" Command'),Lu=d.union([d.object({id:d.string(),username:d.string(),global_name:d.union([d.string(),d.null()]).optional(),discriminator:d.string(),avatar:d.union([d.string(),d.null()]).optional(),flags:d.number(),bot:d.boolean(),avatar_decoration_data:d.union([d.object({asset:d.union([d.string(),d.null()]).optional(),skuId:d.string().optional(),expiresAt:d.number().optional()}),d.null()]).optional(),premium_type:d.union([d.number(),d.null()]).optional()}),d.null()]),Uu=d.object({quest_id:d.string()}).describe('Request for "GET_QUEST_ENROLLMENT_STATUS" Command'),Pu=d.object({quest_id:d.string(),is_enrolled:d.boolean(),enrolled_at:d.union([d.string(),d.null()]).optional()}).describe('Response for "GET_QUEST_ENROLLMENT_STATUS" Command'),Mu=d.object({quest_id:d.string()}).describe('Request for "QUEST_START_TIMER" Command'),ku=d.object({success:d.boolean()}).describe('Response for "QUEST_START_TIMER" Command'),Gu=d.object({quest_id:d.string(),enrolled_at:d.union([d.string(),d.null()]).optional(),completed_at:d.union([d.string(),d.null()]).optional(),external_cta_url:d.string()}).describe('Response for "GET_QUEST" Command'),Bu=d.object({ticket:d.string()}).describe('Response for "REQUEST_PROXY_TICKET_REFRESH" Command'),Q;(function(e){e.INITIATE_IMAGE_UPLOAD="INITIATE_IMAGE_UPLOAD",e.OPEN_SHARE_MOMENT_DIALOG="OPEN_SHARE_MOMENT_DIALOG",e.AUTHENTICATE="AUTHENTICATE",e.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS="GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS",e.SHARE_INTERACTION="SHARE_INTERACTION",e.SHARE_LINK="SHARE_LINK",e.GET_RELATIONSHIPS="GET_RELATIONSHIPS",e.INVITE_USER_EMBEDDED="INVITE_USER_EMBEDDED",e.GET_USER="GET_USER",e.GET_QUEST_ENROLLMENT_STATUS="GET_QUEST_ENROLLMENT_STATUS",e.QUEST_START_TIMER="QUEST_START_TIMER",e.GET_QUEST="GET_QUEST",e.REQUEST_PROXY_TICKET_REFRESH="REQUEST_PROXY_TICKET_REFRESH"})(Q||(Q={}));var Oa=d.object({}).optional().nullable(),Fn=d.void(),Lr={[Q.INITIATE_IMAGE_UPLOAD]:{request:Fn,response:Oi},[Q.OPEN_SHARE_MOMENT_DIALOG]:{request:Au,response:Oa},[Q.AUTHENTICATE]:{request:Iu,response:qn},[Q.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS]:{request:Fn,response:xi},[Q.SHARE_INTERACTION]:{request:Nu,response:wu},[Q.SHARE_LINK]:{request:Ru,response:Ou},[Q.GET_RELATIONSHIPS]:{request:Fn,response:Di},[Q.INVITE_USER_EMBEDDED]:{request:xu,response:Oa},[Q.GET_USER]:{request:Du,response:Lu},[Q.GET_QUEST_ENROLLMENT_STATUS]:{request:Uu,response:Pu},[Q.QUEST_START_TIMER]:{request:Mu,response:ku},[Q.GET_QUEST]:{request:Fn,response:Gu},[Q.REQUEST_PROXY_TICKET_REFRESH]:{request:Fn,response:Bu}};var Li="DISPATCH",D;(function(e){e.AUTHORIZE="AUTHORIZE",e.GET_GUILDS="GET_GUILDS",e.GET_GUILD="GET_GUILD",e.GET_CHANNEL="GET_CHANNEL",e.GET_CHANNELS="GET_CHANNELS",e.SELECT_VOICE_CHANNEL="SELECT_VOICE_CHANNEL",e.SELECT_TEXT_CHANNEL="SELECT_TEXT_CHANNEL",e.SUBSCRIBE="SUBSCRIBE",e.UNSUBSCRIBE="UNSUBSCRIBE",e.CAPTURE_SHORTCUT="CAPTURE_SHORTCUT",e.SET_CERTIFIED_DEVICES="SET_CERTIFIED_DEVICES",e.SET_ACTIVITY="SET_ACTIVITY",e.GET_SKUS="GET_SKUS",e.GET_ENTITLEMENTS="GET_ENTITLEMENTS",e.GET_SKUS_EMBEDDED="GET_SKUS_EMBEDDED",e.GET_ENTITLEMENTS_EMBEDDED="GET_ENTITLEMENTS_EMBEDDED",e.START_PURCHASE="START_PURCHASE",e.SET_CONFIG="SET_CONFIG",e.SEND_ANALYTICS_EVENT="SEND_ANALYTICS_EVENT",e.USER_SETTINGS_GET_LOCALE="USER_SETTINGS_GET_LOCALE",e.OPEN_EXTERNAL_LINK="OPEN_EXTERNAL_LINK",e.ENCOURAGE_HW_ACCELERATION="ENCOURAGE_HW_ACCELERATION",e.CAPTURE_LOG="CAPTURE_LOG",e.SET_ORIENTATION_LOCK_STATE="SET_ORIENTATION_LOCK_STATE",e.OPEN_INVITE_DIALOG="OPEN_INVITE_DIALOG",e.GET_PLATFORM_BEHAVIORS="GET_PLATFORM_BEHAVIORS",e.GET_CHANNEL_PERMISSIONS="GET_CHANNEL_PERMISSIONS",e.AUTHENTICATE="AUTHENTICATE",e.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS="GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS",e.GET_QUEST="GET_QUEST",e.GET_QUEST_ENROLLMENT_STATUS="GET_QUEST_ENROLLMENT_STATUS",e.GET_RELATIONSHIPS="GET_RELATIONSHIPS",e.GET_USER="GET_USER",e.INITIATE_IMAGE_UPLOAD="INITIATE_IMAGE_UPLOAD",e.INVITE_USER_EMBEDDED="INVITE_USER_EMBEDDED",e.OPEN_SHARE_MOMENT_DIALOG="OPEN_SHARE_MOMENT_DIALOG",e.QUEST_START_TIMER="QUEST_START_TIMER",e.REQUEST_PROXY_TICKET_REFRESH="REQUEST_PROXY_TICKET_REFRESH",e.SHARE_INTERACTION="SHARE_INTERACTION",e.SHARE_LINK="SHARE_LINK"})(D||(D={}));var Je=O({cmd:v(),data:Jt(),evt:gn(),nonce:v()}).passthrough(),xa=Object.assign(Object.assign({},qn.shape.scopes.element.overlayType._def.innerType.options[0].Values),{UNHANDLED:-1}),Hu=ye(xa),Ui=Di.shape.relationships.element,nt=O({id:v(),username:v(),discriminator:v(),global_name:v().optional().nullable(),avatar:v().optional().nullable(),avatar_decoration_data:O({asset:v(),sku_id:v().optional()}).nullable(),bot:Z(),flags:G().optional().nullable(),premium_type:G().optional().nullable()}),Cn=O({user:nt,nick:v().optional().nullable(),roles:ne(v()),joined_at:v(),deaf:Z(),mute:Z()}),Pi=O({user_id:v(),nick:v().optional().nullable(),guild_id:v(),avatar:v().optional().nullable(),avatar_decoration_data:O({asset:v(),sku_id:v().optional().nullable()}).optional().nullable(),color_string:v().optional().nullable()}),Pr=O({id:v(),name:v().optional().nullable(),roles:ne(v()).optional().nullable(),user:nt.optional().nullable(),require_colons:Z().optional().nullable(),managed:Z().optional().nullable(),animated:Z().optional().nullable(),available:Z().optional().nullable()}),Mi=O({mute:Z(),deaf:Z(),self_mute:Z(),self_deaf:Z(),suppress:Z()}),Kn=O({mute:Z(),nick:v(),user:nt,voice_state:Mi,volume:G()}),Da={UNHANDLED:-1,IDLE:"idle",DND:"dnd",ONLINE:"online",OFFLINE:"offline"},Zn=ye(Da),Rt=O({name:v(),type:G(),url:v().optional().nullable(),created_at:G().optional().nullable(),timestamps:O({start:G(),end:G()}).partial().optional().nullable(),application_id:v().optional().nullable(),details:v().optional().nullable(),details_url:v().url().optional().nullable(),state:v().optional().nullable(),state_url:v().url().optional().nullable(),emoji:Pr.optional().nullable(),party:O({id:v().optional().nullable(),size:ne(G()).optional().nullable()}).optional().nullable(),assets:O({large_image:v().nullable(),large_text:v().nullable(),large_url:v().url().optional().nullable(),small_image:v().nullable(),small_text:v().nullable(),small_url:v().url().optional().nullable()}).partial().optional().nullable(),secrets:O({join:v(),match:v()}).partial().optional().nullable(),instance:Z().optional().nullable(),flags:G().optional().nullable()}),La={UNHANDLED:-1,ROLE:0,MEMBER:1},Ua=O({id:v(),type:ye(La),allow:v(),deny:v()}),vn={UNHANDLED:-1,DM:1,GROUP_DM:3,GUILD_TEXT:0,GUILD_VOICE:2,GUILD_CATEGORY:4,GUILD_ANNOUNCEMENT:5,GUILD_STORE:6,ANNOUNCEMENT_THREAD:10,PUBLIC_THREAD:11,PRIVATE_THREAD:12,GUILD_STAGE_VOICE:13,GUILD_DIRECTORY:14,GUILD_FORUM:15},Mr=O({id:v(),type:ye(vn),guild_id:v().optional().nullable(),position:G().optional().nullable(),permission_overwrites:ne(Ua).optional().nullable(),name:v().optional().nullable(),topic:v().optional().nullable(),nsfw:Z().optional().nullable(),last_message_id:v().optional().nullable(),bitrate:G().optional().nullable(),user_limit:G().optional().nullable(),rate_limit_per_user:G().optional().nullable(),recipients:ne(nt).optional().nullable(),icon:v().optional().nullable(),owner_id:v().optional().nullable(),application_id:v().optional().nullable(),parent_id:v().optional().nullable(),last_pin_timestamp:v().optional().nullable()}),Pa=O({user:nt,guild_id:v(),status:Zn,activities:ne(Rt),client_status:O({desktop:Zn,mobile:Zn,web:Zn}).partial()}),Ma=O({id:v(),name:v(),color:G(),hoist:Z(),position:G(),permissions:v(),managed:Z(),mentionable:Z()}),Vu=O({id:v(),name:v(),owner_id:v(),icon:v().nullable(),icon_hash:v().optional().nullable(),splash:v().nullable(),discovery_splash:v().nullable(),owner:Z().optional().nullable(),permissions:v().optional().nullable(),region:v(),afk_channel_id:v().nullable(),afk_timeout:G(),widget_enabled:Z().optional().nullable(),widget_channel_id:v().optional().nullable(),verification_level:G(),default_message_notifications:G(),explicit_content_filter:G(),roles:ne(Ma),emojis:ne(Pr),features:ne(v()),mfa_level:G(),application_id:v().nullable(),system_channel_id:v().nullable(),system_channel_flags:G(),rules_channel_id:v().nullable(),joined_at:v().optional().nullable(),large:Z().optional().nullable(),unavailable:Z().optional().nullable(),member_count:G().optional().nullable(),voice_states:ne(Mi).optional().nullable(),members:ne(Cn).optional().nullable(),channels:ne(Mr).optional().nullable(),presences:ne(Pa).optional().nullable(),max_presences:G().optional().nullable(),max_members:G().optional().nullable(),vanity_url_code:v().nullable(),description:v().nullable(),banner:v().nullable(),premium_tier:G(),premium_subscription_count:G().optional().nullable(),preferred_locale:v(),public_updates_channel_id:v().nullable(),max_video_channel_users:G().optional().nullable(),approximate_member_count:G().optional().nullable(),approximate_presence_count:G().optional().nullable()}),ka=O({id:v(),guild_id:v(),type:G(),name:v()}),Ga=O({id:v(),filename:v(),size:G(),url:v(),proxy_url:v(),height:G().optional().nullable(),width:G().optional().nullable()}),Ba=O({text:v(),icon_url:v().optional().nullable(),proxy_icon_url:v().optional().nullable()}),Ur=O({url:v().optional().nullable(),proxy_url:v().optional().nullable(),height:G().optional().nullable(),width:G().optional().nullable()}),Ha=Ur.omit({proxy_url:!0}),Va=O({name:v().optional().nullable(),url:v().optional().nullable()}),ja=O({name:v().optional().nullable(),url:v().optional().nullable(),icon_url:v().optional().nullable(),proxy_icon_url:v().optional().nullable()}),Fa=O({name:v(),value:v(),inline:Z()}),qa=O({title:v().optional().nullable(),type:v().optional().nullable(),description:v().optional().nullable(),url:v().optional().nullable(),timestamp:v().optional().nullable(),color:G().optional().nullable(),footer:Ba.optional().nullable(),image:Ur.optional().nullable(),thumbnail:Ur.optional().nullable(),video:Ha.optional().nullable(),provider:Va.optional().nullable(),author:ja.optional().nullable(),fields:ne(Fa).optional().nullable()}),Za=O({count:G(),me:Z(),emoji:Pr}),Ca=O({type:G(),party_id:v().optional().nullable()}),Ka=O({id:v(),cover_image:v().optional().nullable(),description:v(),icon:v().optional().nullable(),name:v()}),Ya=O({message_id:v().optional().nullable(),channel_id:v().optional().nullable(),guild_id:v().optional().nullable()}),ki=O({id:v(),channel_id:v(),guild_id:v().optional().nullable(),author:nt.optional().nullable(),member:Cn.optional().nullable(),content:v(),timestamp:v(),edited_timestamp:v().optional().nullable(),tts:Z(),mention_everyone:Z(),mentions:ne(nt),mention_roles:ne(v()),mention_channels:ne(ka),attachments:ne(Ga),embeds:ne(qa),reactions:ne(Za).optional().nullable(),nonce:Bn([v(),G()]).optional().nullable(),pinned:Z(),webhook_id:v().optional().nullable(),type:G(),activity:Ca.optional().nullable(),application:Ka.optional().nullable(),message_reference:Ya.optional().nullable(),flags:G().optional().nullable(),stickers:ne(Jt()).optional().nullable(),referenced_message:Jt().optional().nullable()}),$a=O({id:v(),name:v()}),Xa={UNHANDLED:-1,KEYBOARD_KEY:0,MOUSE_BUTTON:1,KEYBOARD_MODIFIER_KEY:2,GAMEPAD_BUTTON:3},kr=O({type:ye(Xa),code:G(),name:v()}),za={UNHANDLED:-1,PUSH_TO_TALK:"PUSH_TO_TALK",VOICE_ACTIVITY:"VOICE_ACTIVITY"},Gi=O({type:ye(za),auto_threshold:Z(),threshold:G(),shortcut:ne(kr),delay:G()}),Gr=O({device_id:v(),volume:G(),available_devices:ne($a)}),Wa={UNHANDLED:-1,AUDIO_INPUT:"AUDIO_INPUT",AUDIO_OUTPUT:"AUDIO_OUTPUT",VIDEO_INPUT:"VIDEO_INPUT"},ju=O({type:ye(Wa),id:v(),vendor:O({name:v(),url:v()}),model:O({name:v(),url:v()}),related:ne(v()),echo_cancellation:Z().optional().nullable(),noise_suppression:Z().optional().nullable(),automatic_gain_control:Z().optional().nullable(),hardware_mute:Z().optional().nullable()}),Qa={UNHANDLED:-1,APPLICATION:1,DLC:2,CONSUMABLE:3,BUNDLE:4,SUBSCRIPTION:5},Bi=O({id:v(),name:v(),type:ye(Qa),price:O({amount:G(),currency:v()}),application_id:v(),flags:G(),release_date:v().nullable()}),Ja={UNHANDLED:-1,PURCHASE:1,PREMIUM_SUBSCRIPTION:2,DEVELOPER_GIFT:3,TEST_MODE_PURCHASE:4,FREE_PURCHASE:5,USER_GIFT:6,PREMIUM_PURCHASE:7},En=O({id:v(),sku_id:v(),application_id:v(),user_id:v(),gift_code_flags:G(),type:ye(Ja),gifter_user_id:v().optional().nullable(),branches:ne(v()).optional().nullable(),starts_at:v().optional().nullable(),ends_at:v().optional().nullable(),parent_id:v().optional().nullable(),consumed:Z().optional().nullable(),deleted:Z().optional().nullable(),gift_code_batch_id:v().optional().nullable()}),es={UNHANDLED:-1,UNLOCKED:1,PORTRAIT:2,LANDSCAPE:3},Fu=ye(es),ts={UNHANDLED:-1,NOMINAL:0,FAIR:1,SERIOUS:2,CRITICAL:3},Hi=ye(ts),Br={UNHANDLED:-1,PORTRAIT:0,LANDSCAPE:1},qu=ye(Br),Hr={UNHANDLED:-1,FOCUSED:0,PIP:1,GRID:2},Zu=ye(Hr);var Yn="ERROR",J;(function(e){e.READY="READY",e.VOICE_STATE_UPDATE="VOICE_STATE_UPDATE",e.SPEAKING_START="SPEAKING_START",e.SPEAKING_STOP="SPEAKING_STOP",e.ACTIVITY_LAYOUT_MODE_UPDATE="ACTIVITY_LAYOUT_MODE_UPDATE",e.ORIENTATION_UPDATE="ORIENTATION_UPDATE",e.CURRENT_USER_UPDATE="CURRENT_USER_UPDATE",e.CURRENT_GUILD_MEMBER_UPDATE="CURRENT_GUILD_MEMBER_UPDATE",e.ENTITLEMENT_CREATE="ENTITLEMENT_CREATE",e.THERMAL_STATE_UPDATE="THERMAL_STATE_UPDATE",e.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE="ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE",e.RELATIONSHIP_UPDATE="RELATIONSHIP_UPDATE",e.ACTIVITY_JOIN="ACTIVITY_JOIN",e.QUEST_ENROLLMENT_STATUS_UPDATE="QUEST_ENROLLMENT_STATUS_UPDATE"})(J||(J={}));var Re=Je.extend({evt:gt(J),nonce:v().nullable(),cmd:pe(Li),data:O({}).passthrough()}),Vi=Je.extend({evt:pe(Yn),data:O({code:G(),message:v().optional()}).passthrough(),cmd:gt(D),nonce:v().nullable()}),Cu=Re.extend({evt:v()}),ns=Bn([Re,Cu,Vi]);function rs(e){let t=e.evt;if(!(t in J))throw new Error(`Unrecognized event type ${e.evt}`);return Ku[t].payload.parse(e)}var Ku={[J.READY]:{payload:Re.extend({evt:pe(J.READY),data:O({v:G(),config:O({cdn_host:v().optional(),api_endpoint:v(),environment:v()}),user:O({id:v(),username:v(),discriminator:v(),avatar:v().optional()}).optional()})})},[J.VOICE_STATE_UPDATE]:{payload:Re.extend({evt:pe(J.VOICE_STATE_UPDATE),data:Kn}),subscribeArgs:O({channel_id:v()})},[J.SPEAKING_START]:{payload:Re.extend({evt:pe(J.SPEAKING_START),data:O({lobby_id:v().optional(),channel_id:v().optional(),user_id:v()})}),subscribeArgs:O({lobby_id:v().nullable().optional(),channel_id:v().nullable().optional()})},[J.SPEAKING_STOP]:{payload:Re.extend({evt:pe(J.SPEAKING_STOP),data:O({lobby_id:v().optional(),channel_id:v().optional(),user_id:v()})}),subscribeArgs:O({lobby_id:v().nullable().optional(),channel_id:v().nullable().optional()})},[J.ACTIVITY_LAYOUT_MODE_UPDATE]:{payload:Re.extend({evt:pe(J.ACTIVITY_LAYOUT_MODE_UPDATE),data:O({layout_mode:ye(Hr)})})},[J.ORIENTATION_UPDATE]:{payload:Re.extend({evt:pe(J.ORIENTATION_UPDATE),data:O({screen_orientation:ye(Br),orientation:gt(jn)})})},[J.CURRENT_USER_UPDATE]:{payload:Re.extend({evt:pe(J.CURRENT_USER_UPDATE),data:nt})},[J.CURRENT_GUILD_MEMBER_UPDATE]:{payload:Re.extend({evt:pe(J.CURRENT_GUILD_MEMBER_UPDATE),data:Pi}),subscribeArgs:O({guild_id:v()})},[J.ENTITLEMENT_CREATE]:{payload:Re.extend({evt:pe(J.ENTITLEMENT_CREATE),data:O({entitlement:En})})},[J.THERMAL_STATE_UPDATE]:{payload:Re.extend({evt:pe(J.THERMAL_STATE_UPDATE),data:O({thermal_state:Hi})})},[J.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE]:{payload:Re.extend({evt:pe(J.ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE),data:O({participants:xi.shape.participants})})},[J.RELATIONSHIP_UPDATE]:{payload:Re.extend({evt:pe(J.RELATIONSHIP_UPDATE),data:Ui})},[J.ACTIVITY_JOIN]:{payload:Re.extend({evt:pe(J.ACTIVITY_JOIN),data:O({applicationId:v(),secret:v()})})},[J.QUEST_ENROLLMENT_STATUS_UPDATE]:{payload:Re.extend({evt:pe(J.QUEST_ENROLLMENT_STATUS_UPDATE),data:O({quest_id:v(),is_enrolled:Z(),enrolled_at:v().date()})})}};var qi={};pa(qi,{AuthenticateResponse:()=>qn,AuthorizeResponse:()=>jr,CaptureShortcutResponse:()=>ps,EmptyResponse:()=>xt,EncourageHardwareAccelerationResponse:()=>$r,GetChannelPermissionsResponse:()=>Xr,GetChannelResponse:()=>Ot,GetChannelsResponse:()=>os,GetEntitlementsResponse:()=>Zr,GetGuildResponse:()=>ss,GetGuildsResponse:()=>as,GetPlatformBehaviorsResponse:()=>Wr,GetSkusResponse:()=>qr,InitiateImageUploadResponse:()=>Oi,NullableChannelResponse:()=>Yu,OpenExternalLinkResponse:()=>zr,ResponseFrame:()=>ji,SelectTextChannelResponse:()=>us,SelectVoiceChannelResponse:()=>ls,SetActivityResponse:()=>Fr,SetConfigResponse:()=>Kr,StartPurchaseResponse:()=>Cr,SubscribeResponse:()=>cs,UserSettingsGetLocaleResponse:()=>Yr,VoiceSettingsResponse:()=>$u,parseResponsePayload:()=>Fi});function is(e,t){throw t}var xt=O({}).nullable(),jr=O({code:v()}),as=O({guilds:ne(O({id:v(),name:v()}))}),ss=O({id:v(),name:v(),icon_url:v().optional(),members:ne(Cn)}),Ot=O({id:v(),type:ye(vn),guild_id:v().optional().nullable(),name:v().optional().nullable(),topic:v().optional().nullable(),bitrate:G().optional().nullable(),user_limit:G().optional().nullable(),position:G().optional().nullable(),voice_states:ne(Kn),messages:ne(ki)}),os=O({channels:ne(Mr)}),Yu=Ot.nullable(),ls=Ot.nullable(),us=Ot.nullable(),$u=O({input:Gr,output:Gr,mode:Gi,automatic_gain_control:Z(),echo_cancellation:Z(),noise_suppression:Z(),qos:Z(),silence_warning:Z(),deaf:Z(),mute:Z()}),cs=O({evt:v()}),ps=O({shortcut:kr}),Fr=Rt,qr=O({skus:ne(Bi)}),Zr=O({entitlements:ne(En)}),Cr=ne(En).nullable(),Kr=O({use_interactive_pip:Z()}),Yr=O({locale:v()}),$r=O({enabled:Z()}),Xr=O({permissions:Si().or(v())}),zr=Dr(O({opened:Z().or(gn())}).default({opened:null})),Wr=O({iosKeyboardResizesView:bi(Z())}),ji=Je.extend({cmd:gt(D),evt:gn()});function Xu({cmd:e,data:t}){switch(e){case D.AUTHORIZE:return jr.parse(t);case D.CAPTURE_SHORTCUT:return ps.parse(t);case D.ENCOURAGE_HW_ACCELERATION:return $r.parse(t);case D.GET_CHANNEL:return Ot.parse(t);case D.GET_CHANNELS:return os.parse(t);case D.GET_CHANNEL_PERMISSIONS:return Xr.parse(t);case D.GET_GUILD:return ss.parse(t);case D.GET_GUILDS:return as.parse(t);case D.GET_PLATFORM_BEHAVIORS:return Wr.parse(t);case D.GET_CHANNEL:return Ot.parse(t);case D.SELECT_TEXT_CHANNEL:return us.parse(t);case D.SELECT_VOICE_CHANNEL:return ls.parse(t);case D.SET_ACTIVITY:return Fr.parse(t);case D.GET_SKUS_EMBEDDED:return qr.parse(t);case D.GET_ENTITLEMENTS_EMBEDDED:return Zr.parse(t);case D.SET_CONFIG:return Kr.parse(t);case D.START_PURCHASE:return Cr.parse(t);case D.SUBSCRIBE:case D.UNSUBSCRIBE:return cs.parse(t);case D.USER_SETTINGS_GET_LOCALE:return Yr.parse(t);case D.OPEN_EXTERNAL_LINK:return zr.parse(t);case D.SET_ORIENTATION_LOCK_STATE:case D.SET_CERTIFIED_DEVICES:case D.SEND_ANALYTICS_EVENT:case D.OPEN_INVITE_DIALOG:case D.CAPTURE_LOG:case D.GET_SKUS:case D.GET_ENTITLEMENTS:return xt.parse(t);case D.AUTHENTICATE:case D.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS:case D.GET_QUEST:case D.GET_QUEST_ENROLLMENT_STATUS:case D.GET_RELATIONSHIPS:case D.GET_USER:case D.INITIATE_IMAGE_UPLOAD:case D.INVITE_USER_EMBEDDED:case D.OPEN_SHARE_MOMENT_DIALOG:case D.QUEST_START_TIMER:case D.REQUEST_PROXY_TICKET_REFRESH:case D.SHARE_INTERACTION:case D.SHARE_LINK:let{response:n}=Lr[e];return n.parse(t);default:is(e,new Error(`Unrecognized command ${e}`))}}function Fi(e){return Object.assign(Object.assign({},e),{data:Xu(e)})}O({frame_id:v(),platform:gt(Ge).optional().nullable()});O({v:pe(1),encoding:pe("json").optional(),client_id:v(),frame_id:v()});var fs=O({code:G(),message:v().optional()}),zu=O({evt:v().nullable(),nonce:v().nullable(),data:Jt().nullable(),cmd:v()}).passthrough();function ds(e){let t=zu.parse(e);return t.evt!=null?t.evt===Yn?Vi.parse(t):rs(ns.parse(t)):Fi(ji.passthrough().parse(t))}function le(e,t,n,r=()=>{}){let i=Je.extend({cmd:pe(t),data:n});return async a=>{let c=await e({cmd:t,args:a,transfer:r(a)});return i.parse(c).data}}function fe(e,t=()=>{}){let n=Lr[e].response,r=Je.extend({cmd:pe(e),data:n});return i=>async a=>{let c=await i({cmd:e,args:a,transfer:t(a)});return r.parse(c).data}}var ms=e=>le(e,D.AUTHORIZE,jr);var hs=e=>le(e,D.CAPTURE_LOG,xt);var _s=e=>le(e,D.ENCOURAGE_HW_ACCELERATION,$r);var gs=e=>le(e,D.GET_CHANNEL,Ot);var vs=e=>le(e,D.GET_ENTITLEMENTS_EMBEDDED,Zr);var Es=e=>le(e,D.GET_SKUS_EMBEDDED,qr);var ys=e=>le(e,D.GET_CHANNEL_PERMISSIONS,Xr);var Ts=e=>le(e,D.GET_PLATFORM_BEHAVIORS,Wr);var Ss=e=>le(e,D.OPEN_EXTERNAL_LINK,zr);var bs=e=>le(e,D.OPEN_INVITE_DIALOG,xt);Rt.pick({state:!0,state_url:!0,details:!0,details_url:!0,timestamps:!0,assets:!0,party:!0,secrets:!0,instance:!0,type:!0}).extend({type:Rt.shape.type.optional(),instance:Rt.shape.instance.optional()}).nullable();var As=e=>le(e,D.SET_ACTIVITY,Fr);var Is=e=>le(e,D.SET_CONFIG,Kr);function Ns({sendCommand:e,cmd:t,response:n,fallbackTransform:r,transferTransform:i=()=>{}}){let a=Je.extend({cmd:pe(t),data:n});return async c=>{try{let u=await e({cmd:t,args:c,transfer:i(c)});return a.parse(u).data}catch(u){if(u.code===Vn.INVALID_PAYLOAD){let h=r(c),f=await e({cmd:t,args:h,transfer:i(h)});return a.parse(f).data}else throw u}}}var Wu=e=>({lock_state:e.lock_state,picture_in_picture_lock_state:e.picture_in_picture_lock_state}),ws=e=>Ns({sendCommand:e,cmd:D.SET_ORIENTATION_LOCK_STATE,response:xt,fallbackTransform:Wu});var Rs=e=>le(e,D.START_PURCHASE,Cr);var Os=e=>le(e,D.USER_SETTINGS_GET_LOCALE,Yr);var xs=fe(Q.AUTHENTICATE);var Zi=fe(Q.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS);var Ds=fe(Q.GET_QUEST);var Ls=fe(Q.GET_QUEST_ENROLLMENT_STATUS);var Us=fe(Q.GET_RELATIONSHIPS);var Ps=fe(Q.GET_USER);var Ms=fe(Q.INITIATE_IMAGE_UPLOAD);var ks=fe(Q.INVITE_USER_EMBEDDED);var Gs=fe(Q.OPEN_SHARE_MOMENT_DIALOG);var Bs=fe(Q.QUEST_START_TIMER);var Hs=fe(Q.REQUEST_PROXY_TICKET_REFRESH);var Vs=fe(Q.SHARE_INTERACTION);var js=fe(Q.SHARE_LINK);function Fs(e){return{authorize:ms(e),captureLog:hs(e),encourageHardwareAcceleration:_s(e),getChannel:gs(e),getChannelPermissions:ys(e),getEntitlements:vs(e),getPlatformBehaviors:Ts(e),getSkus:Es(e),openExternalLink:Ss(e),openInviteDialog:bs(e),setActivity:As(e),setConfig:Is(e),setOrientationLockState:ws(e),startPurchase:Rs(e),userSettingsGetLocale:Os(e),getInstanceConnectedParticipants:Zi(e),authenticate:xs(e),getActivityInstanceConnectedParticipants:Zi(e),getQuest:Ds(e),getQuestEnrollmentStatus:Ls(e),getRelationships:Us(e),getUser:Ps(e),initiateImageUpload:Ms(e),inviteUserEmbedded:ks(e),openShareMomentDialog:Gs(e),questStartTimer:Bs(e),requestProxyTicketRefresh:Hs(e),shareInteraction:Vs(e),shareLink:js(e)}}var Qr=class extends Error{constructor(t,n=""){super(n),this.code=t,this.message=n,this.name="Discord SDK Error"}};function Jr(){return{disableConsoleLogOverride:!1}}var qs=["log","warn","debug","info","error"];function Zs(e,t,n){let r=e[t],i=e;r&&(e[t]=function(){let a=[].slice.call(arguments),c=""+a.join(" ");n(t,c),r.apply(i,a)})}var Cs="2.5.0";var Qu=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ci={randomUUID:Qu};var Ki,Ju=new Uint8Array(16);function Ks(){if(!Ki){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ki=crypto.getRandomValues.bind(crypto)}return Ki(Ju)}var be=[];for(let e=0;e<256;++e)be.push((e+256).toString(16).slice(1));function Ys(e,t=0){return(be[e[t+0]]+be[e[t+1]]+be[e[t+2]]+be[e[t+3]]+"-"+be[e[t+4]]+be[e[t+5]]+"-"+be[e[t+6]]+be[e[t+7]]+"-"+be[e[t+8]]+be[e[t+9]]+"-"+be[e[t+10]]+be[e[t+11]]+be[e[t+12]]+be[e[t+13]]+be[e[t+14]]+be[e[t+15]]).toLowerCase()}function Yi(e,t,n){if(Ci.randomUUID&&!t&&!e)return Ci.randomUUID();e=e||{};let r=e.random??e.rng?.()??Ks();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ys(r)}var vt;(function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.FRAME=1]="FRAME",e[e.CLOSE=2]="CLOSE",e[e.HELLO=3]="HELLO"})(vt||(vt={}));var ec=new Set(tc());function tc(){return typeof window>"u"?[]:[window.location.origin,"https://discord.com","https://discordapp.com","https://ptb.discord.com","https://ptb.discordapp.com","https://canary.discord.com","https://canary.discordapp.com","https://staging.discord.co","http://localhost:3333","https://pax.discord.com","null"]}function nc(){var e;return[(e=window.parent.opener)!==null&&e!==void 0?e:window.parent,document.referrer?document.referrer:"*"]}var $i=class{getTransfer(t){var n;switch(t.cmd){case D.SUBSCRIBE:case D.UNSUBSCRIBE:return;default:return(n=t.transfer)!==null&&n!==void 0?n:void 0}}constructor(t,n){if(this.sdkVersion=Cs,this.mobileAppVersion=null,this.source=null,this.sourceOrigin="",this.eventBus=new Er,this.pendingCommands=new Map,this.sendCommand=u=>{var h;if(this.source==null)throw new Error("Attempting to send message before initialization");let f=Yi();return(h=this.source)===null||h===void 0||h.postMessage([vt.FRAME,Object.assign(Object.assign({},u),{nonce:f})],this.sourceOrigin,this.getTransfer(u)),new Promise((g,A)=>{this.pendingCommands.set(f,{resolve:g,reject:A})})},this.commands=Fs(this.sendCommand),this.handleMessage=u=>{if(!ec.has(u.origin))return;let h=u.data;if(!Array.isArray(h))return;let[f,p]=h;switch(f){case vt.HELLO:return;case vt.CLOSE:return this.handleClose(p);case vt.HANDSHAKE:return this.handleHandshake();case vt.FRAME:return this.handleFrame(p);default:throw new Error("Invalid message format")}},this.isReady=!1,this.clientId=t,this.configuration=n??Jr(),typeof window<"u"&&window.addEventListener("message",this.handleMessage),typeof window>"u"){this.frameId="",this.instanceId="",this.customId=null,this.referrerId=null,this.platform=Ge.DESKTOP,this.guildId=null,this.channelId=null,this.locationId=null;return}let r=new URLSearchParams(this._getSearch()),i=r.get("frame_id");if(!i)throw new Error("frame_id query param is not defined");this.frameId=i;let a=r.get("instance_id");if(!a)throw new Error("instance_id query param is not defined");this.instanceId=a;let c=r.get("platform");if(c){if(c!==Ge.DESKTOP&&c!==Ge.MOBILE)throw new Error(`Invalid query param "platform" of "${c}". Valid values are "${Ge.DESKTOP}" or "${Ge.MOBILE}"`)}else throw new Error("platform query param is not defined");this.platform=c,this.customId=r.get("custom_id"),this.referrerId=r.get("referrer_id"),this.guildId=r.get("guild_id"),this.channelId=r.get("channel_id"),this.locationId=r.get("location_id"),this.mobileAppVersion=r.get("mobile_app_version"),[this.source,this.sourceOrigin]=nc(),this.addOnReadyListener(),this.handshake()}close(t,n){var r;window.removeEventListener("message",this.handleMessage);let i=Yi();(r=this.source)===null||r===void 0||r.postMessage([vt.CLOSE,{code:t,message:n,nonce:i}],this.sourceOrigin)}async subscribe(t,n,...r){let[i]=r,a=this.eventBus.listenerCount(t),c=this.eventBus.on(t,n);return Object.values(J).includes(t)&&t!==J.READY&&a===0&&await this.sendCommand({cmd:D.SUBSCRIBE,args:i,evt:t}),c}async unsubscribe(t,n,...r){let[i]=r;return t!==J.READY&&this.eventBus.listenerCount(t)===1&&await this.sendCommand({cmd:D.UNSUBSCRIBE,evt:t,args:i}),this.eventBus.off(t,n)}async ready(){this.isReady||await new Promise(t=>{this.eventBus.once(J.READY,t)})}parseMajorMobileVersion(){if(this.mobileAppVersion&&this.mobileAppVersion.includes("."))try{return parseInt(this.mobileAppVersion.split(".")[0])}catch{return Ri}return Ri}handshake(){var t;let n={v:1,encoding:"json",client_id:this.clientId,frame_id:this.frameId},r=this.parseMajorMobileVersion();(this.platform===Ge.DESKTOP||r>=Ra)&&(n.sdk_version=this.sdkVersion),(t=this.source)===null||t===void 0||t.postMessage([vt.HANDSHAKE,n],this.sourceOrigin)}addOnReadyListener(){this.eventBus.once(J.READY,()=>{this.overrideConsoleLogging(),this.isReady=!0})}overrideConsoleLogging(){if(this.configuration.disableConsoleLogOverride)return;let t=(n,r)=>{this.commands.captureLog({level:n,message:r})};qs.forEach(n=>{Zs(console,n,t)})}handleClose(t){fs.parse(t)}handleHandshake(){}handleFrame(t){var n,r;let i;try{i=ds(t)}catch(a){console.error("Failed to parse",t),console.error(a);return}if(i.cmd==="DISPATCH")this.eventBus.emit(i.evt,i.data);else{if(i.evt===Yn){if(i.nonce!=null){(n=this.pendingCommands.get(i.nonce))===null||n===void 0||n.reject(i.data),this.pendingCommands.delete(i.nonce);return}this.eventBus.emit("error",new Qr(i.data.code,i.data.message))}if(i.nonce==null){console.error("Missing nonce",t);return}(r=this.pendingCommands.get(i.nonce))===null||r===void 0||r.resolve(i),this.pendingCommands.delete(i.nonce)}}_getSearch(){return typeof window>"u"?"":window.location.search}};function rc(e,t){return V.has(V.deserialize(t),e)}var ic={can:rc};var yn=1e9,ac={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Wi,me=!0,$e="[DecimalError] ",tn=$e+"Invalid argument: ",zi=$e+"Exponent out of range: ",Tn=Math.floor,en=Math.pow,sc=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,je,Te=1e7,de=7,zs=9007199254740991,ei=Tn(zs/de),k={};k.absoluteValue=k.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};k.comparedTo=k.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};k.decimalPlaces=k.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*de;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};k.dividedBy=k.div=function(e){return Et(this,new this.constructor(e))};k.dividedToIntegerBy=k.idiv=function(e){var t=this,n=t.constructor;return ce(Et(t,new n(e),0,1),n.precision)};k.equals=k.eq=function(e){return!this.cmp(e)};k.exponent=function(){return Ee(this)};k.greaterThan=k.gt=function(e){return this.cmp(e)>0};k.greaterThanOrEqualTo=k.gte=function(e){return this.cmp(e)>=0};k.isInteger=k.isint=function(){return this.e>this.d.length-2};k.isNegative=k.isneg=function(){return this.s<0};k.isPositive=k.ispos=function(){return this.s>0};k.isZero=function(){return this.s===0};k.lessThan=k.lt=function(e){return this.cmp(e)<0};k.lessThanOrEqualTo=k.lte=function(e){return this.cmp(e)<1};k.logarithm=k.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(je))throw Error($e+"NaN");if(n.s<1)throw Error($e+(n.s?"NaN":"-Infinity"));return n.eq(je)?new r(0):(me=!1,t=Et($n(n,a),$n(e,a),a),me=!0,ce(t,i))};k.minus=k.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Js(t,e):Ws(t,(e.s=-e.s,e))};k.modulo=k.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error($e+"NaN");return n.s?(me=!1,t=Et(n,e,0,1).times(e),me=!0,n.minus(t)):ce(new r(n),i)};k.naturalExponential=k.exp=function(){return Qs(this)};k.naturalLogarithm=k.ln=function(){return $n(this)};k.negated=k.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};k.plus=k.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ws(t,e):Js(t,(e.s=-e.s,e))};k.precision=k.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(tn+e);if(t=Ee(i)+1,r=i.d.length-1,n=r*de+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};k.squareRoot=k.sqrt=function(){var e,t,n,r,i,a,c,u=this,h=u.constructor;if(u.s<1){if(!u.s)return new h(0);throw Error($e+"NaN")}for(e=Ee(u),me=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=rt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Tn((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new h(t)):r=new h(i.toString()),n=h.precision,i=c=n+3;;)if(a=r,r=a.plus(Et(u,a,c+2)).times(.5),rt(a.d).slice(0,c)===(t=rt(r.d)).slice(0,c)){if(t=t.slice(c-3,c+1),i==c&&t=="4999"){if(ce(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;c+=4}return me=!0,ce(r,n)};k.times=k.mul=function(e){var t,n,r,i,a,c,u,h,f,p=this,g=p.constructor,A=p.d,U=(e=new g(e)).d;if(!p.s||!e.s)return new g(0);for(e.s*=p.s,n=p.e+e.e,h=A.length,f=U.length,h<f&&(a=A,A=U,U=a,c=h,h=f,f=c),a=[],c=h+f,r=c;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=h+r;i>r;)u=a[i]+U[r]*A[i-r-1]+t,a[i--]=u%Te|0,t=u/Te|0;a[i]=(a[i]+t)%Te|0}for(;!a[--c];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,me?ce(e,g.precision):e};k.toDecimalPlaces=k.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(it(e,0,yn),t===void 0?t=r.rounding:it(t,0,8),ce(n,e+Ee(n)+1,t))};k.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=nn(r,!0):(it(e,0,yn),t===void 0?t=i.rounding:it(t,0,8),r=ce(new i(r),e+1,t),n=nn(r,!0,e+1)),n};k.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?nn(i):(it(e,0,yn),t===void 0?t=a.rounding:it(t,0,8),r=ce(new a(i),e+Ee(i)+1,t),n=nn(r.abs(),!1,e+Ee(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};k.toInteger=k.toint=function(){var e=this,t=e.constructor;return ce(new t(e),Ee(e)+1,t.rounding)};k.toNumber=function(){return+this};k.toPower=k.pow=function(e){var t,n,r,i,a,c,u=this,h=u.constructor,f=12,p=+(e=new h(e));if(!e.s)return new h(je);if(u=new h(u),!u.s){if(e.s<1)throw Error($e+"Infinity");return u}if(u.eq(je))return u;if(r=h.precision,e.eq(je))return ce(u,r);if(t=e.e,n=e.d.length-1,c=t>=n,a=u.s,c){if((n=p<0?-p:p)<=zs){for(i=new h(je),t=Math.ceil(r/de+4),me=!1;n%2&&(i=i.times(u),Xs(i.d,t)),n=Tn(n/2),n!==0;)u=u.times(u),Xs(u.d,t);return me=!0,e.s<0?new h(je).div(i):ce(i,r)}}else if(a<0)throw Error($e+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,me=!1,i=e.times($n(u,r+f)),me=!0,i=Qs(i),i.s=a,i};k.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Ee(i),r=nn(i,n<=a.toExpNeg||n>=a.toExpPos)):(it(e,1,yn),t===void 0?t=a.rounding:it(t,0,8),i=ce(new a(i),e,t),n=Ee(i),r=nn(i,e<=n||n<=a.toExpNeg,e)),r};k.toSignificantDigits=k.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(it(e,1,yn),t===void 0?t=r.rounding:it(t,0,8)),ce(new r(n),e,t)};k.toString=k.valueOf=k.val=k.toJSON=k[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ee(e),n=e.constructor;return nn(e,t<=n.toExpNeg||t>=n.toExpPos)};function Ws(e,t){var n,r,i,a,c,u,h,f,p=e.constructor,g=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),me?ce(t,g):t;if(h=e.d,f=t.d,c=e.e,i=t.e,h=h.slice(),a=c-i,a){for(a<0?(r=h,a=-a,u=f.length):(r=f,i=c,u=h.length),c=Math.ceil(g/de),u=c>u?c+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=h.length,a=f.length,u-a<0&&(a=u,r=f,f=h,h=r),n=0;a;)n=(h[--a]=h[a]+f[a]+n)/Te|0,h[a]%=Te;for(n&&(h.unshift(n),++i),u=h.length;h[--u]==0;)h.pop();return t.d=h,t.e=i,me?ce(t,g):t}function it(e,t,n){if(e!==~~e||e<t||e>n)throw Error(tn+e)}function rt(e){var t,n,r,i=e.length-1,a="",c=e[0];if(i>0){for(a+=c,t=1;t<i;t++)r=e[t]+"",n=de-r.length,n&&(a+=Dt(n)),a+=r;c=e[t],r=c+"",n=de-r.length,n&&(a+=Dt(n))}else if(c===0)return"0";for(;c%10===0;)c/=10;return a+c}var Et=(function(){function e(r,i){var a,c=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+c,r[u]=a%Te|0,c=a/Te|0;return c&&r.unshift(c),r}function t(r,i,a,c){var u,h;if(a!=c)h=a>c?1:-1;else for(u=h=0;u<a;u++)if(r[u]!=i[u]){h=r[u]>i[u]?1:-1;break}return h}function n(r,i,a){for(var c=0;a--;)r[a]-=c,c=r[a]<i[a]?1:0,r[a]=c*Te+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,c){var u,h,f,p,g,A,U,Y,j,L,_e,ae,se,Oe,ve,Fe,Ae,Be,Xe=r.constructor,qe=r.s==i.s?1:-1,xe=r.d,ue=i.d;if(!r.s)return new Xe(r);if(!i.s)throw Error($e+"Division by zero");for(h=r.e-i.e,Ae=ue.length,ve=xe.length,U=new Xe(qe),Y=U.d=[],f=0;ue[f]==(xe[f]||0);)++f;if(ue[f]>(xe[f]||0)&&--h,a==null?ae=a=Xe.precision:c?ae=a+(Ee(r)-Ee(i))+1:ae=a,ae<0)return new Xe(0);if(ae=ae/de+2|0,f=0,Ae==1)for(p=0,ue=ue[0],ae++;(f<ve||p)&&ae--;f++)se=p*Te+(xe[f]||0),Y[f]=se/ue|0,p=se%ue|0;else{for(p=Te/(ue[0]+1)|0,p>1&&(ue=e(ue,p),xe=e(xe,p),Ae=ue.length,ve=xe.length),Oe=Ae,j=xe.slice(0,Ae),L=j.length;L<Ae;)j[L++]=0;Be=ue.slice(),Be.unshift(0),Fe=ue[0],ue[1]>=Te/2&&++Fe;do p=0,u=t(ue,j,Ae,L),u<0?(_e=j[0],Ae!=L&&(_e=_e*Te+(j[1]||0)),p=_e/Fe|0,p>1?(p>=Te&&(p=Te-1),g=e(ue,p),A=g.length,L=j.length,u=t(g,j,A,L),u==1&&(p--,n(g,Ae<A?Be:ue,A))):(p==0&&(u=p=1),g=ue.slice()),A=g.length,A<L&&g.unshift(0),n(j,g,L),u==-1&&(L=j.length,u=t(ue,j,Ae,L),u<1&&(p++,n(j,Ae<L?Be:ue,L))),L=j.length):u===0&&(p++,j=[0]),Y[f++]=p,u&&j[0]?j[L++]=xe[Oe]||0:(j=[xe[Oe]],L=1);while((Oe++<ve||j[0]!==void 0)&&ae--)}return Y[0]||Y.shift(),U.e=h,ce(U,c?a+Ee(U)+1:a)}})();function Qs(e,t){var n,r,i,a,c,u,h=0,f=0,p=e.constructor,g=p.precision;if(Ee(e)>16)throw Error(zi+Ee(e));if(!e.s)return new p(je);for(t==null?(me=!1,u=g):u=t,c=new p(.03125);e.abs().gte(.1);)e=e.times(c),f+=5;for(r=Math.log(en(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(je),p.precision=u;;){if(i=ce(i.times(e),u),n=n.times(++h),c=a.plus(Et(i,n,u)),rt(c.d).slice(0,u)===rt(a.d).slice(0,u)){for(;f--;)a=ce(a.times(a),u);return p.precision=g,t==null?(me=!0,ce(a,g)):a}a=c}}function Ee(e){for(var t=e.e*de,n=e.d[0];n>=10;n/=10)t++;return t}function Xi(e,t,n){if(t>e.LN10.sd())throw me=!0,n&&(e.precision=n),Error($e+"LN10 precision limit exceeded");return ce(new e(e.LN10),t)}function Dt(e){for(var t="";e--;)t+="0";return t}function $n(e,t){var n,r,i,a,c,u,h,f,p,g=1,A=10,U=e,Y=U.d,j=U.constructor,L=j.precision;if(U.s<1)throw Error($e+(U.s?"NaN":"-Infinity"));if(U.eq(je))return new j(0);if(t==null?(me=!1,f=L):f=t,U.eq(10))return t==null&&(me=!0),Xi(j,f);if(f+=A,j.precision=f,n=rt(Y),r=n.charAt(0),a=Ee(U),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)U=U.times(e),n=rt(U.d),r=n.charAt(0),g++;a=Ee(U),r>1?(U=new j("0."+n),a++):U=new j(r+"."+n.slice(1))}else return h=Xi(j,f+2,L).times(a+""),U=$n(new j(r+"."+n.slice(1)),f-A).plus(h),j.precision=L,t==null?(me=!0,ce(U,L)):U;for(u=c=U=Et(U.minus(je),U.plus(je),f),p=ce(U.times(U),f),i=3;;){if(c=ce(c.times(p),f),h=u.plus(Et(c,new j(i),f)),rt(h.d).slice(0,f)===rt(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(Xi(j,f+2,L).times(a+""))),u=Et(u,new j(g),f),j.precision=L,t==null?(me=!0,ce(u,L)):u;u=h,i+=2}}function $s(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Tn(n/de),e.d=[],r=(n+1)%de,n<0&&(r+=de),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=de;r<i;)e.d.push(+t.slice(r,r+=de));t=t.slice(r),r=de-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),me&&(e.e>ei||e.e<-ei))throw Error(zi+n)}else e.s=0,e.e=0,e.d=[0];return e}function ce(e,t,n){var r,i,a,c,u,h,f,p,g=e.d;for(c=1,a=g[0];a>=10;a/=10)c++;if(r=t-c,r<0)r+=de,i=t,f=g[p=0];else{if(p=Math.ceil((r+1)/de),a=g.length,p>=a)return e;for(f=a=g[p],c=1;a>=10;a/=10)c++;r%=de,i=r-de+c}if(n!==void 0&&(a=en(10,c-i-1),u=f/a%10|0,h=t<0||g[p+1]!==void 0||f%a,h=n<4?(u||h)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||h||n==6&&(r>0?i>0?f/en(10,c-i):0:g[p-1])%10&1||n==(e.s<0?8:7))),t<1||!g[0])return h?(a=Ee(e),g.length=1,t=t-a-1,g[0]=en(10,(de-t%de)%de),e.e=Tn(-t/de)||0):(g.length=1,g[0]=e.e=e.s=0),e;if(r==0?(g.length=p,a=1,p--):(g.length=p+1,a=en(10,de-r),g[p]=i>0?(f/en(10,c-i)%en(10,i)|0)*a:0),h)for(;;)if(p==0){(g[0]+=a)==Te&&(g[0]=1,++e.e);break}else{if(g[p]+=a,g[p]!=Te)break;g[p--]=0,a=1}for(r=g.length;g[--r]===0;)g.pop();if(me&&(e.e>ei||e.e<-ei))throw Error(zi+Ee(e));return e}function Js(e,t){var n,r,i,a,c,u,h,f,p,g,A=e.constructor,U=A.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new A(e),me?ce(t,U):t;if(h=e.d,g=t.d,r=t.e,f=e.e,h=h.slice(),c=f-r,c){for(p=c<0,p?(n=h,c=-c,u=g.length):(n=g,r=f,u=h.length),i=Math.max(Math.ceil(U/de),u)+2,c>i&&(c=i,n.length=1),n.reverse(),i=c;i--;)n.push(0);n.reverse()}else{for(i=h.length,u=g.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(h[i]!=g[i]){p=h[i]<g[i];break}c=0}for(p&&(n=h,h=g,g=n,t.s=-t.s),u=h.length,i=g.length-u;i>0;--i)h[u++]=0;for(i=g.length;i>c;){if(h[--i]<g[i]){for(a=i;a&&h[--a]===0;)h[a]=Te-1;--h[a],h[i]+=Te}h[i]-=g[i]}for(;h[--u]===0;)h.pop();for(;h[0]===0;h.shift())--r;return h[0]?(t.d=h,t.e=r,me?ce(t,U):t):new A(0)}function nn(e,t,n){var r,i=Ee(e),a=rt(e.d),c=a.length;return t?(n&&(r=n-c)>0?a=a.charAt(0)+"."+a.slice(1)+Dt(r):c>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Dt(-i-1)+a,n&&(r=n-c)>0&&(a+=Dt(r))):i>=c?(a+=Dt(i+1-c),n&&(r=n-i-1)>0&&(a=a+"."+Dt(r))):((r=i+1)<c&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-c)>0&&(i+1===c&&(a+="."),a+=Dt(r))),e.s<0?"-"+a:a}function Xs(e,t){if(e.length>t)return e.length=t,!0}function eo(e){var t,n,r;function i(a){var c=this;if(!(c instanceof i))return new i(a);if(c.constructor=i,a instanceof i){c.s=a.s,c.e=a.e,c.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(tn+a);if(a>0)c.s=1;else if(a<0)a=-a,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(a===~~a&&a<1e7){c.e=0,c.d=[a];return}return $s(c,a.toString())}else if(typeof a!="string")throw Error(tn+a);if(a.charCodeAt(0)===45?(a=a.slice(1),c.s=-1):c.s=1,sc.test(a))$s(c,a);else throw Error(tn+a)}if(i.prototype=k,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=eo,i.config=i.set=oc,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function oc(e){if(!e||typeof e!="object")throw Error($e+"Object expected");var t,n,r,i=["precision",1,yn,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Tn(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(tn+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(tn+n+": "+r);return this}var Wi=eo(ac);je=new Wi(1);var to=Wi;var E;(function(e){e.AED="aed",e.AFN="afn",e.ALL="all",e.AMD="amd",e.ANG="ang",e.AOA="aoa",e.ARS="ars",e.AUD="aud",e.AWG="awg",e.AZN="azn",e.BAM="bam",e.BBD="bbd",e.BDT="bdt",e.BGN="bgn",e.BHD="bhd",e.BIF="bif",e.BMD="bmd",e.BND="bnd",e.BOB="bob",e.BOV="bov",e.BRL="brl",e.BSD="bsd",e.BTN="btn",e.BWP="bwp",e.BYN="byn",e.BYR="byr",e.BZD="bzd",e.CAD="cad",e.CDF="cdf",e.CHE="che",e.CHF="chf",e.CHW="chw",e.CLF="clf",e.CLP="clp",e.CNY="cny",e.COP="cop",e.COU="cou",e.CRC="crc",e.CUC="cuc",e.CUP="cup",e.CVE="cve",e.CZK="czk",e.DJF="djf",e.DKK="dkk",e.DOP="dop",e.DZD="dzd",e.EGP="egp",e.ERN="ern",e.ETB="etb",e.EUR="eur",e.FJD="fjd",e.FKP="fkp",e.GBP="gbp",e.GEL="gel",e.GHS="ghs",e.GIP="gip",e.GMD="gmd",e.GNF="gnf",e.GTQ="gtq",e.GYD="gyd",e.HKD="hkd",e.HNL="hnl",e.HRK="hrk",e.HTG="htg",e.HUF="huf",e.IDR="idr",e.ILS="ils",e.INR="inr",e.IQD="iqd",e.IRR="irr",e.ISK="isk",e.JMD="jmd",e.JOD="jod",e.JPY="jpy",e.KES="kes",e.KGS="kgs",e.KHR="khr",e.KMF="kmf",e.KPW="kpw",e.KRW="krw",e.KWD="kwd",e.KYD="kyd",e.KZT="kzt",e.LAK="lak",e.LBP="lbp",e.LKR="lkr",e.LRD="lrd",e.LSL="lsl",e.LTL="ltl",e.LVL="lvl",e.LYD="lyd",e.MAD="mad",e.MDL="mdl",e.MGA="mga",e.MKD="mkd",e.MMK="mmk",e.MNT="mnt",e.MOP="mop",e.MRO="mro",e.MUR="mur",e.MVR="mvr",e.MWK="mwk",e.MXN="mxn",e.MXV="mxv",e.MYR="myr",e.MZN="mzn",e.NAD="nad",e.NGN="ngn",e.NIO="nio",e.NOK="nok",e.NPR="npr",e.NZD="nzd",e.OMR="omr",e.PAB="pab",e.PEN="pen",e.PGK="pgk",e.PHP="php",e.PKR="pkr",e.PLN="pln",e.PYG="pyg",e.QAR="qar",e.RON="ron",e.RSD="rsd",e.RUB="rub",e.RWF="rwf",e.SAR="sar",e.SBD="sbd",e.SCR="scr",e.SDG="sdg",e.SEK="sek",e.SGD="sgd",e.SHP="shp",e.SLL="sll",e.SOS="sos",e.SRD="srd",e.SSP="ssp",e.STD="std",e.SVC="svc",e.SYP="syp",e.SZL="szl",e.THB="thb",e.TJS="tjs",e.TMT="tmt",e.TND="tnd",e.TOP="top",e.TRY="try",e.TTD="ttd",e.TWD="twd",e.TZS="tzs",e.UAH="uah",e.UGX="ugx",e.USD="usd",e.USN="usn",e.USS="uss",e.UYI="uyi",e.UYU="uyu",e.UZS="uzs",e.VEF="vef",e.VND="vnd",e.VUV="vuv",e.WST="wst",e.XAF="xaf",e.XAG="xag",e.XAU="xau",e.XBA="xba",e.XBB="xbb",e.XBC="xbc",e.XBD="xbd",e.XCD="xcd",e.XDR="xdr",e.XFU="xfu",e.XOF="xof",e.XPD="xpd",e.XPF="xpf",e.XPT="xpt",e.XSU="xsu",e.XTS="xts",e.XUA="xua",e.YER="yer",e.ZAR="zar",e.ZMW="zmw",e.ZWL="zwl"})(E||(E={}));var no={[E.AED]:2,[E.AFN]:2,[E.ALL]:2,[E.AMD]:2,[E.ANG]:2,[E.AOA]:2,[E.ARS]:2,[E.AUD]:2,[E.AWG]:2,[E.AZN]:2,[E.BAM]:2,[E.BBD]:2,[E.BDT]:2,[E.BGN]:2,[E.BHD]:3,[E.BIF]:0,[E.BMD]:2,[E.BND]:2,[E.BOB]:2,[E.BOV]:2,[E.BRL]:2,[E.BSD]:2,[E.BTN]:2,[E.BWP]:2,[E.BYR]:0,[E.BYN]:2,[E.BZD]:2,[E.CAD]:2,[E.CDF]:2,[E.CHE]:2,[E.CHF]:2,[E.CHW]:2,[E.CLF]:0,[E.CLP]:0,[E.CNY]:2,[E.COP]:2,[E.COU]:2,[E.CRC]:2,[E.CUC]:2,[E.CUP]:2,[E.CVE]:2,[E.CZK]:2,[E.DJF]:0,[E.DKK]:2,[E.DOP]:2,[E.DZD]:2,[E.EGP]:2,[E.ERN]:2,[E.ETB]:2,[E.EUR]:2,[E.FJD]:2,[E.FKP]:2,[E.GBP]:2,[E.GEL]:2,[E.GHS]:2,[E.GIP]:2,[E.GMD]:2,[E.GNF]:0,[E.GTQ]:2,[E.GYD]:2,[E.HKD]:2,[E.HNL]:2,[E.HRK]:2,[E.HTG]:2,[E.HUF]:2,[E.IDR]:2,[E.ILS]:2,[E.INR]:2,[E.IQD]:3,[E.IRR]:2,[E.ISK]:0,[E.JMD]:2,[E.JOD]:3,[E.JPY]:0,[E.KES]:2,[E.KGS]:2,[E.KHR]:2,[E.KMF]:0,[E.KPW]:2,[E.KRW]:0,[E.KWD]:3,[E.KYD]:2,[E.KZT]:2,[E.LAK]:2,[E.LBP]:2,[E.LKR]:2,[E.LRD]:2,[E.LSL]:2,[E.LTL]:2,[E.LVL]:2,[E.LYD]:3,[E.MAD]:2,[E.MDL]:2,[E.MGA]:2,[E.MKD]:2,[E.MMK]:2,[E.MNT]:2,[E.MOP]:2,[E.MRO]:2,[E.MUR]:2,[E.MVR]:2,[E.MWK]:2,[E.MXN]:2,[E.MXV]:2,[E.MYR]:2,[E.MZN]:2,[E.NAD]:2,[E.NGN]:2,[E.NIO]:2,[E.NOK]:2,[E.NPR]:2,[E.NZD]:2,[E.OMR]:3,[E.PAB]:2,[E.PEN]:2,[E.PGK]:2,[E.PHP]:2,[E.PKR]:2,[E.PLN]:2,[E.PYG]:0,[E.QAR]:2,[E.RON]:2,[E.RSD]:2,[E.RUB]:2,[E.RWF]:0,[E.SAR]:2,[E.SBD]:2,[E.SCR]:2,[E.SDG]:2,[E.SEK]:2,[E.SGD]:2,[E.SHP]:2,[E.SLL]:2,[E.SOS]:2,[E.SRD]:2,[E.SSP]:2,[E.STD]:2,[E.SVC]:2,[E.SYP]:2,[E.SZL]:2,[E.THB]:2,[E.TJS]:2,[E.TMT]:2,[E.TND]:3,[E.TOP]:2,[E.TRY]:2,[E.TTD]:2,[E.TWD]:2,[E.TZS]:2,[E.UAH]:2,[E.UGX]:0,[E.USD]:2,[E.USN]:2,[E.USS]:2,[E.UYI]:0,[E.UYU]:2,[E.UZS]:2,[E.VEF]:2,[E.VND]:0,[E.VUV]:0,[E.WST]:2,[E.XAF]:0,[E.XAG]:0,[E.XAU]:0,[E.XBA]:0,[E.XBB]:0,[E.XBC]:0,[E.XBD]:0,[E.XCD]:2,[E.XDR]:0,[E.XFU]:0,[E.XOF]:0,[E.XPD]:0,[E.XPF]:0,[E.XPT]:0,[E.XSU]:0,[E.XTS]:0,[E.XUA]:0,[E.YER]:2,[E.ZAR]:2,[E.ZMW]:2,[E.ZWL]:2};function lc(e,t="en-US"){let{amount:n,currency:r}=e;return Intl.NumberFormat(t,{style:"currency",currency:r}).format(uc(n,r))}function uc(e,t){let n=no[t];return n==null?(console.warn(`Unexpected currency ${t}`),e):new to(e).dividedBy(10**n).toNumber()}var cc={formatPrice:lc};var Sn={exports:{}};Sn.exports;var ro;function io(){return ro?Sn.exports:(ro=1,(function(e,t){var n=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,c=2,u=1/0,h=9007199254740991,f="[object Arguments]",p="[object Array]",g="[object Boolean]",A="[object Date]",U="[object Error]",Y="[object Function]",j="[object GeneratorFunction]",L="[object Map]",_e="[object Number]",ae="[object Object]",se="[object Promise]",Oe="[object RegExp]",ve="[object Set]",Fe="[object String]",Ae="[object Symbol]",Be="[object WeakMap]",Xe="[object ArrayBuffer]",qe="[object DataView]",xe="[object Float32Array]",ue="[object Float64Array]",ni="[object Int8Array]",Xn="[object Int16Array]",zn="[object Int32Array]",ri="[object Uint8Array]",ii="[object Uint8ClampedArray]",Wn="[object Uint16Array]",at="[object Uint32Array]",st=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qn=/^\w*$/,An=/^\./,ze=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ut=/[\\^$.*+?()[\]{}|]/g,ot=/\\(\\)?/g,Jn=/^\[object .+?Constructor\]$/,In=/^(?:0|[1-9]\d*)$/,oe={};oe[xe]=oe[ue]=oe[ni]=oe[Xn]=oe[zn]=oe[ri]=oe[ii]=oe[Wn]=oe[at]=!0,oe[f]=oe[p]=oe[Xe]=oe[g]=oe[qe]=oe[A]=oe[U]=oe[Y]=oe[L]=oe[_e]=oe[ae]=oe[Oe]=oe[ve]=oe[Fe]=oe[Be]=!1;var er=typeof Dn=="object"&&Dn&&Dn.Object===Object&&Dn,rn=typeof self=="object"&&self&&self.Object===Object&&self,We=er||rn||Function("return this")(),Nn=t&&!t.nodeType&&t,an=Nn&&!0&&e&&!e.nodeType&&e,tr=an&&an.exports===Nn,nr=tr&&er.process,rr=(function(){try{return nr&&nr.binding("util")}catch{}})(),ir=rr&&rr.isTypedArray;function ar(o,m){for(var b=-1,x=o?o.length:0;++b<x&&m(o[b],b,o)!==!1;);return o}function ai(o,m){for(var b=-1,x=o?o.length:0;++b<x;)if(m(o[b],b,o))return!0;return!1}function Pt(o){return function(m){return m?.[o]}}function sr(o,m){for(var b=-1,x=Array(o);++b<o;)x[b]=m(b);return x}function or(o){return function(m){return o(m)}}function si(o,m){return o?.[m]}function C(o){var m=!1;if(o!=null&&typeof o.toString!="function")try{m=!!(o+"")}catch{}return m}function lt(o){var m=-1,b=Array(o.size);return o.forEach(function(x,X){b[++m]=[X,x]}),b}function s(o,m){return function(b){return o(m(b))}}function l(o){var m=-1,b=Array(o.size);return o.forEach(function(x){b[++m]=x}),b}var _=Array.prototype,y=Function.prototype,S=Object.prototype,T=We["__core-js_shared__"],I=(function(){var o=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""})(),N=y.toString,w=S.hasOwnProperty,F=S.toString,te=RegExp("^"+N.call(w).replace(Ut,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=We.Symbol,ie=We.Uint8Array,De=s(Object.getPrototypeOf,Object),Ie=Object.create,wn=S.propertyIsEnumerable,Rn=_.splice,co=s(Object.keys,Object),oi=sn(We,"DataView"),On=sn(We,"Map"),li=sn(We,"Promise"),ui=sn(We,"Set"),ci=sn(We,"WeakMap"),xn=sn(Object,"create"),po=kt(oi),fo=kt(On),mo=kt(li),ho=kt(ui),_o=kt(ci),lr=$?$.prototype:void 0,pi=lr?lr.valueOf:void 0,Ji=lr?lr.toString:void 0;function Mt(o){var m=-1,b=o?o.length:0;for(this.clear();++m<b;){var x=o[m];this.set(x[0],x[1])}}function go(){this.__data__=xn?xn(null):{}}function vo(o){return this.has(o)&&delete this.__data__[o]}function Eo(o){var m=this.__data__;if(xn){var b=m[o];return b===i?void 0:b}return w.call(m,o)?m[o]:void 0}function yo(o){var m=this.__data__;return xn?m[o]!==void 0:w.call(m,o)}function To(o,m){var b=this.__data__;return b[o]=xn&&m===void 0?i:m,this}Mt.prototype.clear=go,Mt.prototype.delete=vo,Mt.prototype.get=Eo,Mt.prototype.has=yo,Mt.prototype.set=To;function ut(o){var m=-1,b=o?o.length:0;for(this.clear();++m<b;){var x=o[m];this.set(x[0],x[1])}}function So(){this.__data__=[]}function bo(o){var m=this.__data__,b=cr(m,o);if(b<0)return!1;var x=m.length-1;return b==x?m.pop():Rn.call(m,b,1),!0}function Ao(o){var m=this.__data__,b=cr(m,o);return b<0?void 0:m[b][1]}function Io(o){return cr(this.__data__,o)>-1}function No(o,m){var b=this.__data__,x=cr(b,o);return x<0?b.push([o,m]):b[x][1]=m,this}ut.prototype.clear=So,ut.prototype.delete=bo,ut.prototype.get=Ao,ut.prototype.has=Io,ut.prototype.set=No;function ct(o){var m=-1,b=o?o.length:0;for(this.clear();++m<b;){var x=o[m];this.set(x[0],x[1])}}function wo(){this.__data__={hash:new Mt,map:new(On||ut),string:new Mt}}function Ro(o){return pr(this,o).delete(o)}function Oo(o){return pr(this,o).get(o)}function xo(o){return pr(this,o).has(o)}function Do(o,m){return pr(this,o).set(o,m),this}ct.prototype.clear=wo,ct.prototype.delete=Ro,ct.prototype.get=Oo,ct.prototype.has=xo,ct.prototype.set=Do;function ur(o){var m=-1,b=o?o.length:0;for(this.__data__=new ct;++m<b;)this.add(o[m])}function Lo(o){return this.__data__.set(o,i),this}function Uo(o){return this.__data__.has(o)}ur.prototype.add=ur.prototype.push=Lo,ur.prototype.has=Uo;function pt(o){this.__data__=new ut(o)}function Po(){this.__data__=new ut}function Mo(o){return this.__data__.delete(o)}function ko(o){return this.__data__.get(o)}function Go(o){return this.__data__.has(o)}function Bo(o,m){var b=this.__data__;if(b instanceof ut){var x=b.__data__;if(!On||x.length<n-1)return x.push([o,m]),this;b=this.__data__=new ct(x)}return b.set(o,m),this}pt.prototype.clear=Po,pt.prototype.delete=Mo,pt.prototype.get=ko,pt.prototype.has=Go,pt.prototype.set=Bo;function Ho(o,m){var b=ft(o)||oa(o)?sr(o.length,String):[],x=b.length,X=!!x;for(var B in o)w.call(o,B)&&!(X&&(B=="length"||ra(B,x)))&&b.push(B);return b}function cr(o,m){for(var b=o.length;b--;)if(sa(o[b][0],m))return b;return-1}function Vo(o){return on(o)?Ie(o):{}}var jo=tl();function Fo(o,m){return o&&jo(o,m,hr)}function ea(o,m){m=fr(m,o)?[m]:ta(m);for(var b=0,x=m.length;o!=null&&b<x;)o=o[dr(m[b++])];return b&&b==x?o:void 0}function qo(o){return F.call(o)}function Zo(o,m){return o!=null&&m in Object(o)}function fi(o,m,b,x,X){return o===m?!0:o==null||m==null||!on(o)&&!mr(m)?o!==o&&m!==m:Co(o,m,fi,b,x,X)}function Co(o,m,b,x,X,B){var ee=ft(o),ge=ft(m),he=p,Ne=p;ee||(he=yt(o),he=he==f?ae:he),ge||(Ne=yt(m),Ne=Ne==f?ae:Ne);var Pe=he==ae&&!C(o),Me=Ne==ae&&!C(m),Le=he==Ne;if(Le&&!Pe)return B||(B=new pt),ee||ua(o)?na(o,m,b,x,X,B):nl(o,m,he,b,x,X,B);if(!(X&c)){var Ze=Pe&&w.call(o,"__wrapped__"),Ce=Me&&w.call(m,"__wrapped__");if(Ze||Ce){var Tt=Ze?o.value():o,dt=Ce?m.value():m;return B||(B=new pt),b(Tt,dt,x,X,B)}}return Le?(B||(B=new pt),rl(o,m,b,x,X,B)):!1}function Ko(o,m,b,x){var X=b.length,B=X;if(o==null)return!B;for(o=Object(o);X--;){var ee=b[X];if(ee[2]?ee[1]!==o[ee[0]]:!(ee[0]in o))return!1}for(;++X<B;){ee=b[X];var ge=ee[0],he=o[ge],Ne=ee[1];if(ee[2]){if(he===void 0&&!(ge in o))return!1}else{var Pe=new pt,Me;if(!(Me===void 0?fi(Ne,he,x,a|c,Pe):Me))return!1}}return!0}function Yo(o){if(!on(o)||ol(o))return!1;var m=mi(o)||C(o)?te:Jn;return m.test(kt(o))}function $o(o){return mr(o)&&hi(o.length)&&!!oe[F.call(o)]}function Xo(o){return typeof o=="function"?o:o==null?hl:typeof o=="object"?ft(o)?Qo(o[0],o[1]):Wo(o):_l(o)}function zo(o){if(!ll(o))return co(o);var m=[];for(var b in Object(o))w.call(o,b)&&b!="constructor"&&m.push(b);return m}function Wo(o){var m=il(o);return m.length==1&&m[0][2]?aa(m[0][0],m[0][1]):function(b){return b===o||Ko(b,o,m)}}function Qo(o,m){return fr(o)&&ia(m)?aa(dr(o),m):function(b){var x=fl(b,o);return x===void 0&&x===m?dl(b,o):fi(m,x,void 0,a|c)}}function Jo(o){return function(m){return ea(m,o)}}function el(o){if(typeof o=="string")return o;if(_i(o))return Ji?Ji.call(o):"";var m=o+"";return m=="0"&&1/o==-u?"-0":m}function ta(o){return ft(o)?o:ul(o)}function tl(o){return function(m,b,x){for(var X=-1,B=Object(m),ee=x(m),ge=ee.length;ge--;){var he=ee[++X];if(b(B[he],he,B)===!1)break}return m}}function na(o,m,b,x,X,B){var ee=X&c,ge=o.length,he=m.length;if(ge!=he&&!(ee&&he>ge))return!1;var Ne=B.get(o);if(Ne&&B.get(m))return Ne==m;var Pe=-1,Me=!0,Le=X&a?new ur:void 0;for(B.set(o,m),B.set(m,o);++Pe<ge;){var Ze=o[Pe],Ce=m[Pe];if(x)var Tt=ee?x(Ce,Ze,Pe,m,o,B):x(Ze,Ce,Pe,o,m,B);if(Tt!==void 0){if(Tt)continue;Me=!1;break}if(Le){if(!ai(m,function(dt,Gt){if(!Le.has(Gt)&&(Ze===dt||b(Ze,dt,x,X,B)))return Le.add(Gt)})){Me=!1;break}}else if(!(Ze===Ce||b(Ze,Ce,x,X,B))){Me=!1;break}}return B.delete(o),B.delete(m),Me}function nl(o,m,b,x,X,B,ee){switch(b){case qe:if(o.byteLength!=m.byteLength||o.byteOffset!=m.byteOffset)return!1;o=o.buffer,m=m.buffer;case Xe:return!(o.byteLength!=m.byteLength||!x(new ie(o),new ie(m)));case g:case A:case _e:return sa(+o,+m);case U:return o.name==m.name&&o.message==m.message;case Oe:case Fe:return o==m+"";case L:var ge=lt;case ve:var he=B&c;if(ge||(ge=l),o.size!=m.size&&!he)return!1;var Ne=ee.get(o);if(Ne)return Ne==m;B|=a,ee.set(o,m);var Pe=na(ge(o),ge(m),x,X,B,ee);return ee.delete(o),Pe;case Ae:if(pi)return pi.call(o)==pi.call(m)}return!1}function rl(o,m,b,x,X,B){var ee=X&c,ge=hr(o),he=ge.length,Ne=hr(m),Pe=Ne.length;if(he!=Pe&&!ee)return!1;for(var Me=he;Me--;){var Le=ge[Me];if(!(ee?Le in m:w.call(m,Le)))return!1}var Ze=B.get(o);if(Ze&&B.get(m))return Ze==m;var Ce=!0;B.set(o,m),B.set(m,o);for(var Tt=ee;++Me<he;){Le=ge[Me];var dt=o[Le],Gt=m[Le];if(x)var ca=ee?x(Gt,dt,Le,m,o,B):x(dt,Gt,Le,o,m,B);if(!(ca===void 0?dt===Gt||b(dt,Gt,x,X,B):ca)){Ce=!1;break}Tt||(Tt=Le=="constructor")}if(Ce&&!Tt){var _r=o.constructor,gr=m.constructor;_r!=gr&&"constructor"in o&&"constructor"in m&&!(typeof _r=="function"&&_r instanceof _r&&typeof gr=="function"&&gr instanceof gr)&&(Ce=!1)}return B.delete(o),B.delete(m),Ce}function pr(o,m){var b=o.__data__;return sl(m)?b[typeof m=="string"?"string":"hash"]:b.map}function il(o){for(var m=hr(o),b=m.length;b--;){var x=m[b],X=o[x];m[b]=[x,X,ia(X)]}return m}function sn(o,m){var b=si(o,m);return Yo(b)?b:void 0}var yt=qo;(oi&&yt(new oi(new ArrayBuffer(1)))!=qe||On&&yt(new On)!=L||li&&yt(li.resolve())!=se||ui&&yt(new ui)!=ve||ci&&yt(new ci)!=Be)&&(yt=function(o){var m=F.call(o),b=m==ae?o.constructor:void 0,x=b?kt(b):void 0;if(x)switch(x){case po:return qe;case fo:return L;case mo:return se;case ho:return ve;case _o:return Be}return m});function al(o,m,b){m=fr(m,o)?[m]:ta(m);for(var x,X=-1,ee=m.length;++X<ee;){var B=dr(m[X]);if(!(x=o!=null&&b(o,B)))break;o=o[B]}if(x)return x;var ee=o?o.length:0;return!!ee&&hi(ee)&&ra(B,ee)&&(ft(o)||oa(o))}function ra(o,m){return m=m??h,!!m&&(typeof o=="number"||In.test(o))&&o>-1&&o%1==0&&o<m}function fr(o,m){if(ft(o))return!1;var b=typeof o;return b=="number"||b=="symbol"||b=="boolean"||o==null||_i(o)?!0:Qn.test(o)||!st.test(o)||m!=null&&o in Object(m)}function sl(o){var m=typeof o;return m=="string"||m=="number"||m=="symbol"||m=="boolean"?o!=="__proto__":o===null}function ol(o){return!!I&&I in o}function ll(o){var m=o&&o.constructor,b=typeof m=="function"&&m.prototype||S;return o===b}function ia(o){return o===o&&!on(o)}function aa(o,m){return function(b){return b==null?!1:b[o]===m&&(m!==void 0||o in Object(b))}}var ul=di(function(o){o=pl(o);var m=[];return An.test(o)&&m.push(""),o.replace(ze,function(b,x,X,B){m.push(X?B.replace(ot,"$1"):x||b)}),m});function dr(o){if(typeof o=="string"||_i(o))return o;var m=o+"";return m=="0"&&1/o==-u?"-0":m}function kt(o){if(o!=null){try{return N.call(o)}catch{}try{return o+""}catch{}}return""}function di(o,m){if(typeof o!="function"||m&&typeof m!="function")throw new TypeError(r);var b=function(){var x=arguments,X=m?m.apply(this,x):x[0],B=b.cache;if(B.has(X))return B.get(X);var ee=o.apply(this,x);return b.cache=B.set(X,ee),ee};return b.cache=new(di.Cache||ct),b}di.Cache=ct;function sa(o,m){return o===m||o!==o&&m!==m}function oa(o){return cl(o)&&w.call(o,"callee")&&(!wn.call(o,"callee")||F.call(o)==f)}var ft=Array.isArray;function la(o){return o!=null&&hi(o.length)&&!mi(o)}function cl(o){return mr(o)&&la(o)}function mi(o){var m=on(o)?F.call(o):"";return m==Y||m==j}function hi(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=h}function on(o){var m=typeof o;return!!o&&(m=="object"||m=="function")}function mr(o){return!!o&&typeof o=="object"}function _i(o){return typeof o=="symbol"||mr(o)&&F.call(o)==Ae}var ua=ir?or(ir):$o;function pl(o){return o==null?"":el(o)}function fl(o,m,b){var x=o==null?void 0:ea(o,m);return x===void 0?b:x}function dl(o,m){return o!=null&&al(o,m,Zo)}function hr(o){return la(o)?Ho(o):zo(o)}function ml(o,m,b){var x=ft(o)||ua(o);if(m=Xo(m),b==null)if(x||on(o)){var X=o.constructor;x?b=ft(o)?new X:[]:b=mi(X)?Vo(De(o)):{}}else b={};return(x?ar:Fo)(o,function(B,ee,ge){return m(b,B,ee,ge)}),b}function hl(o){return o}function _l(o){return fr(o)?Pt(dr(o)):Jo(o)}e.exports=ml})(Sn,Sn.exports),Sn.exports)}var pc=io(),ao=ln(pc);var Qi=class{constructor(t,n,r,i){this.platform=Ge.DESKTOP,this.instanceId="123456789012345678",this.configuration=Jr(),this.source=null,this.sourceOrigin="",this.sdkVersion="mock",this.mobileAppVersion="unknown",this.frameId="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",this.eventBus=new Er,this.clientId=t,this.commands=this._updateCommandMocks({}),this.guildId=n,this.channelId=r,this.locationId=i,this.customId=null,this.referrerId=null}_updateCommandMocks(t){return this.commands=ao(Object.assign({},fc,t),(n,r,i)=>{n[i]=async(...a)=>(console.info(`DiscordSDKMock: ${String(i)}(${JSON.stringify(a)})`),await r(...a))}),this.commands}emitReady(){this.emitEvent("READY",void 0)}close(...t){console.info(`DiscordSDKMock: close(${JSON.stringify(t)})`)}ready(){return Promise.resolve()}async subscribe(t,n,...r){return await this.eventBus.on(t,n)}async unsubscribe(t,n,...r){return await this.eventBus.off(t,n)}emitEvent(t,n){this.eventBus.emit(t,n)}},fc={authorize:()=>Promise.resolve({code:"mock_code"}),setActivity:()=>Promise.resolve({name:"mock_activity_name",type:0}),getChannel:()=>Promise.resolve({id:"mock_channel_id",name:"mock_channel_name",type:vn.GUILD_TEXT,voice_states:[],messages:[]}),getSkus:()=>Promise.resolve({skus:[]}),getEntitlements:()=>Promise.resolve({entitlements:[]}),startPurchase:()=>Promise.resolve([]),setConfig:()=>Promise.resolve({use_interactive_pip:!1}),userSettingsGetLocale:()=>Promise.resolve({locale:""}),openExternalLink:()=>Promise.resolve({opened:!1}),encourageHardwareAcceleration:()=>Promise.resolve({enabled:!0}),captureLog:()=>Promise.resolve(null),setOrientationLockState:()=>Promise.resolve(null),openInviteDialog:()=>Promise.resolve(null),getPlatformBehaviors:()=>Promise.resolve({iosKeyboardResizesView:!0}),getChannelPermissions:()=>Promise.resolve({permissions:Rr(1234567890)}),getInstanceConnectedParticipants:()=>Promise.resolve({participants:[]}),openShareMomentDialog:()=>Promise.resolve(null),authenticate:()=>Promise.resolve({access_token:"mock_token",user:{username:"mock_user_username",discriminator:"mock_user_discriminator",id:"mock_user_id",avatar:null,public_flags:1},scopes:[],expires:new Date(2121,1,1).toString(),application:{description:"mock_app_description",icon:"mock_app_icon",id:"mock_app_id",name:"mock_app_name"}}),shareLink:()=>Promise.resolve({success:!1,didSendMessage:!1,didCopyLink:!1}),initiateImageUpload:()=>Promise.resolve({image_url:"https://assets-global.website-files.com/6257adef93867e50d84d30e2/636e0b52aa9e99b832574a53_full_logo_blurple_RGB.png"}),getRelationships:()=>Promise.resolve({relationships:[{type:1,user:{username:"mock_friend_username",flags:0,bot:!1,discriminator:"mock_friend_discriminator",id:"mock_friend_id_1",avatar:null}},{type:1,user:{username:"mock_friend_username_with_nickname",flags:0,bot:!1,discriminator:"mock_friend_discriminator_with_nickname",id:"mock_friend_id_2",avatar:null},nickname:"mock_friend_nickname_for_user"},{type:1,user:{username:"mock_friend_username_with_since",flags:0,bot:!1,discriminator:"mock_friend_discriminator_with_since",id:"mock_friend_id_3",avatar:null},since:"2021-06-29T00:32:37.180813+00:00"}]}),inviteUserEmbedded:()=>Promise.resolve(null),getUser:()=>Promise.resolve({username:"mock_friend_username",flags:0,bot:!1,discriminator:"mock_friend_discriminator",id:"mock_friend_id_1",avatar:null}),getQuestEnrollmentStatus:()=>Promise.resolve({quest_id:"mock_quest_id",is_enrolled:!1,enrolled_at:null}),questStartTimer:()=>Promise.resolve({success:!0}),getActivityInstanceConnectedParticipants:()=>Promise.resolve({participants:[]}),shareInteraction:()=>Promise.resolve({success:!1}),requestProxyTicketRefresh:()=>Promise.resolve({ticket:"mock_ticket"}),getQuest:()=>Promise.resolve({quest_id:"mock_quest_id",external_cta_url:"mock_external_cta_url",enrolled_at:null,completed_at:null})};function so(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var oo=/\{([a-z]+)\}/g;function dc(e){let t=e.replace(oo,(n,r)=>`(?<${r}>[\\w-]+)`);return new RegExp(`${t}(/|$)`)}function lo({originalURL:e,prefix:t,prefixHost:n,target:r}){let i=new URL(`https://${r}`),a=dc(i.host.replace(/%7B/g,"{").replace(/%7D/g,"}")),c=e.toString().match(a);if(c==null)return e;let u=new URL(e.toString());u.host=n,u.pathname=t.replace(oo,(f,p)=>{var g;let A=(g=c.groups)===null||g===void 0?void 0:g[p];if(A==null)throw new Error("Misconfigured route.");return A});let h=e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname;return u.pathname+=u.pathname.endsWith("/")?h:"/"+h,u.pathname=u.pathname.replace(i.pathname,""),e.pathname.endsWith("/")&&!u.pathname.endsWith("/")&&(u.pathname+="/"),u}function bn(e,t=window.location.protocol,n=window.location.host){return new URL(e,`${t}//${n}`)}function mc(e,{patchFetch:t=!0,patchWebSocket:n=!0,patchXhr:r=!0,patchSrcAttributes:i=!1}={}){if(!(typeof window>"u")){if(t){let a=window.fetch;window.fetch=function(c,u){if(c instanceof Request){let f=Lt({url:bn(c.url),mappings:e}),p=u??{},g=so(p,["url"]);return Object.keys(Request.prototype).forEach(A=>{if(A!=="url")try{g[A]=c[A]}catch(U){console.warn(`Remapping fetch request key "${A}" failed`,U)}}),new Promise((A,U)=>{try{c.blob().then(Y=>{c.method.toUpperCase()!=="HEAD"&&c.method.toUpperCase()!=="GET"&&Y.size>0&&(g.body=Y),A(a(new Request(f,g)))})}catch(Y){U(Y)}})}let h=Lt({url:c instanceof URL?c:bn(c),mappings:e});return a(h,u)}}if(n){class a extends WebSocket{constructor(u,h){let f=Lt({url:u instanceof URL?u:bn(u),mappings:e});super(f,h)}}window.WebSocket=a}if(r){let a=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(c,u,h,f,p){let g=Lt({url:bn(u),mappings:e});a.apply(this,[c,g,h,f,p])}}if(i){let a=function(h){for(let f of h)f.type==="attributes"&&f.attributeName==="src"?ti(f.target,e):f.type==="childList"&&f.addedNodes.forEach(p=>{ti(p,e),uo(p,e)})},c=new MutationObserver(a),u={attributeFilter:["src"],childList:!0,subtree:!0};c.observe(window.document,u),window.document.querySelectorAll("[src]").forEach(h=>{ti(h,e)})}}}function uo(e,t){e.hasChildNodes()&&e.childNodes.forEach(n=>{ti(n,t),uo(n,t)})}function ti(e,t){if(e instanceof HTMLElement&&e.hasAttribute("src")){let n=e.getAttribute("src"),r=bn(n??"");if(r.host===window.location.host)return;if(e.tagName.toLowerCase()==="script")hc(e,{url:r,mappings:t});else{let i=Lt({url:r,mappings:t}).toString();i!==n&&e.setAttribute("src",i)}}}function hc(e,{url:t,mappings:n}){let r=Lt({url:t,mappings:n});if(t.toString()!==r.toString()){let i=document.createElement(e.tagName);i.innerHTML=e.innerHTML;for(let a of e.attributes)i.setAttribute(a.name,a.value);i.setAttribute("src",Lt({url:t,mappings:n}).toString()),e.after(i),e.remove()}}function Lt({url:e,mappings:t}){let n=new URL(e.toString());for(let r of t){let i=lo({originalURL:n,prefix:r.prefix,target:r.target,prefixHost:window.location.host});if(i!=null&&i?.toString()!==e.toString())return i}return n}var{Commands:Lm}=Vr;export{Lm as Commands,Vr as Common,$i as DiscordSDK,Qi as DiscordSDKMock,J as Events,jn as Orientation,ic as PermissionUtils,bu as Permissions,Ge as Platform,cc as PriceUtils,wi as RPCCloseCodes,Vn as RPCErrorCodes,qi as Responses,Lt as attemptRemap,mc as patchUrlMappings};
|
|
@@ -2188,6 +2188,7 @@ class ZodArray extends ZodType {
|
|
|
2188
2188
|
exact: true,
|
|
2189
2189
|
message: def.exactLength.message,
|
|
2190
2190
|
});
|
|
2191
|
+
if (tooBig) return INVALID;
|
|
2191
2192
|
status.dirty();
|
|
2192
2193
|
}
|
|
2193
2194
|
}
|
|
@@ -2214,7 +2215,7 @@ class ZodArray extends ZodType {
|
|
|
2214
2215
|
exact: false,
|
|
2215
2216
|
message: def.maxLength.message,
|
|
2216
2217
|
});
|
|
2217
|
-
|
|
2218
|
+
return INVALID;
|
|
2218
2219
|
}
|
|
2219
2220
|
}
|
|
2220
2221
|
if (ctx.common.async) {
|
|
@@ -3236,7 +3237,7 @@ class ZodSet extends ZodType {
|
|
|
3236
3237
|
exact: false,
|
|
3237
3238
|
message: def.maxSize.message,
|
|
3238
3239
|
});
|
|
3239
|
-
|
|
3240
|
+
return INVALID;
|
|
3240
3241
|
}
|
|
3241
3242
|
}
|
|
3242
3243
|
const valueType = this._def.valueType;
|
|
@@ -2184,6 +2184,7 @@ class ZodArray extends ZodType {
|
|
|
2184
2184
|
exact: true,
|
|
2185
2185
|
message: def.exactLength.message,
|
|
2186
2186
|
});
|
|
2187
|
+
if (tooBig) return INVALID;
|
|
2187
2188
|
status.dirty();
|
|
2188
2189
|
}
|
|
2189
2190
|
}
|
|
@@ -2210,7 +2211,7 @@ class ZodArray extends ZodType {
|
|
|
2210
2211
|
exact: false,
|
|
2211
2212
|
message: def.maxLength.message,
|
|
2212
2213
|
});
|
|
2213
|
-
|
|
2214
|
+
return INVALID;
|
|
2214
2215
|
}
|
|
2215
2216
|
}
|
|
2216
2217
|
if (ctx.common.async) {
|
|
@@ -3232,7 +3233,7 @@ class ZodSet extends ZodType {
|
|
|
3232
3233
|
exact: false,
|
|
3233
3234
|
message: def.maxSize.message,
|
|
3234
3235
|
});
|
|
3235
|
-
|
|
3236
|
+
return INVALID;
|
|
3236
3237
|
}
|
|
3237
3238
|
}
|
|
3238
3239
|
const valueType = this._def.valueType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.36",
|
|
4
4
|
"description": "OpenClaw Discord channel plugin for channels, DMs, commands, and app events.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"zod": "4.6.7"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"openclaw": ">=2026.9.
|
|
22
|
+
"openclaw": ">=2026.9.36"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"openclaw": {
|
|
@@ -95,14 +95,14 @@
|
|
|
95
95
|
"allowInvalidConfigRecovery": true
|
|
96
96
|
},
|
|
97
97
|
"compat": {
|
|
98
|
-
"pluginApi": ">=2026.9.
|
|
98
|
+
"pluginApi": ">=2026.9.36"
|
|
99
99
|
},
|
|
100
100
|
"build": {
|
|
101
101
|
"bundledDist": false,
|
|
102
102
|
"workerEntries": [
|
|
103
103
|
"./src/voice/audio-worker.runtime.ts"
|
|
104
104
|
],
|
|
105
|
-
"openclawVersion": "2026.9.
|
|
105
|
+
"openclawVersion": "2026.9.36",
|
|
106
106
|
"staticAssets": [
|
|
107
107
|
{
|
|
108
108
|
"source": "./assets/embedded-app-sdk.mjs",
|