@authhero/cloudflare-adapter 2.10.0 → 2.11.1

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.
package/README.md CHANGED
@@ -295,31 +295,64 @@ Use this mode when calling the Pipeline from outside a Cloudflare Worker:
295
295
  }
296
296
  ```
297
297
 
298
- ##### 2. Service Binding Mode (Workers)
298
+ ##### 2. Pipeline Binding Mode (Workers)
299
299
 
300
- Use this mode when running inside a Cloudflare Worker with a service binding to the Pipeline:
300
+ Use this mode when running inside a Cloudflare Worker with a Pipeline binding. This is the most efficient mode as it uses direct bindings without HTTP overhead.
301
301
 
302
- ```typescript
303
- // wrangler.toml
304
- [[pipelines]];
305
- binding = "AUTHHERO_LOGS_STREAM";
306
- pipeline = "my-pipeline";
302
+ **wrangler.toml:**
303
+
304
+ ```toml
305
+ [[pipelines]]
306
+ binding = "AUTH_LOGS_STREAM"
307
+ pipeline = "your-pipeline-id"
308
+ ```
309
+
310
+ **TypeScript:**
307
311
 
308
- // TypeScript
312
+ ```typescript
309
313
  interface Env {
310
- AUTHHERO_LOGS_STREAM: { fetch: typeof fetch };
314
+ AUTH_LOGS_STREAM: Pipeline;
315
+ R2_SQL_AUTH_TOKEN: string;
316
+ R2_WAREHOUSE_NAME: string;
311
317
  }
312
318
 
313
- const { logs } = createAdapters({
319
+ export default {
320
+ async fetch(request: Request, env: Env) {
321
+ const adapters = createAdapters({
322
+ zoneId: "your-zone-id",
323
+ authKey: "your-api-key",
324
+ authEmail: "your-email",
325
+ customDomainAdapter: yourDbAdapter,
326
+
327
+ r2SqlLogs: {
328
+ pipelineBinding: env.AUTH_LOGS_STREAM,
329
+ authToken: env.R2_SQL_AUTH_TOKEN,
330
+ warehouseName: env.R2_WAREHOUSE_NAME,
331
+ },
332
+ });
333
+
334
+ const { logs } = adapters;
335
+ // Use logs adapter
336
+ },
337
+ };
338
+ ```
339
+
340
+ **With Base Adapter (Passthrough Mode):**
341
+
342
+ ```typescript
343
+ const baseAdapter = createKyselyLogsAdapter(db);
344
+
345
+ const adapters = createAdapters({
346
+ // ... other config
314
347
  r2SqlLogs: {
315
- pipelineBinding: env.AUTHHERO_LOGS_STREAM,
316
- authToken: env.R2_SQL_AUTH_TOKEN,
317
- warehouseName: env.R2_WAREHOUSE_NAME,
348
+ baseAdapter, // Logs written to base adapter first
349
+ pipelineBinding: env.AUTH_LOGS_STREAM, // Then sent to Pipeline in background
350
+ // authToken and warehouseName not needed when using baseAdapter
318
351
  },
319
352
  });
320
353
  ```
321
354
 
322
- This mode is more efficient as it avoids HTTP overhead for Worker-to-Worker communication. The `AUTHHERO_LOGS_STREAM` binding name is recommended for consistency across workers.
355
+ The Pipeline binding uses the `.send()` method for direct data ingestion.
323
356
 
324
357
  ##### 3. Passthrough Mode (Wrap Another Adapter)
325
358
 
