%PDF- %PDF-
Direktori : /home/tradesc/www/relax/wp-content/plugins/elementor/assets/js/packages/schema/ |
Current File : /home/tradesc/www/relax/wp-content/plugins/elementor/assets/js/packages/schema/schema.min.js |
!function(){"use strict";var e,t,a={d:function(e,t){for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},s={};a.r(s),a.d(s,{z:function(){return vt}}),function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),s={};for(const e of a)s[e]=t[e];return e.objectValues(s)},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 a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&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.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const n=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),r=e=>{switch(typeof e){case"undefined":return n.undefined;case"string":return n.string;case"number":return isNaN(e)?n.nan:n.number;case"boolean":return n.boolean;case"function":return n.function;case"bigint":return n.bigint;case"symbol":return n.symbol;case"object":return Array.isArray(e)?n.array:null===e?n.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?n.promise:"undefined"!=typeof Map&&e instanceof Map?n.map:"undefined"!=typeof Set&&e instanceof Set?n.set:"undefined"!=typeof Date&&e instanceof Date?n.date:n.object;default:return n.unknown}},i=e.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 o extends Error{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}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},a={_errors:[]},s=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(s);else if("invalid_return_type"===n.code)s(n.returnTypeError);else if("invalid_arguments"===n.code)s(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,s=0;for(;s<n.path.length;){const a=n.path[s];s===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],s++}}};return s(this),a}static assert(e){if(!(e instanceof o))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},a=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}o.create=e=>new o(e);const d=(t,a)=>{let s;switch(t.code){case i.invalid_type:s=t.received===n.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case i.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case i.unrecognized_keys:s=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case i.invalid_union:s="Invalid input";break;case i.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case i.invalid_enum_value:s=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case i.invalid_arguments:s="Invalid function arguments";break;case i.invalid_return_type:s="Invalid function return type";break;case i.invalid_date:s="Invalid date";break;case i.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):s="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case i.too_small:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case i.too_big:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case i.custom:s="Invalid input";break;case i.invalid_intersection_types:s="Intersection results could not be merged";break;case i.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case i.not_finite:s="Number must be finite";break;default:s=a.defaultError,e.assertNever(t)}return{message:s}};let u=d;function c(){return u}const l=e=>{const{data:t,path:a,errorMaps:s,issueData:n}=e,r=[...a,...n.path||[]],i={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const d=s.filter((e=>!!e)).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function h(e,t){const a=c(),s=l({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===d?void 0:d].filter((e=>!!e))});e.common.issues.push(s)}class p{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if("aborted"===s.status)return m;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,s=await e.value;a.push({key:t,value:s})}return p.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:t,value:n}=s;if("aborted"===t.status)return m;if("aborted"===n.status)return m;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!s.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const m=Object.freeze({status:"aborted"}),f=e=>({status:"dirty",value:e}),y=e=>({status:"valid",value:e}),_=e=>"aborted"===e.status,v=e=>"dirty"===e.status,g=e=>"valid"===e.status,k=e=>"undefined"!=typeof Promise&&e instanceof Promise;function b(e,t,a,s){if("a"===a&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?s:"a"===a?s.call(e):s?s.value:t.get(e)}function x(e,t,a,s,n){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?n.call(e,a):n?n.value=a:t.set(e,a),a}var w,Z,T;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(w||(w={}));class O{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const S=(e,t)=>{if(g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new o(e.common.issues);return this._error=t,this._error}}};function C(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:s,description:n}=e;if(t&&(a||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var r,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!==(r=null!=o?o:s)&&void 0!==r?r:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!==(i=null!=o?o:a)&&void 0!==i?i:n.defaultError}},description:n}}class N{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)}get description(){return this._def.description}_getType(e){return r(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new p,ctx:{common:e.parent.common,data:e.data,parsedType:r(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(k(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){var a;const s={common:{issues:[],async:null!==(a=null==t?void 0:t.async)&&void 0!==a&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},n=this._parseSync({data:e,path:s.path,parent:s});return S(s,n)}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:r(e)},s=this._parse({data:e,path:a.path,parent:a}),n=await(k(s)?s:Promise.resolve(s));return S(a,n)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,s)=>{const n=e(t),r=()=>s.addIssue({code:i.custom,...a(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(r(),!1))):!!n||(r(),!1)}))}refinement(e,t){return this._refinement(((a,s)=>!!e(a)||(s.addIssue("function"==typeof t?t(a,s):t),!1)))}_refinement(e){return new we({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ze.create(this,this._def)}nullable(){return Te.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ne.create(this,this._def)}promise(){return xe.create(this,this._def)}or(e){return oe.create([this,e],this._def)}and(e){return le.create(this,e,this._def)}transform(e){return new we({...C(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Oe({...C(this._def),innerType:this,defaultValue:t,typeName:Ae.ZodDefault})}brand(){return new je({typeName:Ae.ZodBranded,type:this,...C(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Se({...C(this._def),innerType:this,catchValue:t,typeName:Ae.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ee.create(this,e)}readonly(){return Ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const j=/^c[^\s-]{8,}$/i,E=/^[0-9a-z]+$/,I=/^[0-9A-HJKMNP-TV-Z]{26}$/,P=/^[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,R=/^[a-z0-9_-]{21}$/i,A=/^[-+]?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)?)??$/,$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let M;const L=/^(?:(?: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])$/,D=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,V=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z="((\\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])))",U=new RegExp(`^${z}$`);function K(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function B(e){let t=`${z}T${K(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}class W extends N{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==n.string){const e=this._getOrReturnCtx(t);return h(e,{code:i.invalid_type,expected:n.string,received:e.parsedType}),m}const a=new p;let s;for(const n of this._def.checks)if("min"===n.kind)t.data.length<n.value&&(s=this._getOrReturnCtx(t,s),h(s,{code:i.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if("max"===n.kind)t.data.length>n.value&&(s=this._getOrReturnCtx(t,s),h(s,{code:i.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if("length"===n.kind){const e=t.data.length>n.value,r=t.data.length<n.value;(e||r)&&(s=this._getOrReturnCtx(t,s),e?h(s,{code:i.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):r&&h(s,{code:i.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if("email"===n.kind)$.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"email",code:i.invalid_string,message:n.message}),a.dirty());else if("emoji"===n.kind)M||(M=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),M.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"emoji",code:i.invalid_string,message:n.message}),a.dirty());else if("uuid"===n.kind)P.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"uuid",code:i.invalid_string,message:n.message}),a.dirty());else if("nanoid"===n.kind)R.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"nanoid",code:i.invalid_string,message:n.message}),a.dirty());else if("cuid"===n.kind)j.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"cuid",code:i.invalid_string,message:n.message}),a.dirty());else if("cuid2"===n.kind)E.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"cuid2",code:i.invalid_string,message:n.message}),a.dirty());else if("ulid"===n.kind)I.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"ulid",code:i.invalid_string,message:n.message}),a.dirty());else if("url"===n.kind)try{new URL(t.data)}catch(e){s=this._getOrReturnCtx(t,s),h(s,{validation:"url",code:i.invalid_string,message:n.message}),a.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"regex",code:i.invalid_string,message:n.message}),a.dirty())):"trim"===n.kind?t.data=t.data.trim():"includes"===n.kind?t.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(t,s),h(s,{code:i.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):"toLowerCase"===n.kind?t.data=t.data.toLowerCase():"toUpperCase"===n.kind?t.data=t.data.toUpperCase():"startsWith"===n.kind?t.data.startsWith(n.value)||(s=this._getOrReturnCtx(t,s),h(s,{code:i.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):"endsWith"===n.kind?t.data.endsWith(n.value)||(s=this._getOrReturnCtx(t,s),h(s,{code:i.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):"datetime"===n.kind?B(n).test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{code:i.invalid_string,validation:"datetime",message:n.message}),a.dirty()):"date"===n.kind?U.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{code:i.invalid_string,validation:"date",message:n.message}),a.dirty()):"time"===n.kind?new RegExp(`^${K(n)}$`).test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{code:i.invalid_string,validation:"time",message:n.message}),a.dirty()):"duration"===n.kind?A.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"duration",code:i.invalid_string,message:n.message}),a.dirty()):"ip"===n.kind?(r=t.data,("v4"!==(o=n.version)&&o||!L.test(r))&&("v6"!==o&&o||!D.test(r))&&(s=this._getOrReturnCtx(t,s),h(s,{validation:"ip",code:i.invalid_string,message:n.message}),a.dirty())):"base64"===n.kind?V.test(t.data)||(s=this._getOrReturnCtx(t,s),h(s,{validation:"base64",code:i.invalid_string,message:n.message}),a.dirty()):e.assertNever(n);var r,o;return{status:a.value,value:t.data}}_regex(e,t,a){return this.refinement((t=>e.test(t)),{validation:t,code:i.invalid_string,...w.errToObj(a)})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...w.errToObj(e)})}url(e){return this._addCheck({kind:"url",...w.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...w.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...w.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...w.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...w.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...w.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...w.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...w.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...w.errToObj(e)})}datetime(e){var t,a;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(a=null==e?void 0:e.local)&&void 0!==a&&a,...w.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...w.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...w.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...w.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...w.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...w.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...w.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...w.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...w.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...w.errToObj(t)})}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new W({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new W({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new W({...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 isBase64(){return!!this._def.checks.find((e=>"base64"===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 F(e,t){const a=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=a>s?a:s;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}W.create=e=>{var t;return new W({checks:[],typeName:Ae.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...C(e)})};class q extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==n.number){const e=this._getOrReturnCtx(t);return h(e,{code:i.invalid_type,expected:n.number,received:e.parsedType}),m}let a;const s=new p;for(const n of this._def.checks)"int"===n.kind?e.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),h(a,{code:i.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):"min"===n.kind?(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),h(a,{code:i.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):"max"===n.kind?(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),h(a,{code:i.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):"multipleOf"===n.kind?0!==F(t.data,n.value)&&(a=this._getOrReturnCtx(t,a),h(a,{code:i.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):"finite"===n.kind?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),h(a,{code:i.not_finite,message:n.message}),s.dirty()):e.assertNever(n);return{status:s.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,a,s){return new q({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:w.toString(s)}]})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.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((t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}q.create=e=>new q({checks:[],typeName:Ae.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...C(e)});class J extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==n.bigint){const e=this._getOrReturnCtx(t);return h(e,{code:i.invalid_type,expected:n.bigint,received:e.parsedType}),m}let a;const s=new p;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?t.data<n.value:t.data<=n.value)&&(a=this._getOrReturnCtx(t,a),h(a,{code:i.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):"max"===n.kind?(n.inclusive?t.data>n.value:t.data>=n.value)&&(a=this._getOrReturnCtx(t,a),h(a,{code:i.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):"multipleOf"===n.kind?t.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),h(a,{code:i.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):e.assertNever(n);return{status:s.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,a,s){return new J({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:w.toString(s)}]})}_addCheck(e){return new J({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.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}}J.create=e=>{var t;return new J({checks:[],typeName:Ae.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...C(e)})};class Y extends N{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==n.boolean){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.boolean,received:t.parsedType}),m}return y(e.data)}}Y.create=e=>new Y({typeName:Ae.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...C(e)});class H extends N{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==n.date){const e=this._getOrReturnCtx(t);return h(e,{code:i.invalid_type,expected:n.date,received:e.parsedType}),m}if(isNaN(t.data.getTime()))return h(this._getOrReturnCtx(t),{code:i.invalid_date}),m;const a=new p;let s;for(const n of this._def.checks)"min"===n.kind?t.data.getTime()<n.value&&(s=this._getOrReturnCtx(t,s),h(s,{code:i.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):"max"===n.kind?t.data.getTime()>n.value&&(s=this._getOrReturnCtx(t,s),h(s,{code:i.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):e.assertNever(n);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(e){return new H({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:w.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}}H.create=e=>new H({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ae.ZodDate,...C(e)});class G extends N{_parse(e){if(this._getType(e)!==n.symbol){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.symbol,received:t.parsedType}),m}return y(e.data)}}G.create=e=>new G({typeName:Ae.ZodSymbol,...C(e)});class X extends N{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.undefined,received:t.parsedType}),m}return y(e.data)}}X.create=e=>new X({typeName:Ae.ZodUndefined,...C(e)});class Q extends N{_parse(e){if(this._getType(e)!==n.null){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.null,received:t.parsedType}),m}return y(e.data)}}Q.create=e=>new Q({typeName:Ae.ZodNull,...C(e)});class ee extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return y(e.data)}}ee.create=e=>new ee({typeName:Ae.ZodAny,...C(e)});class te extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return y(e.data)}}te.create=e=>new te({typeName:Ae.ZodUnknown,...C(e)});class ae extends N{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.never,received:t.parsedType}),m}}ae.create=e=>new ae({typeName:Ae.ZodNever,...C(e)});class se extends N{_parse(e){if(this._getType(e)!==n.undefined){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.void,received:t.parsedType}),m}return y(e.data)}}se.create=e=>new se({typeName:Ae.ZodVoid,...C(e)});class ne extends N{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),s=this._def;if(t.parsedType!==n.array)return h(t,{code:i.invalid_type,expected:n.array,received:t.parsedType}),m;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,n=t.data.length<s.exactLength.value;(e||n)&&(h(t,{code:e?i.too_big:i.too_small,minimum:n?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(h(t,{code:i.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(h(t,{code:i.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map(((e,a)=>s.type._parseAsync(new O(t,e,t.path,a))))).then((e=>p.mergeArray(a,e)));const r=[...t.data].map(((e,a)=>s.type._parseSync(new O(t,e,t.path,a))));return p.mergeArray(a,r)}get element(){return this._def.type}min(e,t){return new ne({...this._def,minLength:{value:e,message:w.toString(t)}})}max(e,t){return new ne({...this._def,maxLength:{value:e,message:w.toString(t)}})}length(e,t){return new ne({...this._def,exactLength:{value:e,message:w.toString(t)}})}nonempty(e){return this.min(1,e)}}function re(e){if(e instanceof ie){const t={};for(const a in e.shape){const s=e.shape[a];t[a]=Ze.create(re(s))}return new ie({...e._def,shape:()=>t})}return e instanceof ne?new ne({...e._def,type:re(e.element)}):e instanceof Ze?Ze.create(re(e.unwrap())):e instanceof Te?Te.create(re(e.unwrap())):e instanceof he?he.create(e.items.map((e=>re(e)))):e}ne.create=(e,t)=>new ne({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...C(t)});class ie extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),a=e.objectKeys(t);return this._cached={shape:t,keys:a}}_parse(e){if(this._getType(e)!==n.object){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.object,received:t.parsedType}),m}const{status:t,ctx:a}=this._processInputParams(e),{shape:s,keys:r}=this._getCached(),o=[];if(!(this._def.catchall instanceof ae&&"strip"===this._def.unknownKeys))for(const e in a.data)r.includes(e)||o.push(e);const d=[];for(const e of r){const t=s[e],n=a.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new O(a,n,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof ae){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)d.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)o.length>0&&(h(a,{code:i.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const s=a.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new O(a,s,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const a=await t.key,s=await t.value;e.push({key:a,value:s,alwaysSet:t.alwaysSet})}return e})).then((e=>p.mergeObjectSync(t,e))):p.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return w.errToObj,new ie({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{var s,n,r,i;const o=null!==(r=null===(n=(s=this._def).errorMap)||void 0===n?void 0:n.call(s,t,a).message)&&void 0!==r?r:a.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=w.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ie({...this._def,unknownKeys:"strip"})}passthrough(){return new ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ae.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ie({...this._def,catchall:e})}pick(t){const a={};return e.objectKeys(t).forEach((e=>{t[e]&&this.shape[e]&&(a[e]=this.shape[e])})),new ie({...this._def,shape:()=>a})}omit(t){const a={};return e.objectKeys(this.shape).forEach((e=>{t[e]||(a[e]=this.shape[e])})),new ie({...this._def,shape:()=>a})}deepPartial(){return re(this)}partial(t){const a={};return e.objectKeys(this.shape).forEach((e=>{const s=this.shape[e];t&&!t[e]?a[e]=s:a[e]=s.optional()})),new ie({...this._def,shape:()=>a})}required(t){const a={};return e.objectKeys(this.shape).forEach((e=>{if(t&&!t[e])a[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ze;)t=t._def.innerType;a[e]=t}})),new ie({...this._def,shape:()=>a})}keyof(){return ge(e.objectKeys(this.shape))}}ie.create=(e,t)=>new ie({shape:()=>e,unknownKeys:"strip",catchall:ae.create(),typeName:Ae.ZodObject,...C(t)}),ie.strictCreate=(e,t)=>new ie({shape:()=>e,unknownKeys:"strict",catchall:ae.create(),typeName:Ae.ZodObject,...C(t)}),ie.lazycreate=(e,t)=>new ie({shape:e,unknownKeys:"strip",catchall:ae.create(),typeName:Ae.ZodObject,...C(t)});class oe extends N{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map((async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map((e=>new o(e.ctx.common.issues)));return h(t,{code:i.invalid_union,unionErrors:a}),m}));{let e;const s=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:a}),a.common.issues.length&&s.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=s.map((e=>new o(e)));return h(t,{code:i.invalid_union,unionErrors:n}),m}}get options(){return this._def.options}}oe.create=(e,t)=>new oe({options:e,typeName:Ae.ZodUnion,...C(t)});const de=t=>t instanceof _e?de(t.schema):t instanceof we?de(t.innerType()):t instanceof ve?[t.value]:t instanceof ke?t.options:t instanceof be?e.objectValues(t.enum):t instanceof Oe?de(t._def.innerType):t instanceof X?[void 0]:t instanceof Q?[null]:t instanceof Ze?[void 0,...de(t.unwrap())]:t instanceof Te?[null,...de(t.unwrap())]:t instanceof je||t instanceof Ie?de(t.unwrap()):t instanceof Se?de(t._def.innerType):[];class ue extends N{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.object)return h(t,{code:i.invalid_type,expected:n.object,received:t.parsedType}),m;const a=this.discriminator,s=t.data[a],r=this.optionsMap.get(s);return r?t.common.async?r._parseAsync({data:t.data,path:t.path,parent:t}):r._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:i.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const a of t){const t=de(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(s.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);s.set(n,a)}}return new ue({typeName:Ae.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...C(a)})}}function ce(t,a){const s=r(t),i=r(a);if(t===a)return{valid:!0,data:t};if(s===n.object&&i===n.object){const s=e.objectKeys(a),n=e.objectKeys(t).filter((e=>-1!==s.indexOf(e))),r={...t,...a};for(const e of n){const s=ce(t[e],a[e]);if(!s.valid)return{valid:!1};r[e]=s.data}return{valid:!0,data:r}}if(s===n.array&&i===n.array){if(t.length!==a.length)return{valid:!1};const e=[];for(let s=0;s<t.length;s++){const n=ce(t[s],a[s]);if(!n.valid)return{valid:!1};e.push(n.data)}return{valid:!0,data:e}}return s===n.date&&i===n.date&&+t==+a?{valid:!0,data:t}:{valid:!1}}class le extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(e,s)=>{if(_(e)||_(s))return m;const n=ce(e.value,s.value);return n.valid?((v(e)||v(s))&&t.dirty(),{status:t.value,value:n.data}):(h(a,{code:i.invalid_intersection_types}),m)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then((([e,t])=>s(e,t))):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}le.create=(e,t,a)=>new le({left:e,right:t,typeName:Ae.ZodIntersection,...C(a)});class he extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.array)return h(a,{code:i.invalid_type,expected:n.array,received:a.parsedType}),m;if(a.data.length<this._def.items.length)return h(a,{code:i.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:i.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...a.data].map(((e,t)=>{const s=this._def.items[t]||this._def.rest;return s?s._parse(new O(a,e,a.path,t)):null})).filter((e=>!!e));return a.common.async?Promise.all(s).then((e=>p.mergeArray(t,e))):p.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new he({...this._def,rest:e})}}he.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new he({items:e,typeName:Ae.ZodTuple,rest:null,...C(t)})};class pe extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.object)return h(a,{code:i.invalid_type,expected:n.object,received:a.parsedType}),m;const s=[],r=this._def.keyType,o=this._def.valueType;for(const e in a.data)s.push({key:r._parse(new O(a,e,a.path,e)),value:o._parse(new O(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?p.mergeObjectAsync(t,s):p.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,a){return new pe(t instanceof N?{keyType:e,valueType:t,typeName:Ae.ZodRecord,...C(a)}:{keyType:W.create(),valueType:e,typeName:Ae.ZodRecord,...C(t)})}}class me extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.map)return h(a,{code:i.invalid_type,expected:n.map,received:a.parsedType}),m;const s=this._def.keyType,r=this._def.valueType,o=[...a.data.entries()].map((([e,t],n)=>({key:s._parse(new O(a,e,a.path,[n,"key"])),value:r._parse(new O(a,t,a.path,[n,"value"]))})));if(a.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const a of o){const s=await a.key,n=await a.value;if("aborted"===s.status||"aborted"===n.status)return m;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const a of o){const s=a.key,n=a.value;if("aborted"===s.status||"aborted"===n.status)return m;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}}}me.create=(e,t,a)=>new me({valueType:t,keyType:e,typeName:Ae.ZodMap,...C(a)});class fe extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==n.set)return h(a,{code:i.invalid_type,expected:n.set,received:a.parsedType}),m;const s=this._def;null!==s.minSize&&a.data.size<s.minSize.value&&(h(a,{code:i.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&a.data.size>s.maxSize.value&&(h(a,{code:i.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const r=this._def.valueType;function o(e){const a=new Set;for(const s of e){if("aborted"===s.status)return m;"dirty"===s.status&&t.dirty(),a.add(s.value)}return{status:t.value,value:a}}const d=[...a.data.values()].map(((e,t)=>r._parse(new O(a,e,a.path,t))));return a.common.async?Promise.all(d).then((e=>o(e))):o(d)}min(e,t){return new fe({...this._def,minSize:{value:e,message:w.toString(t)}})}max(e,t){return new fe({...this._def,maxSize:{value:e,message:w.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}fe.create=(e,t)=>new fe({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...C(t)});class ye extends N{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.function)return h(t,{code:i.invalid_type,expected:n.function,received:t.parsedType}),m;function a(e,a){return l({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),d].filter((e=>!!e)),issueData:{code:i.invalid_arguments,argumentsError:a}})}function s(e,a){return l({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,c(),d].filter((e=>!!e)),issueData:{code:i.invalid_return_type,returnTypeError:a}})}const r={errorMap:t.common.contextualErrorMap},u=t.data;if(this._def.returns instanceof xe){const e=this;return y((async function(...t){const n=new o([]),i=await e._def.args.parseAsync(t,r).catch((e=>{throw n.addIssue(a(t,e)),n})),d=await Reflect.apply(u,this,i);return await e._def.returns._def.type.parseAsync(d,r).catch((e=>{throw n.addIssue(s(d,e)),n}))}))}{const e=this;return y((function(...t){const n=e._def.args.safeParse(t,r);if(!n.success)throw new o([a(t,n.error)]);const i=Reflect.apply(u,this,n.data),d=e._def.returns.safeParse(i,r);if(!d.success)throw new o([s(i,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ye({...this._def,args:he.create(e).rest(te.create())})}returns(e){return new ye({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ye({args:e||he.create([]).rest(te.create()),returns:t||te.create(),typeName:Ae.ZodFunction,...C(a)})}}class _e extends N{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})}}_e.create=(e,t)=>new _e({getter:e,typeName:Ae.ZodLazy,...C(t)});class ve extends N{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:i.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}function ge(e,t){return new ke({values:e,typeName:Ae.ZodEnum,...C(t)})}ve.create=(e,t)=>new ve({value:e,typeName:Ae.ZodLiteral,...C(t)});class ke extends N{constructor(){super(...arguments),Z.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const a=this._getOrReturnCtx(t),s=this._def.values;return h(a,{expected:e.joinValues(s),received:a.parsedType,code:i.invalid_type}),m}if(b(this,Z,"f")||x(this,Z,new Set(this._def.values),"f"),!b(this,Z,"f").has(t.data)){const e=this._getOrReturnCtx(t),a=this._def.values;return h(e,{received:e.data,code:i.invalid_enum_value,options:a}),m}return y(t.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 ke.create(e,{...this._def,...t})}exclude(e,t=this._def){return ke.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}Z=new WeakMap,ke.create=ge;class be extends N{constructor(){super(...arguments),T.set(this,void 0)}_parse(t){const a=e.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==n.string&&s.parsedType!==n.number){const t=e.objectValues(a);return h(s,{expected:e.joinValues(t),received:s.parsedType,code:i.invalid_type}),m}if(b(this,T,"f")||x(this,T,new Set(e.getValidEnumValues(this._def.values)),"f"),!b(this,T,"f").has(t.data)){const t=e.objectValues(a);return h(s,{received:s.data,code:i.invalid_enum_value,options:t}),m}return y(t.data)}get enum(){return this._def.values}}T=new WeakMap,be.create=(e,t)=>new be({values:e,typeName:Ae.ZodNativeEnum,...C(t)});class xe extends N{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==n.promise&&!1===t.common.async)return h(t,{code:i.invalid_type,expected:n.promise,received:t.parsedType}),m;const a=t.parsedType===n.promise?t.data:Promise.resolve(t.data);return y(a.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}xe.create=(e,t)=>new xe({type:e,typeName:Ae.ZodPromise,...C(t)});class we extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:a,ctx:s}=this._processInputParams(t),n=this._def.effect||null,r={addIssue:e=>{h(s,e),e.fatal?a.abort():a.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===n.type){const e=n.transform(s.data,r);if(s.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===a.value)return m;const t=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===t.status?m:"dirty"===t.status||"dirty"===a.value?f(t.value):t}));{if("aborted"===a.value)return m;const t=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===t.status?m:"dirty"===t.status||"dirty"===a.value?f(t.value):t}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,r);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const t=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===t.status?m:("dirty"===t.status&&a.dirty(),e(t.value),{status:a.value,value:t.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((t=>"aborted"===t.status?m:("dirty"===t.status&&a.dirty(),e(t.value).then((()=>({status:a.value,value:t.value}))))))}if("transform"===n.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!g(e))return e;const t=n.transform(e.value,r);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:t}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>g(e)?Promise.resolve(n.transform(e.value,r)).then((e=>({status:a.value,value:e}))):e))}e.assertNever(n)}}we.create=(e,t,a)=>new we({schema:e,typeName:Ae.ZodEffects,effect:t,...C(a)}),we.createWithPreprocess=(e,t,a)=>new we({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...C(a)});class Ze extends N{_parse(e){return this._getType(e)===n.undefined?y(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:Ae.ZodOptional,...C(t)});class Te extends N{_parse(e){return this._getType(e)===n.null?y(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Te.create=(e,t)=>new Te({innerType:e,typeName:Ae.ZodNullable,...C(t)});class Oe extends N{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===n.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:Ae.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...C(t)});class Se extends N{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return k(s)?s.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new o(a.common.issues)},input:a.data})}))):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new o(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Se.create=(e,t)=>new Se({innerType:e,typeName:Ae.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...C(t)});class Ce extends N{_parse(e){if(this._getType(e)!==n.nan){const t=this._getOrReturnCtx(e);return h(t,{code:i.invalid_type,expected:n.nan,received:t.parsedType}),m}return{status:"valid",value:e.data}}}Ce.create=e=>new Ce({typeName:Ae.ZodNaN,...C(e)});const Ne=Symbol("zod_brand");class je extends N{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ee extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),f(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})();{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?m:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new Ee({in:e,out:t,typeName:Ae.ZodPipeline})}}class Ie extends N{_parse(e){const t=this._def.innerType._parse(e),a=e=>(g(e)&&(e.value=Object.freeze(e.value)),e);return k(t)?t.then((e=>a(e))):a(t)}unwrap(){return this._def.innerType}}function Pe(e,t={},a){return e?ee.create().superRefine(((s,n)=>{var r,i;if(!e(s)){const e="function"==typeof t?t(s):"string"==typeof t?{message:t}:t,o=null===(i=null!==(r=e.fatal)&&void 0!==r?r:a)||void 0===i||i,d="string"==typeof e?{message:e}:e;n.addIssue({code:"custom",...d,fatal:o})}})):ee.create()}Ie.create=(e,t)=>new Ie({innerType:e,typeName:Ae.ZodReadonly,...C(t)});const Re={object:ie.lazycreate};var Ae;!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"}(Ae||(Ae={}));const $e=W.create,Me=q.create,Le=Ce.create,De=J.create,Ve=Y.create,ze=H.create,Ue=G.create,Ke=X.create,Be=Q.create,We=ee.create,Fe=te.create,qe=ae.create,Je=se.create,Ye=ne.create,He=ie.create,Ge=ie.strictCreate,Xe=oe.create,Qe=ue.create,et=le.create,tt=he.create,at=pe.create,st=me.create,nt=fe.create,rt=ye.create,it=_e.create,ot=ve.create,dt=ke.create,ut=be.create,ct=xe.create,lt=we.create,ht=Ze.create,pt=Te.create,mt=we.createWithPreprocess,ft=Ee.create,yt={string:e=>W.create({...e,coerce:!0}),number:e=>q.create({...e,coerce:!0}),boolean:e=>Y.create({...e,coerce:!0}),bigint:e=>J.create({...e,coerce:!0}),date:e=>H.create({...e,coerce:!0})},_t=m;var vt=Object.freeze({__proto__:null,defaultErrorMap:d,setErrorMap:function(e){u=e},getErrorMap:c,makeIssue:l,EMPTY_PATH:[],addIssueToContext:h,ParseStatus:p,INVALID:m,DIRTY:f,OK:y,isAborted:_,isDirty:v,isValid:g,isAsync:k,get util(){return e},get objectUtil(){return t},ZodParsedType:n,getParsedType:r,ZodType:N,datetimeRegex:B,ZodString:W,ZodNumber:q,ZodBigInt:J,ZodBoolean:Y,ZodDate:H,ZodSymbol:G,ZodUndefined:X,ZodNull:Q,ZodAny:ee,ZodUnknown:te,ZodNever:ae,ZodVoid:se,ZodArray:ne,ZodObject:ie,ZodUnion:oe,ZodDiscriminatedUnion:ue,ZodIntersection:le,ZodTuple:he,ZodRecord:pe,ZodMap:me,ZodSet:fe,ZodFunction:ye,ZodLazy:_e,ZodLiteral:ve,ZodEnum:ke,ZodNativeEnum:be,ZodPromise:xe,ZodEffects:we,ZodTransformer:we,ZodOptional:Ze,ZodNullable:Te,ZodDefault:Oe,ZodCatch:Se,ZodNaN:Ce,BRAND:Ne,ZodBranded:je,ZodPipeline:Ee,ZodReadonly:Ie,custom:Pe,Schema:N,ZodSchema:N,late:Re,get ZodFirstPartyTypeKind(){return Ae},coerce:yt,any:We,array:Ye,bigint:De,boolean:Ve,date:ze,discriminatedUnion:Qe,effect:lt,enum:dt,function:rt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Pe((t=>t instanceof e),t),intersection:et,lazy:it,literal:ot,map:st,nan:Le,nativeEnum:ut,never:qe,null:Be,nullable:pt,number:Me,object:He,oboolean:()=>Ve().optional(),onumber:()=>Me().optional(),optional:ht,ostring:()=>$e().optional(),pipeline:ft,preprocess:mt,promise:ct,record:at,set:nt,strictObject:Ge,string:$e,symbol:Ue,transformer:lt,tuple:tt,undefined:Ke,union:Xe,unknown:Fe,void:Je,NEVER:_t,ZodIssueCode:i,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:o});(window.elementorV2=window.elementorV2||{}).schema=s}();