@authhero/widget 0.28.2 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authhero-widget/authhero-widget.esm.js +1 -1
- package/dist/authhero-widget/index.esm.js +1 -1
- package/dist/authhero-widget/p-5428e2e1.entry.js +1 -0
- package/dist/cjs/authhero-widget.cjs.entry.js +206 -3
- package/dist/cjs/index.cjs.js +23 -5
- package/dist/collection/components/authhero-widget/authhero-widget.js +206 -3
- package/dist/components/authhero-widget.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/esm/authhero-widget.entry.js +206 -3
- package/dist/esm/index.js +23 -5
- package/dist/types/components/authhero-widget/authhero-widget.d.ts +22 -0
- package/hydrate/index.js +206 -3
- package/hydrate/index.mjs +206 -3
- package/package.json +1 -1
- package/dist/authhero-widget/p-b9ae0275.entry.js +0 -1
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-DpfoRsj0.js";function e(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),i}var t={};function i(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i}function n(e,t){var i;return(null===(i=null==e?void 0:e._def)||void 0===i?void 0:i.typeName)===t}function o(e,t){const i=e.ZodType.prototype[t];e.ZodType.prototype[t]=function(...e){const t=i.apply(this,e);return t._def.openapi=this._def.openapi,t}}function c(e){if(void 0!==e.ZodType.prototype.openapi)return;e.ZodType.prototype.openapi=function(e,t){var s,r,o,a,c,u;const d="string"==typeof e?t:e,l=null!=d?d:{},{param:h}=l,_=i(l,["param"]),p=Object.assign(Object.assign({},null===(s=this._def.openapi)||void 0===s?void 0:s._internal),"string"==typeof e?{refId:e}:void 0),f=Object.assign(Object.assign(Object.assign({},null===(r=this._def.openapi)||void 0===r?void 0:r.metadata),_),(null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.param)||h?{param:Object.assign(Object.assign({},null===(u=null===(c=this._def.openapi)||void 0===c?void 0:c.metadata)||void 0===u?void 0:u.param),h)}:void 0),m=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(p).length>0?{_internal:p}:void 0),Object.keys(f).length>0?{metadata:f}:void 0)}));if(n(this,"ZodObject")){const e=this.extend;m.extend=function(...t){var i,n,s,r,o,a,c;const u=e.apply(this,t);return u._def.openapi={_internal:{extendedFrom:(null===(n=null===(i=this._def.openapi)||void 0===i?void 0:i._internal)||void 0===n?void 0:n.refId)?{refId:null===(r=null===(s=this._def.openapi)||void 0===s?void 0:s._internal)||void 0===r?void 0:r.refId,schema:this}:null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o._internal)||void 0===a?void 0:a.extendedFrom},metadata:null===(c=u._def.openapi)||void 0===c?void 0:c.metadata},u}}return m},o(e,"optional"),o(e,"nullable"),o(e,"default"),o(e,"transform"),o(e,"refine");const t=e.ZodObject.prototype.deepPartial;e.ZodObject.prototype.deepPartial=function(){const e=this._def.shape(),i=t.apply(this),n=i._def.shape();return Object.entries(n).forEach((([t,i])=>{var n,s;i._def.openapi=null===(s=null===(n=e[t])||void 0===n?void 0:n._def)||void 0===s?void 0:s.openapi})),i._def.openapi=void 0,i};const s=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...e){const t=s.apply(this,e);return t._def.openapi=void 0,t};const r=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...e){const t=r.apply(this,e);return t._def.openapi=void 0,t}}function u(e,t){if(null==e||null==t)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1}if(!(e instanceof Object&&t instanceof Object))return!1;const i=Object.keys(e);return Object.keys(t).every((e=>-1!==i.indexOf(e)))&&i.every((i=>u(e[i],t[i])))}"function"==typeof SuppressedError&&SuppressedError;class d{constructor(){this.buckets=new Map}put(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);i?i.some((t=>u(t,e)))||i.push(e):this.buckets.set(t,[e])}contains(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);return!!i&&i.some((t=>u(t,e)))}values(){return[...this.buckets.values()].flat()}stats(){let e=0,t=0,i=0;for(const n of this.buckets.values())e+=1,t+=n.length,n.length>1&&(i+=1);return{totalBuckets:e,collisions:i,totalValues:t,hashEffectiveness:e/t}}hashCodeOf(e){let t=0;if(Array.isArray(e)){for(let i=0;i<e.length;i++)t^=this.hashCodeOf(e[i])*i;return t}if("string"==typeof e){for(let i=0;i<e.length;i++)t^=e.charCodeAt(i)*i;return t}if("number"==typeof e)return e;if("object"==typeof e)for(const[i,n]of Object.entries(e))t^=this.hashCodeOf(i)+this.hashCodeOf(null!=n?n:"");return t}}function l(e){return void 0===e}function h(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{i[e]=t(n)})),i}function _(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t(n,e)||(i[e]=n)})),i}function p(e){return e.filter((e=>!l(e)))}const f=u;function m(e){return"string"==typeof e}class y{constructor(e){this.parents=e,this._definitions=[]}get definitions(){var e,t;return[...null!==(t=null===(e=this.parents)||void 0===e?void 0:e.flatMap((e=>e.definitions)))&&void 0!==t?t:[],...this._definitions]}register(e,t){const i=this.schemaWithRefId(e,t);return this._definitions.push({type:"schema",schema:i}),i}registerParameter(e,t){var i,n,s;const r=this.schemaWithRefId(e,t),o=null===(i=r._def.openapi)||void 0===i?void 0:i.metadata,a=r.openapi(Object.assign(Object.assign({},o),{param:Object.assign(Object.assign({},null==o?void 0:o.param),{name:null!==(s=null===(n=null==o?void 0:o.param)||void 0===n?void 0:n.name)&&void 0!==s?s:e})}));return this._definitions.push({type:"parameter",schema:a}),a}registerPath(e){this._definitions.push({type:"route",route:e})}registerWebhook(e){this._definitions.push({type:"webhook",webhook:e})}registerComponent(e,t,i){return this._definitions.push({type:"component",componentType:e,name:t,component:i}),{name:t,ref:{$ref:`#/components/${e}/${t}`}}}schemaWithRefId(e,t){return t.openapi(e)}}class v{constructor(e){this.message=e}}class E extends v{constructor(e,t){super(e),this.data=t}}class O extends v{constructor(e){super(`Missing parameter data, please specify \`${e.missingField}\` and other OpenAPI parameter props using the \`param\` field of \`ZodSchema.openapi\``),this.data=e}}function w(e,t){try{return e()}catch(e){if(e instanceof O)throw new O(Object.assign(Object.assign({},e.data),t));throw e}}class A extends v{constructor(e){super("Unknown zod object type, please specify `type` and other OpenAPI props using `ZodSchema.openapi`."),this.data=e}}class S{static getMetadata(e){var t;const i=this.unwrapChained(e),n=e._def.openapi?e._def.openapi:i._def.openapi,s=null!==(t=e.description)&&void 0!==t?t:i.description;return{_internal:null==n?void 0:n._internal,metadata:Object.assign({description:s},null==n?void 0:n.metadata)}}static getInternalMetadata(e){const t=this.unwrapChained(e),i=e._def.openapi?e._def.openapi:t._def.openapi;return null==i?void 0:i._internal}static getParamMetadata(e){var t,i;const n=this.unwrapChained(e),s=e._def.openapi?e._def.openapi:n._def.openapi,r=null!==(t=e.description)&&void 0!==t?t:n.description;return{_internal:null==s?void 0:s._internal,metadata:Object.assign(Object.assign({},null==s?void 0:s.metadata),{param:Object.assign({description:r},null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param)})}}static buildSchemaMetadata(e){return _(function(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t.some((t=>t===e))||(i[e]=n)})),i}(e,["param"]),l)}static buildParameterMetadata(e){return _(e,l)}static applySchemaMetadata(e,t){return _(Object.assign(Object.assign({},e),this.buildSchemaMetadata(t)),l)}static getRefId(e){var t;return null===(t=this.getInternalMetadata(e))||void 0===t?void 0:t.refId}static unwrapChained(e){return this.unwrapUntil(e)}static getDefaultValue(e){const t=this.unwrapUntil(e,"ZodDefault");return null==t?void 0:t._def.defaultValue()}static unwrapUntil(e,t){return t&&n(e,t)?e:n(e,"ZodOptional")||n(e,"ZodNullable")||n(e,"ZodBranded")?this.unwrapUntil(e.unwrap(),t):n(e,"ZodDefault")||n(e,"ZodReadonly")?this.unwrapUntil(e._def.innerType,t):n(e,"ZodEffects")?this.unwrapUntil(e._def.schema,t):n(e,"ZodPipeline")?this.unwrapUntil(e._def.in,t):t?void 0:e}static isOptionalSchema(e){return e.isOptional()}}class I{transform(e,t,i){var n,s;const r=e._def.type;return Object.assign(Object.assign({},t("array")),{items:i(r),minItems:null===(n=e._def.minLength)||void 0===n?void 0:n.value,maxItems:null===(s=e._def.maxLength)||void 0===s?void 0:s.value})}}class C{transform(e){return Object.assign(Object.assign({},e("string")),{pattern:"^d+$"})}}class N{transform(e,t,i,n,s){const r=[...e.options.values()],o=r.map(n);return t?{oneOf:i(o,t)}:{oneOf:o,discriminator:this.mapDiscriminator(r,e.discriminator,s)}}mapDiscriminator(e,t,i){if(e.some((e=>void 0===S.getRefId(e))))return;const s={};return e.forEach((e=>{var r;const o=S.getRefId(e),a=null===(r=e.shape)||void 0===r?void 0:r[t];if(n(a,"ZodEnum")||n(a,"ZodNativeEnum"))return void Object.values(a.enum).filter(m).forEach((e=>{s[e]=i(o)}));const c=null==a?void 0:a._def.value;if("string"!=typeof c)throw Error(`Discriminator ${t} could not be found in one of the values of a discriminated union`);s[c]=i(o)})),{propertyName:t,mapping:s}}}class T{transform(e,t){return Object.assign(Object.assign({},t("string")),{enum:e._def.values})}}class x{transform(e,t,i,n){const s={allOf:this.flattenIntersectionTypes(e).map(n)};return t?{anyOf:i([s],t)}:s}flattenIntersectionTypes(e){return n(e,"ZodIntersection")?[...this.flattenIntersectionTypes(e._def.left),...this.flattenIntersectionTypes(e._def.right)]:[e]}}class k{transform(e,t){return Object.assign(Object.assign({},t(typeof e._def.value)),{enum:[e._def.value]})}}class R{transform(e,t){const{type:i,values:n}=function(e){const t=Object.keys(e).filter((t=>"number"!=typeof e[e[t]])).map((t=>e[t])),i=t.filter((e=>"number"==typeof e)).length;return{values:t,type:0===i?"string":i===t.length?"numeric":"mixed"}}(e._def.values);if("mixed"===i)throw new v("Enum has mixed string and number values, please specify the OpenAPI type manually");return Object.assign(Object.assign({},t("numeric"===i?"integer":"string")),{enum:n})}}class D{transform(e,t,i){return Object.assign(Object.assign({},t(e.isInt?"integer":"number")),i(e._def.checks))}}class L{transform(e,t,i,n){var s;const r=null===(s=S.getInternalMetadata(e))||void 0===s?void 0:s.extendedFrom,o=this.requiredKeysOf(e),a=h(e._def.shape(),n);if(!r)return Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{properties:a,default:t}),o.length>0?{required:o}:{}),this.generateAdditionalProperties(e,n));const c=r.schema;n(c);const u=this.requiredKeysOf(c),d=h(null==c?void 0:c._def.shape(),n),l=Object.fromEntries(Object.entries(a).filter((([e,t])=>!f(d[e],t)))),_=o.filter((e=>!u.includes(e))),p=Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{default:t,properties:l}),_.length>0?{required:_}:{}),this.generateAdditionalProperties(e,n));return{allOf:[{$ref:"#/components/schemas/"+r.refId},p]}}generateAdditionalProperties(e,t){const i=e._def.unknownKeys,s=e._def.catchall;return n(s,"ZodNever")?"strict"===i?{additionalProperties:!1}:{}:{additionalProperties:t(s)}}requiredKeysOf(e){return Object.entries(e._def.shape()).filter((([e,t])=>!S.isOptionalSchema(t))).map((([e,t])=>e))}}class j{transform(e,t,i){const s=e._def.keyType,r=i(e._def.valueType);if(n(s,"ZodEnum")||n(s,"ZodNativeEnum")){const e=Object.values(s.enum).filter(m).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:r})),{});return Object.assign(Object.assign({},t("object")),{properties:e})}return Object.assign(Object.assign({},t("object")),{additionalProperties:r})}}class F{transform(e,t){var i,n,s;const r=this.getZodStringCheck(e,"regex"),o=null===(i=this.getZodStringCheck(e,"length"))||void 0===i?void 0:i.value,a=Number.isFinite(e.minLength)&&null!==(n=e.minLength)&&void 0!==n?n:void 0,c=Number.isFinite(e.maxLength)&&null!==(s=e.maxLength)&&void 0!==s?s:void 0;return Object.assign(Object.assign({},t("string")),{minLength:null!=o?o:a,maxLength:null!=o?o:c,format:this.mapStringFormat(e),pattern:null==r?void 0:r.regex.source})}mapStringFormat(e){return e.isUUID?"uuid":e.isEmail?"email":e.isURL?"uri":e.isDate?"date":e.isDatetime?"date-time":e.isCUID?"cuid":e.isCUID2?"cuid2":e.isULID?"ulid":e.isIP?"ip":e.isEmoji?"emoji":void 0}getZodStringCheck(e,t){return e._def.checks.find((e=>e.kind===t))}}class U{constructor(e){this.versionSpecifics=e}transform(e,t,i){const{items:n}=e._def,s=n.map(i);return Object.assign(Object.assign({},t("array")),this.versionSpecifics.mapTupleItems(s))}}class P{transform(e,t,i){return{anyOf:t(this.flattenUnionTypes(e).map((e=>{const t=this.unwrapNullable(e);return i(t)})))}}flattenUnionTypes(e){return n(e,"ZodUnion")?e._def.options.flatMap((e=>this.flattenUnionTypes(e))):[e]}unwrapNullable(e){return n(e,"ZodNullable")?this.unwrapNullable(e.unwrap()):e}}class M{constructor(e){this.versionSpecifics=e,this.objectTransformer=new L,this.stringTransformer=new F,this.numberTransformer=new D,this.bigIntTransformer=new C,this.literalTransformer=new k,this.enumTransformer=new T,this.nativeEnumTransformer=new R,this.arrayTransformer=new I,this.unionTransformer=new P,this.discriminatedUnionTransformer=new N,this.intersectionTransformer=new x,this.recordTransformer=new j,this.tupleTransformer=new U(e)}transform(e,t,i,s,r){if(n(e,"ZodNull"))return this.versionSpecifics.nullType;if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodObject"))return this.objectTransformer.transform(e,r,(e=>this.versionSpecifics.mapNullableType(e,t)),i);const o=this.transformSchemaWithoutDefault(e,t,i,s);return Object.assign(Object.assign({},o),{default:r})}transformSchemaWithoutDefault(e,t,i,s){if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodString"))return this.stringTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNumber"))return this.numberTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),(e=>this.versionSpecifics.getNumberChecks(e)));if(n(e,"ZodBigInt"))return this.bigIntTransformer.transform((e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodBoolean"))return this.versionSpecifics.mapNullableType("boolean",t);if(n(e,"ZodLiteral"))return this.literalTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodEnum"))return this.enumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNativeEnum"))return this.nativeEnumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodArray"))return this.arrayTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodTuple"))return this.tupleTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodUnion"))return this.unionTransformer.transform(e,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodDiscriminatedUnion"))return this.discriminatedUnionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i,s);if(n(e,"ZodIntersection"))return this.intersectionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodRecord"))return this.recordTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodDate"))return this.versionSpecifics.mapNullableType("string",t);const r=S.getRefId(e);throw new A({currentSchema:e._def,schemaName:r})}}class Z{constructor(e,t){this.definitions=e,this.versionSpecifics=t,this.schemaRefs={},this.paramRefs={},this.pathRefs={},this.rawComponents=[],this.openApiTransformer=new M(t),this.sortDefinitions()}generateDocumentData(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents(),paths:this.pathRefs}}generateComponents(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents()}}buildComponents(){var e,t;const i={};return this.rawComponents.forEach((({componentType:e,name:t,component:n})=>{var s;null!==(s=i[e])&&void 0!==s||(i[e]={}),i[e][t]=n})),Object.assign(Object.assign({},i),{schemas:Object.assign(Object.assign({},null!==(e=i.schemas)&&void 0!==e?e:{}),this.schemaRefs),parameters:Object.assign(Object.assign({},null!==(t=i.parameters)&&void 0!==t?t:{}),this.paramRefs)})}sortDefinitions(){const e=["schema","parameter","component","route"];this.definitions.sort(((t,i)=>"type"in t?"type"in i?e.findIndex((e=>e===t.type))-e.findIndex((e=>e===i.type)):1:"type"in i?-1:0))}generateSingle(e){if("type"in e)switch(e.type){case"parameter":return void this.generateParameterDefinition(e.schema);case"schema":return void this.generateSchemaWithRef(e.schema);case"route":return void this.generateSingleRoute(e.route);case"component":return void this.rawComponents.push(e)}else this.generateSchemaWithRef(e)}generateParameterDefinition(e){const t=S.getRefId(e),i=this.generateParameter(e);return t&&(this.paramRefs[t]=i),i}getParameterRef(e,t){var i,n,s,r,o;const a=null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.param,c=(null===(n=null==e?void 0:e._internal)||void 0===n?void 0:n.refId)?this.paramRefs[null===(s=e._internal)||void 0===s?void 0:s.refId]:void 0;if((null===(r=null==e?void 0:e._internal)||void 0===r?void 0:r.refId)&&c){if(a&&c.in!==a.in||(null==t?void 0:t.in)&&c.in!==t.in)throw new E("Conflicting location for parameter "+c.name,{key:"in",values:p([c.in,null==t?void 0:t.in,null==a?void 0:a.in])});if(a&&c.name!==a.name||(null==t?void 0:t.name)&&c.name!==(null==t?void 0:t.name))throw new E("Conflicting names for parameter",{key:"name",values:p([c.name,null==t?void 0:t.name,null==a?void 0:a.name])});return{$ref:"#/components/parameters/"+(null===(o=e._internal)||void 0===o?void 0:o.refId)}}}generateInlineParameters(e,t){var i;const s=S.getMetadata(e),r=null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param,o=this.getParameterRef(s,{in:t});if(o)return[o];if(n(e,"ZodObject")){const i=e._def.shape(),n=Object.entries(i).map((([e,i])=>{var n,s;const r=S.getMetadata(i),o=this.getParameterRef(r,{in:t,name:e});if(o)return o;const a=null===(n=null==r?void 0:r.metadata)||void 0===n?void 0:n.param;if((null==a?void 0:a.name)&&a.name!==e)throw new E("Conflicting names for parameter",{key:"name",values:[e,a.name]});if((null==a?void 0:a.in)&&a.in!==t)throw new E("Conflicting location for parameter "+(null!==(s=a.name)&&void 0!==s?s:e),{key:"in",values:[t,a.in]});return this.generateParameter(i.openapi({param:{name:e,in:t}}))}));return n}if((null==r?void 0:r.in)&&r.in!==t)throw new E("Conflicting location for parameter "+r.name,{key:"in",values:[t,r.in]});return[this.generateParameter(e.openapi({param:{in:t}}))]}generateSimpleParameter(e){var t;const i=S.getParamMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=!S.isOptionalSchema(e)&&!e.isNullable(),r=this.generateSchemaWithRef(e);return Object.assign({schema:r,required:s},n?S.buildParameterMetadata(n):{})}generateParameter(e){var t;const i=S.getMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=null==n?void 0:n.name,r=null==n?void 0:n.in;if(!s)throw new O({missingField:"name"});if(!r)throw new O({missingField:"in",paramName:s});const o=this.generateSimpleParameter(e);return Object.assign(Object.assign({},o),{in:r,name:s})}generateSchemaWithMetadata(e){var t;const i=S.unwrapChained(e),n=S.getMetadata(e),s=S.getDefaultValue(e),r=(null===(t=null==n?void 0:n.metadata)||void 0===t?void 0:t.type)?{type:null==n?void 0:n.metadata.type}:this.toOpenAPISchema(i,e.isNullable(),s);return(null==n?void 0:n.metadata)?S.applySchemaMetadata(r,n.metadata):_(r,l)}constructReferencedOpenAPISchema(e){var t;const i=S.getMetadata(e),n=S.unwrapChained(e),s=S.getDefaultValue(e),r=e.isNullable();return(null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.type)?this.versionSpecifics.mapNullableType(i.metadata.type,r):this.toOpenAPISchema(n,r,s)}generateSimpleSchema(e){var t;const i=S.getMetadata(e),n=S.getRefId(e);if(!n||!this.schemaRefs[n])return this.generateSchemaWithMetadata(e);const s=this.schemaRefs[n],r={$ref:this.generateSchemaRef(n)},o=_(S.buildSchemaMetadata(null!==(t=null==i?void 0:i.metadata)&&void 0!==t?t:{}),((e,t)=>void 0===e||f(e,s[t])));if(o.type)return{allOf:[r,o]};const a=_(this.constructReferencedOpenAPISchema(e),((e,t)=>void 0===e||f(e,s[t]))),c=S.applySchemaMetadata(a,o);return Object.keys(c).length>0?{allOf:[r,c]}:r}generateSchemaWithRef(e){const t=S.getRefId(e),i=this.generateSimpleSchema(e);return t&&void 0===this.schemaRefs[t]?(this.schemaRefs[t]=i,{$ref:this.generateSchemaRef(t)}):i}generateSchemaRef(e){return"#/components/schemas/"+e}getRequestBody(e){if(!e)return;const{content:t}=e,n=i(e,["content"]),s=this.getBodyContent(t);return Object.assign(Object.assign({},n),{content:s})}getParameters(e){if(!e)return[];const{headers:t}=e,i=this.cleanParameter(e.query),n=this.cleanParameter(e.params),s=this.cleanParameter(e.cookies),r=w((()=>i?this.generateInlineParameters(i,"query"):[]),{location:"query"}),o=w((()=>n?this.generateInlineParameters(n,"path"):[]),{location:"path"}),a=w((()=>s?this.generateInlineParameters(s,"cookie"):[]),{location:"cookie"});return[...o,...r,...w((()=>{if(Array.isArray(t))return t.flatMap((e=>this.generateInlineParameters(e,"header")));const e=this.cleanParameter(t);return e?this.generateInlineParameters(e,"header"):[]}),{location:"header"}),...a]}cleanParameter(e){if(e)return n(e,"ZodEffects")?this.cleanParameter(e._def.schema):e}generatePath(e){const{method:t,path:n,request:s,responses:r}=e,o=i(e,["method","path","request","responses"]),a=h(r,(e=>this.getResponse(e))),c=w((()=>this.getParameters(s)),{route:`${t} ${n}`}),u=this.getRequestBody(null==s?void 0:s.body);return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},o),c.length>0?{parameters:[...o.parameters||[],...c]}:{}),u?{requestBody:u}:{}),{responses:a})}}generateSingleRoute(e){const t=this.generatePath(e);return this.pathRefs[e.path]=Object.assign(Object.assign({},this.pathRefs[e.path]),t),t}getResponse(e){if(this.isReferenceObject(e))return e;const{content:t,headers:s}=e,r=i(e,["content","headers"]),o=t?{content:this.getBodyContent(t)}:{};if(!s)return Object.assign(Object.assign({},r),o);const a=n(s,"ZodObject")?this.getResponseHeaders(s):s;return Object.assign(Object.assign(Object.assign({},r),{headers:a}),o)}isReferenceObject(e){return"$ref"in e}getResponseHeaders(e){return h(e._def.shape(),(e=>this.generateSimpleParameter(e)))}getBodyContent(e){return h(e,(e=>{if(!e||!function(e){return"_def"in e}(e.schema))return e;const{schema:t}=e,n=i(e,["schema"]),s=this.generateSchemaWithRef(t);return Object.assign({schema:s},n)}))}toOpenAPISchema(e,t,i){return this.openApiTransformer.transform(e,t,(e=>this.generateSchemaWithRef(e)),(e=>this.generateSchemaRef(e)),i)}}class H{get nullType(){return{nullable:!0}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return Object.assign(Object.assign({},e?{type:e}:void 0),t?this.nullType:void 0)}mapTupleItems(e){const t=function(e){const t=new d;return e.forEach((e=>t.put(e))),[...t.values()]}(e);return{items:1===t.length?t[0]:{anyOf:t},minItems:e.length,maxItems:e.length}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{minimum:Number(e.value),exclusiveMinimum:!0};case"max":return e.inclusive?{maximum:Number(e.value)}:{maximum:Number(e.value),exclusiveMaximum:!0};default:return{}}})))}}class ${constructor(e){const t=new H;this.generator=new Z(e,t)}generateDocument(e){const t=this.generator.generateDocumentData();return Object.assign(Object.assign({},e),t)}generateComponents(){return this.generator.generateComponents()}}class z{get nullType(){return{type:"null"}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return e?t?{type:Array.isArray(e)?[...e,"null"]:[e,"null"]}:{type:e}:{}}mapTupleItems(e){return{prefixItems:e}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{exclusiveMinimum:Number(e.value)};case"max":return e.inclusive?{maximum:Number(e.value)}:{exclusiveMaximum:Number(e.value)};default:return{}}})))}}function G(e){return"type"in e&&"webhook"===e.type}class q{constructor(e){this.definitions=e,this.webhookRefs={};const t=new z;this.generator=new Z(this.definitions,t)}generateDocument(e){const t=this.generator.generateDocumentData();return this.definitions.filter(G).forEach((e=>this.generateSingleWebhook(e.webhook))),Object.assign(Object.assign(Object.assign({},e),t),{webhooks:this.webhookRefs})}generateComponents(){return this.generator.generateComponents()}generateSingleWebhook(e){const t=this.generator.generatePath(e);return this.webhookRefs[e.path]=Object.assign(Object.assign({},this.webhookRefs[e.path]),t),t}}var B=e=>{const t=e.split("/");return""===t[0]&&t.shift(),t},W={},K=(e,t)=>{if("*"===e)return"*";const i=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(i){const n=`${e}#${t}`;return W[n]||(W[n]=i[2]?t&&":"!==t[0]&&"*"!==t[0]?[n,i[1],RegExp(`^${i[2]}(?=/${t})`)]:[e,i[1],RegExp(`^${i[2]}$`)]:[e,i[1],!0]),W[n]}return null},V=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,(e=>{try{return t(e)}catch{return e}}))}},X=e=>V(e,decodeURI),Y=e=>{const t=e.url,i=t.indexOf("/",t.indexOf(":")+4);let n=i;for(;n<t.length;n++){const e=t.charCodeAt(n);if(37===e){const e=t.indexOf("?",n),s=t.indexOf("#",n),r=t.slice(i,-1===e?-1===s?void 0:s:-1===s?e:Math.min(e,s));return X(r.includes("%25")?r.replace(/%25/g,"%2525"):r)}if(63===e||35===e)break}return t.slice(i,n)},J=e=>{const t=Y(e);return t.length>1&&"/"===t.at(-1)?t.slice(0,-1):t},Q=(e,t,...i)=>(i.length&&(t=Q(t,...i)),`${"/"===e?.[0]?"":"/"}${e}${"/"===t?"":`${"/"===e?.at(-1)?"":"/"}${"/"===t?.[0]?t.slice(1):t}`}`),ee=e=>{if(63!==e.charCodeAt(e.length-1)||!e.includes(":"))return null;const t=e.split("/"),i=[];let n="";return t.forEach((e=>{if(""===e||/\:/.test(e)){if(/\:/.test(e))if(/\?/.test(e)){i.push(0===i.length&&""===n?"/":n);const t=e.replace("?","");n+="/"+t,i.push(n)}else n+="/"+e}else n+="/"+e})),i.filter(((e,t,i)=>i.indexOf(e)===t))},te=e=>/[%+]/.test(e)?(-1!==e.indexOf("+")&&(e=e.replace(/\+/g," ")),-1!==e.indexOf("%")?V(e,se):e):e,ie=(e,t,i)=>{let n;if(!i&&t&&!/[%+]/.test(t)){let i=e.indexOf("?",8);if(-1===i)return;for(e.startsWith(t,i+1)||(i=e.indexOf("&"+t,i+1));-1!==i;){const n=e.charCodeAt(i+t.length+1);if(61===n){const n=i+t.length+2,s=e.indexOf("&",n);return te(e.slice(n,-1===s?void 0:s))}if(38==n||isNaN(n))return"";i=e.indexOf("&"+t,i+1)}if(n=/[%+]/.test(e),!n)return}const s={};n??=/[%+]/.test(e);let r=e.indexOf("?",8);for(;-1!==r;){const t=e.indexOf("&",r+1);let o=e.indexOf("=",r);o>t&&-1!==t&&(o=-1);let a,c=e.slice(r+1,-1===o?-1===t?void 0:t:o);n&&(c=te(c)),r=t,""!==c&&(-1===o?a="":(a=e.slice(o+1,-1===t?void 0:t),n&&(a=te(a))),i?(s[c]&&Array.isArray(s[c])||(s[c]=[]),s[c].push(a)):s[c]??=a)}return t?s[t]:s},ne=ie,se=decodeURIComponent,re=/^[\w!#$%&'*.^`|~+-]+$/,oe=/^[ !#-:<-[\]-~]*$/,ae=class extends Error{res;status;constructor(e=500,t){super(t?.message,{cause:t?.cause}),this.res=t?.res,this.status=e}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}},ce=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,ue=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/,de=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,le=(e,t)=>async(i,n)=>{let s={};const r=i.req.header("Content-Type");switch(e){case"json":if(!r||!ce.test(r))break;try{s=await i.req.json()}catch{throw new ae(400,{message:"Malformed JSON in request body"})}break;case"form":{if(!r||!ue.test(r)&&!de.test(r))break;let e;if(i.req.bodyCache.formData)e=await i.req.bodyCache.formData;else try{const t=await i.req.arrayBuffer();e=await((e,t)=>new Response(e,{headers:{"Content-Type":t}}).formData())(t,r),i.req.bodyCache.formData=e}catch(e){let t="Malformed FormData request.";throw t+=e instanceof Error?" "+e.message:" "+e,new ae(400,{message:t})}const t=Object.create(null);e.forEach(((e,i)=>{i.endsWith("[]")?(t[i]??=[]).push(e):Array.isArray(t[i])?t[i].push(e):t[i]=Object.hasOwn(t,i)?[t[i],e]:e})),s=t;break}case"query":s=Object.fromEntries(Object.entries(i.req.queries()).map((([e,t])=>1===t.length?[e,t[0]]:[e,t])));break;case"param":s=i.req.param();break;case"header":s=i.req.header();break;case"cookie":s=(e=>{const t=e.req.raw.headers.get("Cookie");if(!t)return{};return(e=>{const t=e.trim().split(";"),i={};for(let e of t){e=e.trim();const t=e.indexOf("=");if(-1===t)continue;const n=e.substring(0,t).trim();if(!re.test(n))continue;let s=e.substring(t+1).trim();s.startsWith('"')&&s.endsWith('"')&&(s=s.slice(1,-1)),oe.test(s)&&(i[n]=-1!==s.indexOf("%")?V(s,se):s)}return i})(t)})(i)}const o=await t(s,i);return o instanceof Response?o:(i.req.addValidatedData(e,o),await n())};const he=function(e,t,i,n){return le(e,(async(s,r)=>{let o=s;if("header"===e&&"_def"in t||"header"===e&&"_zod"in t){const e=Object.fromEntries(Object.keys("in"in t?t.in.shape:t.shape).map((e=>[e.toLowerCase(),e])));o=Object.fromEntries(Object.entries(s).map((([t,i])=>[e[t]||t,i])))}const a=n&&n.validationFunction?await n.validationFunction(t,o):await t.safeParseAsync(o);if(i){const t=await i({data:o,...a,target:e},r);if(t){if(t instanceof Response)return t;if("response"in t)return t.response}}return a.success?a.data:r.json(a,400)}))};var _e=(e,t,i)=>(n,s)=>{let r=-1;return async function o(a){if(a<=r)throw Error("next() called multiple times");let c;r=a;let u,d=!1;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&s||void 0,u)try{c=await u(n,(()=>o(a+1)))}catch(e){if(!(e instanceof Error&&t))throw e;n.error=e,c=await t(e,n),d=!0}else!1===n.finalized&&i&&(c=await i(n));return c&&(!1===n.finalized||d)&&(n.res=c),n}(0)},pe=Symbol(),fe=(e,t,i)=>{void 0!==e[t]?Array.isArray(e[t])?e[t].push(i):e[t]=[e[t],i]:e[t]=t.endsWith("[]")?[i]:i},me=(e,t,i)=>{if(/(?:^|\.)__proto__\./.test(t))return;let n=e;const s=t.split(".");s.forEach(((e,t)=>{t===s.length-1?n[e]=i:((!n[e]||"object"!=typeof n[e]||Array.isArray(n[e])||n[e]instanceof File)&&(n[e]=Object.create(null)),n=n[e])}))},ge=e=>V(e,se),ye=class{raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(e,t="/",i=[[]]){this.raw=e,this.path=t,this.#t=i,this.#e={}}param(e){return e?this.#i(e):this.#n()}#i(e){const t=this.#t[0][this.routeIndex][1][e],i=this.#s(t);return i&&/\%/.test(i)?ge(i):i}#n(){const e={},t=Object.keys(this.#t[0][this.routeIndex][1]);for(const i of t){const t=this.#s(this.#t[0][this.routeIndex][1][i]);void 0!==t&&(e[i]=/\%/.test(t)?ge(t):t)}return e}#s(e){return this.#t[1]?this.#t[1][e]:e}query(e){return ne(this.url,e)}queries(e){return((e,t)=>ie(this.url,t,!0))(0,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;const t={};return this.raw.headers.forEach(((e,i)=>{t[i]=e})),t}async parseBody(e){return(async(e,t=Object.create(null))=>{const{all:i=!1,dot:n=!1}=t,s=(e instanceof ye?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?async function(e,t){const i=await e.formData();return i?function(e,t){const i=Object.create(null);return e.forEach(((e,n)=>{t.all||n.endsWith("[]")?fe(i,n,e):i[n]=e})),t.dot&&Object.entries(i).forEach((([e,t])=>{e.includes(".")&&(me(i,e,t),delete i[e])})),i}(i,t):{}}(e,{all:i,dot:n}):{}})(this,e)}#r=e=>{const{bodyCache:t,raw:i}=this,n=t[e];if(n)return n;const s=Object.keys(t)[0];return s?t[s].then((t=>("json"===s&&(t=JSON.stringify(t)),new Response(t)[e]()))):t[e]=i[e]()};json(){return this.#r("text").then((e=>JSON.parse(e)))}text(){return this.#r("text")}arrayBuffer(){return this.#r("arrayBuffer")}blob(){return this.#r("blob")}formData(){return this.#r("formData")}addValidatedData(e,t){this.#e[e]=t}valid(e){return this.#e[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[pe](){return this.#t}get matchedRoutes(){return this.#t[0].map((([[,e]])=>e))}get routePath(){return this.#t[0].map((([[,e]])=>e))[this.routeIndex].path}},ve=async(e,t,i,n,s)=>{"object"!=typeof e||e instanceof String||(e instanceof Promise||(e=""+e),e instanceof Promise&&(e=await e));const r=e.callbacks;return r?.length?(s?s[0]+=e:s=[e],Promise.all(r.map((e=>e({phase:t,buffer:s,context:n})))).then((e=>Promise.all(e.filter(Boolean).map((e=>ve(e,t,!1,n,s)))).then((()=>s[0]))))):Promise.resolve(e)},be=(e,t)=>({"Content-Type":e,...t}),Ee=(e,t)=>new Response(e,t),Oe=class{#o;#a;env={};#c;finalized=!1;error;#u;#d;#l;#h;#_;#p;#f;#t;#m;constructor(e,t){this.#o=e,t&&(this.#d=t.executionCtx,this.env=t.env,this.#p=t.notFoundHandler,this.#m=t.path,this.#t=t.matchResult)}get req(){return this.#a??=new ye(this.#o,this.#m,this.#t),this.#a}get event(){if(this.#d&&"respondWith"in this.#d)return this.#d;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#d)return this.#d;throw Error("This context has no ExecutionContext")}get res(){return this.#l||=Ee(null,{headers:this.#f??=new Headers})}set res(e){if(this.#l&&e){e=Ee(e.body,e);for(const[t,i]of this.#l.headers.entries())if("content-type"!==t)if("set-cookie"===t){const t=this.#l.headers.getSetCookie();e.headers.delete("set-cookie");for(const i of t)e.headers.append("set-cookie",i)}else e.headers.set(t,i)}this.#l=e,this.finalized=!0}render=(...e)=>(this.#_??=e=>this.html(e),this.#_(...e));setLayout=e=>this.#h=e;getLayout=()=>this.#h;setRenderer=e=>{this.#_=e};header=(e,t,i)=>{this.finalized&&(this.#l=Ee(this.#l.body,this.#l));const n=this.#l?this.#l.headers:this.#f??=new Headers;void 0===t?n.delete(e):i?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#u=e};set=(e,t)=>{this.#c??=new Map,this.#c.set(e,t)};get=e=>this.#c?this.#c.get(e):void 0;get var(){return this.#c?Object.fromEntries(this.#c):{}}#g(e,t,i){const n=this.#l?new Headers(this.#l.headers):this.#f??new Headers;if("object"==typeof t&&"headers"in t){const e=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(const[t,i]of e)"set-cookie"===t.toLowerCase()?n.append(t,i):n.set(t,i)}if(i)for(const[e,t]of Object.entries(i))if("string"==typeof t)n.set(e,t);else{n.delete(e);for(const i of t)n.append(e,i)}const s="number"==typeof t?t:t?.status??this.#u;return Ee(e,{status:s,headers:n})}newResponse=(...e)=>this.#g(...e);body=(e,t,i)=>this.#g(e,t,i);text=(e,t,i)=>this.#f||this.#u||t||i||this.finalized?this.#g(e,t,be("text/plain; charset=UTF-8",i)):new Response(e);json=(e,t,i)=>this.#g(JSON.stringify(e),t,be("application/json",i));html=(e,t,i)=>{const n=e=>this.#g(e,t,be("text/html; charset=UTF-8",i));return"object"==typeof e?ve(e,1,!1,{}).then(n):n(e)};redirect=(e,t)=>{const i=e+"";return this.header("Location",/[^\x00-\xFF]/.test(i)?encodeURI(i):i),this.newResponse(null,t??302)};notFound=()=>(this.#p??=()=>Ee(),this.#p(this))},we="ALL",Ae=["get","post","put","delete","options","patch"],Se="Can not add a route since the matcher is already built.",Ie=class extends Error{},Ce=e=>e.text("404 Not Found",404),Ne=(e,t)=>{if("getResponse"in e){const i=e.getResponse();return t.newResponse(i.body,i)}return console.error(e),t.text("Internal Server Error",500)},Te=class e{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#m="/";routes=[];constructor(e={}){[...Ae,"all"].forEach((e=>{this[e]=(t,...i)=>("string"==typeof t?this.#m=t:this.#y(e,this.#m,t),i.forEach((t=>{this.#y(e,this.#m,t)})),this)})),this.on=(e,t,...i)=>{for(const n of[t].flat()){this.#m=n;for(const t of[e].flat())i.map((e=>{this.#y(t.toUpperCase(),this.#m,e)}))}return this},this.use=(e,...t)=>("string"==typeof e?this.#m=e:(this.#m="*",t.unshift(e)),t.forEach((e=>{this.#y(we,this.#m,e)})),this);const{strict:t,...i}=e;Object.assign(this,i),this.getPath=t??1?e.getPath??Y:J}#v(){const t=new e({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#p=this.#p,t.routes=this.routes,t}#p=Ce;errorHandler=Ne;route(e,t){const i=this.basePath(e);return t.routes.map((e=>{let n;t.errorHandler===Ne?n=e.handler:(n=async(i,n)=>(await _e([],t.errorHandler)(i,(()=>e.handler(i,n)))).res,n.__COMPOSED_HANDLER=e.handler),i.#y(e.method,e.path,n)})),this}basePath(e){const t=this.#v();return t._basePath=Q(this._basePath,e),t}onError=e=>(this.errorHandler=e,this);notFound=e=>(this.#p=e,this);mount(e,t,i){let n,s;i&&("function"==typeof i?s=i:(s=i.optionHandler,n=!1===i.replaceRequest?e=>e:i.replaceRequest));const r=s?e=>{const t=s(e);return Array.isArray(t)?t:[t]}:e=>{let t;try{t=e.executionCtx}catch{}return[e.env,t]};return n||=(()=>{const t=Q(this._basePath,e),i="/"===t?0:t.length;return e=>{const t=new URL(e.url);return t.pathname=t.pathname.slice(i)||"/",new Request(t,e)}})(),this.#y(we,Q(e,"*"),(async(e,i)=>{const s=await t(n(e.req.raw),...r(e));if(s)return s;await i()})),this}#y(e,t,i){e=e.toUpperCase(),t=Q(this._basePath,t);const n={basePath:this._basePath,path:t,method:e,handler:i};this.router.add(e,t,[i,n]),this.routes.push(n)}#b(e,t){if(e instanceof Error)return this.errorHandler(e,t);throw e}#E(e,t,i,n){if("HEAD"===n)return(async()=>new Response(null,await this.#E(e,t,i,"GET")))();const s=this.getPath(e,{env:i}),r=this.router.match(n,s),o=new Oe(e,{path:s,matchResult:r,env:i,executionCtx:t,notFoundHandler:this.#p});if(1===r[0].length){let e;try{e=r[0][0][0][0](o,(async()=>{o.res=await this.#p(o)}))}catch(e){return this.#b(e,o)}return e instanceof Promise?e.then((e=>e||(o.finalized?o.res:this.#p(o)))).catch((e=>this.#b(e,o))):e??this.#p(o)}const a=_e(r[0],this.errorHandler,this.#p);return(async()=>{try{const e=await a(o);if(!e.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return e.res}catch(e){return this.#b(e,o)}})()}fetch=(e,...t)=>this.#E(e,t[1],t[0],e.method);request=(e,t,i,n)=>e instanceof Request?this.fetch(t?new Request(e,t):e,i,n):(e=""+e,this.fetch(new Request(/^https?:\/\//.test(e)?e:"http://localhost"+Q("/",e),t),i,n));fire=()=>{addEventListener("fetch",(e=>{e.respondWith(this.#E(e.request,e,void 0,e.request.method))}))}},xe=[];function ke(e,t){const i=this.buildAllMatchers(),n=(e,t)=>{const n=i[e]||i[we],s=n[2][t];if(s)return s;const r=t.match(n[0]);if(!r)return[[],xe];const o=r.indexOf("",1);return[n[1][o],r]};return this.match=n,n(e,t)}var Re="[^/]+",De=".*",Le="(?:|/.*)",je=Symbol(),Fe=new Set(".\\+*[^]$()");function Ue(e,t){return 1===e.length?1===t.length?e<t?-1:1:-1:1===t.length||e===De||e===Le?1:t===De||t===Le?-1:e===Re?1:t===Re?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Pe=class e{#O;#w;#A=Object.create(null);insert(t,i,n,s,r){if(0===t.length){if(void 0!==this.#O)throw je;if(r)return;return void(this.#O=i)}const[o,...a]=t,c="*"===o?0===a.length?["","",De]:["","",Re]:"/*"===o?["","",Le]:o.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);let u;if(c){const t=c[1];let i=c[2]||Re;if(t&&c[2]){if(".*"===i)throw je;if(i=i.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(i))throw je}if(u=this.#A[i],!u){if(Object.keys(this.#A).some((e=>e!==De&&e!==Le)))throw je;if(r)return;u=this.#A[i]=new e,""!==t&&(u.#w=s.varIndex++)}r||""===t||n.push([t,u.#w])}else if(u=this.#A[o],!u){if(Object.keys(this.#A).some((e=>e.length>1&&e!==De&&e!==Le)))throw je;if(r)return;u=this.#A[o]=new e}u.insert(a,i,n,s,r)}buildRegExpStr(){const e=Object.keys(this.#A).sort(Ue).map((e=>{const t=this.#A[e];return("number"==typeof t.#w?`(${e})@${t.#w}`:Fe.has(e)?"\\"+e:e)+t.buildRegExpStr()}));return"number"==typeof this.#O&&e.unshift("#"+this.#O),0===e.length?"":1===e.length?e[0]:"(?:"+e.join("|")+")"}},Me=class{#S={varIndex:0};#I=new Pe;insert(e,t,i){const n=[],s=[];for(let t=0;;){let i=!1;if(e=e.replace(/\{[^}]+\}/g,(e=>{const n="@\\"+t;return s[t]=[n,e],t++,i=!0,n})),!i)break}const r=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let e=s.length-1;e>=0;e--){const[t]=s[e];for(let i=r.length-1;i>=0;i--)if(-1!==r[i].indexOf(t)){r[i]=r[i].replace(t,s[e][1]);break}}return this.#I.insert(r,t,n,this.#S,i),n}buildRegExp(){let e=this.#I.buildRegExpStr();if(""===e)return[/^$/,[],[]];let t=0;const i=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,((e,s,r)=>void 0!==s?(i[++t]=Number(s),"$()"):void 0!==r?(n[Number(r)]=++t,""):"")),[RegExp("^"+e),i,n]}},Ze=[/^$/,[],Object.create(null)],He=Object.create(null);function $e(e){return He[e]??=RegExp("*"===e?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,((e,t)=>t?"\\"+t:"(?:|/.*)"))}$`)}function ze(e,t){if(e)for(const i of Object.keys(e).sort(((e,t)=>t.length-e.length)))if($e(i).test(t))return[...e[i]]}var Ge,qe,Be=class{name="RegExpRouter";#C;#N;constructor(){this.#C={[we]:Object.create(null)},this.#N={[we]:Object.create(null)}}add(e,t,i){const n=this.#C,s=this.#N;if(!n||!s)throw Error(Se);n[e]||[n,s].forEach((t=>{t[e]=Object.create(null),Object.keys(t[we]).forEach((i=>{t[e][i]=[...t[we][i]]}))})),"/*"===t&&(t="*");const r=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){const o=$e(t);return e===we?Object.keys(n).forEach((e=>{n[e][t]||=ze(n[e],t)||ze(n[we],t)||[]})):n[e][t]||=ze(n[e],t)||ze(n[we],t)||[],Object.keys(n).forEach((t=>{e!==we&&e!==t||Object.keys(n[t]).forEach((e=>{o.test(e)&&n[t][e].push([i,r])}))})),void Object.keys(s).forEach((t=>{e!==we&&e!==t||Object.keys(s[t]).forEach((e=>o.test(e)&&s[t][e].push([i,r])))}))}const o=ee(t)||[t];for(let t=0,a=o.length;t<a;t++){const c=o[t];Object.keys(s).forEach((o=>{e!==we&&e!==o||(s[o][c]||=[...ze(n[o],c)||ze(n[we],c)||[]],s[o][c].push([i,r-a+t+1]))}))}}match=ke;buildAllMatchers(){const e=Object.create(null);return Object.keys(this.#N).concat(Object.keys(this.#C)).forEach((t=>{e[t]||=this.#T(t)})),this.#C=this.#N=void 0,He=Object.create(null),e}#T(e){const t=[];let i=e===we;return[this.#C,this.#N].forEach((n=>{const s=n[e]?Object.keys(n[e]).map((t=>[t,n[e][t]])):[];0!==s.length?(i||=!0,t.push(...s)):e!==we&&t.push(...Object.keys(n[we]).map((e=>[e,n[we][e]])))})),i?function(e){const t=new Me,i=[];if(0===e.length)return Ze;const n=e.map((e=>[!/\*|\/:/.test(e[0]),...e])).sort((([e,t],[i,n])=>e?1:i?-1:t.length-n.length)),s=Object.create(null);for(let e=0,r=-1,o=n.length;e<o;e++){const[o,a,c]=n[e];let u;o?s[a]=[c.map((([e])=>[e,Object.create(null)])),xe]:r++;try{u=t.insert(a,r,o)}catch(e){throw e===je?new Ie(a):e}o||(i[r]=c.map((([e,t])=>{const i=Object.create(null);for(t-=1;t>=0;t--){const[e,n]=u[t];i[e]=n}return[e,i]})))}const[r,o,a]=t.buildRegExp();for(let e=0,t=i.length;e<t;e++)for(let t=0,n=i[e].length;t<n;t++){const n=i[e][t]?.[1];if(!n)continue;const s=Object.keys(n);for(let e=0,t=s.length;e<t;e++)n[s[e]]=a[n[s[e]]]}const c=[];for(const e in o)c[e]=i[o[e]];return[r,c,s]}(t):null}},We=class{name="SmartRouter";#x=[];#N=[];constructor(e){this.#x=e.routers}add(e,t,i){if(!this.#N)throw Error(Se);this.#N.push([e,t,i])}match(e,t){if(!this.#N)throw Error("Fatal error");const i=this.#x,n=this.#N,s=i.length;let r,o=0;for(;o<s;o++){const s=i[o];try{for(let e=0,t=n.length;e<t;e++)s.add(...n[e]);r=s.match(e,t)}catch(e){if(e instanceof Ie)continue;throw e}this.match=s.match.bind(s),this.#x=[s],this.#N=void 0;break}if(o===s)throw Error("Fatal error");return this.name="SmartRouter + "+this.activeRouter.name,r}get activeRouter(){if(this.#N||1!==this.#x.length)throw Error("No active router has been determined yet.");return this.#x[0]}},Ke=Object.create(null),Ve=e=>{for(const t in e)return!0;return!1},Xe=class e{#k;#A;#R;#D=0;#L=Ke;constructor(e,t,i){if(this.#A=i||Object.create(null),this.#k=[],e&&t){const i=Object.create(null);i[e]={handler:t,possibleKeys:[],score:0},this.#k=[i]}this.#R=[]}insert(t,i,n){this.#D=++this.#D;let s=this;const r=(e=>{const{groups:t,path:i}=(e=>{const t=[];return e=e.replace(/\{[^}]+\}/g,((e,i)=>{const n="@"+i;return t.push([n,e]),n})),{groups:t,path:e}})(e);return((e,t)=>{for(let i=t.length-1;i>=0;i--){const[n]=t[i];for(let s=e.length-1;s>=0;s--)if(e[s].includes(n)){e[s]=e[s].replace(n,t[i][1]);break}}return e})(B(i),t)})(i),o=[];for(let t=0,i=r.length;t<i;t++){const i=r[t],n=K(i,r[t+1]),a=Array.isArray(n)?n[0]:i;a in s.#A?(s=s.#A[a],n&&o.push(n[1])):(s.#A[a]=new e,n&&(s.#R.push(n),o.push(n[1])),s=s.#A[a])}return s.#k.push({[t]:{handler:n,possibleKeys:o.filter(((e,t,i)=>i.indexOf(e)===t)),score:this.#D}}),s}#j(e,t,i,n,s){for(let r=0,o=t.#k.length;r<o;r++){const o=t.#k[r],a=o[i]||o[we],c={};if(void 0!==a&&(a.params=Object.create(null),e.push(a),n!==Ke||s&&s!==Ke))for(let e=0,t=a.possibleKeys.length;e<t;e++){const t=a.possibleKeys[e],i=c[a.score];a.params[t]=s?.[t]&&!i?s[t]:n[t]??s?.[t],c[a.score]=!0}}}search(e,t){const i=[];this.#L=Ke;let n=[this];const s=B(t),r=[],o=s.length;let a=null;for(let c=0;c<o;c++){const u=s[c],d=c===o-1,l=[];for(let h=0,_=n.length;h<_;h++){const _=n[h],p=_.#A[u];p&&(p.#L=_.#L,d?(p.#A["*"]&&this.#j(i,p.#A["*"],e,_.#L),this.#j(i,p,e,_.#L)):l.push(p));for(let n=0,h=_.#R.length;n<h;n++){const h=_.#R[n],p=_.#L===Ke?{}:{..._.#L};if("*"===h){const t=_.#A["*"];t&&(this.#j(i,t,e,_.#L),t.#L=p,l.push(t));continue}const[f,m,g]=h;if(!(u||g instanceof RegExp))continue;const y=_.#A[f];if(g instanceof RegExp){if(null===a){a=Array(o);let e="/"===t[0]?1:0;for(let t=0;t<o;t++)a[t]=e,e+=s[t].length+1}const n=t.substring(a[c]),u=g.exec(n);if(u){if(p[m]=u[0],this.#j(i,y,e,_.#L,p),Ve(y.#A)){y.#L=p;const e=u[0].match(/\//)?.length??0;(r[e]||=[]).push(y)}continue}}(!0===g||g.test(u))&&(p[m]=u,d?(this.#j(i,y,e,p,_.#L),y.#A["*"]&&this.#j(i,y.#A["*"],e,p,_.#L)):(y.#L=p,l.push(y)))}}const h=r.shift();n=h?l.concat(h):l}return i.length>1&&i.sort(((e,t)=>e.score-t.score)),[i.map((({handler:e,params:t})=>[e,t]))]}},Ye=class{name="TrieRouter";#F;constructor(){this.#F=new Xe}add(e,t,i){const n=ee(t);if(n)for(let t=0,s=n.length;t<s;t++)this.#F.insert(e,n[t],i);else this.#F.insert(e,t,i)}match(e,t){return this.#F.search(e,t)}},Je=class extends Te{constructor(e={}){super(e),this.router=e.router??new We({routers:[new Be,new Ye]})}};!function(e){e.assertEqual=()=>{},e.assertIs=function(){},e.assertNever=function(){throw Error()},e.arrayToEnum=e=>{const t={};for(const i of e)t[i]=i;return t},e.getValidEnumValues=t=>{const i=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of i)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},e.find=(e,t)=>{for(const i of e)if(t(i))return i},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?""+t:t}(Ge||(Ge={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(qe||(qe={}));const Qe=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),et=e=>{switch(typeof e){case"undefined":return Qe.undefined;case"string":return Qe.string;case"number":return Number.isNaN(e)?Qe.nan:Qe.number;case"boolean":return Qe.boolean;case"function":return Qe.function;case"bigint":return Qe.bigint;case"symbol":return Qe.symbol;case"object":return Array.isArray(e)?Qe.array:null===e?Qe.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?Qe.promise:"undefined"!=typeof Map&&e instanceof Map?Qe.map:"undefined"!=typeof Set&&e instanceof Set?Qe.set:void 0!==Date&&e instanceof Date?Qe.date:Qe.object;default:return Qe.unknown}},tt=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class it extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},i={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)i._errors.push(t(s));else{let e=i,n=0;for(;n<s.path.length;){const i=s.path[n];n===s.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(t(s))):e[i]=e[i]||{_errors:[]},e=e[i],n++}}};return n(this),i}static assert(e){if(!(e instanceof it))throw Error("Not a ZodError: "+e)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},i=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}it.create=e=>new it(e);const nt=(e,t)=>{let i;switch(e.code){case tt.invalid_type:i=e.received===Qe.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case tt.invalid_literal:i="Invalid literal value, expected "+JSON.stringify(e.expected,Ge.jsonStringifyReplacer);break;case tt.unrecognized_keys:i="Unrecognized key(s) in object: "+Ge.joinValues(e.keys,", ");break;case tt.invalid_union:i="Invalid input";break;case tt.invalid_union_discriminator:i="Invalid discriminator value. Expected "+Ge.joinValues(e.options);break;case tt.invalid_enum_value:i=`Invalid enum value. Expected ${Ge.joinValues(e.options)}, received '${e.received}'`;break;case tt.invalid_arguments:i="Invalid function arguments";break;case tt.invalid_return_type:i="Invalid function return type";break;case tt.invalid_date:i="Invalid date";break;case tt.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:Ge.assertNever(e.validation):i="regex"!==e.validation?"Invalid "+e.validation:"Invalid";break;case tt.too_small:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case tt.too_big:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case tt.custom:i="Invalid input";break;case tt.invalid_intersection_types:i="Intersection results could not be merged";break;case tt.not_multiple_of:i="Number must be a multiple of "+e.multipleOf;break;case tt.not_finite:i="Number must be finite";break;default:i=t.defaultError,Ge.assertNever(e)}return{message:i}};let st=nt;function rt(){return st}const ot=e=>{const{data:t,path:i,errorMaps:n,issueData:s}=e,r=[...i,...s.path||[]],o={...s,path:r};if(void 0!==s.message)return{...s,path:r,message:s.message};let a="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)a=e(o,{data:t,defaultError:a}).message;return{...s,path:r,message:a}};function at(e,t){const i=rt(),n=ot({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===nt?void 0:nt].filter((e=>!!e))});e.common.issues.push(n)}class ct{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const n of t){if("aborted"===n.status)return ut;"dirty"===n.status&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const e of t){const t=await e.key,n=await e.value;i.push({key:t,value:n})}return ct.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return ut;if("aborted"===s.status)return ut;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(i[t.value]=s.value)}return{status:e.value,value:i}}}const ut=Object.freeze({status:"aborted"}),dt=e=>({status:"dirty",value:e}),lt=e=>({status:"valid",value:e}),ht=e=>"aborted"===e.status,_t=e=>"dirty"===e.status,pt=e=>"valid"===e.status,ft=e=>"undefined"!=typeof Promise&&e instanceof Promise;var mt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(mt||(mt={}));class gt{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}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 yt=(e,t)=>{if(pt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new it(e.common.issues);return this._error=t,this._error}}};function vt(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:n,description:s}=e;if(t&&(i||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??s.defaultError}:void 0===s.data?{message:r??n??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:r??i??s.defaultError}},description:s}}class bt{get description(){return this._def.description}_getType(e){return et(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:et(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ct,ctx:{common:e.parent.common,data:e.data,parsedType:et(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ft(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){const i={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},n=this._parseSync({data:e,path:i.path,parent:i});return yt(i,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return pt(i)?{value:i.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>pt(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:et(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(ft(n)?n:Promise.resolve(n));return yt(i,s)}refine(e,t){const i=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),r=()=>n.addIssue({code:tt.custom,...i(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(r(),!1))):!!s||(r(),!1)}))}refinement(e,t){return this._refinement(((i,n)=>!!e(i)||(n.addIssue("function"==typeof t?t(i,n):t),!1)))}_refinement(e){return new Oi({schema:this,typeName:ji.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return wi.create(this,this._def)}nullable(){return Ai.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ni.create(this)}promise(){return Ei.create(this,this._def)}or(e){return oi.create([this,e],this._def)}and(e){return di.create(this,e,this._def)}transform(e){return new Oi({...vt(this._def),schema:this,typeName:ji.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Si({...vt(this._def),innerType:this,defaultValue:t,typeName:ji.ZodDefault})}brand(){return new Ti({typeName:ji.ZodBranded,type:this,...vt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ii({...vt(this._def),innerType:this,catchValue:t,typeName:ji.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return xi.create(this,e)}readonly(){return ki.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Et=/^c[^\s-]{8,}$/i,Ot=/^[0-9a-z]+$/,wt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,At=/^[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,St=/^[a-z0-9_-]{21}$/i,It=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ct=/^[-+]?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)?)??$/,Nt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Tt;const xt=/^(?:(?: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])$/,kt=/^(?:(?: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])$/,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]))$/,Dt=/^(([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])$/,Lt=/^([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}(=)?))?$/,Ft="((\\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])))",Ut=RegExp(`^${Ft}$`);function Pt(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t+="(\\.\\d+)?"),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function Mt(e){return RegExp(`^${Pt(e)}$`)}function Zt(e){let t=`${Ft}T${Pt(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,RegExp(`^${t}$`)}function Ht(e,t){return!("v4"!==t&&t||!xt.test(e))||!("v6"!==t&&t||!Rt.test(e))}function $t(e,t){if(!It.test(e))return!1;try{const[i]=e.split(".");if(!i)return!1;const n=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),s=JSON.parse(atob(n));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function zt(e,t){return!("v4"!==t&&t||!kt.test(e))||!("v6"!==t&&t||!Dt.test(e))}class Gt extends bt{_parse(e){if(this._def.coerce&&(e.data=e.data+""),this._getType(e)!==Qe.string){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.string,received:t.parsedType}),ut}const t=new ct;let i;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),at(i,{code:tt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),at(i,{code:tt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const s=e.data.length>n.value,r=e.data.length<n.value;(s||r)&&(i=this._getOrReturnCtx(e,i),s?at(i,{code:tt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&at(i,{code:tt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)Nt.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"email",code:tt.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)Tt||(Tt=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Tt.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"emoji",code:tt.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)At.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"uuid",code:tt.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)St.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"nanoid",code:tt.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)Et.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"cuid",code:tt.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)Ot.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"cuid2",code:tt.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)wt.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"ulid",code:tt.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),at(i,{validation:"url",code:tt.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"regex",code:tt.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),at(i,{code:tt.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),at(i,{code:tt.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),at(i,{code:tt.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?Zt(n).test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{code:tt.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?Ut.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{code:tt.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?Mt(n).test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{code:tt.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?Ct.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"duration",code:tt.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?Ht(e.data,n.version)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"ip",code:tt.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?$t(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"jwt",code:tt.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?zt(e.data,n.version)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"cidr",code:tt.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?Lt.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"base64",code:tt.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?jt.test(e.data)||(i=this._getOrReturnCtx(e,i),at(i,{validation:"base64url",code:tt.invalid_string,message:n.message}),t.dirty()):Ge.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,i){return this.refinement((t=>e.test(t)),{validation:t,code:tt.invalid_string,...mt.errToObj(i)})}_addCheck(e){return new Gt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...mt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...mt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...mt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...mt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...mt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...mt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...mt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...mt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...mt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...mt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...mt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...mt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...mt.errToObj(e)})}datetime(e){return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,local:!1,message:e}:{kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...mt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return this._addCheck("string"==typeof e?{kind:"time",precision:null,message:e}:{kind:"time",precision:void 0===e?.precision?null:e?.precision,...mt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...mt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...mt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...mt.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...mt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...mt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...mt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...mt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...mt.errToObj(t)})}nonempty(e){return this.min(1,mt.errToObj(e))}trim(){return new Gt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Gt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Gt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function qt(e,t){const i=((""+e).split(".")[1]||"").length,n=((""+t).split(".")[1]||"").length,s=i>n?i:n;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}Gt.create=e=>new Gt({checks:[],typeName:ji.ZodString,coerce:e?.coerce??!1,...vt(e)});class Bt extends bt{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)!==Qe.number){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.number,received:t.parsedType}),ut}let t;const i=new ct;for(const n of this._def.checks)"int"===n.kind?Ge.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),at(t,{code:tt.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),at(t,{code:tt.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),at(t,{code:tt.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"multipleOf"===n.kind?0!==qt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),at(t,{code:tt.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),at(t,{code:tt.not_finite,message:n.message}),i.dirty()):Ge.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,mt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,mt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,mt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,mt.toString(t))}setLimit(e,t,i,n){return new Bt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:mt.toString(n)}]})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:mt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:mt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:mt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:mt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:mt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:mt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:mt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:mt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:mt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Ge.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Bt.create=e=>new Bt({checks:[],typeName:ji.ZodNumber,coerce:e?.coerce||!1,...vt(e)});class Wt extends bt{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)!==Qe.bigint)return this._getInvalidInput(e);let t;const i=new ct;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),at(t,{code:tt.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),at(t,{code:tt.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),at(t,{code:tt.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):Ge.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.bigint,received:t.parsedType}),ut}gte(e,t){return this.setLimit("min",e,!0,mt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,mt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,mt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,mt.toString(t))}setLimit(e,t,i,n){return new Wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:mt.toString(n)}]})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:mt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:mt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:mt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:mt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:mt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Wt.create=e=>new Wt({checks:[],typeName:ji.ZodBigInt,coerce:e?.coerce??!1,...vt(e)});class Kt extends bt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Qe.boolean){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.boolean,received:t.parsedType}),ut}return lt(e.data)}}Kt.create=e=>new Kt({typeName:ji.ZodBoolean,coerce:e?.coerce||!1,...vt(e)});class Vt extends bt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Qe.date){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.date,received:t.parsedType}),ut}if(Number.isNaN(e.data.getTime()))return at(this._getOrReturnCtx(e),{code:tt.invalid_date}),ut;const t=new ct;let i;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),at(i,{code:tt.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),at(i,{code:tt.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):Ge.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:mt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:mt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Vt.create=e=>new Vt({checks:[],coerce:e?.coerce||!1,typeName:ji.ZodDate,...vt(e)});class Xt extends bt{_parse(e){if(this._getType(e)!==Qe.symbol){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.symbol,received:t.parsedType}),ut}return lt(e.data)}}Xt.create=e=>new Xt({typeName:ji.ZodSymbol,...vt(e)});class Yt extends bt{_parse(e){if(this._getType(e)!==Qe.undefined){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.undefined,received:t.parsedType}),ut}return lt(e.data)}}Yt.create=e=>new Yt({typeName:ji.ZodUndefined,...vt(e)});class Jt extends bt{_parse(e){if(this._getType(e)!==Qe.null){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.null,received:t.parsedType}),ut}return lt(e.data)}}Jt.create=e=>new Jt({typeName:ji.ZodNull,...vt(e)});class Qt extends bt{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}}Qt.create=e=>new Qt({typeName:ji.ZodAny,...vt(e)});class ei extends bt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}}ei.create=e=>new ei({typeName:ji.ZodUnknown,...vt(e)});class ti extends bt{_parse(e){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.never,received:t.parsedType}),ut}}ti.create=e=>new ti({typeName:ji.ZodNever,...vt(e)});class ii extends bt{_parse(e){if(this._getType(e)!==Qe.undefined){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.void,received:t.parsedType}),ut}return lt(e.data)}}ii.create=e=>new ii({typeName:ji.ZodVoid,...vt(e)});class ni extends bt{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==Qe.array)return at(t,{code:tt.invalid_type,expected:Qe.array,received:t.parsedType}),ut;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(at(t,{code:e?tt.too_big:tt.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(at(t,{code:tt.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(at(t,{code:tt.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map(((e,i)=>n.type._parseAsync(new gt(t,e,t.path,i))))).then((e=>ct.mergeArray(i,e)));const s=[...t.data].map(((e,i)=>n.type._parseSync(new gt(t,e,t.path,i))));return ct.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new ni({...this._def,minLength:{value:e,message:mt.toString(t)}})}max(e,t){return new ni({...this._def,maxLength:{value:e,message:mt.toString(t)}})}length(e,t){return new ni({...this._def,exactLength:{value:e,message:mt.toString(t)}})}nonempty(e){return this.min(1,e)}}function si(e){if(e instanceof ri){const t={};for(const i in e.shape)t[i]=wi.create(si(e.shape[i]));return new ri({...e._def,shape:()=>t})}return e instanceof ni?new ni({...e._def,type:si(e.element)}):e instanceof wi?wi.create(si(e.unwrap())):e instanceof Ai?Ai.create(si(e.unwrap())):e instanceof li?li.create(e.items.map((e=>si(e)))):e}ni.create=(e,t)=>new ni({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ji.ZodArray,...vt(t)});class ri extends bt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Ge.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==Qe.object){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.object,received:t.parsedType}),ut}const{status:t,ctx:i}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),r=[];if(!(this._def.catchall instanceof ti&&"strip"===this._def.unknownKeys))for(const e in i.data)s.includes(e)||r.push(e);const o=[];for(const e of s)o.push({key:{status:"valid",value:e},value:n[e]._parse(new gt(i,i.data[e],i.path,e)),alwaysSet:e in i.data});if(this._def.catchall instanceof ti){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)o.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)r.length>0&&(at(i,{code:tt.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r)o.push({key:{status:"valid",value:t},value:e._parse(new gt(i,i.data[t],i.path,t)),alwaysSet:t in i.data})}return i.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const i=await t.key,n=await t.value;e.push({key:i,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>ct.mergeObjectSync(t,e))):ct.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return new ri({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{const n=this._def.errorMap?.(t,i).message??i.defaultError;return"unrecognized_keys"===t.code?{message:mt.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new ri({...this._def,unknownKeys:"strip"})}passthrough(){return new ri({...this._def,unknownKeys:"passthrough"})}extend(e){return new ri({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ri({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ji.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ri({...this._def,catchall:e})}pick(e){const t={};for(const i of Ge.objectKeys(e))e[i]&&this.shape[i]&&(t[i]=this.shape[i]);return new ri({...this._def,shape:()=>t})}omit(e){const t={};for(const i of Ge.objectKeys(this.shape))e[i]||(t[i]=this.shape[i]);return new ri({...this._def,shape:()=>t})}deepPartial(){return si(this)}partial(e){const t={};for(const i of Ge.objectKeys(this.shape)){const n=this.shape[i];t[i]=e&&!e[i]?n:n.optional()}return new ri({...this._def,shape:()=>t})}required(e){const t={};for(const i of Ge.objectKeys(this.shape))if(e&&!e[i])t[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof wi;)e=e._def.innerType;t[i]=e}return new ri({...this._def,shape:()=>t})}keyof(){return yi(Ge.objectKeys(this.shape))}}ri.create=(e,t)=>new ri({shape:()=>e,unknownKeys:"strip",catchall:ti.create(),typeName:ji.ZodObject,...vt(t)}),ri.strictCreate=(e,t)=>new ri({shape:()=>e,unknownKeys:"strict",catchall:ti.create(),typeName:ji.ZodObject,...vt(t)}),ri.lazycreate=(e,t)=>new ri({shape:e,unknownKeys:"strip",catchall:ti.create(),typeName:ji.ZodObject,...vt(t)});class oi extends bt{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map((async e=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;const i=e.map((e=>new it(e.ctx.common.issues)));return at(t,{code:tt.invalid_union,unionErrors:i}),ut}));{let e;const n=[];for(const s of i){const i={...t,common:{...t.common,issues:[]},parent:null},r=s._parseSync({data:t.data,path:t.path,parent:i});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:i}),i.common.issues.length&&n.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new it(e)));return at(t,{code:tt.invalid_union,unionErrors:s}),ut}}get options(){return this._def.options}}oi.create=(e,t)=>new oi({options:e,typeName:ji.ZodUnion,...vt(t)});const ai=e=>e instanceof mi?ai(e.schema):e instanceof Oi?ai(e.innerType()):e instanceof gi?[e.value]:e instanceof vi?e.options:e instanceof bi?Ge.objectValues(e.enum):e instanceof Si?ai(e._def.innerType):e instanceof Yt?[void 0]:e instanceof Jt?[null]:e instanceof wi?[void 0,...ai(e.unwrap())]:e instanceof Ai?[null,...ai(e.unwrap())]:e instanceof Ti||e instanceof ki?ai(e.unwrap()):e instanceof Ii?ai(e._def.innerType):[];class ci extends bt{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Qe.object)return at(t,{code:tt.invalid_type,expected:Qe.object,received:t.parsedType}),ut;const i=this.discriminator,n=this.optionsMap.get(t.data[i]);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(at(t,{code:tt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),ut)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const n=new Map;for(const i of t){const t=ai(i.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw Error(`Discriminator property ${e+""} has duplicate value ${s+""}`);n.set(s,i)}}return new ci({typeName:ji.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...vt(i)})}}function ui(e,t){const i=et(e),n=et(t);if(e===t)return{valid:!0,data:e};if(i===Qe.object&&n===Qe.object){const i=Ge.objectKeys(t),n=Ge.objectKeys(e).filter((e=>-1!==i.indexOf(e))),s={...e,...t};for(const i of n){const n=ui(e[i],t[i]);if(!n.valid)return{valid:!1};s[i]=n.data}return{valid:!0,data:s}}if(i===Qe.array&&n===Qe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let n=0;n<e.length;n++){const s=ui(e[n],t[n]);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}return i===Qe.date&&n===Qe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class di extends bt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=(e,n)=>{if(ht(e)||ht(n))return ut;const s=ui(e.value,n.value);return s.valid?((_t(e)||_t(n))&&t.dirty(),{status:t.value,value:s.data}):(at(i,{code:tt.invalid_intersection_types}),ut)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}di.create=(e,t,i)=>new di({left:e,right:t,typeName:ji.ZodIntersection,...vt(i)});class li extends bt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Qe.array)return at(i,{code:tt.invalid_type,expected:Qe.array,received:i.parsedType}),ut;if(i.data.length<this._def.items.length)return at(i,{code:tt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ut;!this._def.rest&&i.data.length>this._def.items.length&&(at(i,{code:tt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...i.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new gt(i,e,i.path,t)):null})).filter((e=>!!e));return i.common.async?Promise.all(n).then((e=>ct.mergeArray(t,e))):ct.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new li({...this._def,rest:e})}}li.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new li({items:e,typeName:ji.ZodTuple,rest:null,...vt(t)})};class hi extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Qe.object)return at(i,{code:tt.invalid_type,expected:Qe.object,received:i.parsedType}),ut;const n=[],s=this._def.keyType,r=this._def.valueType;for(const e in i.data)n.push({key:s._parse(new gt(i,e,i.path,e)),value:r._parse(new gt(i,i.data[e],i.path,e)),alwaysSet:e in i.data});return i.common.async?ct.mergeObjectAsync(t,n):ct.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,i){return new hi(t instanceof bt?{keyType:e,valueType:t,typeName:ji.ZodRecord,...vt(i)}:{keyType:Gt.create(),valueType:e,typeName:ji.ZodRecord,...vt(t)})}}class _i extends bt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Qe.map)return at(i,{code:tt.invalid_type,expected:Qe.map,received:i.parsedType}),ut;const n=this._def.keyType,s=this._def.valueType,r=[...i.data.entries()].map((([e,t],r)=>({key:n._parse(new gt(i,e,i.path,[r,"key"])),value:s._parse(new gt(i,t,i.path,[r,"value"]))})));if(i.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const i of r){const n=await i.key,s=await i.value;if("aborted"===n.status||"aborted"===s.status)return ut;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const i of r){const n=i.key,s=i.value;if("aborted"===n.status||"aborted"===s.status)return ut;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}_i.create=(e,t,i)=>new _i({valueType:t,keyType:e,typeName:ji.ZodMap,...vt(i)});class pi extends bt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==Qe.set)return at(i,{code:tt.invalid_type,expected:Qe.set,received:i.parsedType}),ut;const n=this._def;null!==n.minSize&&i.data.size<n.minSize.value&&(at(i,{code:tt.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&i.data.size>n.maxSize.value&&(at(i,{code:tt.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function r(e){const i=new Set;for(const n of e){if("aborted"===n.status)return ut;"dirty"===n.status&&t.dirty(),i.add(n.value)}return{status:t.value,value:i}}const o=[...i.data.values()].map(((e,t)=>s._parse(new gt(i,e,i.path,t))));return i.common.async?Promise.all(o).then((e=>r(e))):r(o)}min(e,t){return new pi({...this._def,minSize:{value:e,message:mt.toString(t)}})}max(e,t){return new pi({...this._def,maxSize:{value:e,message:mt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}pi.create=(e,t)=>new pi({valueType:e,minSize:null,maxSize:null,typeName:ji.ZodSet,...vt(t)});class fi extends bt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Qe.function)return at(t,{code:tt.invalid_type,expected:Qe.function,received:t.parsedType}),ut;function i(e,i){return ot({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rt(),nt].filter((e=>!!e)),issueData:{code:tt.invalid_arguments,argumentsError:i}})}function n(e,i){return ot({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rt(),nt].filter((e=>!!e)),issueData:{code:tt.invalid_return_type,returnTypeError:i}})}const s={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Ei){const e=this;return lt((async function(...t){const o=new it([]),a=await e._def.args.parseAsync(t,s).catch((e=>{throw o.addIssue(i(t,e)),o})),c=await Reflect.apply(r,this,a);return await e._def.returns._def.type.parseAsync(c,s).catch((e=>{throw o.addIssue(n(c,e)),o}))}))}{const e=this;return lt((function(...t){const o=e._def.args.safeParse(t,s);if(!o.success)throw new it([i(t,o.error)]);const a=Reflect.apply(r,this,o.data),c=e._def.returns.safeParse(a,s);if(!c.success)throw new it([n(a,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new fi({...this._def,args:li.create(e).rest(ei.create())})}returns(e){return new fi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new fi({args:e||li.create([]).rest(ei.create()),returns:t||ei.create(),typeName:ji.ZodFunction,...vt(i)})}}class mi extends bt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}mi.create=(e,t)=>new mi({getter:e,typeName:ji.ZodLazy,...vt(t)});class gi extends bt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return at(t,{received:t.data,code:tt.invalid_literal,expected:this._def.value}),ut}return{status:"valid",value:e.data}}get value(){return this._def.value}}function yi(e,t){return new vi({values:e,typeName:ji.ZodEnum,...vt(t)})}gi.create=(e,t)=>new gi({value:e,typeName:ji.ZodLiteral,...vt(t)});class vi extends bt{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return at(t,{expected:Ge.joinValues(this._def.values),received:t.parsedType,code:tt.invalid_type}),ut}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e);return at(t,{received:t.data,code:tt.invalid_enum_value,options:this._def.values}),ut}return lt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return vi.create(e,{...this._def,...t})}exclude(e,t=this._def){return vi.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}vi.create=yi;class bi extends bt{_parse(e){const t=Ge.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==Qe.string&&i.parsedType!==Qe.number){const e=Ge.objectValues(t);return at(i,{expected:Ge.joinValues(e),received:i.parsedType,code:tt.invalid_type}),ut}if(this._cache||(this._cache=new Set(Ge.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=Ge.objectValues(t);return at(i,{received:i.data,code:tt.invalid_enum_value,options:e}),ut}return lt(e.data)}get enum(){return this._def.values}}bi.create=(e,t)=>new bi({values:e,typeName:ji.ZodNativeEnum,...vt(t)});class Ei extends bt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Qe.promise&&!1===t.common.async)return at(t,{code:tt.invalid_type,expected:Qe.promise,received:t.parsedType}),ut;const i=t.parsedType===Qe.promise?t.data:Promise.resolve(t.data);return lt(i.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ei.create=(e,t)=>new Ei({type:e,typeName:ji.ZodPromise,...vt(t)});class Oi extends bt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ji.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{at(i,e),e.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(i.data,s);if(i.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return ut;const n=await this._def.schema._parseAsync({data:e,path:i.path,parent:i});return"aborted"===n.status?ut:"dirty"===n.status||"dirty"===t.value?dt(n.value):n}));{if("aborted"===t.value)return ut;const n=this._def.schema._parseSync({data:e,path:i.path,parent:i});return"aborted"===n.status?ut:"dirty"===n.status||"dirty"===t.value?dt(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===i.common.async){const n=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===n.status?ut:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((i=>"aborted"===i.status?ut:("dirty"===i.status&&t.dirty(),e(i.value).then((()=>({status:t.value,value:i.value}))))))}if("transform"===n.type){if(!1===i.common.async){const e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!pt(e))return ut;const r=n.transform(e.value,s);if(r instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((e=>pt(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):ut))}Ge.assertNever(n)}}Oi.create=(e,t,i)=>new Oi({schema:e,typeName:ji.ZodEffects,effect:t,...vt(i)}),Oi.createWithPreprocess=(e,t,i)=>new Oi({schema:t,effect:{type:"preprocess",transform:e},typeName:ji.ZodEffects,...vt(i)});class wi extends bt{_parse(e){return this._getType(e)===Qe.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wi.create=(e,t)=>new wi({innerType:e,typeName:ji.ZodOptional,...vt(t)});class Ai extends bt{_parse(e){return this._getType(e)===Qe.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ai.create=(e,t)=>new Ai({innerType:e,typeName:ji.ZodNullable,...vt(t)});class Si extends bt{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===Qe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Si.create=(e,t)=>new Si({innerType:e,typeName:ji.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...vt(t)});class Ii extends bt{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return ft(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new it(i.common.issues)},input:i.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new it(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Ii.create=(e,t)=>new Ii({innerType:e,typeName:ji.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...vt(t)});class Ci extends bt{_parse(e){if(this._getType(e)!==Qe.nan){const t=this._getOrReturnCtx(e);return at(t,{code:tt.invalid_type,expected:Qe.nan,received:t.parsedType}),ut}return{status:"valid",value:e.data}}}Ci.create=e=>new Ci({typeName:ji.ZodNaN,...vt(e)});const Ni=Symbol("zod_brand");class Ti extends bt{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class xi extends bt{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?ut:"dirty"===e.status?(t.dirty(),dt(e.value)):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})();{const e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?ut:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new xi({in:e,out:t,typeName:ji.ZodPipeline})}}class ki extends bt{_parse(e){const t=this._def.innerType._parse(e),i=e=>(pt(e)&&(e.value=Object.freeze(e.value)),e);return ft(t)?t.then((e=>i(e))):i(t)}unwrap(){return this._def.innerType}}function Ri(e,t){const i="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof i?{message:i}:i}function Di(e,t={},i){return e?Qt.create().superRefine(((n,s)=>{const r=e(n);if(r instanceof Promise)return r.then((e=>{if(!e){const e=Ri(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}}));if(!r){const e=Ri(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}})):Qt.create()}ki.create=(e,t)=>new ki({innerType:e,typeName:ji.ZodReadonly,...vt(t)});const Li={object:ri.lazycreate};var ji;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(ji||(ji={}));const Fi=Gt.create,Ui=Bt.create,Pi=Ci.create,Mi=Wt.create,Zi=Kt.create,Hi=Vt.create,$i=Xt.create,zi=Yt.create,Gi=Jt.create,qi=Qt.create,Bi=ei.create,Wi=ti.create,Ki=ii.create,Vi=ni.create,Xi=ri.create,Yi=ri.strictCreate,Ji=oi.create,Qi=ci.create,en=di.create,tn=li.create,nn=hi.create,sn=_i.create,rn=pi.create,on=fi.create,an=mi.create,cn=gi.create,un=vi.create,dn=bi.create,ln=Ei.create,hn=Oi.create,_n=wi.create,pn=Ai.create,fn=Oi.createWithPreprocess,mn=xi.create,gn={string:e=>Gt.create({...e,coerce:!0}),number:e=>Bt.create({...e,coerce:!0}),boolean:e=>Kt.create({...e,coerce:!0}),bigint:e=>Wt.create({...e,coerce:!0}),date:e=>Vt.create({...e,coerce:!0})};var yn=Object.freeze({__proto__:null,BRAND:Ni,DIRTY:dt,EMPTY_PATH:[],INVALID:ut,NEVER:ut,OK:lt,ParseStatus:ct,Schema:bt,ZodAny:Qt,ZodArray:ni,ZodBigInt:Wt,ZodBoolean:Kt,ZodBranded:Ti,ZodCatch:Ii,ZodDate:Vt,ZodDefault:Si,ZodDiscriminatedUnion:ci,ZodEffects:Oi,ZodEnum:vi,ZodError:it,get ZodFirstPartyTypeKind(){return ji},ZodFunction:fi,ZodIntersection:di,ZodIssueCode:tt,ZodLazy:mi,ZodLiteral:gi,ZodMap:_i,ZodNaN:Ci,ZodNativeEnum:bi,ZodNever:ti,ZodNull:Jt,ZodNullable:Ai,ZodNumber:Bt,ZodObject:ri,ZodOptional:wi,ZodParsedType:Qe,ZodPipeline:xi,ZodPromise:Ei,ZodReadonly:ki,ZodRecord:hi,ZodSchema:bt,ZodSet:pi,ZodString:Gt,ZodSymbol:Xt,ZodTransformer:Oi,ZodTuple:li,ZodType:bt,ZodUndefined:Yt,ZodUnion:oi,ZodUnknown:ei,ZodVoid:ii,addIssueToContext:at,any:qi,array:Vi,bigint:Mi,boolean:Zi,coerce:gn,custom:Di,date:Hi,datetimeRegex:Zt,defaultErrorMap:nt,discriminatedUnion:Qi,effect:hn,enum:un,function:on,getErrorMap:rt,getParsedType:et,instanceof:(e,t={message:"Input not instance of "+e.name})=>Di((t=>t instanceof e),t),intersection:en,isAborted:ht,isAsync:ft,isDirty:_t,isValid:pt,late:Li,lazy:an,literal:cn,makeIssue:ot,map:sn,nan:Pi,nativeEnum:dn,never:Wi,null:Gi,nullable:pn,number:Ui,object:Xi,get objectUtil(){return qe},oboolean:()=>Zi().optional(),onumber:()=>Ui().optional(),optional:_n,ostring:()=>Fi().optional(),pipeline:mn,preprocess:fn,promise:ln,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:nn,set:rn,setErrorMap:function(e){st=e},strictObject:Yi,string:Fi,symbol:$i,transformer:hn,tuple:tn,undefined:zi,union:Ji,unknown:Bi,get util(){return Ge},void:Ki});function vn(e,t){const i={};return Object.keys(e.paths).forEach((n=>{i[Q(t.replaceAll(/:([^\/]+)/g,"{$1}"),n)]=e.paths[n]})),{...e,paths:i}}function bn(e){return/^application\/([a-z-\.]+\+)?json/.test(e)}function En(e){return e.startsWith("multipart/form-data")||e.startsWith("application/x-www-form-urlencoded")}c(yn);var On,wn=Object.freeze({__proto__:null,OpenAPIHono:class e extends Je{openAPIRegistry;defaultHook;constructor(e){super(e),this.openAPIRegistry=new y,this.defaultHook=e?.defaultHook}openapi=({middleware:e,hide:t,...i},n,s=this.defaultHook)=>{t||this.openAPIRegistry.registerPath(i);const r=[];if(i.request?.query){const e=he("query",i.request.query,s);r.push(e)}if(i.request?.params){const e=he("param",i.request.params,s);r.push(e)}if(i.request?.headers){const e=he("header",i.request.headers,s);r.push(e)}if(i.request?.cookies){const e=he("cookie",i.request.cookies,s);r.push(e)}const o=i.request?.body?.content;if(o)for(const e of Object.keys(o)){if(!o[e])continue;const t=o[e].schema;if(t instanceof bt){if(bn(e)){const e=he("json",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&bn(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("json",{}),await i()})}if(En(e)){const e=he("form",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&En(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("form",{}),await i()})}}}const a=e?Array.isArray(e)?e:[e]:[];return this.on([i.method],i.path.replaceAll(/\/{(.+?)}/g,"/:$1"),...a,...r,n),this};getOpenAPIDocument=e=>{const t=new $(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?vn(t,this._basePath):t};getOpenAPI31Document=e=>{const t=new q(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?vn(t,this._basePath):t};doc=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPIDocument(i);return e.json(t)}catch(t){return e.json(t,500)}}));doc31=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPI31Document(i);return e.json(t)}catch(t){return e.json(t,500)}}));route(t,i){const n=t.replaceAll(/:([^\/]+)/g,"{$1}");return super.route(t,i),i instanceof e?(i.openAPIRegistry.definitions.forEach((e=>{switch(e.type){case"component":return this.openAPIRegistry.registerComponent(e.componentType,e.name,e.component);case"route":return void this.openAPIRegistry.registerPath({...e.route,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.route.path)});case"webhook":return void this.openAPIRegistry.registerWebhook({...e.webhook,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.webhook.path)});case"schema":return this.openAPIRegistry.register(e.schema._def.openapi._internal.refId,e.schema);case"parameter":return this.openAPIRegistry.registerParameter(e.schema._def.openapi._internal.refId,e.schema);default:throw Error("Unknown registry type: "+e)}})),this):this}basePath(t){return new e({...super.basePath(t),defaultHook:this.defaultHook})}},createRoute:e=>{const t={...e,getRoutingPath:()=>e.path.replaceAll(/\/{(.+?)}/g,"/:$1")};return Object.defineProperty(t,"getRoutingPath",{enumerable:!1})},extendZodWithOpenApi:c,z:yn}),An=e(wn),Sn=(On||(On=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=An,i=t.z.enum(["user_action","admin_action","system","api"]),n=t.z.object({type:t.z.enum(["user","admin","system","api_key","client_credentials"]),id:t.z.string().optional(),email:t.z.string().optional(),org_id:t.z.string().optional(),org_name:t.z.string().optional(),scopes:t.z.array(t.z.string()).optional(),client_id:t.z.string().optional()}),s=t.z.object({type:t.z.string(),id:t.z.string(),before:t.z.record(t.z.unknown()).optional(),after:t.z.record(t.z.unknown()).optional(),diff:t.z.record(t.z.object({old:t.z.unknown(),new:t.z.unknown()})).optional()}),r=t.z.object({method:t.z.string(),path:t.z.string(),query:t.z.record(t.z.string()).optional(),body:t.z.unknown().optional(),ip:t.z.string(),user_agent:t.z.string().optional(),correlation_id:t.z.string().optional()}),o=t.z.object({status_code:t.z.number(),body:t.z.unknown().optional()}),a=t.z.object({country_code:t.z.string(),city_name:t.z.string(),latitude:t.z.string(),longitude:t.z.string(),time_zone:t.z.string(),continent_code:t.z.string()}),c=t.z.object({name:t.z.string(),version:t.z.string(),env:t.z.record(t.z.string()).optional()}),u=t.z.object({tenant_id:t.z.string(),event_type:t.z.string(),log_type:t.z.string(),description:t.z.string().optional(),category:i,actor:n,target:s,request:r,response:o.optional(),connection:t.z.string().optional(),strategy:t.z.string().optional(),strategy_type:t.z.string().optional(),location:a.optional(),auth0_client:c.optional(),hostname:t.z.string(),is_mobile:t.z.boolean().optional(),timestamp:t.z.string()}),d=u.extend({id:t.z.string()}),l=t.z.object({created_at:t.z.string(),updated_at:t.z.string()}),h=t.z.enum(["AUTH0","EMAIL","REDIRECT"]),_=t.z.enum(["CREATE_USER","GET_USER","UPDATE_USER","SEND_REQUEST","SEND_EMAIL"]),p=t.z.enum(["VERIFY_EMAIL"]),f=t.z.object({require_mx_record:t.z.boolean().optional(),block_aliases:t.z.boolean().optional(),block_free_emails:t.z.boolean().optional(),block_disposable_emails:t.z.boolean().optional(),blocklist:t.z.array(t.z.string()).optional(),allowlist:t.z.array(t.z.string()).optional()}),m=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("AUTH0"),action:t.z.literal("UPDATE_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({connection_id:t.z.string().optional(),user_id:t.z.string(),changes:t.z.record(t.z.string(),t.z.any())})}),g=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("EMAIL"),action:t.z.literal("VERIFY_EMAIL"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({email:t.z.string(),rules:f.optional()})}),y=t.z.enum(["change-email","account","custom"]),v=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("REDIRECT"),action:t.z.literal("REDIRECT_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({target:y.openapi({description:"The predefined target to redirect to, or 'custom' for a custom URL"}),custom_url:t.z.string().optional().openapi({description:"Custom URL to redirect to when target is 'custom'"})})}),b=t.z.union([m,g,v]),E=t.z.object({name:t.z.string().min(1).max(150).openapi({description:"The name of the flow"}),actions:t.z.array(b).optional().default([]).openapi({description:"The list of actions to execute in sequence"})}),O=E.extend({...l.shape,id:t.z.string().openapi({description:"Unique identifier for the flow",example:"af_12tMpdJ3iek7svMyZkSh5M"})}),w=t.z.object({page:t.z.string().min(0).optional().default("0").transform((e=>parseInt(e,10))).openapi({description:"The page number where 0 is the first page"}),per_page:t.z.string().min(1).optional().default("10").transform((e=>parseInt(e,10))).openapi({description:"The number of items per page"}),include_totals:t.z.string().optional().default("false").transform((e=>"true"===e)).openapi({description:"If the total number of items should be included in the response"}),sort:t.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:"A property that should have the format 'string:-1' or 'string:1'"}),q:t.z.string().optional().openapi({description:"A lucene query string used to filter the results"})}),A=t.z.object({start:t.z.number(),limit:t.z.number(),length:t.z.number(),total:t.z.number().optional()}),S=t.z.object({email:t.z.string().optional(),email_verified:t.z.boolean().optional(),name:t.z.string().optional(),username:t.z.string().optional(),given_name:t.z.string().optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),family_name:t.z.string().optional()}).catchall(t.z.any()),I=t.z.object({connection:t.z.string(),user_id:t.z.string(),provider:t.z.string(),isSocial:t.z.boolean(),email:t.z.string().optional(),email_verified:t.z.boolean().optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),username:t.z.string().optional(),access_token:t.z.string().optional(),access_token_secret:t.z.string().optional(),refresh_token:t.z.string().optional(),profileData:S.optional()}),C=t.z.object({formatted:t.z.string().optional(),street_address:t.z.string().optional(),locality:t.z.string().optional(),region:t.z.string().optional(),postal_code:t.z.string().optional(),country:t.z.string().optional()}).optional(),N=t.z.object({email:t.z.string().optional().transform((e=>e&&e.toLowerCase())),username:t.z.string().refine((e=>!e.includes("@")),{message:'Usernames must not contain "@". Use the email field for email addresses.'}).optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),given_name:t.z.string().optional(),family_name:t.z.string().optional(),nickname:t.z.string().optional(),name:t.z.string().optional(),picture:t.z.string().optional(),locale:t.z.string().optional(),linked_to:t.z.string().optional(),profileData:t.z.string().optional(),user_id:t.z.string().optional(),app_metadata:t.z.any().default({}).optional(),user_metadata:t.z.any().default({}).optional(),middle_name:t.z.string().optional(),preferred_username:t.z.string().optional(),profile:t.z.string().optional(),website:t.z.string().optional(),gender:t.z.string().optional(),birthdate:t.z.string().optional(),zoneinfo:t.z.string().optional(),address:C}),T=N.extend({email_verified:t.z.boolean().default(!1),verify_email:t.z.boolean().optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string().optional(),provider:t.z.string().optional(),connection:t.z.string(),is_social:t.z.boolean().optional(),password:t.z.object({hash:t.z.string(),algorithm:t.z.string()}).optional()}),x=t.z.object({...T.omit({password:!0}).shape,...l.shape,user_id:t.z.string(),provider:t.z.string(),is_social:t.z.boolean(),email:t.z.string().optional(),login_count:t.z.number().default(0),identities:t.z.array(I).optional()}),k=x,R=N.extend({login_count:t.z.number(),multifactor:t.z.array(t.z.string()).optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string()}).catchall(t.z.any()),D=t.z.object({client_id:t.z.string().openapi({description:"ID of this client."}),name:t.z.string().min(1).openapi({description:"Name of this client (min length: 1 character, does not allow < or >)."}),description:t.z.string().max(140).optional().openapi({description:"Free text description of this client (max length: 140 characters)."}),global:t.z.boolean().default(!1).openapi({description:"Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false)."}),client_secret:t.z.string().default((()=>((e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[e]];return t})())).optional().openapi({description:"Client secret (which you must not make public)."}),app_type:t.z.enum(["native","spa","regular_web","non_interactive","resource_server","express_configuration","rms","box","cloudbees","concur","dropbox","mscrm","echosign","egnyte","newrelic","office365","salesforce","sentry","sharepoint","slack","springcm","zendesk","zoom","sso_integration","oag"]).default("regular_web").optional().openapi({description:"The type of application this client represents"}),logo_uri:t.z.string().url().optional().openapi({description:"URL of the logo to display for this client. Recommended size is 150x150 pixels."}),is_first_party:t.z.boolean().default(!1).openapi({description:"Whether this client a first party client (true) or not (false)."}),oidc_conformant:t.z.boolean().default(!0).openapi({description:"Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false)."}),auth0_conformant:t.z.boolean().default(!0).openapi({description:"Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance)."}),callbacks:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication."}),allowed_origins:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs."}),web_origins:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."}),client_aliases:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of audiences/realms for SAML protocol. Used by the wsfed addon."}),allowed_clients:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed."}),connections:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of connection IDs enabled for this client. The order determines the display order on the login page."}),allowed_logout_urls:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."}),session_transfer:t.z.record(t.z.any()).default({}).optional().openapi({description:"Native to Web SSO Configuration"}),oidc_logout:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration for OIDC backchannel logout"}),grant_types:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code."}),jwt_configuration:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration related to JWTs for the client."}),signing_keys:t.z.array(t.z.record(t.z.any())).default([]).optional().openapi({description:"Signing certificates associated with this client."}),encryption_key:t.z.record(t.z.any()).default({}).optional().openapi({description:"Encryption used for WsFed responses with this client."}),sso:t.z.boolean().default(!1).openapi({description:"Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false)."}),sso_disabled:t.z.boolean().default(!0).openapi({description:"Whether Single Sign On is disabled (true) or enabled (true). Defaults to true."}),cross_origin_authentication:t.z.boolean().default(!1).openapi({description:"Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false)."}),cross_origin_loc:t.z.string().url().optional().openapi({description:"URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page."}),custom_login_page_on:t.z.boolean().default(!1).openapi({description:"Whether a custom login page is to be used (true) or the default provided login page (false)."}),custom_login_page:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page."}),custom_login_page_preview:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page. (Used on Previews)"}),form_template:t.z.string().optional().openapi({description:"HTML form template to be used for WS-Federation."}),addons:t.z.record(t.z.any()).default({}).optional().openapi({description:"Addons enabled for this client and their associated configurations."}),token_endpoint_auth_method:t.z.enum(["none","client_secret_post","client_secret_basic"]).default("client_secret_basic").optional().openapi({description:"Defines the requested authentication method for the token endpoint. Can be none (public client without a client secret), client_secret_post (client uses HTTP POST parameters), or client_secret_basic (client uses HTTP Basic)."}),client_metadata:t.z.record(t.z.string().max(255)).default({}).optional().openapi({description:'Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?"/()<>@ [Tab][Space]'}),mobile:t.z.record(t.z.any()).default({}).optional().openapi({description:"Additional configuration for native mobile apps."}),initiate_login_uri:t.z.string().url().optional().openapi({description:"Initiate login uri, must be https"}),native_social_login:t.z.record(t.z.any()).default({}).optional(),refresh_token:t.z.record(t.z.any()).default({}).optional().openapi({description:"Refresh token configuration"}),default_organization:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines the default Organization ID and flows"}),organization_usage:t.z.enum(["deny","allow","require"]).default("deny").optional().openapi({description:"Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require."}),organization_require_behavior:t.z.enum(["no_prompt","pre_login_prompt","post_login_prompt"]).default("no_prompt").optional().openapi({description:"Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true."}),client_authentication_methods:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines client authentication methods."}),require_pushed_authorization_requests:t.z.boolean().default(!1).openapi({description:"Makes the use of Pushed Authorization Requests mandatory for this client"}),require_proof_of_possession:t.z.boolean().default(!1).openapi({description:"Makes the use of Proof-of-Possession mandatory for this client"}),signed_request_object:t.z.record(t.z.any()).default({}).optional().openapi({description:"JWT-secured Authorization Requests (JAR) settings."}),compliance_level:t.z.enum(["none","fapi1_adv_pkj_par","fapi1_adv_mtls_par","fapi2_sp_pkj_mtls","fapi2_sp_mtls_mtls"]).optional().openapi({description:"Defines the compliance level for this client, which may restrict it's capabilities"}),par_request_expiry:t.z.number().optional().openapi({description:"Specifies how long, in seconds, a Pushed Authorization Request URI remains valid"}),token_quota:t.z.record(t.z.any()).default({}).optional()}),L=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),...D.shape}),j=t.z.object({client_id:t.z.string().min(1).openapi({description:"ID of the client."}),audience:t.z.string().min(1).openapi({description:"The audience (API identifier) of this client grant."}),scope:t.z.array(t.z.string()).optional().openapi({description:"Scopes allowed for this client grant."}),organization_usage:t.z.enum(["deny","allow","require"]).optional().openapi({description:"Defines whether organizations can be used with client credentials exchanges for this grant."}),allow_any_organization:t.z.boolean().optional().openapi({description:"If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations."}),is_system:t.z.boolean().optional().openapi({description:"If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly."}),subject_type:t.z.enum(["client","user"]).optional().openapi({description:"The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."}),authorization_details_types:t.z.array(t.z.string()).optional().openapi({description:"Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."})}),F=t.z.object({id:t.z.string().openapi({description:"ID of the client grant."}),...j.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),U=t.z.array(F),P=t.z.object({x:t.z.number(),y:t.z.number()});var M=(e=>(e.RICH_TEXT="RICH_TEXT",e.NEXT_BUTTON="NEXT_BUTTON",e.BACK_BUTTON="BACK_BUTTON",e.SUBMIT_BUTTON="SUBMIT_BUTTON",e.DIVIDER="DIVIDER",e.TEXT="TEXT",e.EMAIL="EMAIL",e.PASSWORD="PASSWORD",e.NUMBER="NUMBER",e.PHONE="PHONE",e.DATE="DATE",e.CHECKBOX="CHECKBOX",e.RADIO="RADIO",e.SELECT="SELECT",e.HIDDEN="HIDDEN",e.LEGAL="LEGAL",e))(M||{}),Z=(e=>(e.BLOCK="BLOCK",e.FIELD="FIELD",e))(Z||{});const H=t.z.object({id:t.z.string(),category:t.z.nativeEnum(Z),type:t.z.nativeEnum(M)}),$=H.extend({category:t.z.literal("BLOCK"),type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string()}).passthrough()}),z=H.extend({category:t.z.literal("BLOCK"),type:t.z.union([t.z.literal("NEXT_BUTTON"),t.z.literal("BACK_BUTTON"),t.z.literal("SUBMIT_BUTTON")]),config:t.z.object({text:t.z.string()}).passthrough()}),G=H.extend({category:t.z.literal("FIELD"),type:t.z.literal("LEGAL"),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({text:t.z.string()}).passthrough()}),q=H.extend({category:t.z.literal("FIELD"),type:t.z.union([t.z.literal("TEXT"),t.z.literal("EMAIL"),t.z.literal("PASSWORD"),t.z.literal("NUMBER"),t.z.literal("PHONE"),t.z.literal("DATE"),t.z.literal("CHECKBOX"),t.z.literal("RADIO"),t.z.literal("SELECT"),t.z.literal("HIDDEN")]),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({label:t.z.string().optional(),placeholder:t.z.string().optional()}).passthrough()}),B=t.z.object({id:t.z.string(),category:t.z.string(),type:t.z.string()}).passthrough(),W=t.z.union([$,z,G,q,B]);var K=(e=>(e.STEP="STEP",e.FLOW="FLOW",e.CONDITION="CONDITION",e.ACTION="ACTION",e))(K||{});const V=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:P,alias:t.z.string().optional(),config:t.z.object({components:t.z.array(W),next_node:t.z.string()}).passthrough()}),X=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:P,alias:t.z.string().optional(),config:t.z.object({flow_id:t.z.string(),next_node:t.z.string()})}),Y=t.z.object({id:t.z.string(),type:t.z.literal("ACTION"),coordinates:P,alias:t.z.string().optional(),config:t.z.object({action_type:t.z.enum(["REDIRECT"]).openapi({description:"The type of action to perform"}),target:t.z.enum(["change-email","account","custom"]).openapi({description:"The predefined target to redirect to"}),custom_url:t.z.string().optional().openapi({description:"Custom URL when target is 'custom'"}),next_node:t.z.string().openapi({description:"The next node to navigate to after action (for non-redirect actions)"})}).passthrough()}),J=t.z.object({id:t.z.string(),type:t.z.string(),coordinates:P}).passthrough(),Q=t.z.union([V,X,Y,J]),ee=t.z.object({next_node:t.z.string(),coordinates:P}).passthrough(),te=t.z.object({resume_flow:t.z.boolean().optional(),coordinates:P}).passthrough(),ie=t.z.object({id:t.z.string(),name:t.z.string(),languages:t.z.object({primary:t.z.string()}).passthrough(),nodes:t.z.array(Q),start:ee,ending:te,created_at:t.z.string(),updated_at:t.z.string(),links:t.z.object({sdkSrc:t.z.string().optional(),sdk_src:t.z.string().optional()}).passthrough()}).passthrough(),ne=ie.omit({id:!0,created_at:!0,updated_at:!0});var se=(e=>(e.TOKEN="token",e.ID_TOKEN="id_token",e.TOKEN_ID_TOKEN="token id_token",e.CODE="code",e))(se||{}),re=(e=>(e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post",e.WEB_MESSAGE="web_message",e.SAML_POST="saml_post",e))(re||{}),oe=(e=>(e.S256="S256",e.Plain="plain",e))(oe||{});const ae=t.z.object({client_id:t.z.string(),act_as:t.z.string().optional(),response_type:t.z.nativeEnum(se).optional(),response_mode:t.z.nativeEnum(re).optional(),redirect_uri:t.z.string().optional(),audience:t.z.string().optional(),organization:t.z.string().optional(),state:t.z.string().optional(),nonce:t.z.string().optional(),scope:t.z.string().optional(),prompt:t.z.string().optional(),code_challenge_method:t.z.nativeEnum(oe).optional(),code_challenge:t.z.string().optional(),username:t.z.string().optional(),ui_locales:t.z.string().optional(),max_age:t.z.number().optional(),acr_values:t.z.string().optional(),vendor_id:t.z.string().optional()}),ce=t.z.object({colors:t.z.object({primary:t.z.string(),page_background:t.z.object({type:t.z.string().optional(),start:t.z.string().optional(),end:t.z.string().optional(),angle_deg:t.z.number().optional()}).optional()}).optional(),logo_url:t.z.string().optional(),favicon_url:t.z.string().optional(),powered_by_logo_url:t.z.string().optional(),font:t.z.object({url:t.z.string()}).optional()}),ue=t.z.enum(["password_reset","email_verification","otp","mfa_otp","authorization_code","oauth2_state","ticket"]),de=t.z.object({code_id:t.z.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:t.z.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:t.z.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:ue,code_verifier:t.z.string().optional().openapi({description:"The code verifier used in PKCE in outbound flows"}),code_challenge:t.z.string().optional().openapi({description:"The code challenge used in PKCE in outbound flows"}),code_challenge_method:t.z.enum(["plain","S256"]).optional().openapi({description:"The code challenge method used in PKCE in outbound flows"}),redirect_uri:t.z.string().optional().openapi({description:"The redirect URI associated with the code"}),otp:t.z.string().optional().openapi({description:"The one-time password value for OTP-based flows"}),nonce:t.z.string().optional().openapi({description:"The nonce value used for security in OIDC flows"}),state:t.z.string().optional().openapi({description:"The state parameter used for CSRF protection in OAuth flows"}),expires_at:t.z.string(),used_at:t.z.string().optional(),user_id:t.z.string().optional()}),le=t.z.object({...de.shape,created_at:t.z.string()}),he=t.z.object({kid:t.z.string().optional(),team_id:t.z.string().optional(),realms:t.z.string().optional(),authentication_method:t.z.string().optional(),client_id:t.z.string().optional(),client_secret:t.z.string().optional(),app_secret:t.z.string().optional(),scope:t.z.string().optional(),authorization_endpoint:t.z.string().optional(),token_endpoint:t.z.string().optional(),userinfo_endpoint:t.z.string().optional(),jwks_uri:t.z.string().optional(),discovery_url:t.z.string().optional(),issuer:t.z.string().optional(),provider:t.z.string().optional(),from:t.z.string().optional(),twilio_sid:t.z.string().optional(),twilio_token:t.z.string().optional(),icon_url:t.z.string().optional(),passwordPolicy:t.z.enum(["none","low","fair","good","excellent"]).optional(),password_complexity_options:t.z.object({min_length:t.z.number().optional()}).optional(),password_history:t.z.object({enable:t.z.boolean().optional(),size:t.z.number().optional()}).optional(),password_no_personal_info:t.z.object({enable:t.z.boolean().optional()}).optional(),password_dictionary:t.z.object({enable:t.z.boolean().optional(),dictionary:t.z.array(t.z.string()).optional()}).optional(),disable_signup:t.z.boolean().optional(),brute_force_protection:t.z.boolean().optional(),import_mode:t.z.boolean().optional(),attributes:t.z.object({email:t.z.object({identifier:t.z.object({active:t.z.boolean().optional()}).optional(),signup:t.z.object({status:t.z.enum(["required","optional","disabled"]).optional(),verification:t.z.object({active:t.z.boolean().optional()}).optional()}).optional(),validation:t.z.object({allowed:t.z.boolean().optional()}).optional(),unique:t.z.boolean().optional(),profile_required:t.z.boolean().optional(),verification_method:t.z.enum(["link","code"]).optional()}).optional(),username:t.z.object({identifier:t.z.object({active:t.z.boolean().optional()}).optional(),signup:t.z.object({status:t.z.enum(["required","optional","disabled"]).optional()}).optional(),validation:t.z.object({max_length:t.z.number().optional(),min_length:t.z.number().optional(),allowed_types:t.z.object({email:t.z.boolean().optional(),phone_number:t.z.boolean().optional()}).optional()}).optional(),profile_required:t.z.boolean().optional()}).optional(),phone_number:t.z.object({identifier:t.z.object({active:t.z.boolean().optional()}).optional(),signup:t.z.object({status:t.z.enum(["required","optional","disabled"]).optional()}).optional()}).optional()}).optional(),authentication_methods:t.z.object({password:t.z.object({enabled:t.z.boolean().optional()}).optional(),passkey:t.z.object({enabled:t.z.boolean().optional()}).optional()}).optional(),passkey_options:t.z.object({challenge_ui:t.z.enum(["both","autofill","button"]).optional(),local_enrollment_enabled:t.z.boolean().optional(),progressive_enrollment_enabled:t.z.boolean().optional()}).optional(),requires_username:t.z.boolean().optional(),validation:t.z.object({username:t.z.object({min:t.z.number().optional(),max:t.z.number().optional()}).optional()}).optional(),set_user_root_attributes:t.z.enum(["on_each_login","on_first_login","never_on_login"]).optional()}),_e=t.z.object({id:t.z.string().optional(),name:t.z.string(),display_name:t.z.string().optional(),strategy:t.z.string(),options:he.default({}),enabled_clients:t.z.array(t.z.string()).default([]).optional(),response_type:t.z.custom().optional(),response_mode:t.z.custom().optional(),is_domain_connection:t.z.boolean().optional(),show_as_button:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional(),is_system:t.z.boolean().optional()}),pe=t.z.object({id:t.z.string(),created_at:t.z.string().transform((e=>null===e?"":e)),updated_at:t.z.string().transform((e=>null===e?"":e))}).extend(_e.shape),fe=t.z.object({domain:t.z.string(),custom_domain_id:t.z.string().optional(),type:t.z.enum(["auth0_managed_certs","self_managed_certs"]),verification_method:t.z.enum(["txt"]).optional(),tls_policy:t.z.enum(["recommended"]).optional(),custom_client_ip_header:t.z.enum(["true-client-ip","cf-connecting-ip","x-forwarded-for","x-azure-clientip","null"]).optional(),domain_metadata:t.z.record(t.z.string().max(255)).optional()}),me=t.z.discriminatedUnion("name",[t.z.object({name:t.z.literal("txt"),record:t.z.string(),domain:t.z.string()}),t.z.object({name:t.z.literal("http"),http_body:t.z.string(),http_url:t.z.string()})]),ge=t.z.object({...fe.shape,custom_domain_id:t.z.string(),primary:t.z.boolean(),status:t.z.enum(["disabled","pending","pending_verification","ready"]),origin_domain_name:t.z.string().optional(),verification:t.z.object({methods:t.z.array(me)}).optional(),tls_policy:t.z.string().optional()}),ye=ge.extend({tenant_id:t.z.string()}),ve=t.z.object({id:t.z.string(),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0)}),be=ve.extend({category:t.z.literal("BLOCK").optional()}),Ee=be.extend({type:t.z.literal("DIVIDER"),config:t.z.object({text:t.z.string().optional()}).optional()}),Oe=be.extend({type:t.z.literal("HTML"),config:t.z.object({content:t.z.string().optional()}).optional()}),we=be.extend({type:t.z.literal("IMAGE"),config:t.z.object({src:t.z.string().optional(),alt:t.z.string().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional()}),Ae=be.extend({type:t.z.literal("JUMP_BUTTON"),config:t.z.object({text:t.z.string().optional(),target_step:t.z.string().optional()})}),Se=be.extend({type:t.z.literal("RESEND_BUTTON"),config:t.z.object({text:t.z.string().optional(),resend_action:t.z.string().optional()})}),Ie=be.extend({type:t.z.literal("NEXT_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),Ce=be.extend({type:t.z.literal("PREVIOUS_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),Ne=be.extend({type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string().optional()}).optional()}),Te=ve.extend({category:t.z.literal("WIDGET").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),xe=Te.extend({type:t.z.literal("AUTH0_VERIFIABLE_CREDENTIALS"),config:t.z.object({credential_type:t.z.string().optional()})}),ke=Te.extend({type:t.z.literal("GMAPS_ADDRESS"),config:t.z.object({api_key:t.z.string().optional()})}),Re=Te.extend({type:t.z.literal("RECAPTCHA"),config:t.z.object({site_key:t.z.string().optional()})}),De=ve.extend({category:t.z.literal("FIELD").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),messages:t.z.array(t.z.object({id:t.z.number().optional(),text:t.z.string(),type:t.z.enum(["info","error","success","warning"])})).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),Le=De.extend({type:t.z.literal("BOOLEAN"),config:t.z.object({default_value:t.z.boolean().optional()}).optional()}),je=De.extend({type:t.z.literal("CARDS"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string(),description:t.z.string().optional(),image:t.z.string().optional()})).optional(),multi_select:t.z.boolean().optional()}).optional()}),Fe=De.extend({type:t.z.literal("CHOICE"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),display:t.z.enum(["radio","checkbox"]).optional(),multiple:t.z.boolean().optional(),default_value:t.z.union([t.z.string(),t.z.array(t.z.string())]).optional()}).optional()}),Ue=De.extend({type:t.z.literal("CUSTOM"),config:t.z.object({component:t.z.string().optional(),props:t.z.record(t.z.any()).optional(),schema:t.z.record(t.z.any()).optional(),code:t.z.string().optional()})}),Pe=De.extend({type:t.z.literal("DATE"),config:t.z.object({format:t.z.string().optional(),min:t.z.string().optional(),max:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),Me=De.extend({type:t.z.literal("DROPDOWN"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),placeholder:t.z.string().optional(),searchable:t.z.boolean().optional(),multiple:t.z.boolean().optional(),default_value:t.z.union([t.z.string(),t.z.array(t.z.string())]).optional()}).optional()}),Ze=De.extend({type:t.z.literal("EMAIL"),config:t.z.object({placeholder:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),He=De.extend({type:t.z.literal("FILE"),config:t.z.object({accept:t.z.string().optional(),max_size:t.z.number().optional(),multiple:t.z.boolean().optional()}).optional()}),$e=De.extend({type:t.z.literal("LEGAL"),config:t.z.object({text:t.z.string(),html:t.z.boolean().optional()}).optional()}),ze=De.extend({type:t.z.literal("NUMBER"),config:t.z.object({placeholder:t.z.string().optional(),min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional(),default_value:t.z.string().optional()}).optional()}),Ge=De.extend({type:t.z.literal("PASSWORD"),config:t.z.object({placeholder:t.z.string().optional(),min_length:t.z.number().optional(),show_toggle:t.z.boolean().optional(),forgot_password_link:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),qe=De.extend({type:t.z.literal("PAYMENT"),config:t.z.object({provider:t.z.string().optional(),currency:t.z.string().optional()}).optional()}),Be=De.extend({type:t.z.literal("SOCIAL"),config:t.z.object({providers:t.z.array(t.z.string()).optional(),provider_details:t.z.array(t.z.object({name:t.z.string(),strategy:t.z.string().optional(),display_name:t.z.string().optional(),icon_url:t.z.string().optional(),href:t.z.string().optional()})).optional()}).optional()}),We=De.extend({type:t.z.literal("TEL"),config:t.z.object({placeholder:t.z.string().optional(),default_country:t.z.string().optional(),default_value:t.z.string().optional(),allow_email:t.z.boolean().optional()}).optional()}),Ke=De.extend({type:t.z.literal("TEXT"),config:t.z.object({placeholder:t.z.string().optional(),multiline:t.z.boolean().optional(),max_length:t.z.number().optional(),default_value:t.z.string().optional()}).optional()}),Ve=De.extend({type:t.z.literal("COUNTRY"),config:t.z.object({placeholder:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),Xe=De.extend({type:t.z.literal("URL"),config:t.z.object({placeholder:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),Ye=t.z.discriminatedUnion("type",[Ee,Oe,we,Ae,Se,Ie,Ce,Ne]),Je=t.z.discriminatedUnion("type",[xe,ke,Re]),Qe=t.z.discriminatedUnion("type",[Le,je,Fe,Ve,Ue,Pe,Me,Ze,He,$e,ze,Ge,qe,Be,We,Ke,Xe]),et=t.z.union([Ye,Je,Qe]),tt=new Set(["BOOLEAN","CARDS","CHOICE","COUNTRY","DATE","DROPDOWN","EMAIL","LEGAL","NUMBER","PASSWORD","TEL","TEXT","URL"]),it=t.z.object({id:t.z.string(),type:t.z.literal("submit"),label:t.z.string(),className:t.z.string().optional(),disabled:t.z.boolean().optional().default(!1),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0),customizations:t.z.record(t.z.string(),t.z.any()).optional()}),nt=t.z.object({x:t.z.number(),y:t.z.number()}),st=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:nt,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({flow_id:t.z.string().max(30),next_node:t.z.string().optional()})}),rt=t.z.object({id:t.z.string(),type:t.z.literal("ROUTER"),coordinates:nt,alias:t.z.string().min(1).max(150),config:t.z.object({rules:t.z.array(t.z.object({id:t.z.string(),alias:t.z.string().min(1).max(150).optional(),condition:t.z.any(),next_node:t.z.string()})),fallback:t.z.string()})}),ot=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:nt,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({components:t.z.array(et),next_node:t.z.string().optional()})}),at=t.z.discriminatedUnion("type",[st,rt,ot]),ct=t.z.object({name:t.z.string().openapi({description:"The name of the form"}),messages:t.z.object({errors:t.z.record(t.z.string(),t.z.any()).optional(),custom:t.z.record(t.z.string(),t.z.any()).optional()}).optional(),languages:t.z.object({primary:t.z.string().optional(),default:t.z.string().optional()}).optional(),translations:t.z.record(t.z.string(),t.z.any()).optional(),nodes:t.z.array(at).optional(),start:t.z.object({hidden_fields:t.z.array(t.z.object({key:t.z.string(),value:t.z.string()})).optional(),next_node:t.z.string().optional(),coordinates:nt.optional()}).optional(),ending:t.z.object({redirection:t.z.object({delay:t.z.number().optional(),target:t.z.string().optional()}).optional(),after_submit:t.z.object({flow_id:t.z.string().optional()}).optional(),coordinates:nt.optional(),resume_flow:t.z.boolean().optional()}).optional(),style:t.z.object({css:t.z.string().optional()}).optional(),links:t.z.object({sdkSrc:t.z.string().optional(),sdk_src:t.z.string().optional()}).optional()}).openapi({description:"Schema for flow-based forms (matches Auth0 Forms structure)"}),ut=t.z.object({...l.shape,...ct.shape,id:t.z.string()}),dt=t.z.object({id:t.z.number().optional(),text:t.z.string(),type:t.z.enum(["info","error","success","warning"])}),lt=t.z.object({id:t.z.string().optional(),text:t.z.string(),href:t.z.string(),linkText:t.z.string().optional()}),ht=t.z.object({name:t.z.string().optional(),action:t.z.string(),method:t.z.enum(["POST","GET"]),title:t.z.string().optional(),description:t.z.string().optional(),components:t.z.array(et),messages:t.z.array(dt).optional(),links:t.z.array(lt).optional(),footer:t.z.string().optional()}),_t=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),pt=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),ft=t.z.enum(["post-user-login","credentials-exchange"]),mt=t.z.enum(["ensure-username","set-preferred-username"]),gt={enabled:t.z.boolean().default(!1),synchronous:t.z.boolean().default(!1),priority:t.z.number().optional(),hook_id:t.z.string().optional()},yt=t.z.object({...gt,trigger_id:_t,url:t.z.string()}),vt=t.z.object({...gt,trigger_id:pt,form_id:t.z.string()}),bt=t.z.object({...gt,trigger_id:ft,template_id:mt}),Et=t.z.union([yt,vt,bt]),Ot=t.z.object({...gt,trigger_id:_t,...l.shape,hook_id:t.z.string(),url:t.z.string()}),wt=t.z.object({...gt,trigger_id:pt,...l.shape,hook_id:t.z.string(),form_id:t.z.string()}),At=t.z.object({...gt,trigger_id:ft,...l.shape,hook_id:t.z.string(),template_id:mt}),St=t.z.union([Ot,wt,At]),It=t.z.object({name:t.z.string().optional()}),Ct=t.z.object({email:t.z.string().optional()}),Nt=t.z.object({organization_id:t.z.string().max(50),inviter:It,invitee:Ct,invitation_url:t.z.string().url(),client_id:t.z.string(),connection_id:t.z.string().optional(),app_metadata:t.z.record(t.z.any()).default({}).optional(),user_metadata:t.z.record(t.z.any()).default({}).optional(),ttl_sec:t.z.number().int().max(2592e3).default(604800).optional(),roles:t.z.array(t.z.string()).default([]).optional(),send_invitation_email:t.z.boolean().default(!0).optional()}),Tt=t.z.object({id:t.z.string(),organization_id:t.z.string().max(50),created_at:t.z.string().datetime(),expires_at:t.z.string().datetime(),ticket_id:t.z.string().optional()}).extend(Nt.shape),xt=t.z.object({alg:t.z.enum(["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512"]),e:t.z.string(),kid:t.z.string(),kty:t.z.enum(["RSA","EC","oct"]),n:t.z.string(),x5t:t.z.string().optional(),x5c:t.z.array(t.z.string()).optional(),use:t.z.enum(["sig","enc"]).optional()}),kt=t.z.object({keys:t.z.array(xt)}),Rt=t.z.object({issuer:t.z.string(),authorization_endpoint:t.z.string(),token_endpoint:t.z.string(),device_authorization_endpoint:t.z.string(),userinfo_endpoint:t.z.string(),mfa_challenge_endpoint:t.z.string(),jwks_uri:t.z.string(),registration_endpoint:t.z.string(),revocation_endpoint:t.z.string(),scopes_supported:t.z.array(t.z.string()),response_types_supported:t.z.array(t.z.string()),code_challenge_methods_supported:t.z.array(t.z.string()),response_modes_supported:t.z.array(t.z.string()),subject_types_supported:t.z.array(t.z.string()),id_token_signing_alg_values_supported:t.z.array(t.z.string()),token_endpoint_auth_methods_supported:t.z.array(t.z.string()),claims_supported:t.z.array(t.z.string()),request_uri_parameter_supported:t.z.boolean(),request_parameter_supported:t.z.boolean(),token_endpoint_auth_signing_alg_values_supported:t.z.array(t.z.string())});var Dt=(e=>(e.PENDING="pending",e.AUTHENTICATED="authenticated",e.AWAITING_EMAIL_VERIFICATION="awaiting_email_verification",e.AWAITING_MFA="awaiting_mfa",e.AWAITING_HOOK="awaiting_hook",e.AWAITING_CONTINUATION="awaiting_continuation",e.COMPLETED="completed",e.FAILED="failed",e.EXPIRED="expired",e))(Dt||{});const Lt=t.z.nativeEnum(Dt),jt=t.z.object({csrf_token:t.z.string(),auth0Client:t.z.string().optional(),authParams:ae,expires_at:t.z.string(),deleted_at:t.z.string().optional(),ip:t.z.string().optional(),useragent:t.z.string().optional(),session_id:t.z.string().optional(),authorization_url:t.z.string().optional(),state:Lt.optional().default("pending"),state_data:t.z.string().optional(),failure_reason:t.z.string().optional(),user_id:t.z.string().optional(),auth_connection:t.z.string().optional()}).openapi({description:"This represents a login sesion"}),Ft=t.z.object({...jt.shape,id:t.z.string().openapi({description:"This is is used as the state in the universal login"}),created_at:t.z.string(),updated_at:t.z.string()}),Ut={ACLS_SUMMARY:"acls_summary",ACTIONS_EXECUTION_FAILED:"actions_execution_failed",API_LIMIT:"api_limit",API_LIMIT_WARNING:"api_limit_warning",APPI:"appi",CIBA_EXCHANGE_FAILED:"ciba_exchange_failed",CIBA_EXCHANGE_SUCCEEDED:"ciba_exchange_succeeded",CIBA_START_FAILED:"ciba_start_failed",CIBA_START_SUCCEEDED:"ciba_start_succeeded",CODE_LINK_SENT:"cls",CODE_SENT:"cs",DEPRECATION_NOTICE:"depnote",FAILED_LOGIN:"f",FAILED_BY_CONNECTOR:"fc",FAILED_CHANGE_EMAIL:"fce",FAILED_BY_CORS:"fco",FAILED_CROSS_ORIGIN_AUTHENTICATION:"fcoa",FAILED_CHANGE_PASSWORD:"fcp",FAILED_POST_CHANGE_PASSWORD_HOOK:"fcph",FAILED_CHANGE_PHONE_NUMBER:"fcpn",FAILED_CHANGE_PASSWORD_REQUEST:"fcpr",FAILED_CONNECTOR_PROVISIONING:"fcpro",FAILED_CHANGE_USERNAME:"fcu",FAILED_DELEGATION:"fd",FAILED_DEVICE_ACTIVATION:"fdeac",FAILED_DEVICE_AUTHORIZATION_REQUEST:"fdeaz",USER_CANCELED_DEVICE_CONFIRMATION:"fdecc",FAILED_USER_DELETION:"fdu",FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:"feacft",FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:"feccft",FAILED_EXCHANGE_CUSTOM_TOKEN:"fecte",FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:"fede",FAILED_FEDERATED_LOGOUT:"federated_logout_failed",FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN:"fens",FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:"feoobft",FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:"feotpft",FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:"fepft",FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:"fepotpft",FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:"fercft",FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN:"ferrt",FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:"fertft",FAILED_HOOK:"fh",FAILED_IMPERSONATION:"fimp",FAILED_INVITE_ACCEPT:"fi",FAILED_LOGOUT:"flo",FLOWS_EXECUTION_COMPLETED:"flows_execution_completed",FLOWS_EXECUTION_FAILED:"flows_execution_failed",FAILED_SENDING_NOTIFICATION:"fn",FORMS_SUBMISSION_FAILED:"forms_submission_failed",FORMS_SUBMISSION_SUCCEEDED:"forms_submission_succeeded",FAILED_LOGIN_INCORRECT_PASSWORD:"fp",FAILED_PUSHED_AUTHORIZATION_REQUEST:"fpar",FAILED_POST_USER_REGISTRATION_HOOK:"fpurh",FAILED_SIGNUP:"fs",FAILED_SILENT_AUTH:"fsa",FAILED_LOGIN_INVALID_EMAIL_USERNAME:"fu",FAILED_USERS_IMPORT:"fui",FAILED_VERIFICATION_EMAIL:"fv",FAILED_VERIFICATION_EMAIL_REQUEST:"fvr",EMAIL_VERIFICATION_CONFIRMED:"gd_auth_email_verification",EMAIL_VERIFICATION_FAILED:"gd_auth_fail_email_verification",MFA_AUTH_FAILED:"gd_auth_failed",MFA_AUTH_REJECTED:"gd_auth_rejected",MFA_AUTH_SUCCESS:"gd_auth_succeed",MFA_ENROLLMENT_COMPLETE:"gd_enrollment_complete",TOO_MANY_MFA_FAILURES:"gd_otp_rate_limit_exceed",MFA_RECOVERY_FAILED:"gd_recovery_failed",MFA_RECOVERY_RATE_LIMIT_EXCEED:"gd_recovery_rate_limit_exceed",MFA_RECOVERY_SUCCESS:"gd_recovery_succeed",MFA_EMAIL_SENT:"gd_send_email",EMAIL_VERIFICATION_SENT:"gd_send_email_verification",EMAIL_VERIFICATION_SEND_FAILURE:"gd_send_email_verification_failure",PUSH_NOTIFICATION_SENT:"gd_send_pn",ERROR_SENDING_MFA_PUSH_NOTIFICATION:"gd_send_pn_failure",MFA_SMS_SENT:"gd_send_sms",ERROR_SENDING_MFA_SMS:"gd_send_sms_failure",MFA_VOICE_CALL_SUCCESS:"gd_send_voice",MFA_VOICE_CALL_FAILED:"gd_send_voice_failure",SECOND_FACTOR_STARTED:"gd_start_auth",MFA_ENROLL_STARTED:"gd_start_enroll",MFA_ENROLLMENT_FAILED:"gd_start_enroll_failed",GUARDIAN_TENANT_UPDATE:"gd_tenant_update",UNENROLL_DEVICE_ACCOUNT:"gd_unenroll",UPDATE_DEVICE_ACCOUNT:"gd_update_device_account",WEBAUTHN_CHALLENGE_FAILED:"gd_webauthn_challenge_failed",WEBAUTHN_ENROLLMENT_FAILED:"gd_webauthn_enrollment_failed",FAILED_KMS_API_OPERATION:"kms_key_management_failure",SUCCESS_KMS_API_OPERATION:"kms_key_management_success",KMS_KEY_STATE_CHANGED:"kms_key_state_changed",TOO_MANY_CALLS_TO_DELEGATION:"limit_delegation",BLOCKED_IP_ADDRESS:"limit_mu",BLOCKED_ACCOUNT_IP:"limit_sul",BLOCKED_ACCOUNT_EMAIL:"limit_wc",MFA_REQUIRED:"mfar",MANAGEMENT_API_READ_OPERATION:"mgmt_api_read",FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:"my_account_authentication_method_failed",SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:"my_account_authentication_method_succeeded",FAILED_OIDC_BACKCHANNEL_LOGOUT:"oidc_backchannel_logout_failed",SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT:"oidc_backchannel_logout_succeeded",ORGANIZATION_MEMBER_ADDED:"organization_member_added",PASSKEY_CHALLENGE_FAILED:"passkey_challenge_failed",PASSKEY_CHALLENGE_STARTED:"passkey_challenge_started",PRE_LOGIN_ASSESSMENT:"pla",BREACHED_PASSWORD:"pwd_leak",BREACHED_PASSWORD_ON_RESET:"reset_pwd_leak",SUCCESS_RESOURCE_CLEANUP:"resource_cleanup",RICH_CONSENTS_ACCESS_ERROR:"rich_consents_access_error",SUCCESS_LOGIN:"s",SUCCESS_API_OPERATION:"sapi",SUCCESS_CHANGE_EMAIL:"sce",SUCCESS_CROSS_ORIGIN_AUTHENTICATION:"scoa",SUCCESS_CHANGE_PASSWORD:"scp",SUCCESS_CHANGE_PHONE_NUMBER:"scpn",SUCCESS_CHANGE_PASSWORD_REQUEST:"scpr",SUCCESS_CHANGE_USERNAME:"scu",SUCCESS_CREDENTIAL_VALIDATION:"scv",SUCCESS_DELEGATION:"sd",SUCCESS_USER_DELETION:"sdu",SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:"seacft",SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:"seccft",SUCCESS_EXCHANGE_CUSTOM_TOKEN:"secte",SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:"sede",SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN:"sens",SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:"seoobft",SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:"seotpft",SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:"sepft",SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN:"sepkoobft",SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN:"sepkotpft",SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN:"sepkrcft",SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:"sercft",SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:"sertft",SUCCESS_IMPERSONATION:"simp",SUCCESSFULLY_ACCEPTED_USER_INVITE:"si",BREACHED_PASSWORD_ON_SIGNUP:"signup_pwd_leak",SUCCESS_LOGOUT:"slo",SUCCESS_REVOCATION:"srrt",SUCCESS_SIGNUP:"ss",FAILED_SS_SSO_OPERATION:"ss_sso_failure",INFORMATION_FROM_SS_SSO_OPERATION:"ss_sso_info",SUCCESS_SS_SSO_OPERATION:"ss_sso_success",SUCCESS_SILENT_AUTH:"ssa",SUCCESSFUL_SCIM_OPERATION:"sscim",SUCCESSFULLY_IMPORTED_USERS:"sui",SUCCESS_VERIFICATION_EMAIL:"sv",SUCCESS_VERIFICATION_EMAIL_REQUEST:"svr",MAX_AMOUNT_OF_AUTHENTICATORS:"too_many_records",USER_LOGIN_BLOCK_RELEASED:"ublkdu",FAILED_UNIVERSAL_LOGOUT:"universal_logout_failed",SUCCESSFUL_UNIVERSAL_LOGOUT:"universal_logout_succeeded",WARNING_DURING_LOGIN:"w",WARNING_SENDING_NOTIFICATION:"wn",WARNING_USER_MANAGEMENT:"wum"},Pt=t.z.string().refine((e=>Object.values(Ut).includes(e)),{message:"Invalid log type"}),Mt=t.z.object({name:t.z.string(),version:t.z.string(),env:t.z.object({node:t.z.string().optional()}).optional()}),Zt=t.z.object({country_code:t.z.string().length(2),city_name:t.z.string(),latitude:t.z.string(),longitude:t.z.string(),time_zone:t.z.string(),continent_code:t.z.string()}),Ht=t.z.object({type:Pt,date:t.z.string(),description:t.z.string().optional(),ip:t.z.string().optional(),user_agent:t.z.string().optional(),details:t.z.any().optional(),isMobile:t.z.boolean(),user_id:t.z.string().optional(),user_name:t.z.string().optional(),connection:t.z.string().optional(),connection_id:t.z.string().optional(),client_id:t.z.string().optional(),client_name:t.z.string().optional(),audience:t.z.string().optional(),scope:t.z.string().optional(),strategy:t.z.string().optional(),strategy_type:t.z.string().optional(),hostname:t.z.string().optional(),auth0_client:Mt.optional(),log_id:t.z.string().optional(),location_info:Zt.optional()}),$t=t.z.object({...Ht.shape,log_id:t.z.string()}),zt=t.z.object({id:t.z.string().optional(),user_id:t.z.string(),password:t.z.string(),algorithm:t.z.enum(["bcrypt","argon2id"]).default("argon2id"),is_current:t.z.boolean().default(!0)}),Gt=zt.extend({id:t.z.string(),created_at:t.z.string(),updated_at:t.z.string()}),qt=t.z.object({initial_user_agent:t.z.string().describe("First user agent of the device from which this user logged in"),initial_ip:t.z.string().describe("First IP address associated with this session"),initial_asn:t.z.string().describe("First autonomous system number associated with this session"),last_user_agent:t.z.string().describe("Last user agent of the device from which this user logged in"),last_ip:t.z.string().describe("Last IP address from which this user logged in"),last_asn:t.z.string().describe("Last autonomous system number from which this user logged in")}),Bt=t.z.object({id:t.z.string(),revoked_at:t.z.string().optional(),used_at:t.z.string().optional(),user_id:t.z.string().describe("The user ID associated with the session"),expires_at:t.z.string().optional(),login_session_id:t.z.string(),idle_expires_at:t.z.string().optional(),device:qt.describe("Metadata related to the device used in the session"),clients:t.z.array(t.z.string()).describe("List of client details for the session")}),Wt=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),authenticated_at:t.z.string(),last_interaction_at:t.z.string(),...Bt.shape}),Kt=t.z.object({kid:t.z.string().openapi({description:"The key id of the signing key"}),cert:t.z.string().openapi({description:"The public certificate of the signing key"}),fingerprint:t.z.string().openapi({description:"The cert fingerprint"}),thumbprint:t.z.string().openapi({description:"The cert thumbprint"}),pkcs7:t.z.string().optional().openapi({description:"The private key in pkcs7 format"}),current:t.z.boolean().optional().openapi({description:"True if the key is the current key"}),next:t.z.boolean().optional().openapi({description:"True if the key is the next key"}),previous:t.z.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:t.z.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:t.z.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:t.z.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:t.z.string().optional().openapi({description:"The date and time when the key was revoked"}),connection:t.z.string().optional().openapi({description:"The connection identifier associated with the key"}),type:t.z.enum(["jwt_signing","saml_encryption"]).openapi({description:"The type of the signing key"})}),Vt=t.z.object({id:t.z.string().optional(),audience:t.z.string(),friendly_name:t.z.string(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sender_email:t.z.string().email(),sender_name:t.z.string(),session_lifetime:t.z.number().optional(),idle_session_lifetime:t.z.number().optional(),ephemeral_session_lifetime:t.z.number().optional(),idle_ephemeral_session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),allowed_logout_urls:t.z.array(t.z.string()).optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_changing_enable_sso:t.z.boolean().optional(),allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),change_pwd_flow_v1:t.z.boolean().optional(),custom_domains_provisioning:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),disable_impersonation:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),enable_sso:t.z.boolean().optional(),enforce_client_authentication_on_passwordless_start:t.z.boolean().optional(),genai_trial:t.z.boolean().optional(),improved_signup_bot_detection_in_classic:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional(),no_disclose_enterprise_connections:t.z.boolean().optional(),remove_alg_from_jwks:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),trust_azure_adfs_email_verified_connection_property:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),inherit_global_permissions_in_organizations:t.z.boolean().optional()}).optional(),sandbox_version:t.z.string().optional(),legacy_sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),device_flow:t.z.object({charset:t.z.enum(["base20","digits"]).optional(),mask:t.z.string().max(20).optional()}).optional(),default_token_quota:t.z.object({clients:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional(),organizations:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional(),oidc_logout:t.z.object({rp_logout_end_session_endpoint_discovery:t.z.boolean().optional()}).optional(),allow_organization_name_in_authentication_api:t.z.boolean().optional(),customize_mfa_in_postlogin_action:t.z.boolean().optional(),acr_values_supported:t.z.array(t.z.string()).optional(),mtls:t.z.object({enable_endpoint_aliases:t.z.boolean().optional()}).optional(),pushed_authorization_requests_supported:t.z.boolean().optional(),authorization_response_iss_parameter_supported:t.z.boolean().optional(),mfa:t.z.object({policy:t.z.enum(["never","always"]).default("never").optional(),factors:t.z.object({sms:t.z.boolean().default(!1),otp:t.z.boolean().default(!1),email:t.z.boolean().default(!1),push_notification:t.z.boolean().default(!1),webauthn_roaming:t.z.boolean().default(!1),webauthn_platform:t.z.boolean().default(!1),recovery_code:t.z.boolean().default(!1),duo:t.z.boolean().default(!1)}).optional(),sms_provider:t.z.object({provider:t.z.enum(["twilio","vonage","aws_sns","phone_message_hook"]).optional()}).optional(),twilio:t.z.object({sid:t.z.string().optional(),auth_token:t.z.string().optional(),from:t.z.string().optional(),messaging_service_sid:t.z.string().optional()}).optional(),phone_message:t.z.object({message:t.z.string().optional()}).optional()}).optional()}),Xt=t.z.object({created_at:t.z.string().nullable().transform((e=>e??"")),updated_at:t.z.string().nullable().transform((e=>e??"")),...Vt.shape,id:t.z.string()});var Yt=(e=>(e.RefreshToken="refresh_token",e.AuthorizationCode="authorization_code",e.ClientCredential="client_credentials",e.Passwordless="passwordless",e.Password="password",e.OTP="http://auth0.com/oauth/grant-type/passwordless/otp",e))(Yt||{});const Jt=t.z.object({access_token:t.z.string(),id_token:t.z.string().optional(),scope:t.z.string().optional(),state:t.z.string().optional(),refresh_token:t.z.string().optional(),token_type:t.z.string(),expires_in:t.z.number()});t.z.object({code:t.z.string(),state:t.z.string().optional()});const Qt=t.z.object({button_border_radius:t.z.number(),button_border_weight:t.z.number(),buttons_style:t.z.enum(["pill","rounded","sharp"]),input_border_radius:t.z.number(),input_border_weight:t.z.number(),inputs_style:t.z.enum(["pill","rounded","sharp"]),show_widget_shadow:t.z.boolean(),widget_border_weight:t.z.number(),widget_corner_radius:t.z.number()}),ei=t.z.object({base_focus_color:t.z.string(),base_hover_color:t.z.string(),body_text:t.z.string(),captcha_widget_theme:t.z.enum(["auto","dark","light"]),error:t.z.string(),header:t.z.string(),icons:t.z.string(),input_background:t.z.string(),input_border:t.z.string(),input_filled_text:t.z.string(),input_labels_placeholders:t.z.string(),links_focused_components:t.z.string(),primary_button:t.z.string(),primary_button_label:t.z.string(),secondary_button_border:t.z.string(),secondary_button_label:t.z.string(),success:t.z.string(),widget_background:t.z.string(),widget_border:t.z.string()}),ti=t.z.object({bold:t.z.boolean(),size:t.z.number()}),ii=t.z.object({body_text:ti,buttons_text:ti,font_url:t.z.string(),input_labels:ti,links:ti,links_style:t.z.enum(["normal","underlined"]),reference_text_size:t.z.number(),subtitle:ti,title:ti}),ni=t.z.object({background_color:t.z.string(),background_image_url:t.z.string(),page_layout:t.z.enum(["center","left","right"])}),si=t.z.object({header_text_alignment:t.z.enum(["center","left","right"]),logo_height:t.z.number(),logo_position:t.z.enum(["center","left","none","right"]),logo_url:t.z.string(),social_buttons_layout:t.z.enum(["bottom","top"])}),ri=t.z.object({borders:Qt,colors:ei,displayName:t.z.string(),fonts:ii,page_background:ni,widget:si}),oi=ri.extend({themeId:t.z.string()}),ai=t.z.object({universal_login_experience:t.z.enum(["new","classic"]).default("new"),identifier_first:t.z.boolean().default(!0),password_first:t.z.boolean().default(!1),webauthn_platform_first_factor:t.z.boolean()}),ci=t.z.object({name:t.z.string(),enabled:t.z.boolean().optional().default(!0),default_from_address:t.z.string().optional(),credentials:t.z.union([t.z.object({accessKeyId:t.z.string(),secretAccessKey:t.z.string(),region:t.z.string()}),t.z.object({smtp_host:t.z.array(t.z.string()),smtp_port:t.z.number(),smtp_user:t.z.string(),smtp_pass:t.z.string()}),t.z.object({api_key:t.z.string(),domain:t.z.string().optional()}),t.z.object({connectionString:t.z.string()}),t.z.object({tenantId:t.z.string(),clientId:t.z.string(),clientSecret:t.z.string()})]),settings:t.z.object({}).optional()}),ui=t.z.object({id:t.z.string(),login_id:t.z.string(),user_id:t.z.string(),client_id:t.z.string(),expires_at:t.z.string().optional(),idle_expires_at:t.z.string().optional(),last_exchanged_at:t.z.string().optional(),device:qt,resource_servers:t.z.array(t.z.object({audience:t.z.string(),scopes:t.z.string()})),rotating:t.z.boolean()}),di=t.z.object({created_at:t.z.string(),...ui.shape}),li=t.z.object({to:t.z.string(),message:t.z.string()}),hi=t.z.object({name:t.z.string(),options:t.z.object({})}),_i=t.z.object({value:t.z.string(),description:t.z.string().optional()}),pi=t.z.object({token_dialect:t.z.enum(["access_token","access_token_authz"]).optional(),enforce_policies:t.z.boolean().optional(),allow_skipping_userinfo:t.z.boolean().optional(),skip_userinfo:t.z.boolean().optional(),persist_client_authorization:t.z.boolean().optional(),enable_introspection_endpoint:t.z.boolean().optional(),mtls:t.z.object({bound_access_tokens:t.z.boolean().optional()}).optional()}),fi=t.z.object({id:t.z.string().optional(),name:t.z.string(),identifier:t.z.string(),scopes:t.z.array(_i).optional(),signing_alg:t.z.string().optional(),signing_secret:t.z.string().optional(),token_lifetime:t.z.number().optional(),token_lifetime_for_web:t.z.number().optional(),skip_consent_for_verifiable_first_party_clients:t.z.boolean().optional(),allow_offline_access:t.z.boolean().optional(),verificationKey:t.z.string().optional(),options:pi.optional(),is_system:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional()}),mi=t.z.object({...fi.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),gi=t.z.array(mi),yi=t.z.object({role_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string()}),vi=t.z.object({...yi.shape,created_at:t.z.string()}),bi=t.z.array(vi),Ei=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string(),organization_id:t.z.string().optional()}),Oi=t.z.object({...Ei.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),wi=t.z.array(Oi),Ai=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),resource_server_name:t.z.string(),permission_name:t.z.string(),description:t.z.string().nullable().optional(),created_at:t.z.string().optional(),organization_id:t.z.string().optional()}),Si=t.z.array(Ai),Ii=t.z.object({user_id:t.z.string(),role_id:t.z.string(),organization_id:t.z.string().optional()}),Ci=t.z.object({...Ii.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),Ni=t.z.array(Ci),Ti=t.z.object({id:t.z.string().optional().openapi({description:"The unique identifier of the role. If not provided, one will be generated."}),name:t.z.string().min(1).max(50).openapi({description:"The name of the role. Cannot include '<' or '>'"}),description:t.z.string().max(255).optional().openapi({description:"The description of the role"}),is_system:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional().openapi({description:"Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios."})}),xi=Ti.extend({id:t.z.string().openapi({description:"The unique identifier of the role"}),created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),ki=t.z.array(xi),Ri=t.z.object({logo_url:t.z.string().optional().openapi({description:"URL of the organization's logo"}),colors:t.z.object({primary:t.z.string().optional().openapi({description:"Primary color in hex format (e.g., #FF0000)"}),page_background:t.z.string().optional().openapi({description:"Page background color in hex format (e.g., #FFFFFF)"})}).optional()}).optional(),Di=t.z.object({connection_id:t.z.string().openapi({description:"ID of the connection"}),assign_membership_on_login:t.z.boolean().default(!1).openapi({description:"Whether to assign membership to the organization on login"}),show_as_button:t.z.boolean().default(!0).openapi({description:"Whether to show this connection as a button in the login screen"}),is_signup_enabled:t.z.boolean().default(!0).openapi({description:"Whether signup is enabled for this connection"})}),Li=t.z.object({client_credentials:t.z.object({enforce:t.z.boolean().default(!1).openapi({description:"Whether to enforce token quota limits"}),per_day:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per day (0 = unlimited)"}),per_hour:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per hour (0 = unlimited)"})}).optional()}).optional(),ji=t.z.object({id:t.z.string().optional(),name:t.z.string().min(1).regex(/^[a-z0-9_-]+$/,{message:"Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores"}).openapi({description:"The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores."}),display_name:t.z.string().optional().openapi({description:"The display name of the organization"}),branding:Ri,metadata:t.z.record(t.z.any()).default({}).optional().openapi({description:"Custom metadata for the organization"}),enabled_connections:t.z.array(Di).default([]).optional().openapi({description:"List of enabled connections for the organization"}),token_quota:Li}),Fi=t.z.object({...ji.shape,...l.shape,id:t.z.string(),name:t.z.string().min(1).openapi({description:"The name of the organization"})}),Ui=t.z.object({user_id:t.z.string().openapi({description:"ID of the user"}),organization_id:t.z.string().openapi({description:"ID of the organization"})}),Pi=t.z.object({...Ui.shape,...l.shape,id:t.z.string()}),Mi=t.z.object({idle_session_lifetime:t.z.number().optional(),session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),enable_client_connections:t.z.boolean().optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional()}).optional(),friendly_name:t.z.string().optional(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional(),mfa:t.z.object({policy:t.z.enum(["never","always"]).default("never").optional(),factors:t.z.object({sms:t.z.boolean().default(!1),otp:t.z.boolean().default(!1),email:t.z.boolean().default(!1),push_notification:t.z.boolean().default(!1),webauthn_roaming:t.z.boolean().default(!1),webauthn_platform:t.z.boolean().default(!1),recovery_code:t.z.boolean().default(!1),duo:t.z.boolean().default(!1)}).optional(),sms_provider:t.z.object({provider:t.z.enum(["twilio","vonage","aws_sns","phone_message_hook"]).optional()}).optional(),twilio:t.z.object({sid:t.z.string().optional(),auth_token:t.z.string().optional(),from:t.z.string().optional(),messaging_service_sid:t.z.string().optional()}).optional(),phone_message:t.z.object({message:t.z.string().optional()}).optional()}).optional()}),Zi=t.z.object({date:t.z.string().openapi({description:"Date these events occurred in ISO 8601 format",example:"2025-12-19"}),logins:t.z.number().openapi({description:"Number of logins on this date",example:150}),signups:t.z.number().openapi({description:"Number of signups on this date",example:25}),leaked_passwords:t.z.number().openapi({description:"Number of breached-password detections on this date (subscription required)",example:0}),updated_at:t.z.string().openapi({description:"Date and time this stats entry was last updated in ISO 8601 format",example:"2025-12-19T10:30:00.000Z"}),created_at:t.z.string().openapi({description:"Approximate date and time the first event occurred in ISO 8601 format",example:"2025-12-19T00:00:00.000Z"})}),Hi=t.z.number().openapi({description:"Number of active users in the last 30 days",example:1234}),$i=t.z.enum(["login","login-id","login-password","signup","signup-id","signup-password","reset-password","consent","mfa","mfa-push","mfa-otp","mfa-voice","mfa-phone","mfa-webauthn","mfa-email","mfa-recovery-code","status","device-flow","email-verification","email-otp-challenge","organizations","invitation","common","passkeys","captcha","custom-form","login-passwordless","mfa-login-options"]),zi=t.z.record(t.z.string(),t.z.record(t.z.string(),t.z.string())).openapi({type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string"}}}),Gi=t.z.object({prompt:$i,language:t.z.string(),custom_text:zi}),qi=t.z.enum(["phone","totp","email","push","webauthn-roaming","webauthn-platform","passkey"]),Bi=t.z.object({user_id:t.z.string(),type:qi,phone_number:t.z.string().optional(),totp_secret:t.z.string().optional(),credential_id:t.z.string().optional(),public_key:t.z.string().optional(),sign_count:t.z.number().int().nonnegative().optional(),credential_backed_up:t.z.boolean().optional(),transports:t.z.array(t.z.string()).optional(),friendly_name:t.z.string().optional(),confirmed:t.z.boolean().default(!1)});function Wi(e,i){"phone"===e.type&&!e.phone_number&&i.addIssue({code:t.z.ZodIssueCode.custom,message:"phone_number is required when type is 'phone'",path:["phone_number"]}),"totp"===e.type&&!e.totp_secret&&i.addIssue({code:t.z.ZodIssueCode.custom,message:"totp_secret is required when type is 'totp'",path:["totp_secret"]}),["webauthn-roaming","webauthn-platform","passkey"].includes(e.type)&&(e.credential_id||i.addIssue({code:t.z.ZodIssueCode.custom,message:`credential_id is required when type is '${e.type}'`,path:["credential_id"]}),e.public_key||i.addIssue({code:t.z.ZodIssueCode.custom,message:`public_key is required when type is '${e.type}'`,path:["public_key"]}))}const Ki=Bi.superRefine(Wi),Vi=t.z.object({...Bi.shape,id:t.z.string(),created_at:t.z.string(),updated_at:t.z.string()}).superRefine(Wi);e.Auth0ActionEnum=_,e.Auth0Client=Mt,e.AuthorizationResponseMode=re,e.AuthorizationResponseType=se,e.CodeChallengeMethod=oe,e.ComponentCategory=Z,e.ComponentType=M,e.EmailActionEnum=p,e.FORM_FIELD_TYPES=tt,e.FlowActionTypeEnum=h,e.GrantType=Yt,e.LocationInfo=Zt,e.LogTypes=Ut,e.LoginSessionState=Dt,e.NodeType=K,e.RedirectTargetEnum=y,e.Strategy={EMAIL:"email",SMS:"sms",USERNAME_PASSWORD:"Username-Password-Authentication",GOOGLE_OAUTH2:"google-oauth2",APPLE:"apple",FACEBOOK:"facebook",GITHUB:"github",MICROSOFT:"microsoft",VIPPS:"vipps",OIDC:"oidc",OAUTH2:"oauth2",SAMLP:"samlp",WAAD:"waad",ADFS:"adfs"},e.StrategyType={DATABASE:"database",SOCIAL:"social",PASSWORDLESS:"passwordless"},e.actionNodeSchema=Y,e.activeUsersResponseSchema=Hi,e.actorSchema=n,e.addressSchema=C,e.auditCategorySchema=i,e.auditEventInsertSchema=u,e.auditEventSchema=d,e.auth0ClientSchema=c,e.auth0FlowInsertSchema=ne,e.auth0FlowSchema=ie,e.auth0QuerySchema=w,e.auth0UpdateUserActionSchema=m,e.auth0UserResponseSchema=k,e.authParamsSchema=ae,e.authenticationMethodInsertSchema=Ki,e.authenticationMethodSchema=Vi,e.authenticationMethodTypeSchema=qi,e.baseUserSchema=N,e.blockComponentSchema=Ye,e.bordersSchema=Qt,e.brandingSchema=ce,e.buttonComponentSchema=z,e.clientGrantInsertSchema=j,e.clientGrantListSchema=U,e.clientGrantSchema=F,e.clientInsertSchema=D,e.clientSchema=L,e.codeInsertSchema=de,e.codeSchema=le,e.codeTypeSchema=ue,e.colorsSchema=ei,e.componentMessageSchema=dt,e.componentSchema=W,e.connectionInsertSchema=_e,e.connectionOptionsSchema=he,e.connectionSchema=pe,e.coordinatesSchema=P,e.createPassthroughAdapter=function(e){const{primary:t,secondaries:i,syncMethods:n=["create","update","remove","delete","set"]}=e,s={get(e,t){if("symbol"==typeof t)return e[t];const s=e[t];return"function"!=typeof s?s:n.includes(t)?async(...n)=>{const r=await s.apply(e,n),o=[];for(const e of i){const i=e.adapter[t];if("function"!=typeof i)continue;const s=(async()=>{try{await i.apply(e.adapter,n)}catch(i){try{e.onError?e.onError(i,t,n):console.error(`Passthrough adapter: secondary write failed for ${t}:`,i)}catch(e){console.error(`Passthrough adapter: onError handler threw for ${t}:`,e)}}})();e.blocking&&o.push(s)}return o.length>0&&await Promise.all(o),r}:s.bind(e)}};return new Proxy(t,s)},e.createWriteOnlyAdapter=function(e){return e},e.customDomainInsertSchema=fe,e.customDomainSchema=ge,e.customDomainWithTenantIdSchema=ye,e.customTextEntrySchema=Gi,e.customTextSchema=zi,e.dailyStatsSchema=Zi,e.emailProviderSchema=ci,e.emailVerificationRulesSchema=f,e.emailVerifyActionSchema=g,e.endingSchema=te,e.fieldComponentSchema=Qe,e.flowActionStepSchema=b,e.flowInsertSchema=E,e.flowSchema=O,e.flowsFieldComponentSchema=q,e.flowsFlowNodeSchema=X,e.flowsStepNodeSchema=V,e.fontDetailsSchema=ti,e.fontsSchema=ii,e.formControlSchema=it,e.formInsertSchema=ct,e.formNodeComponentDefinition=et,e.formNodeSchema=at,e.formSchema=ut,e.genericComponentSchema=B,e.genericNodeSchema=J,e.getConnectionIdentifierConfig=function(e){var t,i,n,s,r,o,a,c,u,d,l,h;const _=null==e?void 0:e.options;if(!_)return{usernameIdentifierActive:!1,emailIdentifierActive:!0,usernameMinLength:1,usernameMaxLength:15};const p=_.attributes;return p?{usernameIdentifierActive:!0===(null==(i=null==(t=p.username)?void 0:t.identifier)?void 0:i.active),emailIdentifierActive:!1!==(null==(s=null==(n=p.email)?void 0:n.identifier)?void 0:s.active),usernameMinLength:(null==(o=null==(r=p.username)?void 0:r.validation)?void 0:o.min_length)??1,usernameMaxLength:(null==(c=null==(a=p.username)?void 0:a.validation)?void 0:c.max_length)??15}:{usernameIdentifierActive:!0===_.requires_username,emailIdentifierActive:!0,usernameMinLength:(null==(d=null==(u=_.validation)?void 0:u.username)?void 0:d.min)??1,usernameMaxLength:(null==(h=null==(l=_.validation)?void 0:l.username)?void 0:h.max)??15}},e.hookInsertSchema=Et,e.hookSchema=St,e.hookTemplateId=mt,e.hookTemplates={"ensure-username":{name:"Ensure Username",description:"Automatically assigns a username to users who sign in without one. Creates a linked username account for social/email users.",trigger_id:"post-user-login"},"set-preferred-username":{name:"Set Preferred Username",description:"Sets the preferred_username claim on tokens based on the username from the primary or linked user.",trigger_id:"credentials-exchange"}},e.identitySchema=I,e.inviteInsertSchema=Nt,e.inviteSchema=Tt,e.inviteeSchema=Ct,e.inviterSchema=It,e.isBlockComponent=function(e){return"BLOCK"===e.category},e.isFieldComponent=function(e){return"FIELD"===e.category},e.isWidgetComponent=function(e){return"WIDGET"===e.category},e.jwksKeySchema=kt,e.jwksSchema=xt,e.legalComponentSchema=G,e.locationInfoSchema=a,e.logInsertSchema=Ht,e.logSchema=$t,e.loginSessionInsertSchema=jt,e.loginSessionSchema=Ft,e.loginSessionStateSchema=Lt,e.nodeSchema=Q,e.openIDConfigurationSchema=Rt,e.organizationBrandingSchema=Ri,e.organizationEnabledConnectionSchema=Di,e.organizationInsertSchema=ji,e.organizationSchema=Fi,e.organizationTokenQuotaSchema=Li,e.pageBackgroundSchema=ni,e.parseUserId=function(e){const[t,i]=e.split("|");if(!t||!i)throw Error("Invalid user_id: "+e);return{connection:t,id:i}},e.passwordInsertSchema=zt,e.passwordSchema=Gt,e.profileDataSchema=S,e.promptScreenSchema=$i,e.promptSettingSchema=ai,e.redirectActionSchema=v,e.refreshTokenInsertSchema=ui,e.refreshTokenSchema=di,e.requestContextSchema=r,e.resourceServerInsertSchema=fi,e.resourceServerListSchema=gi,e.resourceServerOptionsSchema=pi,e.resourceServerSchema=mi,e.resourceServerScopeSchema=_i,e.responseContextSchema=o,e.richTextComponentSchema=$,e.roleInsertSchema=Ti,e.roleListSchema=ki,e.rolePermissionInsertSchema=yi,e.rolePermissionListSchema=bi,e.rolePermissionSchema=vi,e.roleSchema=xi,e.screenLinkSchema=lt,e.sessionInsertSchema=Bt,e.sessionSchema=Wt,e.signingKeySchema=Kt,e.smsProviderSchema=hi,e.smsSendParamsSchema=li,e.startSchema=ee,e.targetSchema=s,e.tenantInsertSchema=Vt,e.tenantSchema=Xt,e.tenantSettingsSchema=Mi,e.themeInsertSchema=ri,e.themeSchema=oi,e.tokenResponseSchema=Jt,e.totalsSchema=A,e.uiScreenSchema=ht,e.userInsertSchema=T,e.userOrganizationInsertSchema=Ui,e.userOrganizationSchema=Pi,e.userPermissionInsertSchema=Ei,e.userPermissionListSchema=wi,e.userPermissionSchema=Oi,e.userPermissionWithDetailsListSchema=Si,e.userPermissionWithDetailsSchema=Ai,e.userResponseSchema=R,e.userRoleInsertSchema=Ii,e.userRoleListSchema=Ni,e.userRoleSchema=Ci,e.userSchema=x,e.verificationMethodsSchema=me,e.widgetComponentSchema=Je,e.widgetSchema=si}(t)),t),In=Sn.isBlockComponent,Cn=Sn.isFieldComponent,Nn=Sn.isWidgetComponent;export{In as isBlockComponent,Cn as isFieldComponent,Nn as isWidgetComponent}
|
|
1
|
+
export{g as getAssetPath,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions}from"./p-DpfoRsj0.js";function e(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var i=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),i}var t={};function i(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(i[n[s]]=e[n[s]])}return i}function n(e,t){var i;return(null===(i=null==e?void 0:e._def)||void 0===i?void 0:i.typeName)===t}function o(e,t){const i=e.ZodType.prototype[t];e.ZodType.prototype[t]=function(...e){const t=i.apply(this,e);return t._def.openapi=this._def.openapi,t}}function c(e){if(void 0!==e.ZodType.prototype.openapi)return;e.ZodType.prototype.openapi=function(e,t){var s,r,o,a,c,u;const d="string"==typeof e?t:e,l=null!=d?d:{},{param:h}=l,_=i(l,["param"]),p=Object.assign(Object.assign({},null===(s=this._def.openapi)||void 0===s?void 0:s._internal),"string"==typeof e?{refId:e}:void 0),f=Object.assign(Object.assign(Object.assign({},null===(r=this._def.openapi)||void 0===r?void 0:r.metadata),_),(null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o.metadata)||void 0===a?void 0:a.param)||h?{param:Object.assign(Object.assign({},null===(u=null===(c=this._def.openapi)||void 0===c?void 0:c.metadata)||void 0===u?void 0:u.param),h)}:void 0),m=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(p).length>0?{_internal:p}:void 0),Object.keys(f).length>0?{metadata:f}:void 0)}));if(n(this,"ZodObject")){const e=this.extend;m.extend=function(...t){var i,n,s,r,o,a,c;const u=e.apply(this,t);return u._def.openapi={_internal:{extendedFrom:(null===(n=null===(i=this._def.openapi)||void 0===i?void 0:i._internal)||void 0===n?void 0:n.refId)?{refId:null===(r=null===(s=this._def.openapi)||void 0===s?void 0:s._internal)||void 0===r?void 0:r.refId,schema:this}:null===(a=null===(o=this._def.openapi)||void 0===o?void 0:o._internal)||void 0===a?void 0:a.extendedFrom},metadata:null===(c=u._def.openapi)||void 0===c?void 0:c.metadata},u}}return m},o(e,"optional"),o(e,"nullable"),o(e,"default"),o(e,"transform"),o(e,"refine");const t=e.ZodObject.prototype.deepPartial;e.ZodObject.prototype.deepPartial=function(){const e=this._def.shape(),i=t.apply(this),n=i._def.shape();return Object.entries(n).forEach((([t,i])=>{var n,s;i._def.openapi=null===(s=null===(n=e[t])||void 0===n?void 0:n._def)||void 0===s?void 0:s.openapi})),i._def.openapi=void 0,i};const s=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...e){const t=s.apply(this,e);return t._def.openapi=void 0,t};const r=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...e){const t=r.apply(this,e);return t._def.openapi=void 0,t}}function u(e,t){if(null==e||null==t)return e===t;if(e===t||e.valueOf()===t.valueOf())return!0;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1}if(!(e instanceof Object&&t instanceof Object))return!1;const i=Object.keys(e);return Object.keys(t).every((e=>-1!==i.indexOf(e)))&&i.every((i=>u(e[i],t[i])))}"function"==typeof SuppressedError&&SuppressedError;class d{constructor(){this.buckets=new Map}put(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);i?i.some((t=>u(t,e)))||i.push(e):this.buckets.set(t,[e])}contains(e){const t=this.hashCodeOf(e),i=this.buckets.get(t);return!!i&&i.some((t=>u(t,e)))}values(){return[...this.buckets.values()].flat()}stats(){let e=0,t=0,i=0;for(const n of this.buckets.values())e+=1,t+=n.length,n.length>1&&(i+=1);return{totalBuckets:e,collisions:i,totalValues:t,hashEffectiveness:e/t}}hashCodeOf(e){let t=0;if(Array.isArray(e)){for(let i=0;i<e.length;i++)t^=this.hashCodeOf(e[i])*i;return t}if("string"==typeof e){for(let i=0;i<e.length;i++)t^=e.charCodeAt(i)*i;return t}if("number"==typeof e)return e;if("object"==typeof e)for(const[i,n]of Object.entries(e))t^=this.hashCodeOf(i)+this.hashCodeOf(null!=n?n:"");return t}}function l(e){return void 0===e}function h(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{i[e]=t(n)})),i}function _(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t(n,e)||(i[e]=n)})),i}function p(e){return e.filter((e=>!l(e)))}const f=u;function m(e){return"string"==typeof e}class y{constructor(e){this.parents=e,this._definitions=[]}get definitions(){var e,t;return[...null!==(t=null===(e=this.parents)||void 0===e?void 0:e.flatMap((e=>e.definitions)))&&void 0!==t?t:[],...this._definitions]}register(e,t){const i=this.schemaWithRefId(e,t);return this._definitions.push({type:"schema",schema:i}),i}registerParameter(e,t){var i,n,s;const r=this.schemaWithRefId(e,t),o=null===(i=r._def.openapi)||void 0===i?void 0:i.metadata,a=r.openapi(Object.assign(Object.assign({},o),{param:Object.assign(Object.assign({},null==o?void 0:o.param),{name:null!==(s=null===(n=null==o?void 0:o.param)||void 0===n?void 0:n.name)&&void 0!==s?s:e})}));return this._definitions.push({type:"parameter",schema:a}),a}registerPath(e){this._definitions.push({type:"route",route:e})}registerWebhook(e){this._definitions.push({type:"webhook",webhook:e})}registerComponent(e,t,i){return this._definitions.push({type:"component",componentType:e,name:t,component:i}),{name:t,ref:{$ref:`#/components/${e}/${t}`}}}schemaWithRefId(e,t){return t.openapi(e)}}class v{constructor(e){this.message=e}}class E extends v{constructor(e,t){super(e),this.data=t}}class O extends v{constructor(e){super(`Missing parameter data, please specify \`${e.missingField}\` and other OpenAPI parameter props using the \`param\` field of \`ZodSchema.openapi\``),this.data=e}}function w(e,t){try{return e()}catch(e){if(e instanceof O)throw new O(Object.assign(Object.assign({},e.data),t));throw e}}class A extends v{constructor(e){super("Unknown zod object type, please specify `type` and other OpenAPI props using `ZodSchema.openapi`."),this.data=e}}class S{static getMetadata(e){var t;const i=this.unwrapChained(e),n=e._def.openapi?e._def.openapi:i._def.openapi,s=null!==(t=e.description)&&void 0!==t?t:i.description;return{_internal:null==n?void 0:n._internal,metadata:Object.assign({description:s},null==n?void 0:n.metadata)}}static getInternalMetadata(e){const t=this.unwrapChained(e),i=e._def.openapi?e._def.openapi:t._def.openapi;return null==i?void 0:i._internal}static getParamMetadata(e){var t,i;const n=this.unwrapChained(e),s=e._def.openapi?e._def.openapi:n._def.openapi,r=null!==(t=e.description)&&void 0!==t?t:n.description;return{_internal:null==s?void 0:s._internal,metadata:Object.assign(Object.assign({},null==s?void 0:s.metadata),{param:Object.assign({description:r},null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param)})}}static buildSchemaMetadata(e){return _(function(e,t){const i={};return Object.entries(e).forEach((([e,n])=>{t.some((t=>t===e))||(i[e]=n)})),i}(e,["param"]),l)}static buildParameterMetadata(e){return _(e,l)}static applySchemaMetadata(e,t){return _(Object.assign(Object.assign({},e),this.buildSchemaMetadata(t)),l)}static getRefId(e){var t;return null===(t=this.getInternalMetadata(e))||void 0===t?void 0:t.refId}static unwrapChained(e){return this.unwrapUntil(e)}static getDefaultValue(e){const t=this.unwrapUntil(e,"ZodDefault");return null==t?void 0:t._def.defaultValue()}static unwrapUntil(e,t){return t&&n(e,t)?e:n(e,"ZodOptional")||n(e,"ZodNullable")||n(e,"ZodBranded")?this.unwrapUntil(e.unwrap(),t):n(e,"ZodDefault")||n(e,"ZodReadonly")?this.unwrapUntil(e._def.innerType,t):n(e,"ZodEffects")?this.unwrapUntil(e._def.schema,t):n(e,"ZodPipeline")?this.unwrapUntil(e._def.in,t):t?void 0:e}static isOptionalSchema(e){return e.isOptional()}}class I{transform(e,t,i){var n,s;const r=e._def.type;return Object.assign(Object.assign({},t("array")),{items:i(r),minItems:null===(n=e._def.minLength)||void 0===n?void 0:n.value,maxItems:null===(s=e._def.maxLength)||void 0===s?void 0:s.value})}}class C{transform(e){return Object.assign(Object.assign({},e("string")),{pattern:"^d+$"})}}class N{transform(e,t,i,n,s){const r=[...e.options.values()],o=r.map(n);return t?{oneOf:i(o,t)}:{oneOf:o,discriminator:this.mapDiscriminator(r,e.discriminator,s)}}mapDiscriminator(e,t,i){if(e.some((e=>void 0===S.getRefId(e))))return;const s={};return e.forEach((e=>{var r;const o=S.getRefId(e),a=null===(r=e.shape)||void 0===r?void 0:r[t];if(n(a,"ZodEnum")||n(a,"ZodNativeEnum"))return void Object.values(a.enum).filter(m).forEach((e=>{s[e]=i(o)}));const c=null==a?void 0:a._def.value;if("string"!=typeof c)throw Error(`Discriminator ${t} could not be found in one of the values of a discriminated union`);s[c]=i(o)})),{propertyName:t,mapping:s}}}class T{transform(e,t){return Object.assign(Object.assign({},t("string")),{enum:e._def.values})}}class k{transform(e,t,i,n){const s={allOf:this.flattenIntersectionTypes(e).map(n)};return t?{anyOf:i([s],t)}:s}flattenIntersectionTypes(e){return n(e,"ZodIntersection")?[...this.flattenIntersectionTypes(e._def.left),...this.flattenIntersectionTypes(e._def.right)]:[e]}}class x{transform(e,t){return Object.assign(Object.assign({},t(typeof e._def.value)),{enum:[e._def.value]})}}class R{transform(e,t){const{type:i,values:n}=function(e){const t=Object.keys(e).filter((t=>"number"!=typeof e[e[t]])).map((t=>e[t])),i=t.filter((e=>"number"==typeof e)).length;return{values:t,type:0===i?"string":i===t.length?"numeric":"mixed"}}(e._def.values);if("mixed"===i)throw new v("Enum has mixed string and number values, please specify the OpenAPI type manually");return Object.assign(Object.assign({},t("numeric"===i?"integer":"string")),{enum:n})}}class D{transform(e,t,i){return Object.assign(Object.assign({},t(e.isInt?"integer":"number")),i(e._def.checks))}}class L{transform(e,t,i,n){var s;const r=null===(s=S.getInternalMetadata(e))||void 0===s?void 0:s.extendedFrom,o=this.requiredKeysOf(e),a=h(e._def.shape(),n);if(!r)return Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{properties:a,default:t}),o.length>0?{required:o}:{}),this.generateAdditionalProperties(e,n));const c=r.schema;n(c);const u=this.requiredKeysOf(c),d=h(null==c?void 0:c._def.shape(),n),l=Object.fromEntries(Object.entries(a).filter((([e,t])=>!f(d[e],t)))),_=o.filter((e=>!u.includes(e))),p=Object.assign(Object.assign(Object.assign(Object.assign({},i("object")),{default:t,properties:l}),_.length>0?{required:_}:{}),this.generateAdditionalProperties(e,n));return{allOf:[{$ref:"#/components/schemas/"+r.refId},p]}}generateAdditionalProperties(e,t){const i=e._def.unknownKeys,s=e._def.catchall;return n(s,"ZodNever")?"strict"===i?{additionalProperties:!1}:{}:{additionalProperties:t(s)}}requiredKeysOf(e){return Object.entries(e._def.shape()).filter((([e,t])=>!S.isOptionalSchema(t))).map((([e,t])=>e))}}class j{transform(e,t,i){const s=e._def.keyType,r=i(e._def.valueType);if(n(s,"ZodEnum")||n(s,"ZodNativeEnum")){const e=Object.values(s.enum).filter(m).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:r})),{});return Object.assign(Object.assign({},t("object")),{properties:e})}return Object.assign(Object.assign({},t("object")),{additionalProperties:r})}}class F{transform(e,t){var i,n,s;const r=this.getZodStringCheck(e,"regex"),o=null===(i=this.getZodStringCheck(e,"length"))||void 0===i?void 0:i.value,a=Number.isFinite(e.minLength)&&null!==(n=e.minLength)&&void 0!==n?n:void 0,c=Number.isFinite(e.maxLength)&&null!==(s=e.maxLength)&&void 0!==s?s:void 0;return Object.assign(Object.assign({},t("string")),{minLength:null!=o?o:a,maxLength:null!=o?o:c,format:this.mapStringFormat(e),pattern:null==r?void 0:r.regex.source})}mapStringFormat(e){return e.isUUID?"uuid":e.isEmail?"email":e.isURL?"uri":e.isDate?"date":e.isDatetime?"date-time":e.isCUID?"cuid":e.isCUID2?"cuid2":e.isULID?"ulid":e.isIP?"ip":e.isEmoji?"emoji":void 0}getZodStringCheck(e,t){return e._def.checks.find((e=>e.kind===t))}}class U{constructor(e){this.versionSpecifics=e}transform(e,t,i){const{items:n}=e._def,s=n.map(i);return Object.assign(Object.assign({},t("array")),this.versionSpecifics.mapTupleItems(s))}}class P{transform(e,t,i){return{anyOf:t(this.flattenUnionTypes(e).map((e=>{const t=this.unwrapNullable(e);return i(t)})))}}flattenUnionTypes(e){return n(e,"ZodUnion")?e._def.options.flatMap((e=>this.flattenUnionTypes(e))):[e]}unwrapNullable(e){return n(e,"ZodNullable")?this.unwrapNullable(e.unwrap()):e}}class M{constructor(e){this.versionSpecifics=e,this.objectTransformer=new L,this.stringTransformer=new F,this.numberTransformer=new D,this.bigIntTransformer=new C,this.literalTransformer=new x,this.enumTransformer=new T,this.nativeEnumTransformer=new R,this.arrayTransformer=new I,this.unionTransformer=new P,this.discriminatedUnionTransformer=new N,this.intersectionTransformer=new k,this.recordTransformer=new j,this.tupleTransformer=new U(e)}transform(e,t,i,s,r){if(n(e,"ZodNull"))return this.versionSpecifics.nullType;if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodObject"))return this.objectTransformer.transform(e,r,(e=>this.versionSpecifics.mapNullableType(e,t)),i);const o=this.transformSchemaWithoutDefault(e,t,i,s);return Object.assign(Object.assign({},o),{default:r})}transformSchemaWithoutDefault(e,t,i,s){if(n(e,"ZodUnknown")||n(e,"ZodAny"))return this.versionSpecifics.mapNullableType(void 0,t);if(n(e,"ZodString"))return this.stringTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNumber"))return this.numberTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),(e=>this.versionSpecifics.getNumberChecks(e)));if(n(e,"ZodBigInt"))return this.bigIntTransformer.transform((e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodBoolean"))return this.versionSpecifics.mapNullableType("boolean",t);if(n(e,"ZodLiteral"))return this.literalTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodEnum"))return this.enumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodNativeEnum"))return this.nativeEnumTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)));if(n(e,"ZodArray"))return this.arrayTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodTuple"))return this.tupleTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodUnion"))return this.unionTransformer.transform(e,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodDiscriminatedUnion"))return this.discriminatedUnionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i,s);if(n(e,"ZodIntersection"))return this.intersectionTransformer.transform(e,t,(e=>this.versionSpecifics.mapNullableOfArray(e,t)),i);if(n(e,"ZodRecord"))return this.recordTransformer.transform(e,(e=>this.versionSpecifics.mapNullableType(e,t)),i);if(n(e,"ZodDate"))return this.versionSpecifics.mapNullableType("string",t);const r=S.getRefId(e);throw new A({currentSchema:e._def,schemaName:r})}}class Z{constructor(e,t){this.definitions=e,this.versionSpecifics=t,this.schemaRefs={},this.paramRefs={},this.pathRefs={},this.rawComponents=[],this.openApiTransformer=new M(t),this.sortDefinitions()}generateDocumentData(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents(),paths:this.pathRefs}}generateComponents(){return this.definitions.forEach((e=>this.generateSingle(e))),{components:this.buildComponents()}}buildComponents(){var e,t;const i={};return this.rawComponents.forEach((({componentType:e,name:t,component:n})=>{var s;null!==(s=i[e])&&void 0!==s||(i[e]={}),i[e][t]=n})),Object.assign(Object.assign({},i),{schemas:Object.assign(Object.assign({},null!==(e=i.schemas)&&void 0!==e?e:{}),this.schemaRefs),parameters:Object.assign(Object.assign({},null!==(t=i.parameters)&&void 0!==t?t:{}),this.paramRefs)})}sortDefinitions(){const e=["schema","parameter","component","route"];this.definitions.sort(((t,i)=>"type"in t?"type"in i?e.findIndex((e=>e===t.type))-e.findIndex((e=>e===i.type)):1:"type"in i?-1:0))}generateSingle(e){if("type"in e)switch(e.type){case"parameter":return void this.generateParameterDefinition(e.schema);case"schema":return void this.generateSchemaWithRef(e.schema);case"route":return void this.generateSingleRoute(e.route);case"component":return void this.rawComponents.push(e)}else this.generateSchemaWithRef(e)}generateParameterDefinition(e){const t=S.getRefId(e),i=this.generateParameter(e);return t&&(this.paramRefs[t]=i),i}getParameterRef(e,t){var i,n,s,r,o;const a=null===(i=null==e?void 0:e.metadata)||void 0===i?void 0:i.param,c=(null===(n=null==e?void 0:e._internal)||void 0===n?void 0:n.refId)?this.paramRefs[null===(s=e._internal)||void 0===s?void 0:s.refId]:void 0;if((null===(r=null==e?void 0:e._internal)||void 0===r?void 0:r.refId)&&c){if(a&&c.in!==a.in||(null==t?void 0:t.in)&&c.in!==t.in)throw new E("Conflicting location for parameter "+c.name,{key:"in",values:p([c.in,null==t?void 0:t.in,null==a?void 0:a.in])});if(a&&c.name!==a.name||(null==t?void 0:t.name)&&c.name!==(null==t?void 0:t.name))throw new E("Conflicting names for parameter",{key:"name",values:p([c.name,null==t?void 0:t.name,null==a?void 0:a.name])});return{$ref:"#/components/parameters/"+(null===(o=e._internal)||void 0===o?void 0:o.refId)}}}generateInlineParameters(e,t){var i;const s=S.getMetadata(e),r=null===(i=null==s?void 0:s.metadata)||void 0===i?void 0:i.param,o=this.getParameterRef(s,{in:t});if(o)return[o];if(n(e,"ZodObject")){const i=e._def.shape(),n=Object.entries(i).map((([e,i])=>{var n,s;const r=S.getMetadata(i),o=this.getParameterRef(r,{in:t,name:e});if(o)return o;const a=null===(n=null==r?void 0:r.metadata)||void 0===n?void 0:n.param;if((null==a?void 0:a.name)&&a.name!==e)throw new E("Conflicting names for parameter",{key:"name",values:[e,a.name]});if((null==a?void 0:a.in)&&a.in!==t)throw new E("Conflicting location for parameter "+(null!==(s=a.name)&&void 0!==s?s:e),{key:"in",values:[t,a.in]});return this.generateParameter(i.openapi({param:{name:e,in:t}}))}));return n}if((null==r?void 0:r.in)&&r.in!==t)throw new E("Conflicting location for parameter "+r.name,{key:"in",values:[t,r.in]});return[this.generateParameter(e.openapi({param:{in:t}}))]}generateSimpleParameter(e){var t;const i=S.getParamMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=!S.isOptionalSchema(e)&&!e.isNullable(),r=this.generateSchemaWithRef(e);return Object.assign({schema:r,required:s},n?S.buildParameterMetadata(n):{})}generateParameter(e){var t;const i=S.getMetadata(e),n=null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.param,s=null==n?void 0:n.name,r=null==n?void 0:n.in;if(!s)throw new O({missingField:"name"});if(!r)throw new O({missingField:"in",paramName:s});const o=this.generateSimpleParameter(e);return Object.assign(Object.assign({},o),{in:r,name:s})}generateSchemaWithMetadata(e){var t;const i=S.unwrapChained(e),n=S.getMetadata(e),s=S.getDefaultValue(e),r=(null===(t=null==n?void 0:n.metadata)||void 0===t?void 0:t.type)?{type:null==n?void 0:n.metadata.type}:this.toOpenAPISchema(i,e.isNullable(),s);return(null==n?void 0:n.metadata)?S.applySchemaMetadata(r,n.metadata):_(r,l)}constructReferencedOpenAPISchema(e){var t;const i=S.getMetadata(e),n=S.unwrapChained(e),s=S.getDefaultValue(e),r=e.isNullable();return(null===(t=null==i?void 0:i.metadata)||void 0===t?void 0:t.type)?this.versionSpecifics.mapNullableType(i.metadata.type,r):this.toOpenAPISchema(n,r,s)}generateSimpleSchema(e){var t;const i=S.getMetadata(e),n=S.getRefId(e);if(!n||!this.schemaRefs[n])return this.generateSchemaWithMetadata(e);const s=this.schemaRefs[n],r={$ref:this.generateSchemaRef(n)},o=_(S.buildSchemaMetadata(null!==(t=null==i?void 0:i.metadata)&&void 0!==t?t:{}),((e,t)=>void 0===e||f(e,s[t])));if(o.type)return{allOf:[r,o]};const a=_(this.constructReferencedOpenAPISchema(e),((e,t)=>void 0===e||f(e,s[t]))),c=S.applySchemaMetadata(a,o);return Object.keys(c).length>0?{allOf:[r,c]}:r}generateSchemaWithRef(e){const t=S.getRefId(e),i=this.generateSimpleSchema(e);return t&&void 0===this.schemaRefs[t]?(this.schemaRefs[t]=i,{$ref:this.generateSchemaRef(t)}):i}generateSchemaRef(e){return"#/components/schemas/"+e}getRequestBody(e){if(!e)return;const{content:t}=e,n=i(e,["content"]),s=this.getBodyContent(t);return Object.assign(Object.assign({},n),{content:s})}getParameters(e){if(!e)return[];const{headers:t}=e,i=this.cleanParameter(e.query),n=this.cleanParameter(e.params),s=this.cleanParameter(e.cookies),r=w((()=>i?this.generateInlineParameters(i,"query"):[]),{location:"query"}),o=w((()=>n?this.generateInlineParameters(n,"path"):[]),{location:"path"}),a=w((()=>s?this.generateInlineParameters(s,"cookie"):[]),{location:"cookie"});return[...o,...r,...w((()=>{if(Array.isArray(t))return t.flatMap((e=>this.generateInlineParameters(e,"header")));const e=this.cleanParameter(t);return e?this.generateInlineParameters(e,"header"):[]}),{location:"header"}),...a]}cleanParameter(e){if(e)return n(e,"ZodEffects")?this.cleanParameter(e._def.schema):e}generatePath(e){const{method:t,path:n,request:s,responses:r}=e,o=i(e,["method","path","request","responses"]),a=h(r,(e=>this.getResponse(e))),c=w((()=>this.getParameters(s)),{route:`${t} ${n}`}),u=this.getRequestBody(null==s?void 0:s.body);return{[t]:Object.assign(Object.assign(Object.assign(Object.assign({},o),c.length>0?{parameters:[...o.parameters||[],...c]}:{}),u?{requestBody:u}:{}),{responses:a})}}generateSingleRoute(e){const t=this.generatePath(e);return this.pathRefs[e.path]=Object.assign(Object.assign({},this.pathRefs[e.path]),t),t}getResponse(e){if(this.isReferenceObject(e))return e;const{content:t,headers:s}=e,r=i(e,["content","headers"]),o=t?{content:this.getBodyContent(t)}:{};if(!s)return Object.assign(Object.assign({},r),o);const a=n(s,"ZodObject")?this.getResponseHeaders(s):s;return Object.assign(Object.assign(Object.assign({},r),{headers:a}),o)}isReferenceObject(e){return"$ref"in e}getResponseHeaders(e){return h(e._def.shape(),(e=>this.generateSimpleParameter(e)))}getBodyContent(e){return h(e,(e=>{if(!e||!function(e){return"_def"in e}(e.schema))return e;const{schema:t}=e,n=i(e,["schema"]),s=this.generateSchemaWithRef(t);return Object.assign({schema:s},n)}))}toOpenAPISchema(e,t,i){return this.openApiTransformer.transform(e,t,(e=>this.generateSchemaWithRef(e)),(e=>this.generateSchemaRef(e)),i)}}class H{get nullType(){return{nullable:!0}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return Object.assign(Object.assign({},e?{type:e}:void 0),t?this.nullType:void 0)}mapTupleItems(e){const t=function(e){const t=new d;return e.forEach((e=>t.put(e))),[...t.values()]}(e);return{items:1===t.length?t[0]:{anyOf:t},minItems:e.length,maxItems:e.length}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{minimum:Number(e.value),exclusiveMinimum:!0};case"max":return e.inclusive?{maximum:Number(e.value)}:{maximum:Number(e.value),exclusiveMaximum:!0};default:return{}}})))}}class ${constructor(e){const t=new H;this.generator=new Z(e,t)}generateDocument(e){const t=this.generator.generateDocumentData();return Object.assign(Object.assign({},e),t)}generateComponents(){return this.generator.generateComponents()}}class z{get nullType(){return{type:"null"}}mapNullableOfArray(e,t){return t?[...e,this.nullType]:e}mapNullableType(e,t){return e?t?{type:Array.isArray(e)?[...e,"null"]:[e,"null"]}:{type:e}:{}}mapTupleItems(e){return{prefixItems:e}}getNumberChecks(e){return Object.assign({},...e.map((e=>{switch(e.kind){case"min":return e.inclusive?{minimum:Number(e.value)}:{exclusiveMinimum:Number(e.value)};case"max":return e.inclusive?{maximum:Number(e.value)}:{exclusiveMaximum:Number(e.value)};default:return{}}})))}}function G(e){return"type"in e&&"webhook"===e.type}class q{constructor(e){this.definitions=e,this.webhookRefs={};const t=new z;this.generator=new Z(this.definitions,t)}generateDocument(e){const t=this.generator.generateDocumentData();return this.definitions.filter(G).forEach((e=>this.generateSingleWebhook(e.webhook))),Object.assign(Object.assign(Object.assign({},e),t),{webhooks:this.webhookRefs})}generateComponents(){return this.generator.generateComponents()}generateSingleWebhook(e){const t=this.generator.generatePath(e);return this.webhookRefs[e.path]=Object.assign(Object.assign({},this.webhookRefs[e.path]),t),t}}var B=e=>{const t=e.split("/");return""===t[0]&&t.shift(),t},W={},K=(e,t)=>{if("*"===e)return"*";const i=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(i){const n=`${e}#${t}`;return W[n]||(W[n]=i[2]?t&&":"!==t[0]&&"*"!==t[0]?[n,i[1],RegExp(`^${i[2]}(?=/${t})`)]:[e,i[1],RegExp(`^${i[2]}$`)]:[e,i[1],!0]),W[n]}return null},V=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,(e=>{try{return t(e)}catch{return e}}))}},X=e=>V(e,decodeURI),Y=e=>{const t=e.url,i=t.indexOf("/",t.indexOf(":")+4);let n=i;for(;n<t.length;n++){const e=t.charCodeAt(n);if(37===e){const e=t.indexOf("?",n),s=t.indexOf("#",n),r=t.slice(i,-1===e?-1===s?void 0:s:-1===s?e:Math.min(e,s));return X(r.includes("%25")?r.replace(/%25/g,"%2525"):r)}if(63===e||35===e)break}return t.slice(i,n)},J=e=>{const t=Y(e);return t.length>1&&"/"===t.at(-1)?t.slice(0,-1):t},Q=(e,t,...i)=>(i.length&&(t=Q(t,...i)),`${"/"===e?.[0]?"":"/"}${e}${"/"===t?"":`${"/"===e?.at(-1)?"":"/"}${"/"===t?.[0]?t.slice(1):t}`}`),ee=e=>{if(63!==e.charCodeAt(e.length-1)||!e.includes(":"))return null;const t=e.split("/"),i=[];let n="";return t.forEach((e=>{if(""===e||/\:/.test(e)){if(/\:/.test(e))if(/\?/.test(e)){i.push(0===i.length&&""===n?"/":n);const t=e.replace("?","");n+="/"+t,i.push(n)}else n+="/"+e}else n+="/"+e})),i.filter(((e,t,i)=>i.indexOf(e)===t))},te=e=>/[%+]/.test(e)?(-1!==e.indexOf("+")&&(e=e.replace(/\+/g," ")),-1!==e.indexOf("%")?V(e,se):e):e,ie=(e,t,i)=>{let n;if(!i&&t&&!/[%+]/.test(t)){let i=e.indexOf("?",8);if(-1===i)return;for(e.startsWith(t,i+1)||(i=e.indexOf("&"+t,i+1));-1!==i;){const n=e.charCodeAt(i+t.length+1);if(61===n){const n=i+t.length+2,s=e.indexOf("&",n);return te(e.slice(n,-1===s?void 0:s))}if(38==n||isNaN(n))return"";i=e.indexOf("&"+t,i+1)}if(n=/[%+]/.test(e),!n)return}const s={};n??=/[%+]/.test(e);let r=e.indexOf("?",8);for(;-1!==r;){const t=e.indexOf("&",r+1);let o=e.indexOf("=",r);o>t&&-1!==t&&(o=-1);let a,c=e.slice(r+1,-1===o?-1===t?void 0:t:o);n&&(c=te(c)),r=t,""!==c&&(-1===o?a="":(a=e.slice(o+1,-1===t?void 0:t),n&&(a=te(a))),i?(s[c]&&Array.isArray(s[c])||(s[c]=[]),s[c].push(a)):s[c]??=a)}return t?s[t]:s},ne=ie,se=decodeURIComponent,re=/^[\w!#$%&'*.^`|~+-]+$/,oe=/^[ !#-:<-[\]-~]*$/,ae=e=>{let t=0,i=e.length;for(;t<i;){const i=e.charCodeAt(t);if(32!==i&&9!==i)break;t++}for(;i>t;){const t=e.charCodeAt(i-1);if(32!==t&&9!==t)break;i--}return 0===t&&i===e.length?e:e.slice(t,i)},ce=class extends Error{res;status;constructor(e=500,t){super(t?.message,{cause:t?.cause}),this.res=t?.res,this.status=e}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}},ue=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,de=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/,le=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/,he=(e,t)=>async(i,n)=>{let s={};const r=i.req.header("Content-Type");switch(e){case"json":if(!r||!ue.test(r))break;try{s=await i.req.json()}catch{throw new ce(400,{message:"Malformed JSON in request body"})}break;case"form":{if(!r||!de.test(r)&&!le.test(r))break;let e;if(i.req.bodyCache.formData)e=await i.req.bodyCache.formData;else try{const t=await i.req.arrayBuffer();e=await((e,t)=>new Response(e,{headers:{"Content-Type":t}}).formData())(t,r),i.req.bodyCache.formData=e}catch(e){let t="Malformed FormData request.";throw t+=e instanceof Error?" "+e.message:" "+e,new ce(400,{message:t})}const t=Object.create(null);e.forEach(((e,i)=>{i.endsWith("[]")?(t[i]??=[]).push(e):Array.isArray(t[i])?t[i].push(e):t[i]=Object.hasOwn(t,i)?[t[i],e]:e})),s=t;break}case"query":s=Object.fromEntries(Object.entries(i.req.queries()).map((([e,t])=>1===t.length?[e,t[0]]:[e,t])));break;case"param":s=i.req.param();break;case"header":s=i.req.header();break;case"cookie":s=(e=>{const t=e.req.raw.headers.get("Cookie");if(!t)return{};return(e=>{const t=e.split(";"),i={};for(const e of t){const t=e.indexOf("=");if(-1===t)continue;const n=ae(e.substring(0,t));if(!re.test(n))continue;let s=ae(e.substring(t+1));s.startsWith('"')&&s.endsWith('"')&&(s=s.slice(1,-1)),oe.test(s)&&(i[n]=-1!==s.indexOf("%")?V(s,se):s)}return i})(t)})(i)}const o=await t(s,i);return o instanceof Response?o:(i.req.addValidatedData(e,o),await n())};const _e=function(e,t,i,n){return he(e,(async(s,r)=>{let o=s;if("header"===e&&"_def"in t||"header"===e&&"_zod"in t){const e=Object.fromEntries(Object.keys("in"in t?t.in.shape:t.shape).map((e=>[e.toLowerCase(),e])));o=Object.fromEntries(Object.entries(s).map((([t,i])=>[e[t]||t,i])))}const a=n&&n.validationFunction?await n.validationFunction(t,o):await t.safeParseAsync(o);if(i){const t=await i({data:o,...a,target:e},r);if(t){if(t instanceof Response)return t;if("response"in t)return t.response}}return a.success?a.data:r.json(a,400)}))};var pe=(e,t,i)=>(n,s)=>{let r=-1;return async function o(a){if(a<=r)throw Error("next() called multiple times");let c;r=a;let u,d=!1;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&s||void 0,u)try{c=await u(n,(()=>o(a+1)))}catch(e){if(!(e instanceof Error&&t))throw e;n.error=e,c=await t(e,n),d=!0}else!1===n.finalized&&i&&(c=await i(n));return c&&(!1===n.finalized||d)&&(n.res=c),n}(0)},fe=Symbol(),me=(e,t,i)=>{void 0!==e[t]?Array.isArray(e[t])?e[t].push(i):e[t]=[e[t],i]:e[t]=t.endsWith("[]")?[i]:i},ge=(e,t,i)=>{if(/(?:^|\.)__proto__\./.test(t))return;let n=e;const s=t.split(".");s.forEach(((e,t)=>{t===s.length-1?n[e]=i:((!n[e]||"object"!=typeof n[e]||Array.isArray(n[e])||n[e]instanceof File)&&(n[e]=Object.create(null)),n=n[e])}))},ye=e=>V(e,se),ve=class{raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(e,t="/",i=[[]]){this.raw=e,this.path=t,this.#t=i,this.#e={}}param(e){return e?this.#i(e):this.#n()}#i(e){const t=this.#t[0][this.routeIndex][1][e],i=this.#s(t);return i&&/\%/.test(i)?ye(i):i}#n(){const e={},t=Object.keys(this.#t[0][this.routeIndex][1]);for(const i of t){const t=this.#s(this.#t[0][this.routeIndex][1][i]);void 0!==t&&(e[i]=/\%/.test(t)?ye(t):t)}return e}#s(e){return this.#t[1]?this.#t[1][e]:e}query(e){return ne(this.url,e)}queries(e){return((e,t)=>ie(this.url,t,!0))(0,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;const t={};return this.raw.headers.forEach(((e,i)=>{t[i]=e})),t}async parseBody(e){return(async(e,t=Object.create(null))=>{const{all:i=!1,dot:n=!1}=t,s=(e instanceof ve?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?async function(e,t){const i=await e.formData();return i?function(e,t){const i=Object.create(null);return e.forEach(((e,n)=>{t.all||n.endsWith("[]")?me(i,n,e):i[n]=e})),t.dot&&Object.entries(i).forEach((([e,t])=>{e.includes(".")&&(ge(i,e,t),delete i[e])})),i}(i,t):{}}(e,{all:i,dot:n}):{}})(this,e)}#r=e=>{const{bodyCache:t,raw:i}=this,n=t[e];if(n)return n;const s=Object.keys(t)[0];return s?t[s].then((t=>("json"===s&&(t=JSON.stringify(t)),new Response(t)[e]()))):t[e]=i[e]()};json(){return this.#r("text").then((e=>JSON.parse(e)))}text(){return this.#r("text")}arrayBuffer(){return this.#r("arrayBuffer")}blob(){return this.#r("blob")}formData(){return this.#r("formData")}addValidatedData(e,t){this.#e[e]=t}valid(e){return this.#e[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[fe](){return this.#t}get matchedRoutes(){return this.#t[0].map((([[,e]])=>e))}get routePath(){return this.#t[0].map((([[,e]])=>e))[this.routeIndex].path}},be=async(e,t,i,n,s)=>{"object"!=typeof e||e instanceof String||(e instanceof Promise||(e=""+e),e instanceof Promise&&(e=await e));const r=e.callbacks;return r?.length?(s?s[0]+=e:s=[e],Promise.all(r.map((e=>e({phase:t,buffer:s,context:n})))).then((e=>Promise.all(e.filter(Boolean).map((e=>be(e,t,!1,n,s)))).then((()=>s[0]))))):Promise.resolve(e)},Ee=(e,t)=>({"Content-Type":e,...t}),Oe=(e,t)=>new Response(e,t),we=class{#o;#a;env={};#c;finalized=!1;error;#u;#d;#l;#h;#_;#p;#f;#t;#m;constructor(e,t){this.#o=e,t&&(this.#d=t.executionCtx,this.env=t.env,this.#p=t.notFoundHandler,this.#m=t.path,this.#t=t.matchResult)}get req(){return this.#a??=new ve(this.#o,this.#m,this.#t),this.#a}get event(){if(this.#d&&"respondWith"in this.#d)return this.#d;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#d)return this.#d;throw Error("This context has no ExecutionContext")}get res(){return this.#l||=Oe(null,{headers:this.#f??=new Headers})}set res(e){if(this.#l&&e){e=Oe(e.body,e);for(const[t,i]of this.#l.headers.entries())if("content-type"!==t)if("set-cookie"===t){const t=this.#l.headers.getSetCookie();e.headers.delete("set-cookie");for(const i of t)e.headers.append("set-cookie",i)}else e.headers.set(t,i)}this.#l=e,this.finalized=!0}render=(...e)=>(this.#_??=e=>this.html(e),this.#_(...e));setLayout=e=>this.#h=e;getLayout=()=>this.#h;setRenderer=e=>{this.#_=e};header=(e,t,i)=>{this.finalized&&(this.#l=Oe(this.#l.body,this.#l));const n=this.#l?this.#l.headers:this.#f??=new Headers;void 0===t?n.delete(e):i?.append?n.append(e,t):n.set(e,t)};status=e=>{this.#u=e};set=(e,t)=>{this.#c??=new Map,this.#c.set(e,t)};get=e=>this.#c?this.#c.get(e):void 0;get var(){return this.#c?Object.fromEntries(this.#c):{}}#g(e,t,i){const n=this.#l?new Headers(this.#l.headers):this.#f??new Headers;if("object"==typeof t&&"headers"in t){const e=t.headers instanceof Headers?t.headers:new Headers(t.headers);for(const[t,i]of e)"set-cookie"===t.toLowerCase()?n.append(t,i):n.set(t,i)}if(i)for(const[e,t]of Object.entries(i))if("string"==typeof t)n.set(e,t);else{n.delete(e);for(const i of t)n.append(e,i)}const s="number"==typeof t?t:t?.status??this.#u;return Oe(e,{status:s,headers:n})}newResponse=(...e)=>this.#g(...e);body=(e,t,i)=>this.#g(e,t,i);text=(e,t,i)=>this.#f||this.#u||t||i||this.finalized?this.#g(e,t,Ee("text/plain; charset=UTF-8",i)):new Response(e);json=(e,t,i)=>this.#g(JSON.stringify(e),t,Ee("application/json",i));html=(e,t,i)=>{const n=e=>this.#g(e,t,Ee("text/html; charset=UTF-8",i));return"object"==typeof e?be(e,1,!1,{}).then(n):n(e)};redirect=(e,t)=>{const i=e+"";return this.header("Location",/[^\x00-\xFF]/.test(i)?encodeURI(i):i),this.newResponse(null,t??302)};notFound=()=>(this.#p??=()=>Oe(),this.#p(this))},Ae="ALL",Se=["get","post","put","delete","options","patch"],Ie="Can not add a route since the matcher is already built.",Ce=class extends Error{},Ne=e=>e.text("404 Not Found",404),Te=(e,t)=>{if("getResponse"in e){const i=e.getResponse();return t.newResponse(i.body,i)}return console.error(e),t.text("Internal Server Error",500)},ke=class e{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#m="/";routes=[];constructor(e={}){[...Se,"all"].forEach((e=>{this[e]=(t,...i)=>("string"==typeof t?this.#m=t:this.#y(e,this.#m,t),i.forEach((t=>{this.#y(e,this.#m,t)})),this)})),this.on=(e,t,...i)=>{for(const n of[t].flat()){this.#m=n;for(const t of[e].flat())i.map((e=>{this.#y(t.toUpperCase(),this.#m,e)}))}return this},this.use=(e,...t)=>("string"==typeof e?this.#m=e:(this.#m="*",t.unshift(e)),t.forEach((e=>{this.#y(Ae,this.#m,e)})),this);const{strict:t,...i}=e;Object.assign(this,i),this.getPath=t??1?e.getPath??Y:J}#v(){const t=new e({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#p=this.#p,t.routes=this.routes,t}#p=Ne;errorHandler=Te;route(e,t){const i=this.basePath(e);return t.routes.map((e=>{let n;t.errorHandler===Te?n=e.handler:(n=async(i,n)=>(await pe([],t.errorHandler)(i,(()=>e.handler(i,n)))).res,n.__COMPOSED_HANDLER=e.handler),i.#y(e.method,e.path,n)})),this}basePath(e){const t=this.#v();return t._basePath=Q(this._basePath,e),t}onError=e=>(this.errorHandler=e,this);notFound=e=>(this.#p=e,this);mount(e,t,i){let n,s;i&&("function"==typeof i?s=i:(s=i.optionHandler,n=!1===i.replaceRequest?e=>e:i.replaceRequest));const r=s?e=>{const t=s(e);return Array.isArray(t)?t:[t]}:e=>{let t;try{t=e.executionCtx}catch{}return[e.env,t]};return n||=(()=>{const t=Q(this._basePath,e),i="/"===t?0:t.length;return e=>{const t=new URL(e.url);return t.pathname=t.pathname.slice(i)||"/",new Request(t,e)}})(),this.#y(Ae,Q(e,"*"),(async(e,i)=>{const s=await t(n(e.req.raw),...r(e));if(s)return s;await i()})),this}#y(e,t,i){e=e.toUpperCase(),t=Q(this._basePath,t);const n={basePath:this._basePath,path:t,method:e,handler:i};this.router.add(e,t,[i,n]),this.routes.push(n)}#b(e,t){if(e instanceof Error)return this.errorHandler(e,t);throw e}#E(e,t,i,n){if("HEAD"===n)return(async()=>new Response(null,await this.#E(e,t,i,"GET")))();const s=this.getPath(e,{env:i}),r=this.router.match(n,s),o=new we(e,{path:s,matchResult:r,env:i,executionCtx:t,notFoundHandler:this.#p});if(1===r[0].length){let e;try{e=r[0][0][0][0](o,(async()=>{o.res=await this.#p(o)}))}catch(e){return this.#b(e,o)}return e instanceof Promise?e.then((e=>e||(o.finalized?o.res:this.#p(o)))).catch((e=>this.#b(e,o))):e??this.#p(o)}const a=pe(r[0],this.errorHandler,this.#p);return(async()=>{try{const e=await a(o);if(!e.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return e.res}catch(e){return this.#b(e,o)}})()}fetch=(e,...t)=>this.#E(e,t[1],t[0],e.method);request=(e,t,i,n)=>e instanceof Request?this.fetch(t?new Request(e,t):e,i,n):(e=""+e,this.fetch(new Request(/^https?:\/\//.test(e)?e:"http://localhost"+Q("/",e),t),i,n));fire=()=>{addEventListener("fetch",(e=>{e.respondWith(this.#E(e.request,e,void 0,e.request.method))}))}},xe=[];function Re(e,t){const i=this.buildAllMatchers(),n=(e,t)=>{const n=i[e]||i[Ae],s=n[2][t];if(s)return s;const r=t.match(n[0]);if(!r)return[[],xe];const o=r.indexOf("",1);return[n[1][o],r]};return this.match=n,n(e,t)}var De="[^/]+",Le=".*",je="(?:|/.*)",Fe=Symbol(),Ue=new Set(".\\+*[^]$()");function Pe(e,t){return 1===e.length?1===t.length?e<t?-1:1:-1:1===t.length||e===Le||e===je?1:t===Le||t===je?-1:e===De?1:t===De?-1:e.length===t.length?e<t?-1:1:t.length-e.length}var Me=class e{#O;#w;#A=Object.create(null);insert(t,i,n,s,r){if(0===t.length){if(void 0!==this.#O)throw Fe;if(r)return;return void(this.#O=i)}const[o,...a]=t,c="*"===o?0===a.length?["","",Le]:["","",De]:"/*"===o?["","",je]:o.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);let u;if(c){const t=c[1];let i=c[2]||De;if(t&&c[2]){if(".*"===i)throw Fe;if(i=i.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(i))throw Fe}if(u=this.#A[i],!u){if(Object.keys(this.#A).some((e=>e!==Le&&e!==je)))throw Fe;if(r)return;u=this.#A[i]=new e,""!==t&&(u.#w=s.varIndex++)}r||""===t||n.push([t,u.#w])}else if(u=this.#A[o],!u){if(Object.keys(this.#A).some((e=>e.length>1&&e!==Le&&e!==je)))throw Fe;if(r)return;u=this.#A[o]=new e}u.insert(a,i,n,s,r)}buildRegExpStr(){const e=Object.keys(this.#A).sort(Pe).map((e=>{const t=this.#A[e];return("number"==typeof t.#w?`(${e})@${t.#w}`:Ue.has(e)?"\\"+e:e)+t.buildRegExpStr()}));return"number"==typeof this.#O&&e.unshift("#"+this.#O),0===e.length?"":1===e.length?e[0]:"(?:"+e.join("|")+")"}},Ze=class{#S={varIndex:0};#I=new Me;insert(e,t,i){const n=[],s=[];for(let t=0;;){let i=!1;if(e=e.replace(/\{[^}]+\}/g,(e=>{const n="@\\"+t;return s[t]=[n,e],t++,i=!0,n})),!i)break}const r=e.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let e=s.length-1;e>=0;e--){const[t]=s[e];for(let i=r.length-1;i>=0;i--)if(-1!==r[i].indexOf(t)){r[i]=r[i].replace(t,s[e][1]);break}}return this.#I.insert(r,t,n,this.#S,i),n}buildRegExp(){let e=this.#I.buildRegExpStr();if(""===e)return[/^$/,[],[]];let t=0;const i=[],n=[];return e=e.replace(/#(\d+)|@(\d+)|\.\*\$/g,((e,s,r)=>void 0!==s?(i[++t]=Number(s),"$()"):void 0!==r?(n[Number(r)]=++t,""):"")),[RegExp("^"+e),i,n]}},He=[/^$/,[],Object.create(null)],$e=Object.create(null);function ze(e){return $e[e]??=RegExp("*"===e?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,((e,t)=>t?"\\"+t:"(?:|/.*)"))}$`)}function Ge(e,t){if(e)for(const i of Object.keys(e).sort(((e,t)=>t.length-e.length)))if(ze(i).test(t))return[...e[i]]}var qe,Be,We=class{name="RegExpRouter";#C;#N;constructor(){this.#C={[Ae]:Object.create(null)},this.#N={[Ae]:Object.create(null)}}add(e,t,i){const n=this.#C,s=this.#N;if(!n||!s)throw Error(Ie);n[e]||[n,s].forEach((t=>{t[e]=Object.create(null),Object.keys(t[Ae]).forEach((i=>{t[e][i]=[...t[Ae][i]]}))})),"/*"===t&&(t="*");const r=(t.match(/\/:/g)||[]).length;if(/\*$/.test(t)){const o=ze(t);return e===Ae?Object.keys(n).forEach((e=>{n[e][t]||=Ge(n[e],t)||Ge(n[Ae],t)||[]})):n[e][t]||=Ge(n[e],t)||Ge(n[Ae],t)||[],Object.keys(n).forEach((t=>{e!==Ae&&e!==t||Object.keys(n[t]).forEach((e=>{o.test(e)&&n[t][e].push([i,r])}))})),void Object.keys(s).forEach((t=>{e!==Ae&&e!==t||Object.keys(s[t]).forEach((e=>o.test(e)&&s[t][e].push([i,r])))}))}const o=ee(t)||[t];for(let t=0,a=o.length;t<a;t++){const c=o[t];Object.keys(s).forEach((o=>{e!==Ae&&e!==o||(s[o][c]||=[...Ge(n[o],c)||Ge(n[Ae],c)||[]],s[o][c].push([i,r-a+t+1]))}))}}match=Re;buildAllMatchers(){const e=Object.create(null);return Object.keys(this.#N).concat(Object.keys(this.#C)).forEach((t=>{e[t]||=this.#T(t)})),this.#C=this.#N=void 0,$e=Object.create(null),e}#T(e){const t=[];let i=e===Ae;return[this.#C,this.#N].forEach((n=>{const s=n[e]?Object.keys(n[e]).map((t=>[t,n[e][t]])):[];0!==s.length?(i||=!0,t.push(...s)):e!==Ae&&t.push(...Object.keys(n[Ae]).map((e=>[e,n[Ae][e]])))})),i?function(e){const t=new Ze,i=[];if(0===e.length)return He;const n=e.map((e=>[!/\*|\/:/.test(e[0]),...e])).sort((([e,t],[i,n])=>e?1:i?-1:t.length-n.length)),s=Object.create(null);for(let e=0,r=-1,o=n.length;e<o;e++){const[o,a,c]=n[e];let u;o?s[a]=[c.map((([e])=>[e,Object.create(null)])),xe]:r++;try{u=t.insert(a,r,o)}catch(e){throw e===Fe?new Ce(a):e}o||(i[r]=c.map((([e,t])=>{const i=Object.create(null);for(t-=1;t>=0;t--){const[e,n]=u[t];i[e]=n}return[e,i]})))}const[r,o,a]=t.buildRegExp();for(let e=0,t=i.length;e<t;e++)for(let t=0,n=i[e].length;t<n;t++){const n=i[e][t]?.[1];if(!n)continue;const s=Object.keys(n);for(let e=0,t=s.length;e<t;e++)n[s[e]]=a[n[s[e]]]}const c=[];for(const e in o)c[e]=i[o[e]];return[r,c,s]}(t):null}},Ke=class{name="SmartRouter";#k=[];#N=[];constructor(e){this.#k=e.routers}add(e,t,i){if(!this.#N)throw Error(Ie);this.#N.push([e,t,i])}match(e,t){if(!this.#N)throw Error("Fatal error");const i=this.#k,n=this.#N,s=i.length;let r,o=0;for(;o<s;o++){const s=i[o];try{for(let e=0,t=n.length;e<t;e++)s.add(...n[e]);r=s.match(e,t)}catch(e){if(e instanceof Ce)continue;throw e}this.match=s.match.bind(s),this.#k=[s],this.#N=void 0;break}if(o===s)throw Error("Fatal error");return this.name="SmartRouter + "+this.activeRouter.name,r}get activeRouter(){if(this.#N||1!==this.#k.length)throw Error("No active router has been determined yet.");return this.#k[0]}},Ve=Object.create(null),Xe=e=>{for(const t in e)return!0;return!1},Ye=class e{#x;#A;#R;#D=0;#L=Ve;constructor(e,t,i){if(this.#A=i||Object.create(null),this.#x=[],e&&t){const i=Object.create(null);i[e]={handler:t,possibleKeys:[],score:0},this.#x=[i]}this.#R=[]}insert(t,i,n){this.#D=++this.#D;let s=this;const r=(e=>{const{groups:t,path:i}=(e=>{const t=[];return e=e.replace(/\{[^}]+\}/g,((e,i)=>{const n="@"+i;return t.push([n,e]),n})),{groups:t,path:e}})(e);return((e,t)=>{for(let i=t.length-1;i>=0;i--){const[n]=t[i];for(let s=e.length-1;s>=0;s--)if(e[s].includes(n)){e[s]=e[s].replace(n,t[i][1]);break}}return e})(B(i),t)})(i),o=[];for(let t=0,i=r.length;t<i;t++){const i=r[t],n=K(i,r[t+1]),a=Array.isArray(n)?n[0]:i;a in s.#A?(s=s.#A[a],n&&o.push(n[1])):(s.#A[a]=new e,n&&(s.#R.push(n),o.push(n[1])),s=s.#A[a])}return s.#x.push({[t]:{handler:n,possibleKeys:o.filter(((e,t,i)=>i.indexOf(e)===t)),score:this.#D}}),s}#j(e,t,i,n,s){for(let r=0,o=t.#x.length;r<o;r++){const o=t.#x[r],a=o[i]||o[Ae],c={};if(void 0!==a&&(a.params=Object.create(null),e.push(a),n!==Ve||s&&s!==Ve))for(let e=0,t=a.possibleKeys.length;e<t;e++){const t=a.possibleKeys[e],i=c[a.score];a.params[t]=s?.[t]&&!i?s[t]:n[t]??s?.[t],c[a.score]=!0}}}search(e,t){const i=[];this.#L=Ve;let n=[this];const s=B(t),r=[],o=s.length;let a=null;for(let c=0;c<o;c++){const u=s[c],d=c===o-1,l=[];for(let h=0,_=n.length;h<_;h++){const _=n[h],p=_.#A[u];p&&(p.#L=_.#L,d?(p.#A["*"]&&this.#j(i,p.#A["*"],e,_.#L),this.#j(i,p,e,_.#L)):l.push(p));for(let n=0,h=_.#R.length;n<h;n++){const h=_.#R[n],p=_.#L===Ve?{}:{..._.#L};if("*"===h){const t=_.#A["*"];t&&(this.#j(i,t,e,_.#L),t.#L=p,l.push(t));continue}const[f,m,g]=h;if(!(u||g instanceof RegExp))continue;const y=_.#A[f];if(g instanceof RegExp){if(null===a){a=Array(o);let e="/"===t[0]?1:0;for(let t=0;t<o;t++)a[t]=e,e+=s[t].length+1}const n=t.substring(a[c]),u=g.exec(n);if(u){if(p[m]=u[0],this.#j(i,y,e,_.#L,p),Xe(y.#A)){y.#L=p;const e=u[0].match(/\//)?.length??0;(r[e]||=[]).push(y)}continue}}(!0===g||g.test(u))&&(p[m]=u,d?(this.#j(i,y,e,p,_.#L),y.#A["*"]&&this.#j(i,y.#A["*"],e,p,_.#L)):(y.#L=p,l.push(y)))}}const h=r.shift();n=h?l.concat(h):l}return i.length>1&&i.sort(((e,t)=>e.score-t.score)),[i.map((({handler:e,params:t})=>[e,t]))]}},Je=class{name="TrieRouter";#F;constructor(){this.#F=new Ye}add(e,t,i){const n=ee(t);if(n)for(let t=0,s=n.length;t<s;t++)this.#F.insert(e,n[t],i);else this.#F.insert(e,t,i)}match(e,t){return this.#F.search(e,t)}},Qe=class extends ke{constructor(e={}){super(e),this.router=e.router??new Ke({routers:[new We,new Je]})}};!function(e){e.assertEqual=()=>{},e.assertIs=function(){},e.assertNever=function(){throw Error()},e.arrayToEnum=e=>{const t={};for(const i of e)t[i]=i;return t},e.getValidEnumValues=t=>{const i=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of i)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t},e.find=(e,t)=>{for(const i of e)if(t(i))return i},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?""+t:t}(qe||(qe={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(Be||(Be={}));const et=qe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tt=e=>{switch(typeof e){case"undefined":return et.undefined;case"string":return et.string;case"number":return Number.isNaN(e)?et.nan:et.number;case"boolean":return et.boolean;case"function":return et.function;case"bigint":return et.bigint;case"symbol":return et.symbol;case"object":return Array.isArray(e)?et.array:null===e?et.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?et.promise:"undefined"!=typeof Map&&e instanceof Map?et.map:"undefined"!=typeof Set&&e instanceof Set?et.set:void 0!==Date&&e instanceof Date?et.date:et.object;default:return et.unknown}},it=qe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class nt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},i={_errors:[]},n=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(n);else if("invalid_return_type"===s.code)n(s.returnTypeError);else if("invalid_arguments"===s.code)n(s.argumentsError);else if(0===s.path.length)i._errors.push(t(s));else{let e=i,n=0;for(;n<s.path.length;){const i=s.path[n];n===s.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(t(s))):e[i]=e[i]||{_errors:[]},e=e[i],n++}}};return n(this),i}static assert(e){if(!(e instanceof nt))throw Error("Not a ZodError: "+e)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qe.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},i=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else i.push(e(n));return{formErrors:i,fieldErrors:t}}get formErrors(){return this.flatten()}}nt.create=e=>new nt(e);const st=(e,t)=>{let i;switch(e.code){case it.invalid_type:i=e.received===et.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case it.invalid_literal:i="Invalid literal value, expected "+JSON.stringify(e.expected,qe.jsonStringifyReplacer);break;case it.unrecognized_keys:i="Unrecognized key(s) in object: "+qe.joinValues(e.keys,", ");break;case it.invalid_union:i="Invalid input";break;case it.invalid_union_discriminator:i="Invalid discriminator value. Expected "+qe.joinValues(e.options);break;case it.invalid_enum_value:i=`Invalid enum value. Expected ${qe.joinValues(e.options)}, received '${e.received}'`;break;case it.invalid_arguments:i="Invalid function arguments";break;case it.invalid_return_type:i="Invalid function return type";break;case it.invalid_date:i="Invalid date";break;case it.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(i=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(i=`${i} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?i=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?i=`Invalid input: must end with "${e.validation.endsWith}"`:qe.assertNever(e.validation):i="regex"!==e.validation?"Invalid "+e.validation:"Invalid";break;case it.too_small:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case it.too_big:i="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case it.custom:i="Invalid input";break;case it.invalid_intersection_types:i="Intersection results could not be merged";break;case it.not_multiple_of:i="Number must be a multiple of "+e.multipleOf;break;case it.not_finite:i="Number must be finite";break;default:i=t.defaultError,qe.assertNever(e)}return{message:i}};let rt=st;function ot(){return rt}const at=e=>{const{data:t,path:i,errorMaps:n,issueData:s}=e,r=[...i,...s.path||[]],o={...s,path:r};if(void 0!==s.message)return{...s,path:r,message:s.message};let a="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)a=e(o,{data:t,defaultError:a}).message;return{...s,path:r,message:a}};function ct(e,t){const i=ot(),n=at({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,i,i===st?void 0:st].filter((e=>!!e))});e.common.issues.push(n)}class ut{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const i=[];for(const n of t){if("aborted"===n.status)return dt;"dirty"===n.status&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,t){const i=[];for(const e of t){const t=await e.key,n=await e.value;i.push({key:t,value:n})}return ut.mergeObjectSync(e,i)}static mergeObjectSync(e,t){const i={};for(const n of t){const{key:t,value:s}=n;if("aborted"===t.status)return dt;if("aborted"===s.status)return dt;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!n.alwaysSet||(i[t.value]=s.value)}return{status:e.value,value:i}}}const dt=Object.freeze({status:"aborted"}),lt=e=>({status:"dirty",value:e}),ht=e=>({status:"valid",value:e}),_t=e=>"aborted"===e.status,pt=e=>"dirty"===e.status,ft=e=>"valid"===e.status,mt=e=>"undefined"!=typeof Promise&&e instanceof Promise;var gt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(gt||(gt={}));class yt{constructor(e,t,i,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=i,this._key=n}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 vt=(e,t)=>{if(ft(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new nt(e.common.issues);return this._error=t,this._error}}};function bt(e){if(!e)return{};const{errorMap:t,invalid_type_error:i,required_error:n,description:s}=e;if(t&&(i||n))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??s.defaultError}:void 0===s.data?{message:r??n??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:r??i??s.defaultError}},description:s}}class Et{get description(){return this._def.description}_getType(e){return tt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:tt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ut,ctx:{common:e.parent.common,data:e.data,parsedType:tt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(mt(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const i=this.safeParse(e,t);if(i.success)return i.data;throw i.error}safeParse(e,t){const i={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tt(e)},n=this._parseSync({data:e,path:i.path,parent:i});return vt(i,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tt(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:t});return ft(i)?{value:i.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>ft(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const i=await this.safeParseAsync(e,t);if(i.success)return i.data;throw i.error}async safeParseAsync(e,t){const i={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tt(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(mt(n)?n:Promise.resolve(n));return vt(i,s)}refine(e,t){const i=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),r=()=>n.addIssue({code:it.custom,...i(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(r(),!1))):!!s||(r(),!1)}))}refinement(e,t){return this._refinement(((i,n)=>!!e(i)||(n.addIssue("function"==typeof t?t(i,n):t),!1)))}_refinement(e){return new wi({schema:this,typeName:Fi.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Ai.create(this,this._def)}nullable(){return Si.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return si.create(this)}promise(){return Oi.create(this,this._def)}or(e){return ai.create([this,e],this._def)}and(e){return li.create(this,e,this._def)}transform(e){return new wi({...bt(this._def),schema:this,typeName:Fi.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ii({...bt(this._def),innerType:this,defaultValue:t,typeName:Fi.ZodDefault})}brand(){return new ki({typeName:Fi.ZodBranded,type:this,...bt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ci({...bt(this._def),innerType:this,catchValue:t,typeName:Fi.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return xi.create(this,e)}readonly(){return Ri.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ot=/^c[^\s-]{8,}$/i,wt=/^[0-9a-z]+$/,At=/^[0-9A-HJKMNP-TV-Z]{26}$/i,St=/^[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,It=/^[a-z0-9_-]{21}$/i,Ct=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Nt=/^[-+]?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)?)??$/,Tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let kt;const xt=/^(?:(?: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])$/,Rt=/^(?:(?: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])$/,Dt=/^(([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]))$/,Lt=/^(([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}=))?$/,Ft=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ut="((\\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])))",Pt=RegExp(`^${Ut}$`);function Mt(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t+="(\\.\\d+)?"),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function Zt(e){return RegExp(`^${Mt(e)}$`)}function Ht(e){let t=`${Ut}T${Mt(e)}`;const i=[];return i.push(e.local?"Z?":"Z"),e.offset&&i.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${i.join("|")})`,RegExp(`^${t}$`)}function $t(e,t){return!("v4"!==t&&t||!xt.test(e))||!("v6"!==t&&t||!Dt.test(e))}function zt(e,t){if(!Ct.test(e))return!1;try{const[i]=e.split(".");if(!i)return!1;const n=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),s=JSON.parse(atob(n));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function Gt(e,t){return!("v4"!==t&&t||!Rt.test(e))||!("v6"!==t&&t||!Lt.test(e))}class qt extends Et{_parse(e){if(this._def.coerce&&(e.data=e.data+""),this._getType(e)!==et.string){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.string,received:t.parsedType}),dt}const t=new ut;let i;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),ct(i,{code:it.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),ct(i,{code:it.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const s=e.data.length>n.value,r=e.data.length<n.value;(s||r)&&(i=this._getOrReturnCtx(e,i),s?ct(i,{code:it.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&ct(i,{code:it.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)Tt.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"email",code:it.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)kt||(kt=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),kt.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"emoji",code:it.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)St.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"uuid",code:it.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)It.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"nanoid",code:it.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)Ot.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"cuid",code:it.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)wt.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"cuid2",code:it.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)At.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"ulid",code:it.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ct(i,{validation:"url",code:it.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"regex",code:it.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),ct(i,{code:it.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),ct(i,{code:it.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),ct(i,{code:it.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?Ht(n).test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{code:it.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?Pt.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{code:it.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?Zt(n).test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{code:it.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?Nt.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"duration",code:it.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?$t(e.data,n.version)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"ip",code:it.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?zt(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"jwt",code:it.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?Gt(e.data,n.version)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"cidr",code:it.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?jt.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"base64",code:it.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?Ft.test(e.data)||(i=this._getOrReturnCtx(e,i),ct(i,{validation:"base64url",code:it.invalid_string,message:n.message}),t.dirty()):qe.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,i){return this.refinement((t=>e.test(t)),{validation:t,code:it.invalid_string,...gt.errToObj(i)})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...gt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...gt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...gt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...gt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...gt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...gt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...gt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...gt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...gt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...gt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...gt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...gt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...gt.errToObj(e)})}datetime(e){return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,local:!1,message:e}:{kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...gt.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return this._addCheck("string"==typeof e?{kind:"time",precision:null,message:e}:{kind:"time",precision:void 0===e?.precision?null:e?.precision,...gt.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...gt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...gt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...gt.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...gt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...gt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...gt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...gt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...gt.errToObj(t)})}nonempty(e){return this.min(1,gt.errToObj(e))}trim(){return new qt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Bt(e,t){const i=((""+e).split(".")[1]||"").length,n=((""+t).split(".")[1]||"").length,s=i>n?i:n;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}qt.create=e=>new qt({checks:[],typeName:Fi.ZodString,coerce:e?.coerce??!1,...bt(e)});class Wt extends Et{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)!==et.number){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.number,received:t.parsedType}),dt}let t;const i=new ut;for(const n of this._def.checks)"int"===n.kind?qe.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ct(t,{code:it.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),ct(t,{code:it.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),ct(t,{code:it.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):"multipleOf"===n.kind?0!==Bt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),ct(t,{code:it.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),ct(t,{code:it.not_finite,message:n.message}),i.dirty()):qe.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,gt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,gt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,gt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,gt.toString(t))}setLimit(e,t,i,n){return new Wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:gt.toString(n)}]})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:gt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:gt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:gt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:gt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:gt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:gt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:gt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:gt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&qe.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const i of this._def.checks){if("finite"===i.kind||"int"===i.kind||"multipleOf"===i.kind)return!0;"min"===i.kind?(null===t||i.value>t)&&(t=i.value):"max"===i.kind&&(null===e||i.value<e)&&(e=i.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Wt.create=e=>new Wt({checks:[],typeName:Fi.ZodNumber,coerce:e?.coerce||!1,...bt(e)});class Kt extends Et{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)!==et.bigint)return this._getInvalidInput(e);let t;const i=new ut;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),ct(t,{code:it.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),ct(t,{code:it.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),ct(t,{code:it.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):qe.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.bigint,received:t.parsedType}),dt}gte(e,t){return this.setLimit("min",e,!0,gt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,gt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,gt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,gt.toString(t))}setLimit(e,t,i,n){return new Kt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:gt.toString(n)}]})}_addCheck(e){return new Kt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:gt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:gt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:gt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:gt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:gt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Kt.create=e=>new Kt({checks:[],typeName:Fi.ZodBigInt,coerce:e?.coerce??!1,...bt(e)});class Vt extends Et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==et.boolean){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.boolean,received:t.parsedType}),dt}return ht(e.data)}}Vt.create=e=>new Vt({typeName:Fi.ZodBoolean,coerce:e?.coerce||!1,...bt(e)});class Xt extends Et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==et.date){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.date,received:t.parsedType}),dt}if(Number.isNaN(e.data.getTime()))return ct(this._getOrReturnCtx(e),{code:it.invalid_date}),dt;const t=new ut;let i;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),ct(i,{code:it.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),ct(i,{code:it.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):qe.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:gt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:gt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Xt.create=e=>new Xt({checks:[],coerce:e?.coerce||!1,typeName:Fi.ZodDate,...bt(e)});class Yt extends Et{_parse(e){if(this._getType(e)!==et.symbol){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.symbol,received:t.parsedType}),dt}return ht(e.data)}}Yt.create=e=>new Yt({typeName:Fi.ZodSymbol,...bt(e)});class Jt extends Et{_parse(e){if(this._getType(e)!==et.undefined){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.undefined,received:t.parsedType}),dt}return ht(e.data)}}Jt.create=e=>new Jt({typeName:Fi.ZodUndefined,...bt(e)});class Qt extends Et{_parse(e){if(this._getType(e)!==et.null){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.null,received:t.parsedType}),dt}return ht(e.data)}}Qt.create=e=>new Qt({typeName:Fi.ZodNull,...bt(e)});class ei extends Et{constructor(){super(...arguments),this._any=!0}_parse(e){return ht(e.data)}}ei.create=e=>new ei({typeName:Fi.ZodAny,...bt(e)});class ti extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ht(e.data)}}ti.create=e=>new ti({typeName:Fi.ZodUnknown,...bt(e)});class ii extends Et{_parse(e){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.never,received:t.parsedType}),dt}}ii.create=e=>new ii({typeName:Fi.ZodNever,...bt(e)});class ni extends Et{_parse(e){if(this._getType(e)!==et.undefined){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.void,received:t.parsedType}),dt}return ht(e.data)}}ni.create=e=>new ni({typeName:Fi.ZodVoid,...bt(e)});class si extends Et{_parse(e){const{ctx:t,status:i}=this._processInputParams(e),n=this._def;if(t.parsedType!==et.array)return ct(t,{code:it.invalid_type,expected:et.array,received:t.parsedType}),dt;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,s=t.data.length<n.exactLength.value;(e||s)&&(ct(t,{code:e?it.too_big:it.too_small,minimum:s?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(ct(t,{code:it.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(ct(t,{code:it.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),t.common.async)return Promise.all([...t.data].map(((e,i)=>n.type._parseAsync(new yt(t,e,t.path,i))))).then((e=>ut.mergeArray(i,e)));const s=[...t.data].map(((e,i)=>n.type._parseSync(new yt(t,e,t.path,i))));return ut.mergeArray(i,s)}get element(){return this._def.type}min(e,t){return new si({...this._def,minLength:{value:e,message:gt.toString(t)}})}max(e,t){return new si({...this._def,maxLength:{value:e,message:gt.toString(t)}})}length(e,t){return new si({...this._def,exactLength:{value:e,message:gt.toString(t)}})}nonempty(e){return this.min(1,e)}}function ri(e){if(e instanceof oi){const t={};for(const i in e.shape)t[i]=Ai.create(ri(e.shape[i]));return new oi({...e._def,shape:()=>t})}return e instanceof si?new si({...e._def,type:ri(e.element)}):e instanceof Ai?Ai.create(ri(e.unwrap())):e instanceof Si?Si.create(ri(e.unwrap())):e instanceof hi?hi.create(e.items.map((e=>ri(e)))):e}si.create=(e,t)=>new si({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Fi.ZodArray,...bt(t)});class oi extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=qe.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==et.object){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.object,received:t.parsedType}),dt}const{status:t,ctx:i}=this._processInputParams(e),{shape:n,keys:s}=this._getCached(),r=[];if(!(this._def.catchall instanceof ii&&"strip"===this._def.unknownKeys))for(const e in i.data)s.includes(e)||r.push(e);const o=[];for(const e of s)o.push({key:{status:"valid",value:e},value:n[e]._parse(new yt(i,i.data[e],i.path,e)),alwaysSet:e in i.data});if(this._def.catchall instanceof ii){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)o.push({key:{status:"valid",value:e},value:{status:"valid",value:i.data[e]}});else if("strict"===e)r.length>0&&(ct(i,{code:it.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r)o.push({key:{status:"valid",value:t},value:e._parse(new yt(i,i.data[t],i.path,t)),alwaysSet:t in i.data})}return i.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const i=await t.key,n=await t.value;e.push({key:i,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>ut.mergeObjectSync(t,e))):ut.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return new oi({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{const n=this._def.errorMap?.(t,i).message??i.defaultError;return"unrecognized_keys"===t.code?{message:gt.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new oi({...this._def,unknownKeys:"strip"})}passthrough(){return new oi({...this._def,unknownKeys:"passthrough"})}extend(e){return new oi({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new oi({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Fi.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new oi({...this._def,catchall:e})}pick(e){const t={};for(const i of qe.objectKeys(e))e[i]&&this.shape[i]&&(t[i]=this.shape[i]);return new oi({...this._def,shape:()=>t})}omit(e){const t={};for(const i of qe.objectKeys(this.shape))e[i]||(t[i]=this.shape[i]);return new oi({...this._def,shape:()=>t})}deepPartial(){return ri(this)}partial(e){const t={};for(const i of qe.objectKeys(this.shape)){const n=this.shape[i];t[i]=e&&!e[i]?n:n.optional()}return new oi({...this._def,shape:()=>t})}required(e){const t={};for(const i of qe.objectKeys(this.shape))if(e&&!e[i])t[i]=this.shape[i];else{let e=this.shape[i];for(;e instanceof Ai;)e=e._def.innerType;t[i]=e}return new oi({...this._def,shape:()=>t})}keyof(){return vi(qe.objectKeys(this.shape))}}oi.create=(e,t)=>new oi({shape:()=>e,unknownKeys:"strip",catchall:ii.create(),typeName:Fi.ZodObject,...bt(t)}),oi.strictCreate=(e,t)=>new oi({shape:()=>e,unknownKeys:"strict",catchall:ii.create(),typeName:Fi.ZodObject,...bt(t)}),oi.lazycreate=(e,t)=>new oi({shape:e,unknownKeys:"strip",catchall:ii.create(),typeName:Fi.ZodObject,...bt(t)});class ai extends Et{_parse(e){const{ctx:t}=this._processInputParams(e),i=this._def.options;if(t.common.async)return Promise.all(i.map((async e=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const i of e)if("dirty"===i.result.status)return t.common.issues.push(...i.ctx.common.issues),i.result;const i=e.map((e=>new nt(e.ctx.common.issues)));return ct(t,{code:it.invalid_union,unionErrors:i}),dt}));{let e;const n=[];for(const s of i){const i={...t,common:{...t.common,issues:[]},parent:null},r=s._parseSync({data:t.data,path:t.path,parent:i});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:i}),i.common.issues.length&&n.push(i.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=n.map((e=>new nt(e)));return ct(t,{code:it.invalid_union,unionErrors:s}),dt}}get options(){return this._def.options}}ai.create=(e,t)=>new ai({options:e,typeName:Fi.ZodUnion,...bt(t)});const ci=e=>e instanceof gi?ci(e.schema):e instanceof wi?ci(e.innerType()):e instanceof yi?[e.value]:e instanceof bi?e.options:e instanceof Ei?qe.objectValues(e.enum):e instanceof Ii?ci(e._def.innerType):e instanceof Jt?[void 0]:e instanceof Qt?[null]:e instanceof Ai?[void 0,...ci(e.unwrap())]:e instanceof Si?[null,...ci(e.unwrap())]:e instanceof ki||e instanceof Ri?ci(e.unwrap()):e instanceof Ci?ci(e._def.innerType):[];class ui extends Et{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==et.object)return ct(t,{code:it.invalid_type,expected:et.object,received:t.parsedType}),dt;const i=this.discriminator,n=this.optionsMap.get(t.data[i]);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(ct(t,{code:it.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const n=new Map;for(const i of t){const t=ci(i.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(n.has(s))throw Error(`Discriminator property ${e+""} has duplicate value ${s+""}`);n.set(s,i)}}return new ui({typeName:Fi.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...bt(i)})}}function di(e,t){const i=tt(e),n=tt(t);if(e===t)return{valid:!0,data:e};if(i===et.object&&n===et.object){const i=qe.objectKeys(t),n=qe.objectKeys(e).filter((e=>-1!==i.indexOf(e))),s={...e,...t};for(const i of n){const n=di(e[i],t[i]);if(!n.valid)return{valid:!1};s[i]=n.data}return{valid:!0,data:s}}if(i===et.array&&n===et.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let n=0;n<e.length;n++){const s=di(e[n],t[n]);if(!s.valid)return{valid:!1};i.push(s.data)}return{valid:!0,data:i}}return i===et.date&&n===et.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class li extends Et{_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=(e,n)=>{if(_t(e)||_t(n))return dt;const s=di(e.value,n.value);return s.valid?((pt(e)||pt(n))&&t.dirty(),{status:t.value,value:s.data}):(ct(i,{code:it.invalid_intersection_types}),dt)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}li.create=(e,t,i)=>new li({left:e,right:t,typeName:Fi.ZodIntersection,...bt(i)});class hi extends Et{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==et.array)return ct(i,{code:it.invalid_type,expected:et.array,received:i.parsedType}),dt;if(i.data.length<this._def.items.length)return ct(i,{code:it.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dt;!this._def.rest&&i.data.length>this._def.items.length&&(ct(i,{code:it.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...i.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new yt(i,e,i.path,t)):null})).filter((e=>!!e));return i.common.async?Promise.all(n).then((e=>ut.mergeArray(t,e))):ut.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new hi({...this._def,rest:e})}}hi.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new hi({items:e,typeName:Fi.ZodTuple,rest:null,...bt(t)})};class _i extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==et.object)return ct(i,{code:it.invalid_type,expected:et.object,received:i.parsedType}),dt;const n=[],s=this._def.keyType,r=this._def.valueType;for(const e in i.data)n.push({key:s._parse(new yt(i,e,i.path,e)),value:r._parse(new yt(i,i.data[e],i.path,e)),alwaysSet:e in i.data});return i.common.async?ut.mergeObjectAsync(t,n):ut.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,i){return new _i(t instanceof Et?{keyType:e,valueType:t,typeName:Fi.ZodRecord,...bt(i)}:{keyType:qt.create(),valueType:e,typeName:Fi.ZodRecord,...bt(t)})}}class pi extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==et.map)return ct(i,{code:it.invalid_type,expected:et.map,received:i.parsedType}),dt;const n=this._def.keyType,s=this._def.valueType,r=[...i.data.entries()].map((([e,t],r)=>({key:n._parse(new yt(i,e,i.path,[r,"key"])),value:s._parse(new yt(i,t,i.path,[r,"value"]))})));if(i.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const i of r){const n=await i.key,s=await i.value;if("aborted"===n.status||"aborted"===s.status)return dt;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const i of r){const n=i.key,s=i.value;if("aborted"===n.status||"aborted"===s.status)return dt;"dirty"!==n.status&&"dirty"!==s.status||t.dirty(),e.set(n.value,s.value)}return{status:t.value,value:e}}}}pi.create=(e,t,i)=>new pi({valueType:t,keyType:e,typeName:Fi.ZodMap,...bt(i)});class fi extends Et{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.parsedType!==et.set)return ct(i,{code:it.invalid_type,expected:et.set,received:i.parsedType}),dt;const n=this._def;null!==n.minSize&&i.data.size<n.minSize.value&&(ct(i,{code:it.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&i.data.size>n.maxSize.value&&(ct(i,{code:it.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function r(e){const i=new Set;for(const n of e){if("aborted"===n.status)return dt;"dirty"===n.status&&t.dirty(),i.add(n.value)}return{status:t.value,value:i}}const o=[...i.data.values()].map(((e,t)=>s._parse(new yt(i,e,i.path,t))));return i.common.async?Promise.all(o).then((e=>r(e))):r(o)}min(e,t){return new fi({...this._def,minSize:{value:e,message:gt.toString(t)}})}max(e,t){return new fi({...this._def,maxSize:{value:e,message:gt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}fi.create=(e,t)=>new fi({valueType:e,minSize:null,maxSize:null,typeName:Fi.ZodSet,...bt(t)});class mi extends Et{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==et.function)return ct(t,{code:it.invalid_type,expected:et.function,received:t.parsedType}),dt;function i(e,i){return at({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ot(),st].filter((e=>!!e)),issueData:{code:it.invalid_arguments,argumentsError:i}})}function n(e,i){return at({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ot(),st].filter((e=>!!e)),issueData:{code:it.invalid_return_type,returnTypeError:i}})}const s={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Oi){const e=this;return ht((async function(...t){const o=new nt([]),a=await e._def.args.parseAsync(t,s).catch((e=>{throw o.addIssue(i(t,e)),o})),c=await Reflect.apply(r,this,a);return await e._def.returns._def.type.parseAsync(c,s).catch((e=>{throw o.addIssue(n(c,e)),o}))}))}{const e=this;return ht((function(...t){const o=e._def.args.safeParse(t,s);if(!o.success)throw new nt([i(t,o.error)]);const a=Reflect.apply(r,this,o.data),c=e._def.returns.safeParse(a,s);if(!c.success)throw new nt([n(a,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new mi({...this._def,args:hi.create(e).rest(ti.create())})}returns(e){return new mi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,i){return new mi({args:e||hi.create([]).rest(ti.create()),returns:t||ti.create(),typeName:Fi.ZodFunction,...bt(i)})}}class gi extends Et{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}gi.create=(e,t)=>new gi({getter:e,typeName:Fi.ZodLazy,...bt(t)});class yi extends Et{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ct(t,{received:t.data,code:it.invalid_literal,expected:this._def.value}),dt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function vi(e,t){return new bi({values:e,typeName:Fi.ZodEnum,...bt(t)})}yi.create=(e,t)=>new yi({value:e,typeName:Fi.ZodLiteral,...bt(t)});class bi extends Et{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return ct(t,{expected:qe.joinValues(this._def.values),received:t.parsedType,code:it.invalid_type}),dt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e);return ct(t,{received:t.data,code:it.invalid_enum_value,options:this._def.values}),dt}return ht(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return bi.create(e,{...this._def,...t})}exclude(e,t=this._def){return bi.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}bi.create=vi;class Ei extends Et{_parse(e){const t=qe.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==et.string&&i.parsedType!==et.number){const e=qe.objectValues(t);return ct(i,{expected:qe.joinValues(e),received:i.parsedType,code:it.invalid_type}),dt}if(this._cache||(this._cache=new Set(qe.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=qe.objectValues(t);return ct(i,{received:i.data,code:it.invalid_enum_value,options:e}),dt}return ht(e.data)}get enum(){return this._def.values}}Ei.create=(e,t)=>new Ei({values:e,typeName:Fi.ZodNativeEnum,...bt(t)});class Oi extends Et{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==et.promise&&!1===t.common.async)return ct(t,{code:it.invalid_type,expected:et.promise,received:t.parsedType}),dt;const i=t.parsedType===et.promise?t.data:Promise.resolve(t.data);return ht(i.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Oi.create=(e,t)=>new Oi({type:e,typeName:Fi.ZodPromise,...bt(t)});class wi extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fi.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:e=>{ct(i,e),e.fatal?t.abort():t.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===n.type){const e=n.transform(i.data,s);if(i.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return dt;const n=await this._def.schema._parseAsync({data:e,path:i.path,parent:i});return"aborted"===n.status?dt:"dirty"===n.status||"dirty"===t.value?lt(n.value):n}));{if("aborted"===t.value)return dt;const n=this._def.schema._parseSync({data:e,path:i.path,parent:i});return"aborted"===n.status?dt:"dirty"===n.status||"dirty"===t.value?lt(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,s);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===i.common.async){const n=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===n.status?dt:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((i=>"aborted"===i.status?dt:("dirty"===i.status&&t.dirty(),e(i.value).then((()=>({status:t.value,value:i.value}))))))}if("transform"===n.type){if(!1===i.common.async){const e=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ft(e))return dt;const r=n.transform(e.value,s);if(r instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((e=>ft(e)?Promise.resolve(n.transform(e.value,s)).then((e=>({status:t.value,value:e}))):dt))}qe.assertNever(n)}}wi.create=(e,t,i)=>new wi({schema:e,typeName:Fi.ZodEffects,effect:t,...bt(i)}),wi.createWithPreprocess=(e,t,i)=>new wi({schema:t,effect:{type:"preprocess",transform:e},typeName:Fi.ZodEffects,...bt(i)});class Ai extends Et{_parse(e){return this._getType(e)===et.undefined?ht(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ai.create=(e,t)=>new Ai({innerType:e,typeName:Fi.ZodOptional,...bt(t)});class Si extends Et{_parse(e){return this._getType(e)===et.null?ht(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Si.create=(e,t)=>new Si({innerType:e,typeName:Fi.ZodNullable,...bt(t)});class Ii extends Et{_parse(e){const{ctx:t}=this._processInputParams(e);let i=t.data;return t.parsedType===et.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ii.create=(e,t)=>new Ii({innerType:e,typeName:Fi.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...bt(t)});class Ci extends Et{_parse(e){const{ctx:t}=this._processInputParams(e),i={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return mt(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new nt(i.common.issues)},input:i.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new nt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}Ci.create=(e,t)=>new Ci({innerType:e,typeName:Fi.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...bt(t)});class Ni extends Et{_parse(e){if(this._getType(e)!==et.nan){const t=this._getOrReturnCtx(e);return ct(t,{code:it.invalid_type,expected:et.nan,received:t.parsedType}),dt}return{status:"valid",value:e.data}}}Ni.create=e=>new Ni({typeName:Fi.ZodNaN,...bt(e)});const Ti=Symbol("zod_brand");class ki extends Et{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class xi extends Et{_parse(e){const{status:t,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?dt:"dirty"===e.status?(t.dirty(),lt(e.value)):this._def.out._parseAsync({data:e.value,path:i.path,parent:i})})();{const e=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return"aborted"===e.status?dt:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:i.path,parent:i})}}static create(e,t){return new xi({in:e,out:t,typeName:Fi.ZodPipeline})}}class Ri extends Et{_parse(e){const t=this._def.innerType._parse(e),i=e=>(ft(e)&&(e.value=Object.freeze(e.value)),e);return mt(t)?t.then((e=>i(e))):i(t)}unwrap(){return this._def.innerType}}function Di(e,t){const i="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof i?{message:i}:i}function Li(e,t={},i){return e?ei.create().superRefine(((n,s)=>{const r=e(n);if(r instanceof Promise)return r.then((e=>{if(!e){const e=Di(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}}));if(!r){const e=Di(t,n),r=e.fatal??i??!0;s.addIssue({code:"custom",...e,fatal:r})}})):ei.create()}Ri.create=(e,t)=>new Ri({innerType:e,typeName:Fi.ZodReadonly,...bt(t)});const ji={object:oi.lazycreate};var Fi;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Fi||(Fi={}));const Ui=qt.create,Pi=Wt.create,Mi=Ni.create,Zi=Kt.create,Hi=Vt.create,$i=Xt.create,zi=Yt.create,Gi=Jt.create,qi=Qt.create,Bi=ei.create,Wi=ti.create,Ki=ii.create,Vi=ni.create,Xi=si.create,Yi=oi.create,Ji=oi.strictCreate,Qi=ai.create,en=ui.create,tn=li.create,nn=hi.create,sn=_i.create,rn=pi.create,on=fi.create,an=mi.create,cn=gi.create,un=yi.create,dn=bi.create,ln=Ei.create,hn=Oi.create,_n=wi.create,pn=Ai.create,fn=Si.create,mn=wi.createWithPreprocess,gn=xi.create,yn={string:e=>qt.create({...e,coerce:!0}),number:e=>Wt.create({...e,coerce:!0}),boolean:e=>Vt.create({...e,coerce:!0}),bigint:e=>Kt.create({...e,coerce:!0}),date:e=>Xt.create({...e,coerce:!0})};var vn=Object.freeze({__proto__:null,BRAND:Ti,DIRTY:lt,EMPTY_PATH:[],INVALID:dt,NEVER:dt,OK:ht,ParseStatus:ut,Schema:Et,ZodAny:ei,ZodArray:si,ZodBigInt:Kt,ZodBoolean:Vt,ZodBranded:ki,ZodCatch:Ci,ZodDate:Xt,ZodDefault:Ii,ZodDiscriminatedUnion:ui,ZodEffects:wi,ZodEnum:bi,ZodError:nt,get ZodFirstPartyTypeKind(){return Fi},ZodFunction:mi,ZodIntersection:li,ZodIssueCode:it,ZodLazy:gi,ZodLiteral:yi,ZodMap:pi,ZodNaN:Ni,ZodNativeEnum:Ei,ZodNever:ii,ZodNull:Qt,ZodNullable:Si,ZodNumber:Wt,ZodObject:oi,ZodOptional:Ai,ZodParsedType:et,ZodPipeline:xi,ZodPromise:Oi,ZodReadonly:Ri,ZodRecord:_i,ZodSchema:Et,ZodSet:fi,ZodString:qt,ZodSymbol:Yt,ZodTransformer:wi,ZodTuple:hi,ZodType:Et,ZodUndefined:Jt,ZodUnion:ai,ZodUnknown:ti,ZodVoid:ni,addIssueToContext:ct,any:Bi,array:Xi,bigint:Zi,boolean:Hi,coerce:yn,custom:Li,date:$i,datetimeRegex:Ht,defaultErrorMap:st,discriminatedUnion:en,effect:_n,enum:dn,function:an,getErrorMap:ot,getParsedType:tt,instanceof:(e,t={message:"Input not instance of "+e.name})=>Li((t=>t instanceof e),t),intersection:tn,isAborted:_t,isAsync:mt,isDirty:pt,isValid:ft,late:ji,lazy:cn,literal:un,makeIssue:at,map:rn,nan:Mi,nativeEnum:ln,never:Ki,null:qi,nullable:fn,number:Pi,object:Yi,get objectUtil(){return Be},oboolean:()=>Hi().optional(),onumber:()=>Pi().optional(),optional:pn,ostring:()=>Ui().optional(),pipeline:gn,preprocess:mn,promise:hn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:sn,set:on,setErrorMap:function(e){rt=e},strictObject:Ji,string:Ui,symbol:zi,transformer:_n,tuple:nn,undefined:Gi,union:Qi,unknown:Wi,get util(){return qe},void:Vi});function bn(e,t){const i={};return Object.keys(e.paths).forEach((n=>{i[Q(t.replaceAll(/:([^\/]+)/g,"{$1}"),n)]=e.paths[n]})),{...e,paths:i}}function En(e){return/^application\/([a-z-\.]+\+)?json/.test(e)}function On(e){return e.startsWith("multipart/form-data")||e.startsWith("application/x-www-form-urlencoded")}c(vn);var wn,An=Object.freeze({__proto__:null,OpenAPIHono:class e extends Qe{openAPIRegistry;defaultHook;constructor(e){super(e),this.openAPIRegistry=new y,this.defaultHook=e?.defaultHook}openapi=({middleware:e,hide:t,...i},n,s=this.defaultHook)=>{t||this.openAPIRegistry.registerPath(i);const r=[];if(i.request?.query){const e=_e("query",i.request.query,s);r.push(e)}if(i.request?.params){const e=_e("param",i.request.params,s);r.push(e)}if(i.request?.headers){const e=_e("header",i.request.headers,s);r.push(e)}if(i.request?.cookies){const e=_e("cookie",i.request.cookies,s);r.push(e)}const o=i.request?.body?.content;if(o)for(const e of Object.keys(o)){if(!o[e])continue;const t=o[e].schema;if(t instanceof Et){if(En(e)){const e=_e("json",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&En(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("json",{}),await i()})}if(On(e)){const e=_e("form",t,s);r.push(i.request?.body?.required?e:async(t,i)=>{if(t.req.header("content-type")&&On(t.req.header("content-type")))return await e(t,i);t.req.addValidatedData("form",{}),await i()})}}}const a=e?Array.isArray(e)?e:[e]:[];return this.on([i.method],i.path.replaceAll(/\/{(.+?)}/g,"/:$1"),...a,...r,n),this};getOpenAPIDocument=e=>{const t=new $(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?bn(t,this._basePath):t};getOpenAPI31Document=e=>{const t=new q(this.openAPIRegistry.definitions).generateDocument(e);return this._basePath?bn(t,this._basePath):t};doc=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPIDocument(i);return e.json(t)}catch(t){return e.json(t,500)}}));doc31=(e,t)=>this.get(e,(e=>{const i="function"==typeof t?t(e):t;try{const t=this.getOpenAPI31Document(i);return e.json(t)}catch(t){return e.json(t,500)}}));route(t,i){const n=t.replaceAll(/:([^\/]+)/g,"{$1}");return super.route(t,i),i instanceof e?(i.openAPIRegistry.definitions.forEach((e=>{switch(e.type){case"component":return this.openAPIRegistry.registerComponent(e.componentType,e.name,e.component);case"route":return void this.openAPIRegistry.registerPath({...e.route,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.route.path)});case"webhook":return void this.openAPIRegistry.registerWebhook({...e.webhook,path:Q(n,i._basePath.replaceAll(/:([^\/]+)/g,"{$1}"),e.webhook.path)});case"schema":return this.openAPIRegistry.register(e.schema._def.openapi._internal.refId,e.schema);case"parameter":return this.openAPIRegistry.registerParameter(e.schema._def.openapi._internal.refId,e.schema);default:throw Error("Unknown registry type: "+e)}})),this):this}basePath(t){return new e({...super.basePath(t),defaultHook:this.defaultHook})}},createRoute:e=>{const t={...e,getRoutingPath:()=>e.path.replaceAll(/\/{(.+?)}/g,"/:$1")};return Object.defineProperty(t,"getRoutingPath",{enumerable:!1})},extendZodWithOpenApi:c,z:vn}),Sn=e(An),In=(wn||(wn=1,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sn,i=t.z.enum(["user_action","admin_action","system","api"]),n=t.z.object({type:t.z.enum(["user","admin","system","api_key","client_credentials"]),id:t.z.string().optional(),email:t.z.string().optional(),org_id:t.z.string().optional(),org_name:t.z.string().optional(),scopes:t.z.array(t.z.string()).optional(),client_id:t.z.string().optional()}),s=t.z.object({type:t.z.string(),id:t.z.string(),before:t.z.record(t.z.unknown()).optional(),after:t.z.record(t.z.unknown()).optional(),diff:t.z.record(t.z.object({old:t.z.unknown(),new:t.z.unknown()})).optional()}),r=t.z.object({method:t.z.string(),path:t.z.string(),query:t.z.record(t.z.string()).optional(),body:t.z.unknown().optional(),ip:t.z.string(),user_agent:t.z.string().optional(),correlation_id:t.z.string().optional()}),o=t.z.object({status_code:t.z.number(),body:t.z.unknown().optional()}),a=t.z.object({country_code:t.z.string(),city_name:t.z.string(),latitude:t.z.string(),longitude:t.z.string(),time_zone:t.z.string(),continent_code:t.z.string()}),c=t.z.object({name:t.z.string(),version:t.z.string(),env:t.z.record(t.z.string()).optional()}),u=t.z.object({tenant_id:t.z.string(),event_type:t.z.string(),log_type:t.z.string(),description:t.z.string().optional(),category:i,actor:n,target:s,request:r,response:o.optional(),connection:t.z.string().optional(),strategy:t.z.string().optional(),strategy_type:t.z.string().optional(),location:a.optional(),auth0_client:c.optional(),hostname:t.z.string(),is_mobile:t.z.boolean().optional(),timestamp:t.z.string()}),d=u.extend({id:t.z.string()}),l=t.z.object({created_at:t.z.string(),updated_at:t.z.string()}),h=t.z.enum(["AUTH0","EMAIL","REDIRECT"]),_=t.z.enum(["CREATE_USER","GET_USER","UPDATE_USER","SEND_REQUEST","SEND_EMAIL"]),p=t.z.enum(["VERIFY_EMAIL"]),f=t.z.object({require_mx_record:t.z.boolean().optional(),block_aliases:t.z.boolean().optional(),block_free_emails:t.z.boolean().optional(),block_disposable_emails:t.z.boolean().optional(),blocklist:t.z.array(t.z.string()).optional(),allowlist:t.z.array(t.z.string()).optional()}),m=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("AUTH0"),action:t.z.literal("UPDATE_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({connection_id:t.z.string().optional(),user_id:t.z.string(),changes:t.z.record(t.z.string(),t.z.any())})}),g=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("EMAIL"),action:t.z.literal("VERIFY_EMAIL"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({email:t.z.string(),rules:f.optional()})}),y=t.z.enum(["change-email","account","custom"]),v=t.z.object({id:t.z.string(),alias:t.z.string().max(100).optional(),type:t.z.literal("REDIRECT"),action:t.z.literal("REDIRECT_USER"),allow_failure:t.z.boolean().optional(),mask_output:t.z.boolean().optional(),params:t.z.object({target:y.openapi({description:"The predefined target to redirect to, or 'custom' for a custom URL"}),custom_url:t.z.string().optional().openapi({description:"Custom URL to redirect to when target is 'custom'"})})}),b=t.z.union([m,g,v]),E=t.z.object({name:t.z.string().min(1).max(150).openapi({description:"The name of the flow"}),actions:t.z.array(b).optional().default([]).openapi({description:"The list of actions to execute in sequence"})}),O=E.extend({...l.shape,id:t.z.string().openapi({description:"Unique identifier for the flow",example:"af_12tMpdJ3iek7svMyZkSh5M"})}),w=t.z.object({page:t.z.string().min(0).optional().default("0").transform((e=>parseInt(e,10))).openapi({description:"The page number where 0 is the first page"}),per_page:t.z.string().min(1).optional().default("10").transform((e=>parseInt(e,10))).openapi({description:"The number of items per page"}),include_totals:t.z.string().optional().default("false").transform((e=>"true"===e)).openapi({description:"If the total number of items should be included in the response"}),sort:t.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:"A property that should have the format 'string:-1' or 'string:1'"}),q:t.z.string().optional().openapi({description:"A lucene query string used to filter the results"})}),A=t.z.object({start:t.z.number(),limit:t.z.number(),length:t.z.number(),total:t.z.number().optional()}),S=t.z.object({email:t.z.string().optional(),email_verified:t.z.boolean().optional(),name:t.z.string().optional(),username:t.z.string().optional(),given_name:t.z.string().optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),family_name:t.z.string().optional()}).catchall(t.z.any()),I=t.z.object({connection:t.z.string(),user_id:t.z.string(),provider:t.z.string(),isSocial:t.z.boolean(),email:t.z.string().optional(),email_verified:t.z.boolean().optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),username:t.z.string().optional(),access_token:t.z.string().optional(),access_token_secret:t.z.string().optional(),refresh_token:t.z.string().optional(),profileData:S.optional()}),C=t.z.object({formatted:t.z.string().optional(),street_address:t.z.string().optional(),locality:t.z.string().optional(),region:t.z.string().optional(),postal_code:t.z.string().optional(),country:t.z.string().optional()}).optional(),N=t.z.object({email:t.z.string().optional().transform((e=>e&&e.toLowerCase())),username:t.z.string().refine((e=>!e.includes("@")),{message:'Usernames must not contain "@". Use the email field for email addresses.'}).optional(),phone_number:t.z.string().optional(),phone_verified:t.z.boolean().optional(),given_name:t.z.string().optional(),family_name:t.z.string().optional(),nickname:t.z.string().optional(),name:t.z.string().optional(),picture:t.z.string().optional(),locale:t.z.string().optional(),linked_to:t.z.string().optional(),profileData:t.z.string().optional(),user_id:t.z.string().optional(),app_metadata:t.z.any().default({}).optional(),user_metadata:t.z.any().default({}).optional(),middle_name:t.z.string().optional(),preferred_username:t.z.string().optional(),profile:t.z.string().optional(),website:t.z.string().optional(),gender:t.z.string().optional(),birthdate:t.z.string().optional(),zoneinfo:t.z.string().optional(),address:C}),T=N.extend({email_verified:t.z.boolean().default(!1),verify_email:t.z.boolean().optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string().optional(),provider:t.z.string().optional(),connection:t.z.string(),is_social:t.z.boolean().optional(),password:t.z.object({hash:t.z.string(),algorithm:t.z.string()}).optional()}),k=t.z.object({...T.omit({password:!0}).shape,...l.shape,user_id:t.z.string(),provider:t.z.string(),is_social:t.z.boolean(),email:t.z.string().optional(),login_count:t.z.number().default(0),identities:t.z.array(I).optional()}),x=k,R=N.extend({login_count:t.z.number(),multifactor:t.z.array(t.z.string()).optional(),last_ip:t.z.string().optional(),last_login:t.z.string().optional(),user_id:t.z.string()}).catchall(t.z.any()),D=t.z.object({client_id:t.z.string().openapi({description:"ID of this client."}),name:t.z.string().min(1).openapi({description:"Name of this client (min length: 1 character, does not allow < or >)."}),description:t.z.string().max(140).optional().openapi({description:"Free text description of this client (max length: 140 characters)."}),global:t.z.boolean().default(!1).openapi({description:"Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false)."}),client_secret:t.z.string().default((()=>((e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[e]];return t})())).optional().openapi({description:"Client secret (which you must not make public)."}),app_type:t.z.enum(["native","spa","regular_web","non_interactive","resource_server","express_configuration","rms","box","cloudbees","concur","dropbox","mscrm","echosign","egnyte","newrelic","office365","salesforce","sentry","sharepoint","slack","springcm","zendesk","zoom","sso_integration","oag"]).default("regular_web").optional().openapi({description:"The type of application this client represents"}),logo_uri:t.z.string().url().optional().openapi({description:"URL of the logo to display for this client. Recommended size is 150x150 pixels."}),is_first_party:t.z.boolean().default(!1).openapi({description:"Whether this client a first party client (true) or not (false)."}),oidc_conformant:t.z.boolean().default(!0).openapi({description:"Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false)."}),auth0_conformant:t.z.boolean().default(!0).openapi({description:"Whether this client follows Auth0-compatible behavior (true) or strict OIDC behavior (false). When true, profile/email claims are included in the ID token when scopes are requested. When false, these claims are only available from the userinfo endpoint (strict OIDC 5.4 compliance)."}),callbacks:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication."}),allowed_origins:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs."}),web_origins:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."}),client_aliases:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of audiences/realms for SAML protocol. Used by the wsfed addon."}),allowed_clients:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed."}),connections:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of connection IDs enabled for this client. The order determines the display order on the login page."}),allowed_logout_urls:t.z.array(t.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."}),session_transfer:t.z.record(t.z.any()).default({}).optional().openapi({description:"Native to Web SSO Configuration"}),oidc_logout:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration for OIDC backchannel logout"}),grant_types:t.z.array(t.z.string()).default([]).optional().openapi({description:"List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code."}),jwt_configuration:t.z.record(t.z.any()).default({}).optional().openapi({description:"Configuration related to JWTs for the client."}),signing_keys:t.z.array(t.z.record(t.z.any())).default([]).optional().openapi({description:"Signing certificates associated with this client."}),encryption_key:t.z.record(t.z.any()).default({}).optional().openapi({description:"Encryption used for WsFed responses with this client."}),sso:t.z.boolean().default(!1).openapi({description:"Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false)."}),sso_disabled:t.z.boolean().default(!0).openapi({description:"Whether Single Sign On is disabled (true) or enabled (true). Defaults to true."}),cross_origin_authentication:t.z.boolean().default(!1).openapi({description:"Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false)."}),cross_origin_loc:t.z.string().url().optional().openapi({description:"URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page."}),custom_login_page_on:t.z.boolean().default(!1).openapi({description:"Whether a custom login page is to be used (true) or the default provided login page (false)."}),custom_login_page:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page."}),custom_login_page_preview:t.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page. (Used on Previews)"}),form_template:t.z.string().optional().openapi({description:"HTML form template to be used for WS-Federation."}),addons:t.z.record(t.z.any()).default({}).optional().openapi({description:"Addons enabled for this client and their associated configurations."}),token_endpoint_auth_method:t.z.enum(["none","client_secret_post","client_secret_basic"]).default("client_secret_basic").optional().openapi({description:"Defines the requested authentication method for the token endpoint. Can be none (public client without a client secret), client_secret_post (client uses HTTP POST parameters), or client_secret_basic (client uses HTTP Basic)."}),client_metadata:t.z.record(t.z.string().max(255)).default({}).optional().openapi({description:'Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?"/()<>@ [Tab][Space]'}),mobile:t.z.record(t.z.any()).default({}).optional().openapi({description:"Additional configuration for native mobile apps."}),initiate_login_uri:t.z.string().url().optional().openapi({description:"Initiate login uri, must be https"}),native_social_login:t.z.record(t.z.any()).default({}).optional(),refresh_token:t.z.record(t.z.any()).default({}).optional().openapi({description:"Refresh token configuration"}),default_organization:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines the default Organization ID and flows"}),organization_usage:t.z.enum(["deny","allow","require"]).default("deny").optional().openapi({description:"Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require."}),organization_require_behavior:t.z.enum(["no_prompt","pre_login_prompt","post_login_prompt"]).default("no_prompt").optional().openapi({description:"Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true."}),client_authentication_methods:t.z.record(t.z.any()).default({}).optional().openapi({description:"Defines client authentication methods."}),require_pushed_authorization_requests:t.z.boolean().default(!1).openapi({description:"Makes the use of Pushed Authorization Requests mandatory for this client"}),require_proof_of_possession:t.z.boolean().default(!1).openapi({description:"Makes the use of Proof-of-Possession mandatory for this client"}),signed_request_object:t.z.record(t.z.any()).default({}).optional().openapi({description:"JWT-secured Authorization Requests (JAR) settings."}),compliance_level:t.z.enum(["none","fapi1_adv_pkj_par","fapi1_adv_mtls_par","fapi2_sp_pkj_mtls","fapi2_sp_mtls_mtls"]).optional().openapi({description:"Defines the compliance level for this client, which may restrict it's capabilities"}),par_request_expiry:t.z.number().optional().openapi({description:"Specifies how long, in seconds, a Pushed Authorization Request URI remains valid"}),token_quota:t.z.record(t.z.any()).default({}).optional()}),L=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),...D.shape}),j=t.z.object({client_id:t.z.string().min(1).openapi({description:"ID of the client."}),audience:t.z.string().min(1).openapi({description:"The audience (API identifier) of this client grant."}),scope:t.z.array(t.z.string()).optional().openapi({description:"Scopes allowed for this client grant."}),organization_usage:t.z.enum(["deny","allow","require"]).optional().openapi({description:"Defines whether organizations can be used with client credentials exchanges for this grant."}),allow_any_organization:t.z.boolean().optional().openapi({description:"If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations."}),is_system:t.z.boolean().optional().openapi({description:"If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly."}),subject_type:t.z.enum(["client","user"]).optional().openapi({description:"The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."}),authorization_details_types:t.z.array(t.z.string()).optional().openapi({description:"Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."})}),F=t.z.object({id:t.z.string().openapi({description:"ID of the client grant."}),...j.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),U=t.z.array(F),P=t.z.object({x:t.z.number(),y:t.z.number()});var M=(e=>(e.RICH_TEXT="RICH_TEXT",e.NEXT_BUTTON="NEXT_BUTTON",e.BACK_BUTTON="BACK_BUTTON",e.SUBMIT_BUTTON="SUBMIT_BUTTON",e.DIVIDER="DIVIDER",e.TEXT="TEXT",e.EMAIL="EMAIL",e.PASSWORD="PASSWORD",e.NUMBER="NUMBER",e.PHONE="PHONE",e.DATE="DATE",e.CHECKBOX="CHECKBOX",e.RADIO="RADIO",e.SELECT="SELECT",e.HIDDEN="HIDDEN",e.LEGAL="LEGAL",e))(M||{}),Z=(e=>(e.BLOCK="BLOCK",e.FIELD="FIELD",e))(Z||{});const H=t.z.object({id:t.z.string(),category:t.z.nativeEnum(Z),type:t.z.nativeEnum(M)}),$=H.extend({category:t.z.literal("BLOCK"),type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string()}).passthrough()}),z=H.extend({category:t.z.literal("BLOCK"),type:t.z.union([t.z.literal("NEXT_BUTTON"),t.z.literal("BACK_BUTTON"),t.z.literal("SUBMIT_BUTTON")]),config:t.z.object({text:t.z.string()}).passthrough()}),G=H.extend({category:t.z.literal("FIELD"),type:t.z.literal("LEGAL"),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({text:t.z.string()}).passthrough()}),q=H.extend({category:t.z.literal("FIELD"),type:t.z.union([t.z.literal("TEXT"),t.z.literal("EMAIL"),t.z.literal("PASSWORD"),t.z.literal("NUMBER"),t.z.literal("PHONE"),t.z.literal("DATE"),t.z.literal("CHECKBOX"),t.z.literal("RADIO"),t.z.literal("SELECT"),t.z.literal("HIDDEN")]),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional(),config:t.z.object({label:t.z.string().optional(),placeholder:t.z.string().optional()}).passthrough()}),B=t.z.object({id:t.z.string(),category:t.z.string(),type:t.z.string()}).passthrough(),W=t.z.union([$,z,G,q,B]);var K=(e=>(e.STEP="STEP",e.FLOW="FLOW",e.CONDITION="CONDITION",e.ACTION="ACTION",e))(K||{});const V=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:P,alias:t.z.string().optional(),config:t.z.object({components:t.z.array(W),next_node:t.z.string()}).passthrough()}),X=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:P,alias:t.z.string().optional(),config:t.z.object({flow_id:t.z.string(),next_node:t.z.string()})}),Y=t.z.object({id:t.z.string(),type:t.z.literal("ACTION"),coordinates:P,alias:t.z.string().optional(),config:t.z.object({action_type:t.z.enum(["REDIRECT"]).openapi({description:"The type of action to perform"}),target:t.z.enum(["change-email","account","custom"]).openapi({description:"The predefined target to redirect to"}),custom_url:t.z.string().optional().openapi({description:"Custom URL when target is 'custom'"}),next_node:t.z.string().openapi({description:"The next node to navigate to after action (for non-redirect actions)"})}).passthrough()}),J=t.z.object({id:t.z.string(),type:t.z.string(),coordinates:P}).passthrough(),Q=t.z.union([V,X,Y,J]),ee=t.z.object({next_node:t.z.string(),coordinates:P}).passthrough(),te=t.z.object({resume_flow:t.z.boolean().optional(),coordinates:P}).passthrough(),ie=t.z.object({id:t.z.string(),name:t.z.string(),languages:t.z.object({primary:t.z.string()}).passthrough(),nodes:t.z.array(Q),start:ee,ending:te,created_at:t.z.string(),updated_at:t.z.string(),links:t.z.object({sdkSrc:t.z.string().optional(),sdk_src:t.z.string().optional()}).passthrough()}).passthrough(),ne=ie.omit({id:!0,created_at:!0,updated_at:!0});var se=(e=>(e.TOKEN="token",e.ID_TOKEN="id_token",e.TOKEN_ID_TOKEN="token id_token",e.CODE="code",e))(se||{}),re=(e=>(e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post",e.WEB_MESSAGE="web_message",e.SAML_POST="saml_post",e))(re||{}),oe=(e=>(e.S256="S256",e.Plain="plain",e))(oe||{});const ae=t.z.object({client_id:t.z.string(),act_as:t.z.string().optional(),response_type:t.z.nativeEnum(se).optional(),response_mode:t.z.nativeEnum(re).optional(),redirect_uri:t.z.string().optional(),audience:t.z.string().optional(),organization:t.z.string().optional(),state:t.z.string().optional(),nonce:t.z.string().optional(),scope:t.z.string().optional(),prompt:t.z.string().optional(),code_challenge_method:t.z.nativeEnum(oe).optional(),code_challenge:t.z.string().optional(),username:t.z.string().optional(),ui_locales:t.z.string().optional(),max_age:t.z.number().optional(),acr_values:t.z.string().optional(),vendor_id:t.z.string().optional()}),ce=t.z.object({colors:t.z.object({primary:t.z.string(),page_background:t.z.object({type:t.z.string().optional(),start:t.z.string().optional(),end:t.z.string().optional(),angle_deg:t.z.number().optional()}).optional()}).optional(),logo_url:t.z.string().optional(),favicon_url:t.z.string().optional(),powered_by_logo_url:t.z.string().optional(),font:t.z.object({url:t.z.string()}).optional()}),ue=t.z.enum(["password_reset","email_verification","otp","mfa_otp","authorization_code","oauth2_state","ticket"]),de=t.z.object({code_id:t.z.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:t.z.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:t.z.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:ue,code_verifier:t.z.string().optional().openapi({description:"The code verifier used in PKCE in outbound flows"}),code_challenge:t.z.string().optional().openapi({description:"The code challenge used in PKCE in outbound flows"}),code_challenge_method:t.z.enum(["plain","S256"]).optional().openapi({description:"The code challenge method used in PKCE in outbound flows"}),redirect_uri:t.z.string().optional().openapi({description:"The redirect URI associated with the code"}),otp:t.z.string().optional().openapi({description:"The one-time password value for OTP-based flows"}),nonce:t.z.string().optional().openapi({description:"The nonce value used for security in OIDC flows"}),state:t.z.string().optional().openapi({description:"The state parameter used for CSRF protection in OAuth flows"}),expires_at:t.z.string(),used_at:t.z.string().optional(),user_id:t.z.string().optional()}),le=t.z.object({...de.shape,created_at:t.z.string()}),he=t.z.object({kid:t.z.string().optional(),team_id:t.z.string().optional(),realms:t.z.string().optional(),authentication_method:t.z.string().optional(),client_id:t.z.string().optional(),client_secret:t.z.string().optional(),app_secret:t.z.string().optional(),scope:t.z.string().optional(),authorization_endpoint:t.z.string().optional(),token_endpoint:t.z.string().optional(),userinfo_endpoint:t.z.string().optional(),jwks_uri:t.z.string().optional(),discovery_url:t.z.string().optional(),issuer:t.z.string().optional(),provider:t.z.string().optional(),from:t.z.string().optional(),twilio_sid:t.z.string().optional(),twilio_token:t.z.string().optional(),icon_url:t.z.string().optional(),passwordPolicy:t.z.enum(["none","low","fair","good","excellent"]).optional(),password_complexity_options:t.z.object({min_length:t.z.number().optional()}).optional(),password_history:t.z.object({enable:t.z.boolean().optional(),size:t.z.number().optional()}).optional(),password_no_personal_info:t.z.object({enable:t.z.boolean().optional()}).optional(),password_dictionary:t.z.object({enable:t.z.boolean().optional(),dictionary:t.z.array(t.z.string()).optional()}).optional(),disable_signup:t.z.boolean().optional(),brute_force_protection:t.z.boolean().optional(),import_mode:t.z.boolean().optional(),attributes:t.z.object({email:t.z.object({identifier:t.z.object({active:t.z.boolean().optional()}).optional(),signup:t.z.object({status:t.z.enum(["required","optional","disabled"]).optional(),verification:t.z.object({active:t.z.boolean().optional()}).optional()}).optional(),validation:t.z.object({allowed:t.z.boolean().optional()}).optional(),unique:t.z.boolean().optional(),profile_required:t.z.boolean().optional(),verification_method:t.z.enum(["link","code"]).optional()}).optional(),username:t.z.object({identifier:t.z.object({active:t.z.boolean().optional()}).optional(),signup:t.z.object({status:t.z.enum(["required","optional","disabled"]).optional()}).optional(),validation:t.z.object({max_length:t.z.number().optional(),min_length:t.z.number().optional(),allowed_types:t.z.object({email:t.z.boolean().optional(),phone_number:t.z.boolean().optional()}).optional()}).optional(),profile_required:t.z.boolean().optional()}).optional(),phone_number:t.z.object({identifier:t.z.object({active:t.z.boolean().optional()}).optional(),signup:t.z.object({status:t.z.enum(["required","optional","disabled"]).optional()}).optional()}).optional()}).optional(),authentication_methods:t.z.object({password:t.z.object({enabled:t.z.boolean().optional()}).optional(),passkey:t.z.object({enabled:t.z.boolean().optional()}).optional()}).optional(),passkey_options:t.z.object({challenge_ui:t.z.enum(["both","autofill","button"]).optional(),local_enrollment_enabled:t.z.boolean().optional(),progressive_enrollment_enabled:t.z.boolean().optional()}).optional(),requires_username:t.z.boolean().optional(),validation:t.z.object({username:t.z.object({min:t.z.number().optional(),max:t.z.number().optional()}).optional()}).optional(),set_user_root_attributes:t.z.enum(["on_each_login","on_first_login","never_on_login"]).optional()}),_e=t.z.object({id:t.z.string().optional(),name:t.z.string(),display_name:t.z.string().optional(),strategy:t.z.string(),options:he.default({}),enabled_clients:t.z.array(t.z.string()).default([]).optional(),response_type:t.z.custom().optional(),response_mode:t.z.custom().optional(),is_domain_connection:t.z.boolean().optional(),show_as_button:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional(),is_system:t.z.boolean().optional()}),pe=t.z.object({id:t.z.string(),created_at:t.z.string().transform((e=>null===e?"":e)),updated_at:t.z.string().transform((e=>null===e?"":e))}).extend(_e.shape),fe=t.z.object({domain:t.z.string(),custom_domain_id:t.z.string().optional(),type:t.z.enum(["auth0_managed_certs","self_managed_certs"]),verification_method:t.z.enum(["txt"]).optional(),tls_policy:t.z.enum(["recommended"]).optional(),custom_client_ip_header:t.z.enum(["true-client-ip","cf-connecting-ip","x-forwarded-for","x-azure-clientip","null"]).optional(),domain_metadata:t.z.record(t.z.string().max(255)).optional()}),me=t.z.discriminatedUnion("name",[t.z.object({name:t.z.literal("txt"),record:t.z.string(),domain:t.z.string()}),t.z.object({name:t.z.literal("http"),http_body:t.z.string(),http_url:t.z.string()})]),ge=t.z.object({...fe.shape,custom_domain_id:t.z.string(),primary:t.z.boolean(),status:t.z.enum(["disabled","pending","pending_verification","ready"]),origin_domain_name:t.z.string().optional(),verification:t.z.object({methods:t.z.array(me)}).optional(),tls_policy:t.z.string().optional()}),ye=ge.extend({tenant_id:t.z.string()}),ve=t.z.object({id:t.z.string(),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0)}),be=ve.extend({category:t.z.literal("BLOCK").optional()}),Ee=be.extend({type:t.z.literal("DIVIDER"),config:t.z.object({text:t.z.string().optional()}).optional()}),Oe=be.extend({type:t.z.literal("HTML"),config:t.z.object({content:t.z.string().optional()}).optional()}),we=be.extend({type:t.z.literal("IMAGE"),config:t.z.object({src:t.z.string().optional(),alt:t.z.string().optional(),width:t.z.number().optional(),height:t.z.number().optional()}).optional()}),Ae=be.extend({type:t.z.literal("JUMP_BUTTON"),config:t.z.object({text:t.z.string().optional(),target_step:t.z.string().optional()})}),Se=be.extend({type:t.z.literal("RESEND_BUTTON"),config:t.z.object({text:t.z.string().optional(),resend_action:t.z.string().optional()})}),Ie=be.extend({type:t.z.literal("NEXT_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),Ce=be.extend({type:t.z.literal("PREVIOUS_BUTTON"),config:t.z.object({text:t.z.string().optional()})}),Ne=be.extend({type:t.z.literal("RICH_TEXT"),config:t.z.object({content:t.z.string().optional()}).optional()}),Te=ve.extend({category:t.z.literal("WIDGET").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),ke=Te.extend({type:t.z.literal("AUTH0_VERIFIABLE_CREDENTIALS"),config:t.z.object({credential_type:t.z.string().optional()})}),xe=Te.extend({type:t.z.literal("GMAPS_ADDRESS"),config:t.z.object({api_key:t.z.string().optional()})}),Re=Te.extend({type:t.z.literal("RECAPTCHA"),config:t.z.object({site_key:t.z.string().optional()})}),De=ve.extend({category:t.z.literal("FIELD").optional(),label:t.z.string().min(1).optional(),hint:t.z.string().min(1).max(500).optional(),messages:t.z.array(t.z.object({id:t.z.number().optional(),text:t.z.string(),type:t.z.enum(["info","error","success","warning"])})).optional(),required:t.z.boolean().optional(),sensitive:t.z.boolean().optional()}),Le=De.extend({type:t.z.literal("BOOLEAN"),config:t.z.object({default_value:t.z.boolean().optional()}).optional()}),je=De.extend({type:t.z.literal("CARDS"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string(),description:t.z.string().optional(),image:t.z.string().optional()})).optional(),multi_select:t.z.boolean().optional()}).optional()}),Fe=De.extend({type:t.z.literal("CHOICE"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),display:t.z.enum(["radio","checkbox"]).optional(),multiple:t.z.boolean().optional(),default_value:t.z.union([t.z.string(),t.z.array(t.z.string())]).optional()}).optional()}),Ue=De.extend({type:t.z.literal("CUSTOM"),config:t.z.object({component:t.z.string().optional(),props:t.z.record(t.z.any()).optional(),schema:t.z.record(t.z.any()).optional(),code:t.z.string().optional()})}),Pe=De.extend({type:t.z.literal("DATE"),config:t.z.object({format:t.z.string().optional(),min:t.z.string().optional(),max:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),Me=De.extend({type:t.z.literal("DROPDOWN"),config:t.z.object({options:t.z.array(t.z.object({value:t.z.string(),label:t.z.string()})).optional(),placeholder:t.z.string().optional(),searchable:t.z.boolean().optional(),multiple:t.z.boolean().optional(),default_value:t.z.union([t.z.string(),t.z.array(t.z.string())]).optional()}).optional()}),Ze=De.extend({type:t.z.literal("EMAIL"),config:t.z.object({placeholder:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),He=De.extend({type:t.z.literal("FILE"),config:t.z.object({accept:t.z.string().optional(),max_size:t.z.number().optional(),multiple:t.z.boolean().optional()}).optional()}),$e=De.extend({type:t.z.literal("LEGAL"),config:t.z.object({text:t.z.string(),html:t.z.boolean().optional()}).optional()}),ze=De.extend({type:t.z.literal("NUMBER"),config:t.z.object({placeholder:t.z.string().optional(),min:t.z.number().optional(),max:t.z.number().optional(),step:t.z.number().optional(),default_value:t.z.string().optional()}).optional()}),Ge=De.extend({type:t.z.literal("PASSWORD"),config:t.z.object({placeholder:t.z.string().optional(),min_length:t.z.number().optional(),show_toggle:t.z.boolean().optional(),forgot_password_link:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),qe=De.extend({type:t.z.literal("PAYMENT"),config:t.z.object({provider:t.z.string().optional(),currency:t.z.string().optional()}).optional()}),Be=De.extend({type:t.z.literal("SOCIAL"),config:t.z.object({providers:t.z.array(t.z.string()).optional(),provider_details:t.z.array(t.z.object({name:t.z.string(),strategy:t.z.string().optional(),display_name:t.z.string().optional(),icon_url:t.z.string().optional(),href:t.z.string().optional()})).optional()}).optional()}),We=De.extend({type:t.z.literal("TEL"),config:t.z.object({placeholder:t.z.string().optional(),default_country:t.z.string().optional(),default_value:t.z.string().optional(),allow_email:t.z.boolean().optional()}).optional()}),Ke=De.extend({type:t.z.literal("TEXT"),config:t.z.object({placeholder:t.z.string().optional(),multiline:t.z.boolean().optional(),max_length:t.z.number().optional(),default_value:t.z.string().optional()}).optional()}),Ve=De.extend({type:t.z.literal("COUNTRY"),config:t.z.object({placeholder:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),Xe=De.extend({type:t.z.literal("URL"),config:t.z.object({placeholder:t.z.string().optional(),default_value:t.z.string().optional()}).optional()}),Ye=t.z.discriminatedUnion("type",[Ee,Oe,we,Ae,Se,Ie,Ce,Ne]),Je=t.z.discriminatedUnion("type",[ke,xe,Re]),Qe=t.z.discriminatedUnion("type",[Le,je,Fe,Ve,Ue,Pe,Me,Ze,He,$e,ze,Ge,qe,Be,We,Ke,Xe]),et=t.z.union([Ye,Je,Qe]),tt=new Set(["BOOLEAN","CARDS","CHOICE","COUNTRY","DATE","DROPDOWN","EMAIL","LEGAL","NUMBER","PASSWORD","TEL","TEXT","URL"]),it=t.z.object({id:t.z.string(),type:t.z.literal("submit"),label:t.z.string(),className:t.z.string().optional(),disabled:t.z.boolean().optional().default(!1),order:t.z.number().optional(),visible:t.z.boolean().optional().default(!0),customizations:t.z.record(t.z.string(),t.z.any()).optional()}),nt=t.z.object({x:t.z.number(),y:t.z.number()}),st=t.z.object({id:t.z.string(),type:t.z.literal("FLOW"),coordinates:nt,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({flow_id:t.z.string().max(30),next_node:t.z.string().optional()})}),rt=t.z.object({id:t.z.string(),type:t.z.literal("ROUTER"),coordinates:nt,alias:t.z.string().min(1).max(150),config:t.z.object({rules:t.z.array(t.z.object({id:t.z.string(),alias:t.z.string().min(1).max(150).optional(),condition:t.z.any(),next_node:t.z.string()})),fallback:t.z.string()})}),ot=t.z.object({id:t.z.string(),type:t.z.literal("STEP"),coordinates:nt,alias:t.z.string().min(1).max(150).optional(),config:t.z.object({components:t.z.array(et),next_node:t.z.string().optional()})}),at=t.z.discriminatedUnion("type",[st,rt,ot]),ct=t.z.object({name:t.z.string().openapi({description:"The name of the form"}),messages:t.z.object({errors:t.z.record(t.z.string(),t.z.any()).optional(),custom:t.z.record(t.z.string(),t.z.any()).optional()}).optional(),languages:t.z.object({primary:t.z.string().optional(),default:t.z.string().optional()}).optional(),translations:t.z.record(t.z.string(),t.z.any()).optional(),nodes:t.z.array(at).optional(),start:t.z.object({hidden_fields:t.z.array(t.z.object({key:t.z.string(),value:t.z.string()})).optional(),next_node:t.z.string().optional(),coordinates:nt.optional()}).optional(),ending:t.z.object({redirection:t.z.object({delay:t.z.number().optional(),target:t.z.string().optional()}).optional(),after_submit:t.z.object({flow_id:t.z.string().optional()}).optional(),coordinates:nt.optional(),resume_flow:t.z.boolean().optional()}).optional(),style:t.z.object({css:t.z.string().optional()}).optional(),links:t.z.object({sdkSrc:t.z.string().optional(),sdk_src:t.z.string().optional()}).optional()}).openapi({description:"Schema for flow-based forms (matches Auth0 Forms structure)"}),ut=t.z.object({...l.shape,...ct.shape,id:t.z.string()}),dt=t.z.object({id:t.z.number().optional(),text:t.z.string(),type:t.z.enum(["info","error","success","warning"])}),lt=t.z.object({id:t.z.string().optional(),text:t.z.string(),href:t.z.string(),linkText:t.z.string().optional()}),ht=t.z.object({name:t.z.string().optional(),action:t.z.string(),method:t.z.enum(["POST","GET"]),title:t.z.string().optional(),description:t.z.string().optional(),components:t.z.array(et),messages:t.z.array(dt).optional(),links:t.z.array(lt).optional(),footer:t.z.string().optional()}),_t=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),pt=t.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),ft=t.z.enum(["post-user-login","credentials-exchange"]),mt=t.z.enum(["ensure-username","set-preferred-username"]),gt={enabled:t.z.boolean().default(!1),synchronous:t.z.boolean().default(!1),priority:t.z.number().optional(),hook_id:t.z.string().optional()},yt=t.z.object({...gt,trigger_id:_t,url:t.z.string()}),vt=t.z.object({...gt,trigger_id:pt,form_id:t.z.string()}),bt=t.z.object({...gt,trigger_id:ft,template_id:mt}),Et=t.z.union([yt,vt,bt]),Ot=t.z.object({...gt,trigger_id:_t,...l.shape,hook_id:t.z.string(),url:t.z.string()}),wt=t.z.object({...gt,trigger_id:pt,...l.shape,hook_id:t.z.string(),form_id:t.z.string()}),At=t.z.object({...gt,trigger_id:ft,...l.shape,hook_id:t.z.string(),template_id:mt}),St=t.z.union([Ot,wt,At]),It=t.z.object({name:t.z.string().optional()}),Ct=t.z.object({email:t.z.string().optional()}),Nt=t.z.object({organization_id:t.z.string().max(50),inviter:It,invitee:Ct,invitation_url:t.z.string().url(),client_id:t.z.string(),connection_id:t.z.string().optional(),app_metadata:t.z.record(t.z.any()).default({}).optional(),user_metadata:t.z.record(t.z.any()).default({}).optional(),ttl_sec:t.z.number().int().max(2592e3).default(604800).optional(),roles:t.z.array(t.z.string()).default([]).optional(),send_invitation_email:t.z.boolean().default(!0).optional()}),Tt=t.z.object({id:t.z.string(),organization_id:t.z.string().max(50),created_at:t.z.string().datetime(),expires_at:t.z.string().datetime(),ticket_id:t.z.string().optional()}).extend(Nt.shape),kt=t.z.object({alg:t.z.enum(["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512"]),e:t.z.string(),kid:t.z.string(),kty:t.z.enum(["RSA","EC","oct"]),n:t.z.string(),x5t:t.z.string().optional(),x5c:t.z.array(t.z.string()).optional(),use:t.z.enum(["sig","enc"]).optional()}),xt=t.z.object({keys:t.z.array(kt)}),Rt=t.z.object({issuer:t.z.string(),authorization_endpoint:t.z.string(),token_endpoint:t.z.string(),device_authorization_endpoint:t.z.string(),userinfo_endpoint:t.z.string(),mfa_challenge_endpoint:t.z.string(),jwks_uri:t.z.string(),registration_endpoint:t.z.string(),revocation_endpoint:t.z.string(),scopes_supported:t.z.array(t.z.string()),response_types_supported:t.z.array(t.z.string()),code_challenge_methods_supported:t.z.array(t.z.string()),response_modes_supported:t.z.array(t.z.string()),subject_types_supported:t.z.array(t.z.string()),id_token_signing_alg_values_supported:t.z.array(t.z.string()),token_endpoint_auth_methods_supported:t.z.array(t.z.string()),claims_supported:t.z.array(t.z.string()),request_uri_parameter_supported:t.z.boolean(),request_parameter_supported:t.z.boolean(),token_endpoint_auth_signing_alg_values_supported:t.z.array(t.z.string())});var Dt=(e=>(e.PENDING="pending",e.AUTHENTICATED="authenticated",e.AWAITING_EMAIL_VERIFICATION="awaiting_email_verification",e.AWAITING_MFA="awaiting_mfa",e.AWAITING_HOOK="awaiting_hook",e.AWAITING_CONTINUATION="awaiting_continuation",e.COMPLETED="completed",e.FAILED="failed",e.EXPIRED="expired",e))(Dt||{});const Lt=t.z.nativeEnum(Dt),jt=t.z.object({csrf_token:t.z.string(),auth0Client:t.z.string().optional(),authParams:ae,expires_at:t.z.string(),deleted_at:t.z.string().optional(),ip:t.z.string().optional(),useragent:t.z.string().optional(),session_id:t.z.string().optional(),authorization_url:t.z.string().optional(),state:Lt.optional().default("pending"),state_data:t.z.string().optional(),failure_reason:t.z.string().optional(),user_id:t.z.string().optional(),auth_connection:t.z.string().optional()}).openapi({description:"This represents a login sesion"}),Ft=t.z.object({...jt.shape,id:t.z.string().openapi({description:"This is is used as the state in the universal login"}),created_at:t.z.string(),updated_at:t.z.string()}),Ut={ACLS_SUMMARY:"acls_summary",ACTIONS_EXECUTION_FAILED:"actions_execution_failed",API_LIMIT:"api_limit",API_LIMIT_WARNING:"api_limit_warning",APPI:"appi",CIBA_EXCHANGE_FAILED:"ciba_exchange_failed",CIBA_EXCHANGE_SUCCEEDED:"ciba_exchange_succeeded",CIBA_START_FAILED:"ciba_start_failed",CIBA_START_SUCCEEDED:"ciba_start_succeeded",CODE_LINK_SENT:"cls",CODE_SENT:"cs",DEPRECATION_NOTICE:"depnote",FAILED_LOGIN:"f",FAILED_BY_CONNECTOR:"fc",FAILED_CHANGE_EMAIL:"fce",FAILED_BY_CORS:"fco",FAILED_CROSS_ORIGIN_AUTHENTICATION:"fcoa",FAILED_CHANGE_PASSWORD:"fcp",FAILED_POST_CHANGE_PASSWORD_HOOK:"fcph",FAILED_CHANGE_PHONE_NUMBER:"fcpn",FAILED_CHANGE_PASSWORD_REQUEST:"fcpr",FAILED_CONNECTOR_PROVISIONING:"fcpro",FAILED_CHANGE_USERNAME:"fcu",FAILED_DELEGATION:"fd",FAILED_DEVICE_ACTIVATION:"fdeac",FAILED_DEVICE_AUTHORIZATION_REQUEST:"fdeaz",USER_CANCELED_DEVICE_CONFIRMATION:"fdecc",FAILED_USER_DELETION:"fdu",FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:"feacft",FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:"feccft",FAILED_EXCHANGE_CUSTOM_TOKEN:"fecte",FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:"fede",FAILED_FEDERATED_LOGOUT:"federated_logout_failed",FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN:"fens",FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:"feoobft",FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:"feotpft",FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:"fepft",FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:"fepotpft",FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:"fercft",FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN:"ferrt",FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:"fertft",FAILED_HOOK:"fh",FAILED_IMPERSONATION:"fimp",FAILED_INVITE_ACCEPT:"fi",FAILED_LOGOUT:"flo",FLOWS_EXECUTION_COMPLETED:"flows_execution_completed",FLOWS_EXECUTION_FAILED:"flows_execution_failed",FAILED_SENDING_NOTIFICATION:"fn",FORMS_SUBMISSION_FAILED:"forms_submission_failed",FORMS_SUBMISSION_SUCCEEDED:"forms_submission_succeeded",FAILED_LOGIN_INCORRECT_PASSWORD:"fp",FAILED_PUSHED_AUTHORIZATION_REQUEST:"fpar",FAILED_POST_USER_REGISTRATION_HOOK:"fpurh",FAILED_SIGNUP:"fs",FAILED_SILENT_AUTH:"fsa",FAILED_LOGIN_INVALID_EMAIL_USERNAME:"fu",FAILED_USERS_IMPORT:"fui",FAILED_VERIFICATION_EMAIL:"fv",FAILED_VERIFICATION_EMAIL_REQUEST:"fvr",EMAIL_VERIFICATION_CONFIRMED:"gd_auth_email_verification",EMAIL_VERIFICATION_FAILED:"gd_auth_fail_email_verification",MFA_AUTH_FAILED:"gd_auth_failed",MFA_AUTH_REJECTED:"gd_auth_rejected",MFA_AUTH_SUCCESS:"gd_auth_succeed",MFA_ENROLLMENT_COMPLETE:"gd_enrollment_complete",TOO_MANY_MFA_FAILURES:"gd_otp_rate_limit_exceed",MFA_RECOVERY_FAILED:"gd_recovery_failed",MFA_RECOVERY_RATE_LIMIT_EXCEED:"gd_recovery_rate_limit_exceed",MFA_RECOVERY_SUCCESS:"gd_recovery_succeed",MFA_EMAIL_SENT:"gd_send_email",EMAIL_VERIFICATION_SENT:"gd_send_email_verification",EMAIL_VERIFICATION_SEND_FAILURE:"gd_send_email_verification_failure",PUSH_NOTIFICATION_SENT:"gd_send_pn",ERROR_SENDING_MFA_PUSH_NOTIFICATION:"gd_send_pn_failure",MFA_SMS_SENT:"gd_send_sms",ERROR_SENDING_MFA_SMS:"gd_send_sms_failure",MFA_VOICE_CALL_SUCCESS:"gd_send_voice",MFA_VOICE_CALL_FAILED:"gd_send_voice_failure",SECOND_FACTOR_STARTED:"gd_start_auth",MFA_ENROLL_STARTED:"gd_start_enroll",MFA_ENROLLMENT_FAILED:"gd_start_enroll_failed",GUARDIAN_TENANT_UPDATE:"gd_tenant_update",UNENROLL_DEVICE_ACCOUNT:"gd_unenroll",UPDATE_DEVICE_ACCOUNT:"gd_update_device_account",WEBAUTHN_CHALLENGE_FAILED:"gd_webauthn_challenge_failed",WEBAUTHN_ENROLLMENT_FAILED:"gd_webauthn_enrollment_failed",FAILED_KMS_API_OPERATION:"kms_key_management_failure",SUCCESS_KMS_API_OPERATION:"kms_key_management_success",KMS_KEY_STATE_CHANGED:"kms_key_state_changed",TOO_MANY_CALLS_TO_DELEGATION:"limit_delegation",BLOCKED_IP_ADDRESS:"limit_mu",BLOCKED_ACCOUNT_IP:"limit_sul",BLOCKED_ACCOUNT_EMAIL:"limit_wc",MFA_REQUIRED:"mfar",MANAGEMENT_API_READ_OPERATION:"mgmt_api_read",FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:"my_account_authentication_method_failed",SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:"my_account_authentication_method_succeeded",FAILED_OIDC_BACKCHANNEL_LOGOUT:"oidc_backchannel_logout_failed",SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT:"oidc_backchannel_logout_succeeded",ORGANIZATION_MEMBER_ADDED:"organization_member_added",PASSKEY_CHALLENGE_FAILED:"passkey_challenge_failed",PASSKEY_CHALLENGE_STARTED:"passkey_challenge_started",PRE_LOGIN_ASSESSMENT:"pla",BREACHED_PASSWORD:"pwd_leak",BREACHED_PASSWORD_ON_RESET:"reset_pwd_leak",SUCCESS_RESOURCE_CLEANUP:"resource_cleanup",RICH_CONSENTS_ACCESS_ERROR:"rich_consents_access_error",SUCCESS_LOGIN:"s",SUCCESS_API_OPERATION:"sapi",SUCCESS_CHANGE_EMAIL:"sce",SUCCESS_CROSS_ORIGIN_AUTHENTICATION:"scoa",SUCCESS_CHANGE_PASSWORD:"scp",SUCCESS_CHANGE_PHONE_NUMBER:"scpn",SUCCESS_CHANGE_PASSWORD_REQUEST:"scpr",SUCCESS_CHANGE_USERNAME:"scu",SUCCESS_CREDENTIAL_VALIDATION:"scv",SUCCESS_DELEGATION:"sd",SUCCESS_USER_DELETION:"sdu",SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:"seacft",SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:"seccft",SUCCESS_EXCHANGE_CUSTOM_TOKEN:"secte",SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:"sede",SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN:"sens",SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:"seoobft",SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:"seotpft",SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:"sepft",SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN:"sepkoobft",SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN:"sepkotpft",SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN:"sepkrcft",SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:"sercft",SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:"sertft",SUCCESS_IMPERSONATION:"simp",SUCCESSFULLY_ACCEPTED_USER_INVITE:"si",BREACHED_PASSWORD_ON_SIGNUP:"signup_pwd_leak",SUCCESS_LOGOUT:"slo",SUCCESS_REVOCATION:"srrt",SUCCESS_SIGNUP:"ss",FAILED_SS_SSO_OPERATION:"ss_sso_failure",INFORMATION_FROM_SS_SSO_OPERATION:"ss_sso_info",SUCCESS_SS_SSO_OPERATION:"ss_sso_success",SUCCESS_SILENT_AUTH:"ssa",SUCCESSFUL_SCIM_OPERATION:"sscim",SUCCESSFULLY_IMPORTED_USERS:"sui",SUCCESS_VERIFICATION_EMAIL:"sv",SUCCESS_VERIFICATION_EMAIL_REQUEST:"svr",MAX_AMOUNT_OF_AUTHENTICATORS:"too_many_records",USER_LOGIN_BLOCK_RELEASED:"ublkdu",FAILED_UNIVERSAL_LOGOUT:"universal_logout_failed",SUCCESSFUL_UNIVERSAL_LOGOUT:"universal_logout_succeeded",WARNING_DURING_LOGIN:"w",WARNING_SENDING_NOTIFICATION:"wn",WARNING_USER_MANAGEMENT:"wum"},Pt=t.z.string().refine((e=>Object.values(Ut).includes(e)),{message:"Invalid log type"}),Mt=t.z.object({name:t.z.string(),version:t.z.string(),env:t.z.object({node:t.z.string().optional()}).optional()}),Zt=t.z.object({country_code:t.z.string().length(2),city_name:t.z.string(),latitude:t.z.string(),longitude:t.z.string(),time_zone:t.z.string(),continent_code:t.z.string()}),Ht=t.z.object({type:Pt,date:t.z.string(),description:t.z.string().optional(),ip:t.z.string().optional(),user_agent:t.z.string().optional(),details:t.z.any().optional(),isMobile:t.z.boolean(),user_id:t.z.string().optional(),user_name:t.z.string().optional(),connection:t.z.string().optional(),connection_id:t.z.string().optional(),client_id:t.z.string().optional(),client_name:t.z.string().optional(),audience:t.z.string().optional(),scope:t.z.string().optional(),strategy:t.z.string().optional(),strategy_type:t.z.string().optional(),hostname:t.z.string().optional(),auth0_client:Mt.optional(),log_id:t.z.string().optional(),location_info:Zt.optional()}),$t=t.z.object({...Ht.shape,log_id:t.z.string()}),zt=t.z.object({id:t.z.string().optional(),user_id:t.z.string(),password:t.z.string(),algorithm:t.z.enum(["bcrypt","argon2id"]).default("argon2id"),is_current:t.z.boolean().default(!0)}),Gt=zt.extend({id:t.z.string(),created_at:t.z.string(),updated_at:t.z.string()}),qt=t.z.object({initial_user_agent:t.z.string().describe("First user agent of the device from which this user logged in"),initial_ip:t.z.string().describe("First IP address associated with this session"),initial_asn:t.z.string().describe("First autonomous system number associated with this session"),last_user_agent:t.z.string().describe("Last user agent of the device from which this user logged in"),last_ip:t.z.string().describe("Last IP address from which this user logged in"),last_asn:t.z.string().describe("Last autonomous system number from which this user logged in")}),Bt=t.z.object({id:t.z.string(),revoked_at:t.z.string().optional(),used_at:t.z.string().optional(),user_id:t.z.string().describe("The user ID associated with the session"),expires_at:t.z.string().optional(),login_session_id:t.z.string(),idle_expires_at:t.z.string().optional(),device:qt.describe("Metadata related to the device used in the session"),clients:t.z.array(t.z.string()).describe("List of client details for the session")}),Wt=t.z.object({created_at:t.z.string(),updated_at:t.z.string(),authenticated_at:t.z.string(),last_interaction_at:t.z.string(),...Bt.shape}),Kt=t.z.object({kid:t.z.string().openapi({description:"The key id of the signing key"}),cert:t.z.string().openapi({description:"The public certificate of the signing key"}),fingerprint:t.z.string().openapi({description:"The cert fingerprint"}),thumbprint:t.z.string().openapi({description:"The cert thumbprint"}),pkcs7:t.z.string().optional().openapi({description:"The private key in pkcs7 format"}),current:t.z.boolean().optional().openapi({description:"True if the key is the current key"}),next:t.z.boolean().optional().openapi({description:"True if the key is the next key"}),previous:t.z.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:t.z.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:t.z.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:t.z.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:t.z.string().optional().openapi({description:"The date and time when the key was revoked"}),connection:t.z.string().optional().openapi({description:"The connection identifier associated with the key"}),type:t.z.enum(["jwt_signing","saml_encryption"]).openapi({description:"The type of the signing key"})}),Vt=t.z.object({id:t.z.string().optional(),audience:t.z.string(),friendly_name:t.z.string(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sender_email:t.z.string().email(),sender_name:t.z.string(),session_lifetime:t.z.number().optional(),idle_session_lifetime:t.z.number().optional(),ephemeral_session_lifetime:t.z.number().optional(),idle_ephemeral_session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),allowed_logout_urls:t.z.array(t.z.string()).optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_changing_enable_sso:t.z.boolean().optional(),allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),change_pwd_flow_v1:t.z.boolean().optional(),custom_domains_provisioning:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),disable_impersonation:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),enable_sso:t.z.boolean().optional(),enforce_client_authentication_on_passwordless_start:t.z.boolean().optional(),genai_trial:t.z.boolean().optional(),improved_signup_bot_detection_in_classic:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional(),no_disclose_enterprise_connections:t.z.boolean().optional(),remove_alg_from_jwks:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),trust_azure_adfs_email_verified_connection_property:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),inherit_global_permissions_in_organizations:t.z.boolean().optional()}).optional(),sandbox_version:t.z.string().optional(),legacy_sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean().optional(),html:t.z.string().optional()}).optional(),device_flow:t.z.object({charset:t.z.enum(["base20","digits"]).optional(),mask:t.z.string().max(20).optional()}).optional(),default_token_quota:t.z.object({clients:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional(),organizations:t.z.object({client_credentials:t.z.record(t.z.any()).optional()}).optional()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional(),oidc_logout:t.z.object({rp_logout_end_session_endpoint_discovery:t.z.boolean().optional()}).optional(),allow_organization_name_in_authentication_api:t.z.boolean().optional(),customize_mfa_in_postlogin_action:t.z.boolean().optional(),acr_values_supported:t.z.array(t.z.string()).optional(),mtls:t.z.object({enable_endpoint_aliases:t.z.boolean().optional()}).optional(),pushed_authorization_requests_supported:t.z.boolean().optional(),authorization_response_iss_parameter_supported:t.z.boolean().optional(),mfa:t.z.object({policy:t.z.enum(["never","always"]).default("never").optional(),factors:t.z.object({sms:t.z.boolean().default(!1),otp:t.z.boolean().default(!1),email:t.z.boolean().default(!1),push_notification:t.z.boolean().default(!1),webauthn_roaming:t.z.boolean().default(!1),webauthn_platform:t.z.boolean().default(!1),recovery_code:t.z.boolean().default(!1),duo:t.z.boolean().default(!1)}).optional(),sms_provider:t.z.object({provider:t.z.enum(["twilio","vonage","aws_sns","phone_message_hook"]).optional()}).optional(),twilio:t.z.object({sid:t.z.string().optional(),auth_token:t.z.string().optional(),from:t.z.string().optional(),messaging_service_sid:t.z.string().optional()}).optional(),phone_message:t.z.object({message:t.z.string().optional()}).optional()}).optional()}),Xt=t.z.object({created_at:t.z.string().nullable().transform((e=>e??"")),updated_at:t.z.string().nullable().transform((e=>e??"")),...Vt.shape,id:t.z.string()});var Yt=(e=>(e.RefreshToken="refresh_token",e.AuthorizationCode="authorization_code",e.ClientCredential="client_credentials",e.Passwordless="passwordless",e.Password="password",e.OTP="http://auth0.com/oauth/grant-type/passwordless/otp",e))(Yt||{});const Jt=t.z.object({access_token:t.z.string(),id_token:t.z.string().optional(),scope:t.z.string().optional(),state:t.z.string().optional(),refresh_token:t.z.string().optional(),token_type:t.z.string(),expires_in:t.z.number()});t.z.object({code:t.z.string(),state:t.z.string().optional()});const Qt=t.z.object({button_border_radius:t.z.number(),button_border_weight:t.z.number(),buttons_style:t.z.enum(["pill","rounded","sharp"]),input_border_radius:t.z.number(),input_border_weight:t.z.number(),inputs_style:t.z.enum(["pill","rounded","sharp"]),show_widget_shadow:t.z.boolean(),widget_border_weight:t.z.number(),widget_corner_radius:t.z.number()}),ei=t.z.object({base_focus_color:t.z.string(),base_hover_color:t.z.string(),body_text:t.z.string(),captcha_widget_theme:t.z.enum(["auto","dark","light"]),error:t.z.string(),header:t.z.string(),icons:t.z.string(),input_background:t.z.string(),input_border:t.z.string(),input_filled_text:t.z.string(),input_labels_placeholders:t.z.string(),links_focused_components:t.z.string(),primary_button:t.z.string(),primary_button_label:t.z.string(),secondary_button_border:t.z.string(),secondary_button_label:t.z.string(),success:t.z.string(),widget_background:t.z.string(),widget_border:t.z.string()}),ti=t.z.object({bold:t.z.boolean(),size:t.z.number()}),ii=t.z.object({body_text:ti,buttons_text:ti,font_url:t.z.string(),input_labels:ti,links:ti,links_style:t.z.enum(["normal","underlined"]),reference_text_size:t.z.number(),subtitle:ti,title:ti}),ni=t.z.object({background_color:t.z.string(),background_image_url:t.z.string(),page_layout:t.z.enum(["center","left","right"])}),si=t.z.object({header_text_alignment:t.z.enum(["center","left","right"]),logo_height:t.z.number(),logo_position:t.z.enum(["center","left","none","right"]),logo_url:t.z.string(),social_buttons_layout:t.z.enum(["bottom","top"])}),ri=t.z.object({borders:Qt,colors:ei,displayName:t.z.string(),fonts:ii,page_background:ni,widget:si}),oi=ri.extend({themeId:t.z.string()}),ai=t.z.object({universal_login_experience:t.z.enum(["new","classic"]).default("new"),identifier_first:t.z.boolean().default(!0),password_first:t.z.boolean().default(!1),webauthn_platform_first_factor:t.z.boolean()}),ci=t.z.object({name:t.z.string(),enabled:t.z.boolean().optional().default(!0),default_from_address:t.z.string().optional(),credentials:t.z.union([t.z.object({accessKeyId:t.z.string(),secretAccessKey:t.z.string(),region:t.z.string()}),t.z.object({smtp_host:t.z.array(t.z.string()),smtp_port:t.z.number(),smtp_user:t.z.string(),smtp_pass:t.z.string()}),t.z.object({api_key:t.z.string(),domain:t.z.string().optional()}),t.z.object({connectionString:t.z.string()}),t.z.object({tenantId:t.z.string(),clientId:t.z.string(),clientSecret:t.z.string()})]),settings:t.z.object({}).optional()}),ui=t.z.object({id:t.z.string(),login_id:t.z.string(),user_id:t.z.string(),client_id:t.z.string(),expires_at:t.z.string().optional(),idle_expires_at:t.z.string().optional(),last_exchanged_at:t.z.string().optional(),device:qt,resource_servers:t.z.array(t.z.object({audience:t.z.string(),scopes:t.z.string()})),rotating:t.z.boolean()}),di=t.z.object({created_at:t.z.string(),...ui.shape}),li=t.z.object({to:t.z.string(),message:t.z.string()}),hi=t.z.object({name:t.z.string(),options:t.z.object({})}),_i=t.z.object({value:t.z.string(),description:t.z.string().optional()}),pi=t.z.object({token_dialect:t.z.enum(["access_token","access_token_authz"]).optional(),enforce_policies:t.z.boolean().optional(),allow_skipping_userinfo:t.z.boolean().optional(),skip_userinfo:t.z.boolean().optional(),persist_client_authorization:t.z.boolean().optional(),enable_introspection_endpoint:t.z.boolean().optional(),mtls:t.z.object({bound_access_tokens:t.z.boolean().optional()}).optional()}),fi=t.z.object({id:t.z.string().optional(),name:t.z.string(),identifier:t.z.string(),scopes:t.z.array(_i).optional(),signing_alg:t.z.string().optional(),signing_secret:t.z.string().optional(),token_lifetime:t.z.number().optional(),token_lifetime_for_web:t.z.number().optional(),skip_consent_for_verifiable_first_party_clients:t.z.boolean().optional(),allow_offline_access:t.z.boolean().optional(),verificationKey:t.z.string().optional(),options:pi.optional(),is_system:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional()}),mi=t.z.object({...fi.shape,created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),gi=t.z.array(mi),yi=t.z.object({role_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string()}),vi=t.z.object({...yi.shape,created_at:t.z.string()}),bi=t.z.array(vi),Ei=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),permission_name:t.z.string(),organization_id:t.z.string().optional()}),Oi=t.z.object({...Ei.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),wi=t.z.array(Oi),Ai=t.z.object({user_id:t.z.string(),resource_server_identifier:t.z.string(),resource_server_name:t.z.string(),permission_name:t.z.string(),description:t.z.string().nullable().optional(),created_at:t.z.string().optional(),organization_id:t.z.string().optional()}),Si=t.z.array(Ai),Ii=t.z.object({user_id:t.z.string(),role_id:t.z.string(),organization_id:t.z.string().optional()}),Ci=t.z.object({...Ii.shape,tenant_id:t.z.string(),created_at:t.z.string().optional()}),Ni=t.z.array(Ci),Ti=t.z.object({id:t.z.string().optional().openapi({description:"The unique identifier of the role. If not provided, one will be generated."}),name:t.z.string().min(1).max(50).openapi({description:"The name of the role. Cannot include '<' or '>'"}),description:t.z.string().max(255).optional().openapi({description:"The description of the role"}),is_system:t.z.boolean().optional(),metadata:t.z.record(t.z.any()).optional().openapi({description:"Metadata associated with the role. Can be used to control sync behavior in multi-tenancy scenarios."})}),ki=Ti.extend({id:t.z.string().openapi({description:"The unique identifier of the role"}),created_at:t.z.string().optional(),updated_at:t.z.string().optional()}),xi=t.z.array(ki),Ri=t.z.object({logo_url:t.z.string().optional().openapi({description:"URL of the organization's logo"}),colors:t.z.object({primary:t.z.string().optional().openapi({description:"Primary color in hex format (e.g., #FF0000)"}),page_background:t.z.string().optional().openapi({description:"Page background color in hex format (e.g., #FFFFFF)"})}).optional()}).optional(),Di=t.z.object({connection_id:t.z.string().openapi({description:"ID of the connection"}),assign_membership_on_login:t.z.boolean().default(!1).openapi({description:"Whether to assign membership to the organization on login"}),show_as_button:t.z.boolean().default(!0).openapi({description:"Whether to show this connection as a button in the login screen"}),is_signup_enabled:t.z.boolean().default(!0).openapi({description:"Whether signup is enabled for this connection"})}),Li=t.z.object({client_credentials:t.z.object({enforce:t.z.boolean().default(!1).openapi({description:"Whether to enforce token quota limits"}),per_day:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per day (0 = unlimited)"}),per_hour:t.z.number().min(0).default(0).openapi({description:"Maximum tokens per hour (0 = unlimited)"})}).optional()}).optional(),ji=t.z.object({id:t.z.string().optional(),name:t.z.string().min(1).regex(/^[a-z0-9_-]+$/,{message:"Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores"}).openapi({description:"The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores."}),display_name:t.z.string().optional().openapi({description:"The display name of the organization"}),branding:Ri,metadata:t.z.record(t.z.any()).default({}).optional().openapi({description:"Custom metadata for the organization"}),enabled_connections:t.z.array(Di).default([]).optional().openapi({description:"List of enabled connections for the organization"}),token_quota:Li}),Fi=t.z.object({...ji.shape,...l.shape,id:t.z.string(),name:t.z.string().min(1).openapi({description:"The name of the organization"})}),Ui=t.z.object({user_id:t.z.string().openapi({description:"ID of the user"}),organization_id:t.z.string().openapi({description:"ID of the organization"})}),Pi=t.z.object({...Ui.shape,...l.shape,id:t.z.string()}),Mi=t.z.object({idle_session_lifetime:t.z.number().optional(),session_lifetime:t.z.number().optional(),session_cookie:t.z.object({mode:t.z.enum(["persistent","non-persistent"]).optional()}).optional(),enable_client_connections:t.z.boolean().optional(),default_redirection_uri:t.z.string().optional(),enabled_locales:t.z.array(t.z.string()).optional(),default_directory:t.z.string().optional(),error_page:t.z.object({html:t.z.string().optional(),show_log_link:t.z.boolean().optional(),url:t.z.string().optional()}).optional(),flags:t.z.object({allow_legacy_delegation_grant_types:t.z.boolean().optional(),allow_legacy_ro_grant_types:t.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:t.z.boolean().optional(),disable_clickjack_protection_headers:t.z.boolean().optional(),enable_apis_section:t.z.boolean().optional(),enable_client_connections:t.z.boolean().optional(),enable_custom_domain_in_emails:t.z.boolean().optional(),enable_dynamic_client_registration:t.z.boolean().optional(),enable_idtoken_api2:t.z.boolean().optional(),enable_legacy_logs_search_v2:t.z.boolean().optional(),enable_legacy_profile:t.z.boolean().optional(),enable_pipeline2:t.z.boolean().optional(),enable_public_signup_user_exists_error:t.z.boolean().optional(),use_scope_descriptions_for_consent:t.z.boolean().optional(),disable_management_api_sms_obfuscation:t.z.boolean().optional(),enable_adfs_waad_email_verification:t.z.boolean().optional(),revoke_refresh_token_grant:t.z.boolean().optional(),dashboard_log_streams_next:t.z.boolean().optional(),dashboard_insights_view:t.z.boolean().optional(),disable_fields_map_fix:t.z.boolean().optional(),mfa_show_factor_list_on_enrollment:t.z.boolean().optional()}).optional(),friendly_name:t.z.string().optional(),picture_url:t.z.string().optional(),support_email:t.z.string().optional(),support_url:t.z.string().optional(),sandbox_version:t.z.string().optional(),sandbox_versions_available:t.z.array(t.z.string()).optional(),change_password:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),guardian_mfa_page:t.z.object({enabled:t.z.boolean(),html:t.z.string()}).optional(),default_audience:t.z.string().optional(),default_organization:t.z.string().optional(),sessions:t.z.object({oidc_logout_prompt_enabled:t.z.boolean().optional()}).optional(),mfa:t.z.object({policy:t.z.enum(["never","always"]).default("never").optional(),factors:t.z.object({sms:t.z.boolean().default(!1),otp:t.z.boolean().default(!1),email:t.z.boolean().default(!1),push_notification:t.z.boolean().default(!1),webauthn_roaming:t.z.boolean().default(!1),webauthn_platform:t.z.boolean().default(!1),recovery_code:t.z.boolean().default(!1),duo:t.z.boolean().default(!1)}).optional(),sms_provider:t.z.object({provider:t.z.enum(["twilio","vonage","aws_sns","phone_message_hook"]).optional()}).optional(),twilio:t.z.object({sid:t.z.string().optional(),auth_token:t.z.string().optional(),from:t.z.string().optional(),messaging_service_sid:t.z.string().optional()}).optional(),phone_message:t.z.object({message:t.z.string().optional()}).optional()}).optional()}),Zi=t.z.object({date:t.z.string().openapi({description:"Date these events occurred in ISO 8601 format",example:"2025-12-19"}),logins:t.z.number().openapi({description:"Number of logins on this date",example:150}),signups:t.z.number().openapi({description:"Number of signups on this date",example:25}),leaked_passwords:t.z.number().openapi({description:"Number of breached-password detections on this date (subscription required)",example:0}),updated_at:t.z.string().openapi({description:"Date and time this stats entry was last updated in ISO 8601 format",example:"2025-12-19T10:30:00.000Z"}),created_at:t.z.string().openapi({description:"Approximate date and time the first event occurred in ISO 8601 format",example:"2025-12-19T00:00:00.000Z"})}),Hi=t.z.number().openapi({description:"Number of active users in the last 30 days",example:1234}),$i=t.z.enum(["login","login-id","login-password","signup","signup-id","signup-password","reset-password","consent","mfa","mfa-push","mfa-otp","mfa-voice","mfa-phone","mfa-webauthn","mfa-email","mfa-recovery-code","status","device-flow","email-verification","email-otp-challenge","organizations","invitation","common","passkeys","captcha","custom-form","login-passwordless","mfa-login-options"]),zi=t.z.record(t.z.string(),t.z.record(t.z.string(),t.z.string())).openapi({type:"object",additionalProperties:{type:"object",additionalProperties:{type:"string"}}}),Gi=t.z.object({prompt:$i,language:t.z.string(),custom_text:zi}),qi=t.z.enum(["phone","totp","email","push","webauthn-roaming","webauthn-platform","passkey"]),Bi=t.z.object({user_id:t.z.string(),type:qi,phone_number:t.z.string().optional(),totp_secret:t.z.string().optional(),credential_id:t.z.string().optional(),public_key:t.z.string().optional(),sign_count:t.z.number().int().nonnegative().optional(),credential_backed_up:t.z.boolean().optional(),transports:t.z.array(t.z.string()).optional(),friendly_name:t.z.string().optional(),confirmed:t.z.boolean().default(!1)});function Wi(e,i){"phone"===e.type&&!e.phone_number&&i.addIssue({code:t.z.ZodIssueCode.custom,message:"phone_number is required when type is 'phone'",path:["phone_number"]}),"totp"===e.type&&!e.totp_secret&&i.addIssue({code:t.z.ZodIssueCode.custom,message:"totp_secret is required when type is 'totp'",path:["totp_secret"]}),["webauthn-roaming","webauthn-platform","passkey"].includes(e.type)&&(e.credential_id||i.addIssue({code:t.z.ZodIssueCode.custom,message:`credential_id is required when type is '${e.type}'`,path:["credential_id"]}),e.public_key||i.addIssue({code:t.z.ZodIssueCode.custom,message:`public_key is required when type is '${e.type}'`,path:["public_key"]}))}const Ki=Bi.superRefine(Wi),Vi=t.z.object({...Bi.shape,id:t.z.string(),created_at:t.z.string(),updated_at:t.z.string()}).superRefine(Wi);e.Auth0ActionEnum=_,e.Auth0Client=Mt,e.AuthorizationResponseMode=re,e.AuthorizationResponseType=se,e.CodeChallengeMethod=oe,e.ComponentCategory=Z,e.ComponentType=M,e.EmailActionEnum=p,e.FORM_FIELD_TYPES=tt,e.FlowActionTypeEnum=h,e.GrantType=Yt,e.LocationInfo=Zt,e.LogTypes=Ut,e.LoginSessionState=Dt,e.NodeType=K,e.RedirectTargetEnum=y,e.Strategy={EMAIL:"email",SMS:"sms",USERNAME_PASSWORD:"Username-Password-Authentication",GOOGLE_OAUTH2:"google-oauth2",APPLE:"apple",FACEBOOK:"facebook",GITHUB:"github",MICROSOFT:"microsoft",VIPPS:"vipps",OIDC:"oidc",OAUTH2:"oauth2",SAMLP:"samlp",WAAD:"waad",ADFS:"adfs"},e.StrategyType={DATABASE:"database",SOCIAL:"social",PASSWORDLESS:"passwordless"},e.actionNodeSchema=Y,e.activeUsersResponseSchema=Hi,e.actorSchema=n,e.addressSchema=C,e.auditCategorySchema=i,e.auditEventInsertSchema=u,e.auditEventSchema=d,e.auth0ClientSchema=c,e.auth0FlowInsertSchema=ne,e.auth0FlowSchema=ie,e.auth0QuerySchema=w,e.auth0UpdateUserActionSchema=m,e.auth0UserResponseSchema=x,e.authParamsSchema=ae,e.authenticationMethodInsertSchema=Ki,e.authenticationMethodSchema=Vi,e.authenticationMethodTypeSchema=qi,e.baseUserSchema=N,e.blockComponentSchema=Ye,e.bordersSchema=Qt,e.brandingSchema=ce,e.buttonComponentSchema=z,e.clientGrantInsertSchema=j,e.clientGrantListSchema=U,e.clientGrantSchema=F,e.clientInsertSchema=D,e.clientSchema=L,e.codeInsertSchema=de,e.codeSchema=le,e.codeTypeSchema=ue,e.colorsSchema=ei,e.componentMessageSchema=dt,e.componentSchema=W,e.connectionInsertSchema=_e,e.connectionOptionsSchema=he,e.connectionSchema=pe,e.coordinatesSchema=P,e.createPassthroughAdapter=function(e){const{primary:t,secondaries:i,syncMethods:n=["create","update","remove","delete","set"]}=e,s={get(e,t){if("symbol"==typeof t)return e[t];const s=e[t];return"function"!=typeof s?s:n.includes(t)?async(...n)=>{const r=await s.apply(e,n),o=[];for(const e of i){const i=e.adapter[t];if("function"!=typeof i)continue;const s=(async()=>{try{await i.apply(e.adapter,n)}catch(i){try{e.onError?e.onError(i,t,n):console.error(`Passthrough adapter: secondary write failed for ${t}:`,i)}catch(e){console.error(`Passthrough adapter: onError handler threw for ${t}:`,e)}}})();e.blocking&&o.push(s)}return o.length>0&&await Promise.all(o),r}:s.bind(e)}};return new Proxy(t,s)},e.createWriteOnlyAdapter=function(e){return e},e.customDomainInsertSchema=fe,e.customDomainSchema=ge,e.customDomainWithTenantIdSchema=ye,e.customTextEntrySchema=Gi,e.customTextSchema=zi,e.dailyStatsSchema=Zi,e.emailProviderSchema=ci,e.emailVerificationRulesSchema=f,e.emailVerifyActionSchema=g,e.endingSchema=te,e.fieldComponentSchema=Qe,e.flowActionStepSchema=b,e.flowInsertSchema=E,e.flowSchema=O,e.flowsFieldComponentSchema=q,e.flowsFlowNodeSchema=X,e.flowsStepNodeSchema=V,e.fontDetailsSchema=ti,e.fontsSchema=ii,e.formControlSchema=it,e.formInsertSchema=ct,e.formNodeComponentDefinition=et,e.formNodeSchema=at,e.formSchema=ut,e.genericComponentSchema=B,e.genericNodeSchema=J,e.getConnectionIdentifierConfig=function(e){var t,i,n,s,r,o,a,c,u,d,l,h;const _=null==e?void 0:e.options;if(!_)return{usernameIdentifierActive:!1,emailIdentifierActive:!0,usernameMinLength:1,usernameMaxLength:15};const p=_.attributes;return p?{usernameIdentifierActive:!0===(null==(i=null==(t=p.username)?void 0:t.identifier)?void 0:i.active),emailIdentifierActive:!1!==(null==(s=null==(n=p.email)?void 0:n.identifier)?void 0:s.active),usernameMinLength:(null==(o=null==(r=p.username)?void 0:r.validation)?void 0:o.min_length)??1,usernameMaxLength:(null==(c=null==(a=p.username)?void 0:a.validation)?void 0:c.max_length)??15}:{usernameIdentifierActive:!0===_.requires_username,emailIdentifierActive:!0,usernameMinLength:(null==(d=null==(u=_.validation)?void 0:u.username)?void 0:d.min)??1,usernameMaxLength:(null==(h=null==(l=_.validation)?void 0:l.username)?void 0:h.max)??15}},e.hookInsertSchema=Et,e.hookSchema=St,e.hookTemplateId=mt,e.hookTemplates={"ensure-username":{name:"Ensure Username",description:"Automatically assigns a username to users who sign in without one. Creates a linked username account for social/email users.",trigger_id:"post-user-login"},"set-preferred-username":{name:"Set Preferred Username",description:"Sets the preferred_username claim on tokens based on the username from the primary or linked user.",trigger_id:"credentials-exchange"}},e.identitySchema=I,e.inviteInsertSchema=Nt,e.inviteSchema=Tt,e.inviteeSchema=Ct,e.inviterSchema=It,e.isBlockComponent=function(e){return"BLOCK"===e.category},e.isFieldComponent=function(e){return"FIELD"===e.category},e.isWidgetComponent=function(e){return"WIDGET"===e.category},e.jwksKeySchema=xt,e.jwksSchema=kt,e.legalComponentSchema=G,e.locationInfoSchema=a,e.logInsertSchema=Ht,e.logSchema=$t,e.loginSessionInsertSchema=jt,e.loginSessionSchema=Ft,e.loginSessionStateSchema=Lt,e.nodeSchema=Q,e.openIDConfigurationSchema=Rt,e.organizationBrandingSchema=Ri,e.organizationEnabledConnectionSchema=Di,e.organizationInsertSchema=ji,e.organizationSchema=Fi,e.organizationTokenQuotaSchema=Li,e.pageBackgroundSchema=ni,e.parseUserId=function(e){const[t,i]=e.split("|");if(!t||!i)throw Error("Invalid user_id: "+e);return{connection:t,id:i}},e.passwordInsertSchema=zt,e.passwordSchema=Gt,e.profileDataSchema=S,e.promptScreenSchema=$i,e.promptSettingSchema=ai,e.redirectActionSchema=v,e.refreshTokenInsertSchema=ui,e.refreshTokenSchema=di,e.requestContextSchema=r,e.resourceServerInsertSchema=fi,e.resourceServerListSchema=gi,e.resourceServerOptionsSchema=pi,e.resourceServerSchema=mi,e.resourceServerScopeSchema=_i,e.responseContextSchema=o,e.richTextComponentSchema=$,e.roleInsertSchema=Ti,e.roleListSchema=xi,e.rolePermissionInsertSchema=yi,e.rolePermissionListSchema=bi,e.rolePermissionSchema=vi,e.roleSchema=ki,e.screenLinkSchema=lt,e.sessionInsertSchema=Bt,e.sessionSchema=Wt,e.signingKeySchema=Kt,e.smsProviderSchema=hi,e.smsSendParamsSchema=li,e.startSchema=ee,e.targetSchema=s,e.tenantInsertSchema=Vt,e.tenantSchema=Xt,e.tenantSettingsSchema=Mi,e.themeInsertSchema=ri,e.themeSchema=oi,e.tokenResponseSchema=Jt,e.totalsSchema=A,e.uiScreenSchema=ht,e.userInsertSchema=T,e.userOrganizationInsertSchema=Ui,e.userOrganizationSchema=Pi,e.userPermissionInsertSchema=Ei,e.userPermissionListSchema=wi,e.userPermissionSchema=Oi,e.userPermissionWithDetailsListSchema=Si,e.userPermissionWithDetailsSchema=Ai,e.userResponseSchema=R,e.userRoleInsertSchema=Ii,e.userRoleListSchema=Ni,e.userRoleSchema=Ci,e.userSchema=k,e.verificationMethodsSchema=me,e.widgetComponentSchema=Je,e.widgetSchema=si}(t)),t),Cn=In.isBlockComponent,Nn=In.isFieldComponent,Tn=In.isWidgetComponent;export{Cn as isBlockComponent,Nn as isFieldComponent,Tn as isWidgetComponent}
|