@@ -1,4 +1,4 @@
1
- "use strict";const lt=require("@authhero/adapter-interfaces"),ft=require("wretch");function ht(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]]);return n}function pt(t,e){var n;return((n=t?._def)===null||n===void 0?void 0:n.typeName)===e}function le(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...s){const r=n.apply(this,s);return r._def.openapi=this._def.openapi,r}}function mt(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(r,a){var i,o,c,d,p,b;const C=typeof r=="string"?a:r,w=C??{},{param:j}=w,de=ht(w,["param"]),M=Object.assign(Object.assign({},(i=this._def.openapi)===null||i===void 0?void 0:i._internal),typeof r=="string"?{refId:r}:void 0),W=Object.assign(Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o.metadata),de),!((d=(c=this._def.openapi)===null||c===void 0?void 0:c.metadata)===null||d===void 0)&&d.param||j?{param:Object.assign(Object.assign({},(b=(p=this._def.openapi)===null||p===void 0?void 0:p.metadata)===null||b===void 0?void 0:b.param),j)}:void 0),D=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(M).length>0?{_internal:M}:void 0),Object.keys(W).length>0?{metadata:W}:void 0)}));if(pt(this,"ZodObject")){const ee=this.extend;D.extend=function(...G){var J,ue,Pe,Me,De,Le,Ve;const Ue=ee.apply(this,G);return Ue._def.openapi={_internal:{extendedFrom:!((ue=(J=this._def.openapi)===null||J===void 0?void 0:J._internal)===null||ue===void 0)&&ue.refId?{refId:(Me=(Pe=this._def.openapi)===null||Pe===void 0?void 0:Pe._internal)===null||Me===void 0?void 0:Me.refId,schema:this}:(Le=(De=this._def.openapi)===null||De===void 0?void 0:De._internal)===null||Le===void 0?void 0:Le.extendedFrom},metadata:(Ve=Ue._def.openapi)===null||Ve===void 0?void 0:Ve.metadata},Ue}}return D},le(t,"optional"),le(t,"nullable"),le(t,"default"),le(t,"transform"),le(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const r=this._def.shape(),a=e.apply(this),i=a._def.shape();return Object.entries(i).forEach(([o,c])=>{var d,p;c._def.openapi=(p=(d=r[o])===null||d===void 0?void 0:d._def)===null||p===void 0?void 0:p.openapi}),a._def.openapi=void 0,a};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...r){const a=n.apply(this,r);return a._def.openapi=void 0,a};const s=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...r){const a=s.apply(this,r);return a._def.openapi=void 0,a}}var te=class extends Error{res;status;constructor(t=500,e){super(e?.message,{cause:e?.cause}),this.res=e?.res,this.status=t}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}};new Set(".\\+*[^]$()");var x;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const a={};for(const i of r)a[i]=i;return a},t.getValidEnumValues=r=>{const a=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of a)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(a){return r[a]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const a=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&a.push(i);return a},t.find=(r,a)=>{for(const i of r)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,a=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(r,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var qe;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(qe||(qe={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),V=t=>{switch(typeof t){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(t)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(t)?f.array:t===null?f.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?f.promise:typeof Map<"u"&&t instanceof Map?f.map:typeof Set<"u"&&t instanceof Set?f.set:typeof Date<"u"&&t instanceof Date?f.date:f.object;default:return f.unknown}},u=x.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"]),yt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class A extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},s={_errors:[]},r=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(n(i));else{let o=s,c=0;for(;c<i.path.length;){const d=i.path[c];c===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(n(i))):o[d]=o[d]||{_errors:[]},o=o[d],c++}}};return r(this),s}static assert(e){if(!(e instanceof A))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},s=[];for(const r of this.issues)if(r.path.length>0){const a=r.path[0];n[a]=n[a]||[],n[a].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}A.create=t=>new A(t);const ie=(t,e)=>{let n;switch(t.code){case u.invalid_type:t.received===f.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case u.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,x.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:n=`Unrecognized key(s) in object: ${x.joinValues(t.keys,", ")}`;break;case u.invalid_union:n="Invalid input";break;case u.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${x.joinValues(t.options)}`;break;case u.invalid_enum_value:n=`Invalid enum value. Expected ${x.joinValues(t.options)}, received '${t.received}'`;break;case u.invalid_arguments:n="Invalid function arguments";break;case u.invalid_return_type:n="Invalid function return type";break;case u.invalid_date:n="Invalid date";break;case u.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:x.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case u.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case u.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case u.custom:n="Invalid input";break;case u.invalid_intersection_types:n="Intersection results could not be merged";break;case u.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case u.not_finite:n="Number must be finite";break;default:n=e.defaultError,x.assertNever(t)}return{message:n}};let nt=ie;function _t(t){nt=t}function Ae(){return nt}const Oe=t=>{const{data:e,path:n,errorMaps:s,issueData:r}=t,a=[...n,...r.path||[]],i={...r,path:a};if(r.message!==void 0)return{...r,path:a,message:r.message};let o="";const c=s.filter(d=>!!d).slice().reverse();for(const d of c)o=d(i,{data:e,defaultError:o}).message;return{...r,path:a,message:o}},gt=[];function l(t,e){const n=Ae(),s=Oe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ie?void 0:ie].filter(r=>!!r)});t.common.issues.push(s)}class T{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const s=[];for(const r of n){if(r.status==="aborted")return m;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const r of n){const a=await r.key,i=await r.value;s.push({key:a,value:i})}return T.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const r of n){const{key:a,value:i}=r;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||r.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const m=Object.freeze({status:"aborted"}),re=t=>({status:"dirty",value:t}),S=t=>({status:"valid",value:t}),He=t=>t.status==="aborted",We=t=>t.status==="dirty",Q=t=>t.status==="valid",fe=t=>typeof Promise<"u"&&t instanceof Promise;var h;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));class ${constructor(e,n,s,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ye=(t,e)=>{if(Q(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new A(t.common.issues);return this._error=n,this._error}}};function _(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:s,description:r}=t;if(e&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>{const{message:c}=t;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:r}}class v{get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(fe(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){const s={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},r=this._parseSync({data:e,path:s.path,parent:s});return Ye(s,r)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return Q(s)?{value:s.value}:{issues:n.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>Q(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},r=this._parse({data:e,path:s.path,parent:s}),a=await(fe(r)?r:Promise.resolve(r));return Ye(s,a)}refine(e,n){const s=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,a)=>{const i=e(r),o=()=>a.addIssue({code:u.custom,...s(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,n){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof n=="function"?n(s,r):n),!1))}_refinement(e){return new R({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Z.create(this,this._def)}nullable(){return H.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return E.create(this)}promise(){return ce.create(this,this._def)}or(e){return ye.create([this,e],this._def)}and(e){return _e.create(this,e,this._def)}transform(e){return new R({..._(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ke({..._(this._def),innerType:this,defaultValue:n,typeName:y.ZodDefault})}brand(){return new Ke({typeName:y.ZodBranded,type:this,..._(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new we({..._(this._def),innerType:this,catchValue:n,typeName:y.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Se.create(this,e)}readonly(){return Te.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const vt=/^c[^\s-]{8,}$/i,xt=/^[0-9a-z]+$/,bt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kt=/^[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,wt=/^[a-z0-9_-]{21}$/i,Tt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,St=/^[-+]?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)?)??$/,Ct=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,At="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ze;const Ot=/^(?:(?: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])$/,Nt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Et=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Rt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,It=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,st="((\\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])))",Zt=new RegExp(`^${st}$`);function rt(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function $t(t){return new RegExp(`^${rt(t)}$`)}function at(t){let e=`${st}T${rt(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Pt(t,e){return!!((e==="v4"||!e)&&Ot.test(t)||(e==="v6"||!e)&&Et.test(t))}function Mt(t,e){if(!Tt.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(s));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Dt(t,e){return!!((e==="v4"||!e)&&Nt.test(t)||(e==="v6"||!e)&&Rt.test(t))}class N extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.string,received:a.parsedType}),m}const s=new T;let r;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(e,r),i?l(r,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(r,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")Ct.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"email",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")ze||(ze=new RegExp(At,"u")),ze.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"emoji",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")kt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"uuid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")wt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"nanoid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")vt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cuid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")xt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cuid2",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")bt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"ulid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),l(r,{validation:"url",code:u.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"regex",code:u.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?at(a).test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Zt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?$t(a).test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?St.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"duration",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Pt(e.data,a.version)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"ip",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Mt(e.data,a.alg)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"jwt",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Dt(e.data,a.version)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cidr",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?It.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"base64",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?jt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"base64url",code:u.invalid_string,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(r=>e.test(r),{validation:n,code:u.invalid_string,...h.errToObj(s)})}_addCheck(e){return new N({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...h.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...h.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...h.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...h.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...h.errToObj(n)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new N({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}N.create=t=>new N({checks:[],typeName:y.ZodString,coerce:t?.coerce??!1,..._(t)});function Lt(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=n>s?n:s,a=Number.parseInt(t.toFixed(r).replace(".","")),i=Number.parseInt(e.toFixed(r).replace(".",""));return a%i/10**r}class B extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.number,received:a.parsedType}),m}let s;const r=new T;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:u.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Lt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:u.not_finite,message:a.message}),r.dirty()):x.assertNever(a);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,h.toString(n))}gt(e,n){return this.setLimit("min",e,!1,h.toString(n))}lte(e,n){return this.setLimit("max",e,!0,h.toString(n))}lt(e,n){return this.setLimit("max",e,!1,h.toString(n))}setLimit(e,n,s,r){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:h.toString(r)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}B.create=t=>new B({checks:[],typeName:y.ZodNumber,coerce:t?.coerce||!1,..._(t)});class F extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s;const r=new T;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):x.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return l(n,{code:u.invalid_type,expected:f.bigint,received:n.parsedType}),m}gte(e,n){return this.setLimit("min",e,!0,h.toString(n))}gt(e,n){return this.setLimit("min",e,!1,h.toString(n))}lte(e,n){return this.setLimit("max",e,!0,h.toString(n))}lt(e,n){return this.setLimit("max",e,!1,h.toString(n))}setLimit(e,n,s,r){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:h.toString(r)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}F.create=t=>new F({checks:[],typeName:y.ZodBigInt,coerce:t?.coerce??!1,..._(t)});class he extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.boolean,received:s.parsedType}),m}return S(e.data)}}he.create=t=>new he({typeName:y.ZodBoolean,coerce:t?.coerce||!1,..._(t)});class Y extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_date}),m}const s=new T;let r;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):x.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Y.create=t=>new Y({checks:[],coerce:t?.coerce||!1,typeName:y.ZodDate,..._(t)});class Ne extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.symbol,received:s.parsedType}),m}return S(e.data)}}Ne.create=t=>new Ne({typeName:y.ZodSymbol,..._(t)});class pe extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.undefined,received:s.parsedType}),m}return S(e.data)}}pe.create=t=>new pe({typeName:y.ZodUndefined,..._(t)});class me extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.null,received:s.parsedType}),m}return S(e.data)}}me.create=t=>new me({typeName:y.ZodNull,..._(t)});class oe extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}oe.create=t=>new oe({typeName:y.ZodAny,..._(t)});class K extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}K.create=t=>new K({typeName:y.ZodUnknown,..._(t)});class U extends v{_parse(e){const n=this._getOrReturnCtx(e);return l(n,{code:u.invalid_type,expected:f.never,received:n.parsedType}),m}}U.create=t=>new U({typeName:y.ZodNever,..._(t)});class Ee extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.void,received:s.parsedType}),m}return S(e.data)}}Ee.create=t=>new Ee({typeName:y.ZodVoid,..._(t)});class E extends v{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),r=this._def;if(n.parsedType!==f.array)return l(n,{code:u.invalid_type,expected:f.array,received:n.parsedType}),m;if(r.exactLength!==null){const i=n.data.length>r.exactLength.value,o=n.data.length<r.exactLength.value;(i||o)&&(l(n,{code:i?u.too_big:u.too_small,minimum:o?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(l(n,{code:u.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(l(n,{code:u.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((i,o)=>r.type._parseAsync(new $(n,i,n.path,o)))).then(i=>T.mergeArray(s,i));const a=[...n.data].map((i,o)=>r.type._parseSync(new $(n,i,n.path,o)));return T.mergeArray(s,a)}get element(){return this._def.type}min(e,n){return new E({...this._def,minLength:{value:e,message:h.toString(n)}})}max(e,n){return new E({...this._def,maxLength:{value:e,message:h.toString(n)}})}length(e,n){return new E({...this._def,exactLength:{value:e,message:h.toString(n)}})}nonempty(e){return this.min(1,e)}}E.create=(t,e)=>new E({type:t,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,..._(e)});function se(t){if(t instanceof k){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=Z.create(se(s))}return new k({...t._def,shape:()=>e})}else return t instanceof E?new E({...t._def,type:se(t.element)}):t instanceof Z?Z.create(se(t.unwrap())):t instanceof H?H.create(se(t.unwrap())):t instanceof P?P.create(t.items.map(e=>se(e))):t}class k extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=x.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==f.object){const d=this._getOrReturnCtx(e);return l(d,{code:u.invalid_type,expected:f.object,received:d.parsedType}),m}const{status:s,ctx:r}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof U&&this._def.unknownKeys==="strip"))for(const d in r.data)i.includes(d)||o.push(d);const c=[];for(const d of i){const p=a[d],b=r.data[d];c.push({key:{status:"valid",value:d},value:p._parse(new $(r,b,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof U){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of o)c.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(d==="strict")o.length>0&&(l(r,{code:u.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of o){const b=r.data[p];c.push({key:{status:"valid",value:p},value:d._parse(new $(r,b,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of c){const b=await p.key,C=await p.value;d.push({key:b,value:C,alwaysSet:p.alwaysSet})}return d}).then(d=>T.mergeObjectSync(s,d)):T.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{const r=this._def.errorMap?.(n,s).message??s.defaultError;return n.code==="unrecognized_keys"?{message:h.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const n={};for(const s of x.objectKeys(e))e[s]&&this.shape[s]&&(n[s]=this.shape[s]);return new k({...this._def,shape:()=>n})}omit(e){const n={};for(const s of x.objectKeys(this.shape))e[s]||(n[s]=this.shape[s]);return new k({...this._def,shape:()=>n})}deepPartial(){return se(this)}partial(e){const n={};for(const s of x.objectKeys(this.shape)){const r=this.shape[s];e&&!e[s]?n[s]=r:n[s]=r.optional()}return new k({...this._def,shape:()=>n})}required(e){const n={};for(const s of x.objectKeys(this.shape))if(e&&!e[s])n[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof Z;)a=a._def.innerType;n[s]=a}return new k({...this._def,shape:()=>n})}keyof(){return it(x.objectKeys(this.shape))}}k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:U.create(),typeName:y.ZodObject,..._(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:U.create(),typeName:y.ZodObject,..._(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:U.create(),typeName:y.ZodObject,..._(e)});class ye extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function r(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new A(o.ctx.common.issues));return l(n,{code:u.invalid_union,unionErrors:i}),m}if(n.common.async)return Promise.all(s.map(async a=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(r);{let a;const i=[];for(const c of s){const d={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(c=>new A(c));return l(n,{code:u.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}ye.create=(t,e)=>new ye({options:t,typeName:y.ZodUnion,..._(e)});const L=t=>t instanceof ve?L(t.schema):t instanceof R?L(t.innerType()):t instanceof xe?[t.value]:t instanceof q?t.options:t instanceof be?x.objectValues(t.enum):t instanceof ke?L(t._def.innerType):t instanceof pe?[void 0]:t instanceof me?[null]:t instanceof Z?[void 0,...L(t.unwrap())]:t instanceof H?[null,...L(t.unwrap())]:t instanceof Ke||t instanceof Te?L(t.unwrap()):t instanceof we?L(t._def.innerType):[];class $e extends v{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return l(n,{code:u.invalid_type,expected:f.object,received:n.parsedType}),m;const s=this.discriminator,r=n.data[s],a=this.optionsMap.get(r);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}):(l(n,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,s){const r=new Map;for(const a of n){const i=L(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,a)}}return new $e({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,..._(s)})}}function Ge(t,e){const n=V(t),s=V(e);if(t===e)return{valid:!0,data:t};if(n===f.object&&s===f.object){const r=x.objectKeys(e),a=x.objectKeys(t).filter(o=>r.indexOf(o)!==-1),i={...t,...e};for(const o of a){const c=Ge(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(n===f.array&&s===f.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],c=Ge(i,o);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===f.date&&s===f.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _e extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),r=(a,i)=>{if(He(a)||He(i))return m;const o=Ge(a.value,i.value);return o.valid?((We(a)||We(i))&&n.dirty(),{status:n.value,value:o.data}):(l(s,{code:u.invalid_intersection_types}),m)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>r(a,i)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}_e.create=(t,e,n)=>new _e({left:t,right:e,typeName:y.ZodIntersection,..._(n)});class P extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return l(s,{code:u.invalid_type,expected:f.array,received:s.parsedType}),m;if(s.data.length<this._def.items.length)return l(s,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...s.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new $(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>T.mergeArray(n,i)):T.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new P({...this._def,rest:e})}}P.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new P({items:t,typeName:y.ZodTuple,rest:null,..._(e)})};class ge extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return l(s,{code:u.invalid_type,expected:f.object,received:s.parsedType}),m;const r=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)r.push({key:a._parse(new $(s,o,s.path,o)),value:i._parse(new $(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?T.mergeObjectAsync(n,r):T.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,s){return n instanceof v?new ge({keyType:e,valueType:n,typeName:y.ZodRecord,..._(s)}):new ge({keyType:N.create(),valueType:e,typeName:y.ZodRecord,..._(n)})}}class Re extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return l(s,{code:u.invalid_type,expected:f.map,received:s.parsedType}),m;const r=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,c],d)=>({key:r._parse(new $(s,o,s.path,[d,"key"])),value:a._parse(new $(s,c,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const d=await c.key,p=await c.value;if(d.status==="aborted"||p.status==="aborted")return m;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),o.set(d.value,p.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const c of i){const d=c.key,p=c.value;if(d.status==="aborted"||p.status==="aborted")return m;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),o.set(d.value,p.value)}return{status:n.value,value:o}}}}Re.create=(t,e,n)=>new Re({valueType:e,keyType:t,typeName:y.ZodMap,..._(n)});class X extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return l(s,{code:u.invalid_type,expected:f.set,received:s.parsedType}),m;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(l(s,{code:u.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(l(s,{code:u.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const a=this._def.valueType;function i(c){const d=new Set;for(const p of c){if(p.status==="aborted")return m;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}const o=[...s.data.values()].map((c,d)=>a._parse(new $(s,c,s.path,d)));return s.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,n){return new X({...this._def,minSize:{value:e,message:h.toString(n)}})}max(e,n){return new X({...this._def,maxSize:{value:e,message:h.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}X.create=(t,e)=>new X({valueType:t,minSize:null,maxSize:null,typeName:y.ZodSet,..._(e)});class ae extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==f.function)return l(n,{code:u.invalid_type,expected:f.function,received:n.parsedType}),m;function s(o,c){return Oe({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ae(),ie].filter(d=>!!d),issueData:{code:u.invalid_arguments,argumentsError:c}})}function r(o,c){return Oe({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ae(),ie].filter(d=>!!d),issueData:{code:u.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof ce){const o=this;return S(async function(...c){const d=new A([]),p=await o._def.args.parseAsync(c,a).catch(w=>{throw d.addIssue(s(c,w)),d}),b=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(b,a).catch(w=>{throw d.addIssue(r(b,w)),d})})}else{const o=this;return S(function(...c){const d=o._def.args.safeParse(c,a);if(!d.success)throw new A([s(c,d.error)]);const p=Reflect.apply(i,this,d.data),b=o._def.returns.safeParse(p,a);if(!b.success)throw new A([r(p,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ae({...this._def,args:P.create(e).rest(K.create())})}returns(e){return new ae({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,s){return new ae({args:e||P.create([]).rest(K.create()),returns:n||K.create(),typeName:y.ZodFunction,..._(s)})}}class ve extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ve.create=(t,e)=>new ve({getter:t,typeName:y.ZodLazy,..._(e)});class xe extends v{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return l(n,{received:n.data,code:u.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}xe.create=(t,e)=>new xe({value:t,typeName:y.ZodLiteral,..._(e)});function it(t,e){return new q({values:t,typeName:y.ZodEnum,..._(e)})}class q extends v{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return l(n,{expected:x.joinValues(s),received:n.parsedType,code:u.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return l(n,{received:n.data,code:u.invalid_enum_value,options:s}),m}return S(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return q.create(e,{...this._def,...n})}exclude(e,n=this._def){return q.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}q.create=it;class be extends v{_parse(e){const n=x.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const r=x.objectValues(n);return l(s,{expected:x.joinValues(r),received:s.parsedType,code:u.invalid_type}),m}if(this._cache||(this._cache=new Set(x.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=x.objectValues(n);return l(s,{received:s.data,code:u.invalid_enum_value,options:r}),m}return S(e.data)}get enum(){return this._def.values}}be.create=(t,e)=>new be({values:t,typeName:y.ZodNativeEnum,..._(e)});class ce extends v{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==f.promise&&n.common.async===!1)return l(n,{code:u.invalid_type,expected:f.promise,received:n.parsedType}),m;const s=n.parsedType===f.promise?n.data:Promise.resolve(n.data);return S(s.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ce.create=(t,e)=>new ce({type:t,typeName:y.ZodPromise,..._(e)});class R extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?n.abort():n.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){const i=r.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(n.value==="aborted")return m;const c=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return c.status==="aborted"?m:c.status==="dirty"||n.value==="dirty"?re(c.value):c});{if(n.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?m:o.status==="dirty"||n.value==="dirty"?re(o.value):o}}if(r.type==="refinement"){const i=o=>{const c=r.refinement(o,a);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?m:(o.status==="dirty"&&n.dirty(),i(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&n.dirty(),i(o.value).then(()=>({status:n.value,value:o.value}))))}if(r.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Q(i))return m;const o=r.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>Q(i)?Promise.resolve(r.transform(i.value,a)).then(o=>({status:n.value,value:o})):m);x.assertNever(r)}}R.create=(t,e,n)=>new R({schema:t,typeName:y.ZodEffects,effect:e,..._(n)});R.createWithPreprocess=(t,e,n)=>new R({schema:e,effect:{type:"preprocess",transform:t},typeName:y.ZodEffects,..._(n)});class Z extends v{_parse(e){return this._getType(e)===f.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Z.create=(t,e)=>new Z({innerType:t,typeName:y.ZodOptional,..._(e)});class H extends v{_parse(e){return this._getType(e)===f.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}H.create=(t,e)=>new H({innerType:t,typeName:y.ZodNullable,..._(e)});class ke extends v{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ke.create=(t,e)=>new ke({innerType:t,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class we extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return fe(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new A(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new A(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}we.create=(t,e)=>new we({innerType:t,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Ie extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.nan,received:s.parsedType}),m}return{status:"valid",value:e.data}}}Ie.create=t=>new Ie({typeName:y.ZodNaN,..._(t)});const Vt=Symbol("zod_brand");class Ke extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class Se extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?m:a.status==="dirty"?(n.dirty(),re(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?m:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,n){return new Se({in:e,out:n,typeName:y.ZodPipeline})}}class Te extends v{_parse(e){const n=this._def.innerType._parse(e),s=r=>(Q(r)&&(r.value=Object.freeze(r.value)),r);return fe(n)?n.then(r=>s(r)):s(n)}unwrap(){return this._def.innerType}}Te.create=(t,e)=>new Te({innerType:t,typeName:y.ZodReadonly,..._(e)});function Xe(t,e){const n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function ot(t,e={},n){return t?oe.create().superRefine((s,r)=>{const a=t(s);if(a instanceof Promise)return a.then(i=>{if(!i){const o=Xe(e,s),c=o.fatal??n??!0;r.addIssue({code:"custom",...o,fatal:c})}});if(!a){const i=Xe(e,s),o=i.fatal??n??!0;r.addIssue({code:"custom",...i,fatal:o})}}):oe.create()}const Ut={object:k.lazycreate};var y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(y||(y={}));const zt=(t,e={message:`Input not instance of ${t.name}`})=>ot(n=>n instanceof t,e),g=N.create,Qe=B.create,Bt=Ie.create,Ft=F.create,Ce=he.create,qt=Y.create,Ht=Ne.create,Wt=pe.create,Gt=me.create,Jt=oe.create,Kt=K.create,Qt=U.create,Yt=Ee.create,O=E.create,I=k.create,Xt=k.strictCreate,en=ye.create,tn=$e.create,nn=_e.create,sn=P.create,ct=ge.create,rn=Re.create,an=X.create,on=ae.create,cn=ve.create,dn=xe.create,un=q.create,ln=be.create,fn=ce.create,et=R.create,hn=Z.create,pn=H.create,mn=R.createWithPreprocess,yn=Se.create,_n=()=>g().optional(),gn=()=>Qe().optional(),vn=()=>Ce().optional(),xn={string:(t=>N.create({...t,coerce:!0})),number:(t=>B.create({...t,coerce:!0})),boolean:(t=>he.create({...t,coerce:!0})),bigint:(t=>F.create({...t,coerce:!0})),date:(t=>Y.create({...t,coerce:!0}))},bn=m,kn=Object.freeze(Object.defineProperty({__proto__:null,BRAND:Vt,DIRTY:re,EMPTY_PATH:gt,INVALID:m,NEVER:bn,OK:S,ParseStatus:T,Schema:v,ZodAny:oe,ZodArray:E,ZodBigInt:F,ZodBoolean:he,ZodBranded:Ke,ZodCatch:we,ZodDate:Y,ZodDefault:ke,ZodDiscriminatedUnion:$e,ZodEffects:R,ZodEnum:q,ZodError:A,get ZodFirstPartyTypeKind(){return y},ZodFunction:ae,ZodIntersection:_e,ZodIssueCode:u,ZodLazy:ve,ZodLiteral:xe,ZodMap:Re,ZodNaN:Ie,ZodNativeEnum:be,ZodNever:U,ZodNull:me,ZodNullable:H,ZodNumber:B,ZodObject:k,ZodOptional:Z,ZodParsedType:f,ZodPipeline:Se,ZodPromise:ce,ZodReadonly:Te,ZodRecord:ge,ZodSchema:v,ZodSet:X,ZodString:N,ZodSymbol:Ne,ZodTransformer:R,ZodTuple:P,ZodType:v,ZodUndefined:pe,ZodUnion:ye,ZodUnknown:K,ZodVoid:Ee,addIssueToContext:l,any:Jt,array:O,bigint:Ft,boolean:Ce,coerce:xn,custom:ot,date:qt,datetimeRegex:at,defaultErrorMap:ie,discriminatedUnion:tn,effect:et,enum:un,function:on,getErrorMap:Ae,getParsedType:V,instanceof:zt,intersection:nn,isAborted:He,isAsync:fe,isDirty:We,isValid:Q,late:Ut,lazy:cn,literal:dn,makeIssue:Oe,map:rn,nan:Bt,nativeEnum:ln,never:Qt,null:Gt,nullable:pn,number:Qe,object:I,get objectUtil(){return qe},oboolean:vn,onumber:gn,optional:hn,ostring:_n,pipeline:yn,preprocess:mn,promise:fn,quotelessJson:yt,record:ct,set:an,setErrorMap:_t,strictObject:Xt,string:g,symbol:Ht,transformer:et,tuple:sn,undefined:Wt,union:en,unknown:Kt,get util(){return x},void:Yt},Symbol.toStringTag,{value:"Module"}));mt(kn);const wn=(t,e)=>e.skipDedupe||e.method!=="GET",Tn=(t,e)=>e.method+"@"+t,Sn=t=>t.clone(),Cn=({skip:t=wn,key:e=Tn,resolver:n=Sn}={})=>{const s=new Map;return r=>(a,i)=>{if(t(a,i))return r(a,i);const o=e(a,i);if(!s.has(o))s.set(o,[]);else return new Promise((c,d)=>{s.get(o).push([c,d])});try{return r(a,i).then(c=>(s.get(o).forEach(([d])=>d(n(c))),s.delete(o),c)).catch(c=>{throw s.get(o).forEach(([,d])=>d(c)),s.delete(o),c})}catch(c){return s.delete(o),Promise.reject(c)}}},An=(t,e)=>t*e,On=t=>t&&(t.ok||t.status>=400&&t.status<500),Nn=({delayTimer:t=500,delayRamp:e=An,maxAttempts:n=10,until:s=On,onRetry:r=null,retryOnNetworkError:a=!1,resolveWithLatestResponse:i=!1,skip:o}={})=>c=>(d,p)=>{let b=0;if(o&&o(d,p))return c(d,p);const C=(w,j)=>Promise.resolve(s(w,j)).then(de=>de?w&&i?w:j?Promise.reject(j):w:(b++,!n||b<=n?new Promise(M=>{const W=e(t,b);setTimeout(()=>{typeof r=="function"?Promise.resolve(r({response:w,error:j,url:d,attempt:b,options:p})).then((D={})=>{var ee,G;M(c((ee=D&&D.url)!==null&&ee!==void 0?ee:d,(G=D&&D.options)!==null&&G!==void 0?G:p))}):M(c(d,p))},W)}).then(C).catch(M=>{if(!a)throw M;return C(null,M)}):w&&i?w:Promise.reject(j||new Error("Number of attempts exceeded."))));return c(d,p).then(C).catch(w=>{if(!a)throw w;return C(null,w)})},je=I({code:Qe(),message:g()}),En=I({message:g()}),Rn=I({emails:O(g()).optional(),http_body:g().optional(),http_url:g().optional(),txt_name:g().optional(),txt_value:g().optional()}),In=I({ciphers:O(g()).optional(),early_hints:g().optional(),http2:g().optional(),min_tls_version:g().optional(),tls_1_3:g().optional()}),jn=I({id:g(),bundle_method:g().optional(),certificate_authority:g(),custom_certificate:g().optional(),custom_csr_id:g().optional(),custom_key:g().optional(),expires_on:g().optional(),hosts:O(g()).optional(),issuer:g().optional(),method:g(),serial_number:g().optional(),settings:In.optional(),signature:g().optional(),type:g(),uploaded_on:g().optional(),validation_errors:O(En).optional(),validation_records:O(Rn).optional(),wildcard:Ce()}),Zn=I({name:g(),type:g(),value:g()}),$n=I({http_body:g().optional(),http_url:g().optional()}),dt=I({id:g(),ssl:jn,hostname:g(),custom_metadata:ct(g()).optional(),custom_origin_server:g().optional(),custom_origin_sni:g().optional(),ownership_verification:Zn.optional(),ownership_verification_http:$n.optional(),status:g(),verification_errors:O(g()).optional(),created_at:g()}),Be=I({errors:O(je),messages:O(je),success:Ce(),result:dt}),Pn=I({errors:O(je),messages:O(je),success:Ce(),result:O(dt)});function ne(t){return ft(`https://api.cloudflare.com/client/v4/zones/${t.zoneId}`).headers({"X-Auth-Email":t.authEmail,"X-Auth-Key":t.authKey,"Content-Type":"application/json"}).middlewares([Nn(),Cn()])}function Fe(t){const e=[];if(t.ssl.validation_records)for(const n of t.ssl.validation_records)n.txt_name&&n.txt_value&&e.push({name:"txt",record:n.txt_value,domain:n.txt_name});return t.ownership_verification&&e.push({name:"txt",record:t.ownership_verification.value,domain:t.ownership_verification.name}),{custom_domain_id:t.id,domain:t.hostname,primary:t.primary,status:t.status==="active"?"ready":"pending",type:"auth0_managed_certs",verification:{methods:O(lt.verificationMethodsSchema).parse(e)}}}function Mn(t){return{create:async(e,n)=>{const{result:s,errors:r,success:a}=Be.parse(await ne(t).post({hostname:n.domain,ssl:{method:"txt",type:"dv"},custom_metadata:t.enterprise?{tenant_id:e}:void 0},"/custom_hostnames").json());if(!a)throw new Error(JSON.stringify(r));const i=Fe({...s,primary:!1});return await t.customDomainAdapter.create(e,{custom_domain_id:i.custom_domain_id,domain:i.domain,type:i.type}),i},get:async(e,n)=>{const s=await t.customDomainAdapter.get(e,n);if(!s)throw new te(404);const r=await ne(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json(),{result:a,errors:i,success:o}=Be.parse(r);if(!o)throw new te(503,{message:JSON.stringify(i)});if(t.enterprise&&a.custom_metadata?.tenant_id!==e)throw new te(404);return Fe({...s,...a})},getByDomain:async e=>t.customDomainAdapter.getByDomain(e),list:async e=>{const n=await t.customDomainAdapter.list(e),s=await ne(t).get("/custom_hostnames").json(),{result:r,errors:a,success:i}=Pn.parse(s);if(!i)throw new te(503,{message:JSON.stringify(a)});return r.filter(o=>n.find(c=>c.custom_domain_id===o.id)).filter(o=>!(t.enterprise&&o.custom_metadata?.tenant_id!==e)).map(o=>Fe({...n.find(c=>c.custom_domain_id===o.id),...o}))},remove:async(e,n)=>{if(t.enterprise){const{result:r,success:a}=Be.parse(await ne(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json());if(!a||r.custom_metadata?.tenant_id!==e)throw new te(404)}const s=await ne(t).delete(`/custom_hostnames/${encodeURIComponent(n)}`).res();return s.ok&&await t.customDomainAdapter.remove(e,n),s.ok},update:async(e,n,s)=>{const r=await ne(t).patch(s,`/custom_hostnames/${encodeURIComponent(n)}`).res();if(!r.ok)throw new te(503,{message:await r.text()});return t.customDomainAdapter.update(e,n,s)}}}class Dn{constructor(e){this.config=e}cache=null;async getCache(){if(this.cache)return this.cache;if(typeof caches>"u")throw new Error("caches API is not available - CloudflareCache should only be used in Cloudflare Workers");return this.config.cacheName?this.cache=await caches.open(this.config.cacheName):this.cache=caches.default,this.cache}getKey(e){return this.config.keyPrefix?`${this.config.keyPrefix}:${e}`:e}createRequest(e){return new Request(`https://cache.internal/${this.getKey(e)}`)}async get(e){try{const n=await this.getCache(),s=this.createRequest(e),r=await n.match(s);if(!r)return null;const a=await r.json();return a.expiresAt&&new Date(a.expiresAt)<new Date?(await this.delete(e),null):a.value}catch(n){return console.error(`CloudflareCache: get error for key ${e}:`,n),null}}async set(e,n,s){try{const r=await this.getCache(),a=s??this.config.defaultTtlSeconds,i=a!==void 0,o=i?Math.max(0,a):0,c={value:n,expiresAt:i?new Date(Date.now()+(o>0?o*1e3:-1)).toISOString():void 0,cachedAt:new Date().toISOString()},d=this.createRequest(e),p={"Content-Type":"application/json"};i&&o>0&&(p["Cache-Control"]=`max-age=${o}`);const b=new Response(JSON.stringify(c),{headers:p});await r.put(d,b)}catch(r){console.error(`CloudflareCache: set error for key ${e}:`,r)}}async delete(e){try{const n=await this.getCache(),s=this.createRequest(e);return await n.delete(s)}catch(n){return console.error(`CloudflareCache: delete error for key ${e}:`,n),!1}}async clear(){console.warn("CloudflareCache.clear() is not implemented - Cloudflare Cache API does not support clearing all entries")}}function Ln(t={}){const e={defaultTtlSeconds:300,keyPrefix:"authhero",...t};return new Dn(e)}const Vn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Un=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Vn[n[t]&63];return e};async function Je(t,e){const n=t.timeout||3e4,s=new AbortController,r=setTimeout(()=>s.abort(),n);try{const a=`https://api.sql.cloudflarestorage.com/api/v1/accounts/${t.accountId}/r2-sql/query/${t.warehouseName}`,i=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.authToken}`},body:JSON.stringify({query:e}),signal:s.signal});if(!i.ok)throw new Error(`R2 SQL query failed: ${i.status} ${i.statusText}`);const o=await i.json();if(!o.success&&o.errors)throw new Error(`R2 SQL error: ${o.errors.join(", ")}`);return o.data||o.result?.data||[]}finally{clearTimeout(r)}}function Ze(t){return`'${t.replace(/'/g,"''")}'`}function z(t){return`"${t.replace(/"/g,'""')}"`}function ut(t){const e=n=>{if(!n)return"";try{return JSON.parse(n)}catch{return n}};return{type:t.type,date:t.date,description:t.description,ip:t.ip,user_agent:t.user_agent,details:e(t.details),isMobile:!!t.isMobile,user_id:t.user_id,user_name:t.user_name,connection:t.connection,connection_id:t.connection_id,client_id:t.client_id,client_name:t.client_name,audience:t.audience,scope:t.scope,strategy:t.strategy,strategy_type:t.strategy_type,hostname:t.hostname,auth0_client:e(t.auth0_client),log_id:t.id,location_info:t.country_code||t.country_code3||t.country_name||t.city_name||t.latitude||t.longitude||t.time_zone||t.continent_code?{country_code:t.country_code||"",country_code3:t.country_code3||"",country_name:t.country_name||"",city_name:t.city_name||"",latitude:t.latitude||"",longitude:t.longitude||"",time_zone:t.time_zone||"",continent_code:t.continent_code||""}:void 0}}function zn(t){return async(e,n)=>{if(console.log("createLog called with config:",t),t.baseAdapter){const a=await t.baseAdapter.create(e,n);return(t.pipelineEndpoint||t.pipelineBinding)&&tt(t,e,a).catch(i=>{console.error("Failed to send log to Pipeline:",i)}),a}const s=n.log_id||Un(),r={...n,log_id:s};return await tt(t,e,r),console.log("Log sent to Pipeline with ID:",s),r}}async function tt(t,e,n){const s=c=>c?JSON.stringify(c):void 0,r={id:n.log_id,tenant_id:e,type:n.type,date:n.date,description:n.description?.substring(0,256),ip:n.ip,user_agent:n.user_agent,details:s(n.details)?.substring(0,8192),isMobile:n.isMobile?1:0,user_id:n.user_id,user_name:n.user_name,connection:n.connection,connection_id:n.connection_id,client_id:n.client_id,client_name:n.client_name,audience:n.audience,scope:n.scope,strategy:n.strategy,strategy_type:n.strategy_type,hostname:n.hostname,auth0_client:s(n.auth0_client),log_id:n.log_id,country_code:n.location_info?.country_code,country_code3:n.location_info?.country_code3,country_name:n.location_info?.country_name,city_name:n.location_info?.city_name,latitude:n.location_info?.latitude,longitude:n.location_info?.longitude,time_zone:n.location_info?.time_zone,continent_code:n.location_info?.continent_code},a=t.timeout||3e4,i=new AbortController,o=setTimeout(()=>i.abort(),a);try{let c;if(t.pipelineBinding)c=await t.pipelineBinding.fetch("https://pipeline",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r]),signal:i.signal});else if(t.pipelineEndpoint)c=await fetch(t.pipelineEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r]),signal:i.signal});else throw new Error("Either pipelineEndpoint or pipelineBinding must be configured");if(!c.ok)throw new Error(`Pipeline ingestion failed: ${c.status} ${c.statusText}`)}finally{clearTimeout(o)}}function Bn(t){return async(e,n)=>{if(t.baseAdapter)return t.baseAdapter.get(e,n);const s=t.namespace||"default",r=t.tableName||"logs",a=`
1
+ "use strict";const lt=require("@authhero/adapter-interfaces"),ft=require("wretch");function ht(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]]);return n}function pt(t,e){var n;return((n=t?._def)===null||n===void 0?void 0:n.typeName)===e}function le(t,e){const n=t.ZodType.prototype[e];t.ZodType.prototype[e]=function(...s){const r=n.apply(this,s);return r._def.openapi=this._def.openapi,r}}function mt(t){if(typeof t.ZodType.prototype.openapi<"u")return;t.ZodType.prototype.openapi=function(r,a){var i,o,c,d,p,b;const C=typeof r=="string"?a:r,w=C??{},{param:j}=w,de=ht(w,["param"]),M=Object.assign(Object.assign({},(i=this._def.openapi)===null||i===void 0?void 0:i._internal),typeof r=="string"?{refId:r}:void 0),W=Object.assign(Object.assign(Object.assign({},(o=this._def.openapi)===null||o===void 0?void 0:o.metadata),de),!((d=(c=this._def.openapi)===null||c===void 0?void 0:c.metadata)===null||d===void 0)&&d.param||j?{param:Object.assign(Object.assign({},(b=(p=this._def.openapi)===null||p===void 0?void 0:p.metadata)===null||b===void 0?void 0:b.param),j)}:void 0),D=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(M).length>0?{_internal:M}:void 0),Object.keys(W).length>0?{metadata:W}:void 0)}));if(pt(this,"ZodObject")){const ee=this.extend;D.extend=function(...G){var J,ue,Pe,Me,De,Le,Ve;const Ue=ee.apply(this,G);return Ue._def.openapi={_internal:{extendedFrom:!((ue=(J=this._def.openapi)===null||J===void 0?void 0:J._internal)===null||ue===void 0)&&ue.refId?{refId:(Me=(Pe=this._def.openapi)===null||Pe===void 0?void 0:Pe._internal)===null||Me===void 0?void 0:Me.refId,schema:this}:(Le=(De=this._def.openapi)===null||De===void 0?void 0:De._internal)===null||Le===void 0?void 0:Le.extendedFrom},metadata:(Ve=Ue._def.openapi)===null||Ve===void 0?void 0:Ve.metadata},Ue}}return D},le(t,"optional"),le(t,"nullable"),le(t,"default"),le(t,"transform"),le(t,"refine");const e=t.ZodObject.prototype.deepPartial;t.ZodObject.prototype.deepPartial=function(){const r=this._def.shape(),a=e.apply(this),i=a._def.shape();return Object.entries(i).forEach(([o,c])=>{var d,p;c._def.openapi=(p=(d=r[o])===null||d===void 0?void 0:d._def)===null||p===void 0?void 0:p.openapi}),a._def.openapi=void 0,a};const n=t.ZodObject.prototype.pick;t.ZodObject.prototype.pick=function(...r){const a=n.apply(this,r);return a._def.openapi=void 0,a};const s=t.ZodObject.prototype.omit;t.ZodObject.prototype.omit=function(...r){const a=s.apply(this,r);return a._def.openapi=void 0,a}}var te=class extends Error{res;status;constructor(t=500,e){super(e?.message,{cause:e?.cause}),this.res=e?.res,this.status=t}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}};new Set(".\\+*[^]$()");var x;(function(t){t.assertEqual=r=>{};function e(r){}t.assertIs=e;function n(r){throw new Error}t.assertNever=n,t.arrayToEnum=r=>{const a={};for(const i of r)a[i]=i;return a},t.getValidEnumValues=r=>{const a=t.objectKeys(r).filter(o=>typeof r[r[o]]!="number"),i={};for(const o of a)i[o]=r[o];return t.objectValues(i)},t.objectValues=r=>t.objectKeys(r).map(function(a){return r[a]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const a=[];for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&a.push(i);return a},t.find=(r,a)=>{for(const i of r)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function s(r,a=" | "){return r.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(r,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var qe;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(qe||(qe={}));const f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),V=t=>{switch(typeof t){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(t)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(t)?f.array:t===null?f.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?f.promise:typeof Map<"u"&&t instanceof Map?f.map:typeof Set<"u"&&t instanceof Set?f.set:typeof Date<"u"&&t instanceof Date?f.date:f.object;default:return f.unknown}},u=x.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"]),yt=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class A extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},s={_errors:[]},r=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(r);else if(i.code==="invalid_return_type")r(i.returnTypeError);else if(i.code==="invalid_arguments")r(i.argumentsError);else if(i.path.length===0)s._errors.push(n(i));else{let o=s,c=0;for(;c<i.path.length;){const d=i.path[c];c===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(n(i))):o[d]=o[d]||{_errors:[]},o=o[d],c++}}};return r(this),s}static assert(e){if(!(e instanceof A))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},s=[];for(const r of this.issues)if(r.path.length>0){const a=r.path[0];n[a]=n[a]||[],n[a].push(e(r))}else s.push(e(r));return{formErrors:s,fieldErrors:n}}get formErrors(){return this.flatten()}}A.create=t=>new A(t);const ie=(t,e)=>{let n;switch(t.code){case u.invalid_type:t.received===f.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case u.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,x.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:n=`Unrecognized key(s) in object: ${x.joinValues(t.keys,", ")}`;break;case u.invalid_union:n="Invalid input";break;case u.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${x.joinValues(t.options)}`;break;case u.invalid_enum_value:n=`Invalid enum value. Expected ${x.joinValues(t.options)}, received '${t.received}'`;break;case u.invalid_arguments:n="Invalid function arguments";break;case u.invalid_return_type:n="Invalid function return type";break;case u.invalid_date:n="Invalid date";break;case u.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:x.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case u.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case u.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case u.custom:n="Invalid input";break;case u.invalid_intersection_types:n="Intersection results could not be merged";break;case u.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case u.not_finite:n="Number must be finite";break;default:n=e.defaultError,x.assertNever(t)}return{message:n}};let nt=ie;function _t(t){nt=t}function Ae(){return nt}const Oe=t=>{const{data:e,path:n,errorMaps:s,issueData:r}=t,a=[...n,...r.path||[]],i={...r,path:a};if(r.message!==void 0)return{...r,path:a,message:r.message};let o="";const c=s.filter(d=>!!d).slice().reverse();for(const d of c)o=d(i,{data:e,defaultError:o}).message;return{...r,path:a,message:o}},gt=[];function l(t,e){const n=Ae(),s=Oe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ie?void 0:ie].filter(r=>!!r)});t.common.issues.push(s)}class T{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const s=[];for(const r of n){if(r.status==="aborted")return m;r.status==="dirty"&&e.dirty(),s.push(r.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,n){const s=[];for(const r of n){const a=await r.key,i=await r.value;s.push({key:a,value:i})}return T.mergeObjectSync(e,s)}static mergeObjectSync(e,n){const s={};for(const r of n){const{key:a,value:i}=r;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||r.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}}const m=Object.freeze({status:"aborted"}),re=t=>({status:"dirty",value:t}),S=t=>({status:"valid",value:t}),He=t=>t.status==="aborted",We=t=>t.status==="dirty",Q=t=>t.status==="valid",fe=t=>typeof Promise<"u"&&t instanceof Promise;var h;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));class ${constructor(e,n,s,r){this._cachedPath=[],this.parent=e,this.data=n,this._path=s,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ye=(t,e)=>{if(Q(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new A(t.common.issues);return this._error=n,this._error}}};function _(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:s,description:r}=t;if(e&&(n||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>{const{message:c}=t;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??s??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??n??o.defaultError}},description:r}}class v{get description(){return this._def.description}_getType(e){return V(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:V(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(fe(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const s=this.safeParse(e,n);if(s.success)return s.data;throw s.error}safeParse(e,n){const s={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},r=this._parseSync({data:e,path:s.path,parent:s});return Ye(s,r)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:n});return Q(s)?{value:s.value}:{issues:n.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(s=>Q(s)?{value:s.value}:{issues:n.common.issues})}async parseAsync(e,n){const s=await this.safeParseAsync(e,n);if(s.success)return s.data;throw s.error}async safeParseAsync(e,n){const s={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:V(e)},r=this._parse({data:e,path:s.path,parent:s}),a=await(fe(r)?r:Promise.resolve(r));return Ye(s,a)}refine(e,n){const s=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,a)=>{const i=e(r),o=()=>a.addIssue({code:u.custom,...s(r)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,n){return this._refinement((s,r)=>e(s)?!0:(r.addIssue(typeof n=="function"?n(s,r):n),!1))}_refinement(e){return new R({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Z.create(this,this._def)}nullable(){return H.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return ce.create(this,this._def)}or(e){return ye.create([this,e],this._def)}and(e){return _e.create(this,e,this._def)}transform(e){return new R({..._(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ke({..._(this._def),innerType:this,defaultValue:n,typeName:y.ZodDefault})}brand(){return new Ke({typeName:y.ZodBranded,type:this,..._(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new we({..._(this._def),innerType:this,catchValue:n,typeName:y.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Se.create(this,e)}readonly(){return Te.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const vt=/^c[^\s-]{8,}$/i,xt=/^[0-9a-z]+$/,bt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kt=/^[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,wt=/^[a-z0-9_-]{21}$/i,Tt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,St=/^[-+]?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)?)??$/,Ct=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,At="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ze;const Ot=/^(?:(?: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])$/,Et=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Nt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Rt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,It=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,st="((\\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])))",Zt=new RegExp(`^${st}$`);function rt(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function $t(t){return new RegExp(`^${rt(t)}$`)}function at(t){let e=`${st}T${rt(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Pt(t,e){return!!((e==="v4"||!e)&&Ot.test(t)||(e==="v6"||!e)&&Nt.test(t))}function Mt(t,e){if(!Tt.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const s=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(s));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Dt(t,e){return!!((e==="v4"||!e)&&Et.test(t)||(e==="v6"||!e)&&Rt.test(t))}class E extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.string,received:a.parsedType}),m}const s=new T;let r;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(r=this._getOrReturnCtx(e,r),i?l(r,{code:u.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(r,{code:u.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")Ct.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"email",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")ze||(ze=new RegExp(At,"u")),ze.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"emoji",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")kt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"uuid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")wt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"nanoid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")vt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cuid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")xt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cuid2",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")bt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"ulid",code:u.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),l(r,{validation:"url",code:u.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"regex",code:u.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?at(a).test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?Zt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?$t(a).test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{code:u.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?St.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"duration",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Pt(e.data,a.version)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"ip",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Mt(e.data,a.alg)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"jwt",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Dt(e.data,a.version)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"cidr",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?It.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"base64",code:u.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?jt.test(e.data)||(r=this._getOrReturnCtx(e,r),l(r,{validation:"base64url",code:u.invalid_string,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_regex(e,n,s){return this.refinement(r=>e.test(r),{validation:n,code:u.invalid_string,...h.errToObj(s)})}_addCheck(e){return new E({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...h.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...h.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...h.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...h.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...h.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...h.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...h.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...h.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...h.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...h.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...h.errToObj(n)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new E({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new E({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}E.create=t=>new E({checks:[],typeName:y.ZodString,coerce:t?.coerce??!1,..._(t)});function Lt(t,e){const n=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,r=n>s?n:s,a=Number.parseInt(t.toFixed(r).replace(".","")),i=Number.parseInt(e.toFixed(r).replace(".",""));return a%i/10**r}class B extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.number,received:a.parsedType}),m}let s;const r=new T;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:u.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty()):a.kind==="multipleOf"?Lt(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:u.not_finite,message:a.message}),r.dirty()):x.assertNever(a);return{status:r.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,h.toString(n))}gt(e,n){return this.setLimit("min",e,!1,h.toString(n))}lte(e,n){return this.setLimit("max",e,!0,h.toString(n))}lt(e,n){return this.setLimit("max",e,!1,h.toString(n))}setLimit(e,n,s,r){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:h.toString(r)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(n===null||s.value>n)&&(n=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(n)&&Number.isFinite(e)}}B.create=t=>new B({checks:[],typeName:y.ZodNumber,coerce:t?.coerce||!1,..._(t)});class F extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let s;const r=new T;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),l(s,{code:u.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):x.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return l(n,{code:u.invalid_type,expected:f.bigint,received:n.parsedType}),m}gte(e,n){return this.setLimit("min",e,!0,h.toString(n))}gt(e,n){return this.setLimit("min",e,!1,h.toString(n))}lte(e,n){return this.setLimit("max",e,!0,h.toString(n))}lt(e,n){return this.setLimit("max",e,!1,h.toString(n))}setLimit(e,n,s,r){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:s,message:h.toString(r)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}F.create=t=>new F({checks:[],typeName:y.ZodBigInt,coerce:t?.coerce??!1,..._(t)});class he extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.boolean,received:s.parsedType}),m}return S(e.data)}}he.create=t=>new he({typeName:y.ZodBoolean,coerce:t?.coerce||!1,..._(t)});class Y extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.date,received:a.parsedType}),m}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_date}),m}const s=new T;let r;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(r=this._getOrReturnCtx(e,r),l(r,{code:u.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):x.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Y.create=t=>new Y({checks:[],coerce:t?.coerce||!1,typeName:y.ZodDate,..._(t)});class Ee extends v{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.symbol,received:s.parsedType}),m}return S(e.data)}}Ee.create=t=>new Ee({typeName:y.ZodSymbol,..._(t)});class pe extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.undefined,received:s.parsedType}),m}return S(e.data)}}pe.create=t=>new pe({typeName:y.ZodUndefined,..._(t)});class me extends v{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.null,received:s.parsedType}),m}return S(e.data)}}me.create=t=>new me({typeName:y.ZodNull,..._(t)});class oe extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}oe.create=t=>new oe({typeName:y.ZodAny,..._(t)});class K extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}K.create=t=>new K({typeName:y.ZodUnknown,..._(t)});class U extends v{_parse(e){const n=this._getOrReturnCtx(e);return l(n,{code:u.invalid_type,expected:f.never,received:n.parsedType}),m}}U.create=t=>new U({typeName:y.ZodNever,..._(t)});class Ne extends v{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.void,received:s.parsedType}),m}return S(e.data)}}Ne.create=t=>new Ne({typeName:y.ZodVoid,..._(t)});class N extends v{_parse(e){const{ctx:n,status:s}=this._processInputParams(e),r=this._def;if(n.parsedType!==f.array)return l(n,{code:u.invalid_type,expected:f.array,received:n.parsedType}),m;if(r.exactLength!==null){const i=n.data.length>r.exactLength.value,o=n.data.length<r.exactLength.value;(i||o)&&(l(n,{code:i?u.too_big:u.too_small,minimum:o?r.exactLength.value:void 0,maximum:i?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(l(n,{code:u.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(l(n,{code:u.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),n.common.async)return Promise.all([...n.data].map((i,o)=>r.type._parseAsync(new $(n,i,n.path,o)))).then(i=>T.mergeArray(s,i));const a=[...n.data].map((i,o)=>r.type._parseSync(new $(n,i,n.path,o)));return T.mergeArray(s,a)}get element(){return this._def.type}min(e,n){return new N({...this._def,minLength:{value:e,message:h.toString(n)}})}max(e,n){return new N({...this._def,maxLength:{value:e,message:h.toString(n)}})}length(e,n){return new N({...this._def,exactLength:{value:e,message:h.toString(n)}})}nonempty(e){return this.min(1,e)}}N.create=(t,e)=>new N({type:t,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,..._(e)});function se(t){if(t instanceof k){const e={};for(const n in t.shape){const s=t.shape[n];e[n]=Z.create(se(s))}return new k({...t._def,shape:()=>e})}else return t instanceof N?new N({...t._def,type:se(t.element)}):t instanceof Z?Z.create(se(t.unwrap())):t instanceof H?H.create(se(t.unwrap())):t instanceof P?P.create(t.items.map(e=>se(e))):t}class k extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=x.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==f.object){const d=this._getOrReturnCtx(e);return l(d,{code:u.invalid_type,expected:f.object,received:d.parsedType}),m}const{status:s,ctx:r}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof U&&this._def.unknownKeys==="strip"))for(const d in r.data)i.includes(d)||o.push(d);const c=[];for(const d of i){const p=a[d],b=r.data[d];c.push({key:{status:"valid",value:d},value:p._parse(new $(r,b,r.path,d)),alwaysSet:d in r.data})}if(this._def.catchall instanceof U){const d=this._def.unknownKeys;if(d==="passthrough")for(const p of o)c.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(d==="strict")o.length>0&&(l(r,{code:u.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const p of o){const b=r.data[p];c.push({key:{status:"valid",value:p},value:d._parse(new $(r,b,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const d=[];for(const p of c){const b=await p.key,C=await p.value;d.push({key:b,value:C,alwaysSet:p.alwaysSet})}return d}).then(d=>T.mergeObjectSync(s,d)):T.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new k({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,s)=>{const r=this._def.errorMap?.(n,s).message??s.defaultError;return n.code==="unrecognized_keys"?{message:h.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(e){return new k({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new k({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new k({...this._def,catchall:e})}pick(e){const n={};for(const s of x.objectKeys(e))e[s]&&this.shape[s]&&(n[s]=this.shape[s]);return new k({...this._def,shape:()=>n})}omit(e){const n={};for(const s of x.objectKeys(this.shape))e[s]||(n[s]=this.shape[s]);return new k({...this._def,shape:()=>n})}deepPartial(){return se(this)}partial(e){const n={};for(const s of x.objectKeys(this.shape)){const r=this.shape[s];e&&!e[s]?n[s]=r:n[s]=r.optional()}return new k({...this._def,shape:()=>n})}required(e){const n={};for(const s of x.objectKeys(this.shape))if(e&&!e[s])n[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof Z;)a=a._def.innerType;n[s]=a}return new k({...this._def,shape:()=>n})}keyof(){return it(x.objectKeys(this.shape))}}k.create=(t,e)=>new k({shape:()=>t,unknownKeys:"strip",catchall:U.create(),typeName:y.ZodObject,..._(e)});k.strictCreate=(t,e)=>new k({shape:()=>t,unknownKeys:"strict",catchall:U.create(),typeName:y.ZodObject,..._(e)});k.lazycreate=(t,e)=>new k({shape:t,unknownKeys:"strip",catchall:U.create(),typeName:y.ZodObject,..._(e)});class ye extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=this._def.options;function r(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new A(o.ctx.common.issues));return l(n,{code:u.invalid_union,unionErrors:i}),m}if(n.common.async)return Promise.all(s.map(async a=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(r);{let a;const i=[];for(const c of s){const d={...n,common:{...n.common,issues:[]},parent:null},p=c._parseSync({data:n.data,path:n.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(c=>new A(c));return l(n,{code:u.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}}ye.create=(t,e)=>new ye({options:t,typeName:y.ZodUnion,..._(e)});const L=t=>t instanceof ve?L(t.schema):t instanceof R?L(t.innerType()):t instanceof xe?[t.value]:t instanceof q?t.options:t instanceof be?x.objectValues(t.enum):t instanceof ke?L(t._def.innerType):t instanceof pe?[void 0]:t instanceof me?[null]:t instanceof Z?[void 0,...L(t.unwrap())]:t instanceof H?[null,...L(t.unwrap())]:t instanceof Ke||t instanceof Te?L(t.unwrap()):t instanceof we?L(t._def.innerType):[];class $e extends v{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return l(n,{code:u.invalid_type,expected:f.object,received:n.parsedType}),m;const s=this.discriminator,r=n.data[s],a=this.optionsMap.get(r);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}):(l(n,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,s){const r=new Map;for(const a of n){const i=L(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,a)}}return new $e({typeName:y.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:r,..._(s)})}}function Ge(t,e){const n=V(t),s=V(e);if(t===e)return{valid:!0,data:t};if(n===f.object&&s===f.object){const r=x.objectKeys(e),a=x.objectKeys(t).filter(o=>r.indexOf(o)!==-1),i={...t,...e};for(const o of a){const c=Ge(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(n===f.array&&s===f.array){if(t.length!==e.length)return{valid:!1};const r=[];for(let a=0;a<t.length;a++){const i=t[a],o=e[a],c=Ge(i,o);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===f.date&&s===f.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _e extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e),r=(a,i)=>{if(He(a)||He(i))return m;const o=Ge(a.value,i.value);return o.valid?((We(a)||We(i))&&n.dirty(),{status:n.value,value:o.data}):(l(s,{code:u.invalid_intersection_types}),m)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>r(a,i)):r(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}_e.create=(t,e,n)=>new _e({left:t,right:e,typeName:y.ZodIntersection,..._(n)});class P extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return l(s,{code:u.invalid_type,expected:f.array,received:s.parsedType}),m;if(s.data.length<this._def.items.length)return l(s,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&s.data.length>this._def.items.length&&(l(s,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...s.data].map((i,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new $(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>T.mergeArray(n,i)):T.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new P({...this._def,rest:e})}}P.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new P({items:t,typeName:y.ZodTuple,rest:null,..._(e)})};class ge extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return l(s,{code:u.invalid_type,expected:f.object,received:s.parsedType}),m;const r=[],a=this._def.keyType,i=this._def.valueType;for(const o in s.data)r.push({key:a._parse(new $(s,o,s.path,o)),value:i._parse(new $(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?T.mergeObjectAsync(n,r):T.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(e,n,s){return n instanceof v?new ge({keyType:e,valueType:n,typeName:y.ZodRecord,..._(s)}):new ge({keyType:E.create(),valueType:e,typeName:y.ZodRecord,..._(n)})}}class Re extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return l(s,{code:u.invalid_type,expected:f.map,received:s.parsedType}),m;const r=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,c],d)=>({key:r._parse(new $(s,o,s.path,[d,"key"])),value:a._parse(new $(s,c,s.path,[d,"value"]))}));if(s.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of i){const d=await c.key,p=await c.value;if(d.status==="aborted"||p.status==="aborted")return m;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),o.set(d.value,p.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const c of i){const d=c.key,p=c.value;if(d.status==="aborted"||p.status==="aborted")return m;(d.status==="dirty"||p.status==="dirty")&&n.dirty(),o.set(d.value,p.value)}return{status:n.value,value:o}}}}Re.create=(t,e,n)=>new Re({valueType:e,keyType:t,typeName:y.ZodMap,..._(n)});class X extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return l(s,{code:u.invalid_type,expected:f.set,received:s.parsedType}),m;const r=this._def;r.minSize!==null&&s.data.size<r.minSize.value&&(l(s,{code:u.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&s.data.size>r.maxSize.value&&(l(s,{code:u.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());const a=this._def.valueType;function i(c){const d=new Set;for(const p of c){if(p.status==="aborted")return m;p.status==="dirty"&&n.dirty(),d.add(p.value)}return{status:n.value,value:d}}const o=[...s.data.values()].map((c,d)=>a._parse(new $(s,c,s.path,d)));return s.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,n){return new X({...this._def,minSize:{value:e,message:h.toString(n)}})}max(e,n){return new X({...this._def,maxSize:{value:e,message:h.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}X.create=(t,e)=>new X({valueType:t,minSize:null,maxSize:null,typeName:y.ZodSet,..._(e)});class ae extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==f.function)return l(n,{code:u.invalid_type,expected:f.function,received:n.parsedType}),m;function s(o,c){return Oe({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ae(),ie].filter(d=>!!d),issueData:{code:u.invalid_arguments,argumentsError:c}})}function r(o,c){return Oe({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ae(),ie].filter(d=>!!d),issueData:{code:u.invalid_return_type,returnTypeError:c}})}const a={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof ce){const o=this;return S(async function(...c){const d=new A([]),p=await o._def.args.parseAsync(c,a).catch(w=>{throw d.addIssue(s(c,w)),d}),b=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(b,a).catch(w=>{throw d.addIssue(r(b,w)),d})})}else{const o=this;return S(function(...c){const d=o._def.args.safeParse(c,a);if(!d.success)throw new A([s(c,d.error)]);const p=Reflect.apply(i,this,d.data),b=o._def.returns.safeParse(p,a);if(!b.success)throw new A([r(p,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ae({...this._def,args:P.create(e).rest(K.create())})}returns(e){return new ae({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,s){return new ae({args:e||P.create([]).rest(K.create()),returns:n||K.create(),typeName:y.ZodFunction,..._(s)})}}class ve extends v{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}ve.create=(t,e)=>new ve({getter:t,typeName:y.ZodLazy,..._(e)});class xe extends v{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return l(n,{received:n.data,code:u.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}xe.create=(t,e)=>new xe({value:t,typeName:y.ZodLiteral,..._(e)});function it(t,e){return new q({values:t,typeName:y.ZodEnum,..._(e)})}class q extends v{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),s=this._def.values;return l(n,{expected:x.joinValues(s),received:n.parsedType,code:u.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),s=this._def.values;return l(n,{received:n.data,code:u.invalid_enum_value,options:s}),m}return S(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return q.create(e,{...this._def,...n})}exclude(e,n=this._def){return q.create(this.options.filter(s=>!e.includes(s)),{...this._def,...n})}}q.create=it;class be extends v{_parse(e){const n=x.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const r=x.objectValues(n);return l(s,{expected:x.joinValues(r),received:s.parsedType,code:u.invalid_type}),m}if(this._cache||(this._cache=new Set(x.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=x.objectValues(n);return l(s,{received:s.data,code:u.invalid_enum_value,options:r}),m}return S(e.data)}get enum(){return this._def.values}}be.create=(t,e)=>new be({values:t,typeName:y.ZodNativeEnum,..._(e)});class ce extends v{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==f.promise&&n.common.async===!1)return l(n,{code:u.invalid_type,expected:f.promise,received:n.parsedType}),m;const s=n.parsedType===f.promise?n.data:Promise.resolve(n.data);return S(s.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ce.create=(t,e)=>new ce({type:t,typeName:y.ZodPromise,..._(e)});class R extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:s}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:i=>{l(s,i),i.fatal?n.abort():n.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),r.type==="preprocess"){const i=r.transform(s.data,a);if(s.common.async)return Promise.resolve(i).then(async o=>{if(n.value==="aborted")return m;const c=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return c.status==="aborted"?m:c.status==="dirty"||n.value==="dirty"?re(c.value):c});{if(n.value==="aborted")return m;const o=this._def.schema._parseSync({data:i,path:s.path,parent:s});return o.status==="aborted"?m:o.status==="dirty"||n.value==="dirty"?re(o.value):o}}if(r.type==="refinement"){const i=o=>{const c=r.refinement(o,a);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?m:(o.status==="dirty"&&n.dirty(),i(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&n.dirty(),i(o.value).then(()=>({status:n.value,value:o.value}))))}if(r.type==="transform")if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Q(i))return m;const o=r.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>Q(i)?Promise.resolve(r.transform(i.value,a)).then(o=>({status:n.value,value:o})):m);x.assertNever(r)}}R.create=(t,e,n)=>new R({schema:t,typeName:y.ZodEffects,effect:e,..._(n)});R.createWithPreprocess=(t,e,n)=>new R({schema:e,effect:{type:"preprocess",transform:t},typeName:y.ZodEffects,..._(n)});class Z extends v{_parse(e){return this._getType(e)===f.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Z.create=(t,e)=>new Z({innerType:t,typeName:y.ZodOptional,..._(e)});class H extends v{_parse(e){return this._getType(e)===f.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}H.create=(t,e)=>new H({innerType:t,typeName:y.ZodNullable,..._(e)});class ke extends v{_parse(e){const{ctx:n}=this._processInputParams(e);let s=n.data;return n.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ke.create=(t,e)=>new ke({innerType:t,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class we extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return fe(r)?r.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new A(s.common.issues)},input:s.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new A(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}we.create=(t,e)=>new we({innerType:t,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Ie extends v{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.nan,received:s.parsedType}),m}return{status:"valid",value:e.data}}}Ie.create=t=>new Ie({typeName:y.ZodNaN,..._(t)});const Vt=Symbol("zod_brand");class Ke extends v{_parse(e){const{ctx:n}=this._processInputParams(e),s=n.data;return this._def.type._parse({data:s,path:n.path,parent:n})}unwrap(){return this._def.type}}class Se extends v{_parse(e){const{status:n,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?m:a.status==="dirty"?(n.dirty(),re(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const r=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return r.status==="aborted"?m:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:s.path,parent:s})}}static create(e,n){return new Se({in:e,out:n,typeName:y.ZodPipeline})}}class Te extends v{_parse(e){const n=this._def.innerType._parse(e),s=r=>(Q(r)&&(r.value=Object.freeze(r.value)),r);return fe(n)?n.then(r=>s(r)):s(n)}unwrap(){return this._def.innerType}}Te.create=(t,e)=>new Te({innerType:t,typeName:y.ZodReadonly,..._(e)});function Xe(t,e){const n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function ot(t,e={},n){return t?oe.create().superRefine((s,r)=>{const a=t(s);if(a instanceof Promise)return a.then(i=>{if(!i){const o=Xe(e,s),c=o.fatal??n??!0;r.addIssue({code:"custom",...o,fatal:c})}});if(!a){const i=Xe(e,s),o=i.fatal??n??!0;r.addIssue({code:"custom",...i,fatal:o})}}):oe.create()}const Ut={object:k.lazycreate};var y;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(y||(y={}));const zt=(t,e={message:`Input not instance of ${t.name}`})=>ot(n=>n instanceof t,e),g=E.create,Qe=B.create,Bt=Ie.create,Ft=F.create,Ce=he.create,qt=Y.create,Ht=Ee.create,Wt=pe.create,Gt=me.create,Jt=oe.create,Kt=K.create,Qt=U.create,Yt=Ne.create,O=N.create,I=k.create,Xt=k.strictCreate,en=ye.create,tn=$e.create,nn=_e.create,sn=P.create,ct=ge.create,rn=Re.create,an=X.create,on=ae.create,cn=ve.create,dn=xe.create,un=q.create,ln=be.create,fn=ce.create,et=R.create,hn=Z.create,pn=H.create,mn=R.createWithPreprocess,yn=Se.create,_n=()=>g().optional(),gn=()=>Qe().optional(),vn=()=>Ce().optional(),xn={string:(t=>E.create({...t,coerce:!0})),number:(t=>B.create({...t,coerce:!0})),boolean:(t=>he.create({...t,coerce:!0})),bigint:(t=>F.create({...t,coerce:!0})),date:(t=>Y.create({...t,coerce:!0}))},bn=m,kn=Object.freeze(Object.defineProperty({__proto__:null,BRAND:Vt,DIRTY:re,EMPTY_PATH:gt,INVALID:m,NEVER:bn,OK:S,ParseStatus:T,Schema:v,ZodAny:oe,ZodArray:N,ZodBigInt:F,ZodBoolean:he,ZodBranded:Ke,ZodCatch:we,ZodDate:Y,ZodDefault:ke,ZodDiscriminatedUnion:$e,ZodEffects:R,ZodEnum:q,ZodError:A,get ZodFirstPartyTypeKind(){return y},ZodFunction:ae,ZodIntersection:_e,ZodIssueCode:u,ZodLazy:ve,ZodLiteral:xe,ZodMap:Re,ZodNaN:Ie,ZodNativeEnum:be,ZodNever:U,ZodNull:me,ZodNullable:H,ZodNumber:B,ZodObject:k,ZodOptional:Z,ZodParsedType:f,ZodPipeline:Se,ZodPromise:ce,ZodReadonly:Te,ZodRecord:ge,ZodSchema:v,ZodSet:X,ZodString:E,ZodSymbol:Ee,ZodTransformer:R,ZodTuple:P,ZodType:v,ZodUndefined:pe,ZodUnion:ye,ZodUnknown:K,ZodVoid:Ne,addIssueToContext:l,any:Jt,array:O,bigint:Ft,boolean:Ce,coerce:xn,custom:ot,date:qt,datetimeRegex:at,defaultErrorMap:ie,discriminatedUnion:tn,effect:et,enum:un,function:on,getErrorMap:Ae,getParsedType:V,instanceof:zt,intersection:nn,isAborted:He,isAsync:fe,isDirty:We,isValid:Q,late:Ut,lazy:cn,literal:dn,makeIssue:Oe,map:rn,nan:Bt,nativeEnum:ln,never:Qt,null:Gt,nullable:pn,number:Qe,object:I,get objectUtil(){return qe},oboolean:vn,onumber:gn,optional:hn,ostring:_n,pipeline:yn,preprocess:mn,promise:fn,quotelessJson:yt,record:ct,set:an,setErrorMap:_t,strictObject:Xt,string:g,symbol:Ht,transformer:et,tuple:sn,undefined:Wt,union:en,unknown:Kt,get util(){return x},void:Yt},Symbol.toStringTag,{value:"Module"}));mt(kn);const wn=(t,e)=>e.skipDedupe||e.method!=="GET",Tn=(t,e)=>e.method+"@"+t,Sn=t=>t.clone(),Cn=({skip:t=wn,key:e=Tn,resolver:n=Sn}={})=>{const s=new Map;return r=>(a,i)=>{if(t(a,i))return r(a,i);const o=e(a,i);if(!s.has(o))s.set(o,[]);else return new Promise((c,d)=>{s.get(o).push([c,d])});try{return r(a,i).then(c=>(s.get(o).forEach(([d])=>d(n(c))),s.delete(o),c)).catch(c=>{throw s.get(o).forEach(([,d])=>d(c)),s.delete(o),c})}catch(c){return s.delete(o),Promise.reject(c)}}},An=(t,e)=>t*e,On=t=>t&&(t.ok||t.status>=400&&t.status<500),En=({delayTimer:t=500,delayRamp:e=An,maxAttempts:n=10,until:s=On,onRetry:r=null,retryOnNetworkError:a=!1,resolveWithLatestResponse:i=!1,skip:o}={})=>c=>(d,p)=>{let b=0;if(o&&o(d,p))return c(d,p);const C=(w,j)=>Promise.resolve(s(w,j)).then(de=>de?w&&i?w:j?Promise.reject(j):w:(b++,!n||b<=n?new Promise(M=>{const W=e(t,b);setTimeout(()=>{typeof r=="function"?Promise.resolve(r({response:w,error:j,url:d,attempt:b,options:p})).then((D={})=>{var ee,G;M(c((ee=D&&D.url)!==null&&ee!==void 0?ee:d,(G=D&&D.options)!==null&&G!==void 0?G:p))}):M(c(d,p))},W)}).then(C).catch(M=>{if(!a)throw M;return C(null,M)}):w&&i?w:Promise.reject(j||new Error("Number of attempts exceeded."))));return c(d,p).then(C).catch(w=>{if(!a)throw w;return C(null,w)})},je=I({code:Qe(),message:g()}),Nn=I({message:g()}),Rn=I({emails:O(g()).optional(),http_body:g().optional(),http_url:g().optional(),txt_name:g().optional(),txt_value:g().optional()}),In=I({ciphers:O(g()).optional(),early_hints:g().optional(),http2:g().optional(),min_tls_version:g().optional(),tls_1_3:g().optional()}),jn=I({id:g(),bundle_method:g().optional(),certificate_authority:g(),custom_certificate:g().optional(),custom_csr_id:g().optional(),custom_key:g().optional(),expires_on:g().optional(),hosts:O(g()).optional(),issuer:g().optional(),method:g(),serial_number:g().optional(),settings:In.optional(),signature:g().optional(),type:g(),uploaded_on:g().optional(),validation_errors:O(Nn).optional(),validation_records:O(Rn).optional(),wildcard:Ce()}),Zn=I({name:g(),type:g(),value:g()}),$n=I({http_body:g().optional(),http_url:g().optional()}),dt=I({id:g(),ssl:jn,hostname:g(),custom_metadata:ct(g()).optional(),custom_origin_server:g().optional(),custom_origin_sni:g().optional(),ownership_verification:Zn.optional(),ownership_verification_http:$n.optional(),status:g(),verification_errors:O(g()).optional(),created_at:g()}),Be=I({errors:O(je),messages:O(je),success:Ce(),result:dt}),Pn=I({errors:O(je),messages:O(je),success:Ce(),result:O(dt)});function ne(t){return ft(`https://api.cloudflare.com/client/v4/zones/${t.zoneId}`).headers({"X-Auth-Email":t.authEmail,"X-Auth-Key":t.authKey,"Content-Type":"application/json"}).middlewares([En(),Cn()])}function Fe(t){const e=[];if(t.ssl.validation_records)for(const n of t.ssl.validation_records)n.txt_name&&n.txt_value&&e.push({name:"txt",record:n.txt_value,domain:n.txt_name});return t.ownership_verification&&e.push({name:"txt",record:t.ownership_verification.value,domain:t.ownership_verification.name}),{custom_domain_id:t.id,domain:t.hostname,primary:t.primary,status:t.status==="active"?"ready":"pending",type:"auth0_managed_certs",verification:{methods:O(lt.verificationMethodsSchema).parse(e)}}}function Mn(t){return{create:async(e,n)=>{const{result:s,errors:r,success:a}=Be.parse(await ne(t).post({hostname:n.domain,ssl:{method:"txt",type:"dv"},custom_metadata:t.enterprise?{tenant_id:e}:void 0},"/custom_hostnames").json());if(!a)throw new Error(JSON.stringify(r));const i=Fe({...s,primary:!1});return await t.customDomainAdapter.create(e,{custom_domain_id:i.custom_domain_id,domain:i.domain,type:i.type}),i},get:async(e,n)=>{const s=await t.customDomainAdapter.get(e,n);if(!s)throw new te(404);const r=await ne(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json(),{result:a,errors:i,success:o}=Be.parse(r);if(!o)throw new te(503,{message:JSON.stringify(i)});if(t.enterprise&&a.custom_metadata?.tenant_id!==e)throw new te(404);return Fe({...s,...a})},getByDomain:async e=>t.customDomainAdapter.getByDomain(e),list:async e=>{const n=await t.customDomainAdapter.list(e),s=await ne(t).get("/custom_hostnames").json(),{result:r,errors:a,success:i}=Pn.parse(s);if(!i)throw new te(503,{message:JSON.stringify(a)});return r.filter(o=>n.find(c=>c.custom_domain_id===o.id)).filter(o=>!(t.enterprise&&o.custom_metadata?.tenant_id!==e)).map(o=>Fe({...n.find(c=>c.custom_domain_id===o.id),...o}))},remove:async(e,n)=>{if(t.enterprise){const{result:r,success:a}=Be.parse(await ne(t).get(`/custom_hostnames/${encodeURIComponent(n)}`).json());if(!a||r.custom_metadata?.tenant_id!==e)throw new te(404)}const s=await ne(t).delete(`/custom_hostnames/${encodeURIComponent(n)}`).res();return s.ok&&await t.customDomainAdapter.remove(e,n),s.ok},update:async(e,n,s)=>{const r=await ne(t).patch(s,`/custom_hostnames/${encodeURIComponent(n)}`).res();if(!r.ok)throw new te(503,{message:await r.text()});return t.customDomainAdapter.update(e,n,s)}}}class Dn{constructor(e){this.config=e}cache=null;async getCache(){if(this.cache)return this.cache;if(typeof caches>"u")throw new Error("caches API is not available - CloudflareCache should only be used in Cloudflare Workers");return this.config.cacheName?this.cache=await caches.open(this.config.cacheName):this.cache=caches.default,this.cache}getKey(e){return this.config.keyPrefix?`${this.config.keyPrefix}:${e}`:e}createRequest(e){return new Request(`https://cache.internal/${this.getKey(e)}`)}async get(e){try{const n=await this.getCache(),s=this.createRequest(e),r=await n.match(s);if(!r)return null;const a=await r.json();return a.expiresAt&&new Date(a.expiresAt)<new Date?(await this.delete(e),null):a.value}catch(n){return console.error(`CloudflareCache: get error for key ${e}:`,n),null}}async set(e,n,s){try{const r=await this.getCache(),a=s??this.config.defaultTtlSeconds,i=a!==void 0,o=i?Math.max(0,a):0,c={value:n,expiresAt:i?new Date(Date.now()+(o>0?o*1e3:-1)).toISOString():void 0,cachedAt:new Date().toISOString()},d=this.createRequest(e),p={"Content-Type":"application/json"};i&&o>0&&(p["Cache-Control"]=`max-age=${o}`);const b=new Response(JSON.stringify(c),{headers:p});await r.put(d,b)}catch(r){console.error(`CloudflareCache: set error for key ${e}:`,r)}}async delete(e){try{const n=await this.getCache(),s=this.createRequest(e);return await n.delete(s)}catch(n){return console.error(`CloudflareCache: delete error for key ${e}:`,n),!1}}async clear(){console.warn("CloudflareCache.clear() is not implemented - Cloudflare Cache API does not support clearing all entries")}}function Ln(t={}){const e={defaultTtlSeconds:300,keyPrefix:"authhero",...t};return new Dn(e)}const Vn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Un=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Vn[n[t]&63];return e};async function Je(t,e){const n=t.timeout||3e4,s=new AbortController,r=setTimeout(()=>s.abort(),n);try{const a=`https://api.sql.cloudflarestorage.com/api/v1/accounts/${t.accountId}/r2-sql/query/${t.warehouseName}`,i=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.authToken}`},body:JSON.stringify({query:e}),signal:s.signal});if(!i.ok)throw new Error(`R2 SQL query failed: ${i.status} ${i.statusText}`);const o=await i.json();if(!o.success&&o.errors)throw new Error(`R2 SQL error: ${o.errors.join(", ")}`);return o.data||o.result?.data||[]}finally{clearTimeout(r)}}function Ze(t){return`'${t.replace(/'/g,"''")}'`}function z(t){return`"${t.replace(/"/g,'""')}"`}function ut(t){const e=n=>{if(!n)return"";try{return JSON.parse(n)}catch{return n}};return{type:t.type,date:t.date,description:t.description,ip:t.ip,user_agent:t.user_agent,details:e(t.details),isMobile:!!t.isMobile,user_id:t.user_id,user_name:t.user_name,connection:t.connection,connection_id:t.connection_id,client_id:t.client_id,client_name:t.client_name,audience:t.audience,scope:t.scope,strategy:t.strategy,strategy_type:t.strategy_type,hostname:t.hostname,auth0_client:e(t.auth0_client),log_id:t.id,location_info:t.country_code||t.country_code3||t.country_name||t.city_name||t.latitude||t.longitude||t.time_zone||t.continent_code?{country_code:t.country_code||"",country_code3:t.country_code3||"",country_name:t.country_name||"",city_name:t.city_name||"",latitude:t.latitude||"",longitude:t.longitude||"",time_zone:t.time_zone||"",continent_code:t.continent_code||""}:void 0}}function zn(t){return async(e,n)=>{if(console.log("createLog called with config:",t),t.baseAdapter){const a=await t.baseAdapter.create(e,n);return(t.pipelineEndpoint||t.pipelineBinding)&&tt(t,e,a).catch(i=>{console.error("Failed to send log to Pipeline:",i)}),a}const s=n.log_id||Un(),r={...n,log_id:s};return await tt(t,e,r),console.log("Log sent to Pipeline with ID:",s),r}}async function tt(t,e,n){const s=a=>a?JSON.stringify(a):void 0,r={id:n.log_id,tenant_id:e,type:n.type,date:n.date,description:n.description?.substring(0,256),ip:n.ip,user_agent:n.user_agent,details:s(n.details)?.substring(0,8192),isMobile:n.isMobile?1:0,user_id:n.user_id,user_name:n.user_name,connection:n.connection,connection_id:n.connection_id,client_id:n.client_id,client_name:n.client_name,audience:n.audience,scope:n.scope,strategy:n.strategy,strategy_type:n.strategy_type,hostname:n.hostname,auth0_client:s(n.auth0_client),log_id:n.log_id,country_code:n.location_info?.country_code,country_code3:n.location_info?.country_code3,country_name:n.location_info?.country_name,city_name:n.location_info?.city_name,latitude:n.location_info?.latitude,longitude:n.location_info?.longitude,time_zone:n.location_info?.time_zone,continent_code:n.location_info?.continent_code};try{if(t.pipelineBinding)await t.pipelineBinding.send(r);else if(t.pipelineEndpoint){const a=t.timeout||3e4,i=new AbortController,o=setTimeout(()=>i.abort(),a);try{const c=await fetch(t.pipelineEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([r]),signal:i.signal});if(!c.ok)throw new Error(`Pipeline ingestion failed: ${c.status} ${c.statusText}`)}finally{clearTimeout(o)}}else throw new Error("Either pipelineEndpoint or pipelineBinding must be configured")}catch(a){throw console.error("Failed to send log to Pipeline:",a),a}}function Bn(t){return async(e,n)=>{if(t.baseAdapter)return t.baseAdapter.get(e,n);const s=t.namespace||"default",r=t.tableName||"logs",a=`
2
2
  SELECT * FROM ${z(s)}.${z(r)}
3
3
  WHERE tenant_id = ${Ze(e)}
4
4
  AND id = ${Ze(n)}
@@ -604,13 +604,13 @@ export interface R2SQLLogsAdapterConfig {
604
604
  */
605
605
  pipelineEndpoint?: string;
606
606
  /**
607
- * Cloudflare service binding for Pipeline (for Workers)
607
+ * Cloudflare Pipeline binding (for Workers)
608
608
  * Use this instead of pipelineEndpoint when running in a Worker
609
- * Must have a fetch() method or can be the Pipeline directly
610
- * Can be passed as env.AUTHHERO_LOGS_STREAM from wrangler.toml
609
+ * Pass the Pipeline object from env (e.g., env.AUTH_LOGS_STREAM)
610
+ * The Pipeline has a send() method for ingesting data
611
611
  */
612
612
  pipelineBinding?: {
613
- fetch: typeof fetch;
613
+ send: (data: any) => Promise<void>;
614
614
  };
615
615
  /**
616
616
  * Base logs adapter to wrap (passthrough mode)
@@ -24,8 +24,8 @@ function mt(t) {
24
24
  return;
25
25
  t.ZodType.prototype.openapi = function(r, a) {
26
26
  var i, o, c, d, p, b;
27
- const C = typeof r == "string" ? a : r, w = C ?? {}, { param: I } = w, de = ht(w, ["param"]), M = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), W = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), de), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || I ? {
28
- param: Object.assign(Object.assign({}, (b = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || b === void 0 ? void 0 : b.param), I)
27
+ const C = typeof r == "string" ? a : r, w = C ?? {}, { param: j } = w, de = ht(w, ["param"]), M = Object.assign(Object.assign({}, (i = this._def.openapi) === null || i === void 0 ? void 0 : i._internal), typeof r == "string" ? { refId: r } : void 0), W = Object.assign(Object.assign(Object.assign({}, (o = this._def.openapi) === null || o === void 0 ? void 0 : o.metadata), de), !((d = (c = this._def.openapi) === null || c === void 0 ? void 0 : c.metadata) === null || d === void 0) && d.param || j ? {
28
+ param: Object.assign(Object.assign({}, (b = (p = this._def.openapi) === null || p === void 0 ? void 0 : p.metadata) === null || b === void 0 ? void 0 : b.param), j)
29
29
  } : void 0), D = new this.constructor(Object.assign(Object.assign({}, this._def), { openapi: Object.assign(Object.assign({}, Object.keys(M).length > 0 ? { _internal: M } : void 0), Object.keys(W).length > 0 ? { metadata: W } : void 0) }));
30
30
  if (pt(this, "ZodObject")) {
31
31
  const ee = this.extend;
@@ -584,7 +584,7 @@ class v {
584
584
  return this.nullable().optional();
585
585
  }
586
586
  array() {
587
- return E.create(this);
587
+ return N.create(this);
588
588
  }
589
589
  promise() {
590
590
  return ce.create(this, this._def);
@@ -650,7 +650,7 @@ class v {
650
650
  }
651
651
  const vt = /^c[^\s-]{8,}$/i, xt = /^[0-9a-z]+$/, bt = /^[0-9A-HJKMNP-TV-Z]{26}$/i, kt = /^[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, wt = /^[a-z0-9_-]{21}$/i, Tt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, St = /^[-+]?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)?)??$/, Ct = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, At = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
652
652
  let ze;
653
- const Ot = /^(?:(?: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])$/, Nt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Et = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Rt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, jt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, It = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, st = "((\\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])))", Zt = new RegExp(`^${st}$`);
653
+ const Ot = /^(?:(?: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])$/, Et = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Nt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Rt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, It = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, jt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, st = "((\\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])))", Zt = new RegExp(`^${st}$`);
654
654
  function rt(t) {
655
655
  let e = "[0-5]\\d";
656
656
  t.precision ? e = `${e}\\.\\d{${t.precision}}` : t.precision == null && (e = `${e}(\\.\\d+)?`);
@@ -666,7 +666,7 @@ function at(t) {
666
666
  return n.push(t.local ? "Z?" : "Z"), t.offset && n.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${n.join("|")})`, new RegExp(`^${e}$`);
667
667
  }
668
668
  function Pt(t, e) {
669
- return !!((e === "v4" || !e) && Ot.test(t) || (e === "v6" || !e) && Et.test(t));
669
+ return !!((e === "v4" || !e) && Ot.test(t) || (e === "v6" || !e) && Nt.test(t));
670
670
  }
671
671
  function Mt(t, e) {
672
672
  if (!Tt.test(t))
@@ -682,9 +682,9 @@ function Mt(t, e) {
682
682
  }
683
683
  }
684
684
  function Dt(t, e) {
685
- return !!((e === "v4" || !e) && Nt.test(t) || (e === "v6" || !e) && Rt.test(t));
685
+ return !!((e === "v4" || !e) && Et.test(t) || (e === "v6" || !e) && Rt.test(t));
686
686
  }
687
- class N extends v {
687
+ class E extends v {
688
688
  _parse(e) {
689
689
  if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== f.string) {
690
690
  const a = this._getOrReturnCtx(e);
@@ -828,11 +828,11 @@ class N extends v {
828
828
  validation: "cidr",
829
829
  code: u.invalid_string,
830
830
  message: a.message
831
- }), s.dirty()) : a.kind === "base64" ? jt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
831
+ }), s.dirty()) : a.kind === "base64" ? It.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
832
832
  validation: "base64",
833
833
  code: u.invalid_string,
834
834
  message: a.message
835
- }), s.dirty()) : a.kind === "base64url" ? It.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
835
+ }), s.dirty()) : a.kind === "base64url" ? jt.test(e.data) || (r = this._getOrReturnCtx(e, r), l(r, {
836
836
  validation: "base64url",
837
837
  code: u.invalid_string,
838
838
  message: a.message
@@ -847,7 +847,7 @@ class N extends v {
847
847
  });
848
848
  }
849
849
  _addCheck(e) {
850
- return new N({
850
+ return new E({
851
851
  ...this._def,
852
852
  checks: [...this._def.checks, e]
853
853
  });
@@ -983,19 +983,19 @@ class N extends v {
983
983
  return this.min(1, h.errToObj(e));
984
984
  }
985
985
  trim() {
986
- return new N({
986
+ return new E({
987
987
  ...this._def,
988
988
  checks: [...this._def.checks, { kind: "trim" }]
989
989
  });
990
990
  }
991
991
  toLowerCase() {
992
- return new N({
992
+ return new E({
993
993
  ...this._def,
994
994
  checks: [...this._def.checks, { kind: "toLowerCase" }]
995
995
  });
996
996
  }
997
997
  toUpperCase() {
998
- return new N({
998
+ return new E({
999
999
  ...this._def,
1000
1000
  checks: [...this._def.checks, { kind: "toUpperCase" }]
1001
1001
  });
@@ -1061,7 +1061,7 @@ class N extends v {
1061
1061
  return e;
1062
1062
  }
1063
1063
  }
1064
- N.create = (t) => new N({
1064
+ E.create = (t) => new E({
1065
1065
  checks: [],
1066
1066
  typeName: y.ZodString,
1067
1067
  coerce: t?.coerce ?? !1,
@@ -1472,7 +1472,7 @@ Y.create = (t) => new Y({
1472
1472
  typeName: y.ZodDate,
1473
1473
  ..._(t)
1474
1474
  });
1475
- class Ne extends v {
1475
+ class Ee extends v {
1476
1476
  _parse(e) {
1477
1477
  if (this._getType(e) !== f.symbol) {
1478
1478
  const s = this._getOrReturnCtx(e);
@@ -1485,7 +1485,7 @@ class Ne extends v {
1485
1485
  return S(e.data);
1486
1486
  }
1487
1487
  }
1488
- Ne.create = (t) => new Ne({
1488
+ Ee.create = (t) => new Ee({
1489
1489
  typeName: y.ZodSymbol,
1490
1490
  ..._(t)
1491
1491
  });
@@ -1561,7 +1561,7 @@ U.create = (t) => new U({
1561
1561
  typeName: y.ZodNever,
1562
1562
  ..._(t)
1563
1563
  });
1564
- class Ee extends v {
1564
+ class Ne extends v {
1565
1565
  _parse(e) {
1566
1566
  if (this._getType(e) !== f.undefined) {
1567
1567
  const s = this._getOrReturnCtx(e);
@@ -1574,11 +1574,11 @@ class Ee extends v {
1574
1574
  return S(e.data);
1575
1575
  }
1576
1576
  }
1577
- Ee.create = (t) => new Ee({
1577
+ Ne.create = (t) => new Ne({
1578
1578
  typeName: y.ZodVoid,
1579
1579
  ..._(t)
1580
1580
  });
1581
- class E extends v {
1581
+ class N extends v {
1582
1582
  _parse(e) {
1583
1583
  const { ctx: n, status: s } = this._processInputParams(e), r = this._def;
1584
1584
  if (n.parsedType !== f.array)
@@ -1622,19 +1622,19 @@ class E extends v {
1622
1622
  return this._def.type;
1623
1623
  }
1624
1624
  min(e, n) {
1625
- return new E({
1625
+ return new N({
1626
1626
  ...this._def,
1627
1627
  minLength: { value: e, message: h.toString(n) }
1628
1628
  });
1629
1629
  }
1630
1630
  max(e, n) {
1631
- return new E({
1631
+ return new N({
1632
1632
  ...this._def,
1633
1633
  maxLength: { value: e, message: h.toString(n) }
1634
1634
  });
1635
1635
  }
1636
1636
  length(e, n) {
1637
- return new E({
1637
+ return new N({
1638
1638
  ...this._def,
1639
1639
  exactLength: { value: e, message: h.toString(n) }
1640
1640
  });
@@ -1643,7 +1643,7 @@ class E extends v {
1643
1643
  return this.min(1, e);
1644
1644
  }
1645
1645
  }
1646
- E.create = (t, e) => new E({
1646
+ N.create = (t, e) => new N({
1647
1647
  type: t,
1648
1648
  minLength: null,
1649
1649
  maxLength: null,
@@ -1662,7 +1662,7 @@ function se(t) {
1662
1662
  ...t._def,
1663
1663
  shape: () => e
1664
1664
  });
1665
- } else return t instanceof E ? new E({
1665
+ } else return t instanceof N ? new N({
1666
1666
  ...t._def,
1667
1667
  type: se(t.element)
1668
1668
  }) : t instanceof Z ? Z.create(se(t.unwrap())) : t instanceof H ? H.create(se(t.unwrap())) : t instanceof P ? P.create(t.items.map((e) => se(e))) : t;
@@ -2238,7 +2238,7 @@ class ge extends v {
2238
2238
  typeName: y.ZodRecord,
2239
2239
  ..._(s)
2240
2240
  }) : new ge({
2241
- keyType: N.create(),
2241
+ keyType: E.create(),
2242
2242
  valueType: e,
2243
2243
  typeName: y.ZodRecord,
2244
2244
  ..._(n)
@@ -2780,7 +2780,7 @@ we.create = (t, e) => new we({
2780
2780
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
2781
2781
  ..._(e)
2782
2782
  });
2783
- class je extends v {
2783
+ class Ie extends v {
2784
2784
  _parse(e) {
2785
2785
  if (this._getType(e) !== f.nan) {
2786
2786
  const s = this._getOrReturnCtx(e);
@@ -2793,7 +2793,7 @@ class je extends v {
2793
2793
  return { status: "valid", value: e.data };
2794
2794
  }
2795
2795
  }
2796
- je.create = (t) => new je({
2796
+ Ie.create = (t) => new Ie({
2797
2797
  typeName: y.ZodNaN,
2798
2798
  ..._(t)
2799
2799
  });
@@ -2894,8 +2894,8 @@ var y;
2894
2894
  })(y || (y = {}));
2895
2895
  const zt = (t, e = {
2896
2896
  message: `Input not instance of ${t.name}`
2897
- }) => ot((n) => n instanceof t, e), g = N.create, Qe = B.create, Bt = je.create, Ft = F.create, Ce = he.create, qt = Y.create, Ht = Ne.create, Wt = pe.create, Gt = me.create, Jt = oe.create, Kt = K.create, Qt = U.create, Yt = Ee.create, O = E.create, j = k.create, Xt = k.strictCreate, en = ye.create, tn = $e.create, nn = _e.create, sn = P.create, ct = ge.create, rn = Re.create, an = X.create, on = ae.create, cn = ve.create, dn = xe.create, un = q.create, ln = be.create, fn = ce.create, et = R.create, hn = Z.create, pn = H.create, mn = R.createWithPreprocess, yn = Se.create, _n = () => g().optional(), gn = () => Qe().optional(), vn = () => Ce().optional(), xn = {
2898
- string: ((t) => N.create({ ...t, coerce: !0 })),
2897
+ }) => ot((n) => n instanceof t, e), g = E.create, Qe = B.create, Bt = Ie.create, Ft = F.create, Ce = he.create, qt = Y.create, Ht = Ee.create, Wt = pe.create, Gt = me.create, Jt = oe.create, Kt = K.create, Qt = U.create, Yt = Ne.create, O = N.create, I = k.create, Xt = k.strictCreate, en = ye.create, tn = $e.create, nn = _e.create, sn = P.create, ct = ge.create, rn = Re.create, an = X.create, on = ae.create, cn = ve.create, dn = xe.create, un = q.create, ln = be.create, fn = ce.create, et = R.create, hn = Z.create, pn = H.create, mn = R.createWithPreprocess, yn = Se.create, _n = () => g().optional(), gn = () => Qe().optional(), vn = () => Ce().optional(), xn = {
2898
+ string: ((t) => E.create({ ...t, coerce: !0 })),
2899
2899
  number: ((t) => B.create({ ...t, coerce: !0 })),
2900
2900
  boolean: ((t) => he.create({
2901
2901
  ...t,
@@ -2914,7 +2914,7 @@ const zt = (t, e = {
2914
2914
  ParseStatus: T,
2915
2915
  Schema: v,
2916
2916
  ZodAny: oe,
2917
- ZodArray: E,
2917
+ ZodArray: N,
2918
2918
  ZodBigInt: F,
2919
2919
  ZodBoolean: he,
2920
2920
  ZodBranded: Ke,
@@ -2934,7 +2934,7 @@ const zt = (t, e = {
2934
2934
  ZodLazy: ve,
2935
2935
  ZodLiteral: xe,
2936
2936
  ZodMap: Re,
2937
- ZodNaN: je,
2937
+ ZodNaN: Ie,
2938
2938
  ZodNativeEnum: be,
2939
2939
  ZodNever: U,
2940
2940
  ZodNull: me,
@@ -2949,15 +2949,15 @@ const zt = (t, e = {
2949
2949
  ZodRecord: ge,
2950
2950
  ZodSchema: v,
2951
2951
  ZodSet: X,
2952
- ZodString: N,
2953
- ZodSymbol: Ne,
2952
+ ZodString: E,
2953
+ ZodSymbol: Ee,
2954
2954
  ZodTransformer: R,
2955
2955
  ZodTuple: P,
2956
2956
  ZodType: v,
2957
2957
  ZodUndefined: pe,
2958
2958
  ZodUnion: ye,
2959
2959
  ZodUnknown: K,
2960
- ZodVoid: Ee,
2960
+ ZodVoid: Ne,
2961
2961
  addIssueToContext: l,
2962
2962
  any: Jt,
2963
2963
  array: O,
@@ -2991,7 +2991,7 @@ const zt = (t, e = {
2991
2991
  null: Gt,
2992
2992
  nullable: pn,
2993
2993
  number: Qe,
2994
- object: j,
2994
+ object: I,
2995
2995
  get objectUtil() {
2996
2996
  return qe;
2997
2997
  },
@@ -3040,16 +3040,16 @@ const wn = (t, e) => e.skipDedupe || e.method !== "GET", Tn = (t, e) => e.method
3040
3040
  return s.delete(o), Promise.reject(c);
3041
3041
  }
3042
3042
  };
3043
- }, An = (t, e) => t * e, On = (t) => t && (t.ok || t.status >= 400 && t.status < 500), Nn = ({ delayTimer: t = 500, delayRamp: e = An, maxAttempts: n = 10, until: s = On, onRetry: r = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, p) => {
3043
+ }, An = (t, e) => t * e, On = (t) => t && (t.ok || t.status >= 400 && t.status < 500), En = ({ delayTimer: t = 500, delayRamp: e = An, maxAttempts: n = 10, until: s = On, onRetry: r = null, retryOnNetworkError: a = !1, resolveWithLatestResponse: i = !1, skip: o } = {}) => (c) => (d, p) => {
3044
3044
  let b = 0;
3045
3045
  if (o && o(d, p))
3046
3046
  return c(d, p);
3047
- const C = (w, I) => Promise.resolve(s(w, I)).then((de) => de ? w && i ? w : I ? Promise.reject(I) : w : (b++, !n || b <= n ? new Promise((M) => {
3047
+ const C = (w, j) => Promise.resolve(s(w, j)).then((de) => de ? w && i ? w : j ? Promise.reject(j) : w : (b++, !n || b <= n ? new Promise((M) => {
3048
3048
  const W = e(t, b);
3049
3049
  setTimeout(() => {
3050
3050
  typeof r == "function" ? Promise.resolve(r({
3051
3051
  response: w,
3052
- error: I,
3052
+ error: j,
3053
3053
  url: d,
3054
3054
  attempt: b,
3055
3055
  options: p
@@ -3062,30 +3062,30 @@ const wn = (t, e) => e.skipDedupe || e.method !== "GET", Tn = (t, e) => e.method
3062
3062
  if (!a)
3063
3063
  throw M;
3064
3064
  return C(null, M);
3065
- }) : w && i ? w : Promise.reject(I || new Error("Number of attempts exceeded."))));
3065
+ }) : w && i ? w : Promise.reject(j || new Error("Number of attempts exceeded."))));
3066
3066
  return c(d, p).then(C).catch((w) => {
3067
3067
  if (!a)
3068
3068
  throw w;
3069
3069
  return C(null, w);
3070
3070
  });
3071
- }, Ie = j({
3071
+ }, je = I({
3072
3072
  code: Qe(),
3073
3073
  message: g()
3074
- }), En = j({
3074
+ }), Nn = I({
3075
3075
  message: g()
3076
- }), Rn = j({
3076
+ }), Rn = I({
3077
3077
  emails: O(g()).optional(),
3078
3078
  http_body: g().optional(),
3079
3079
  http_url: g().optional(),
3080
3080
  txt_name: g().optional(),
3081
3081
  txt_value: g().optional()
3082
- }), jn = j({
3082
+ }), In = I({
3083
3083
  ciphers: O(g()).optional(),
3084
3084
  early_hints: g().optional(),
3085
3085
  http2: g().optional(),
3086
3086
  min_tls_version: g().optional(),
3087
3087
  tls_1_3: g().optional()
3088
- }), In = j({
3088
+ }), jn = I({
3089
3089
  id: g(),
3090
3090
  bundle_method: g().optional(),
3091
3091
  certificate_authority: g(),
@@ -3097,23 +3097,23 @@ const wn = (t, e) => e.skipDedupe || e.method !== "GET", Tn = (t, e) => e.method
3097
3097
  issuer: g().optional(),
3098
3098
  method: g(),
3099
3099
  serial_number: g().optional(),
3100
- settings: jn.optional(),
3100
+ settings: In.optional(),
3101
3101
  signature: g().optional(),
3102
3102
  type: g(),
3103
3103
  uploaded_on: g().optional(),
3104
- validation_errors: O(En).optional(),
3104
+ validation_errors: O(Nn).optional(),
3105
3105
  validation_records: O(Rn).optional(),
3106
3106
  wildcard: Ce()
3107
- }), Zn = j({
3107
+ }), Zn = I({
3108
3108
  name: g(),
3109
3109
  type: g(),
3110
3110
  value: g()
3111
- }), $n = j({
3111
+ }), $n = I({
3112
3112
  http_body: g().optional(),
3113
3113
  http_url: g().optional()
3114
- }), dt = j({
3114
+ }), dt = I({
3115
3115
  id: g(),
3116
- ssl: In,
3116
+ ssl: jn,
3117
3117
  hostname: g(),
3118
3118
  custom_metadata: ct(g()).optional(),
3119
3119
  custom_origin_server: g().optional(),
@@ -3123,14 +3123,14 @@ const wn = (t, e) => e.skipDedupe || e.method !== "GET", Tn = (t, e) => e.method
3123
3123
  status: g(),
3124
3124
  verification_errors: O(g()).optional(),
3125
3125
  created_at: g()
3126
- }), Be = j({
3127
- errors: O(Ie),
3128
- messages: O(Ie),
3126
+ }), Be = I({
3127
+ errors: O(je),
3128
+ messages: O(je),
3129
3129
  success: Ce(),
3130
3130
  result: dt
3131
- }), Pn = j({
3132
- errors: O(Ie),
3133
- messages: O(Ie),
3131
+ }), Pn = I({
3132
+ errors: O(je),
3133
+ messages: O(je),
3134
3134
  success: Ce(),
3135
3135
  result: O(dt)
3136
3136
  });
@@ -3139,7 +3139,7 @@ function ne(t) {
3139
3139
  "X-Auth-Email": t.authEmail,
3140
3140
  "X-Auth-Key": t.authKey,
3141
3141
  "Content-Type": "application/json"
3142
- }).middlewares([Nn(), Cn()]);
3142
+ }).middlewares([En(), Cn()]);
3143
3143
  }
3144
3144
  function Fe(t) {
3145
3145
  const e = [];
@@ -3431,7 +3431,7 @@ function zn(t) {
3431
3431
  };
3432
3432
  }
3433
3433
  async function tt(t, e, n) {
3434
- const s = (c) => c ? JSON.stringify(c) : void 0, r = {
3434
+ const s = (a) => a ? JSON.stringify(a) : void 0, r = {
3435
3435
  id: n.log_id,
3436
3436
  tenant_id: e,
3437
3437
  type: n.type,
@@ -3463,39 +3463,35 @@ async function tt(t, e, n) {
3463
3463
  longitude: n.location_info?.longitude,
3464
3464
  time_zone: n.location_info?.time_zone,
3465
3465
  continent_code: n.location_info?.continent_code
3466
- }, a = t.timeout || 3e4, i = new AbortController(), o = setTimeout(() => i.abort(), a);
3466
+ };
3467
3467
  try {
3468
- let c;
3469
3468
  if (t.pipelineBinding)
3470
- c = await t.pipelineBinding.fetch("https://pipeline", {
3471
- method: "POST",
3472
- headers: {
3473
- "Content-Type": "application/json"
3474
- },
3475
- body: JSON.stringify([r]),
3476
- // Pipelines accept array of records
3477
- signal: i.signal
3478
- });
3479
- else if (t.pipelineEndpoint)
3480
- c = await fetch(t.pipelineEndpoint, {
3481
- method: "POST",
3482
- headers: {
3483
- "Content-Type": "application/json"
3484
- },
3485
- body: JSON.stringify([r]),
3486
- // Pipelines accept array of records
3487
- signal: i.signal
3488
- });
3489
- else
3469
+ await t.pipelineBinding.send(r);
3470
+ else if (t.pipelineEndpoint) {
3471
+ const a = t.timeout || 3e4, i = new AbortController(), o = setTimeout(() => i.abort(), a);
3472
+ try {
3473
+ const c = await fetch(t.pipelineEndpoint, {
3474
+ method: "POST",
3475
+ headers: {
3476
+ "Content-Type": "application/json"
3477
+ },
3478
+ body: JSON.stringify([r]),
3479
+ // Pipelines accept array of records
3480
+ signal: i.signal
3481
+ });
3482
+ if (!c.ok)
3483
+ throw new Error(
3484
+ `Pipeline ingestion failed: ${c.status} ${c.statusText}`
3485
+ );
3486
+ } finally {
3487
+ clearTimeout(o);
3488
+ }
3489
+ } else
3490
3490
  throw new Error(
3491
3491
  "Either pipelineEndpoint or pipelineBinding must be configured"
3492
3492
  );
3493
- if (!c.ok)
3494
- throw new Error(
3495
- `Pipeline ingestion failed: ${c.status} ${c.statusText}`
3496
- );
3497
- } finally {
3498
- clearTimeout(o);
3493
+ } catch (a) {
3494
+ throw console.error("Failed to send log to Pipeline:", a), a;
3499
3495
  }
3500
3496
  }
3501
3497
  function Bn(t) {
@@ -3548,11 +3544,11 @@ function Hn(t) {
3548
3544
  const J = i.sort_by.replace(/[^a-zA-Z0-9_]/g, ""), ue = i.sort_order === "asc" ? "ASC" : "DESC";
3549
3545
  C = `ORDER BY ${z(J)} ${ue}`;
3550
3546
  }
3551
- const w = s * r, I = `LIMIT ${r} OFFSET ${w}`, de = `
3547
+ const w = s * r, j = `LIMIT ${r} OFFSET ${w}`, de = `
3552
3548
  SELECT * FROM ${z(c)}.${z(d)}
3553
3549
  WHERE ${b}
3554
3550
  ${C}
3555
- ${I}
3551
+ ${j}
3556
3552
  `, W = (await Je(t, de)).map(ut);
3557
3553
  if (!a)
3558
3554
  return {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "type": "git",
12
12
  "url": "https://github.com/markusahlstrand/authhero"
13
13
  },
14
- "version": "2.10.0",
14
+ "version": "2.11.1",
15
15
  "files": [
16
16
  "dist"
17
17
  ],
@@ -46,8 +46,8 @@
46
46
  "dependencies": {
47
47
  "nanoid": "^5.1.6",
48
48
  "wretch": "^3.0.2",
49
- "@authhero/adapter-interfaces": "^0.100.0",
50
- "@authhero/kysely-adapter": "^10.57.0"
49
+ "@authhero/adapter-interfaces": "^0.101.0",
50
+ "@authhero/kysely-adapter": "^10.58.0"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",