@walkeros/web-destination-meta 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var t=Object.defineProperty,e=(e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})};import{getEnv as n}from"@walkeros/web-core";var a={merge:!0,shallow:!0,extend:!0};function o(t){return"object"==typeof t&&null!==t&&!function(t){return Array.isArray(t)}(t)&&"[object Object]"===Object.prototype.toString.call(t)}function i(t={}){var e;const n=t.timestamp||(new Date).setHours(0,13,37,0),o=t.group||"gr0up",i=t.count||1,r=function(t,e={},n={}){n={...a,...n};const o=Object.entries(e).reduce((e,[a,o])=>{const i=t[a];return n.merge&&Array.isArray(i)&&Array.isArray(o)?e[a]=o.reduce((t,e)=>t.includes(e)?t:[...t,e],[...i]):(n.extend||a in t)&&(e[a]=o),e},{});return n.shallow?{...t,...o}:(Object.assign(t,o),t)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],not:void 0},context:{dev:["test",1]},globals:{lang:"elb"},custom:{completely:"random"},user:{id:"us3r",device:"c00k13",session:"s3ss10n"},nested:[{entity:"child",data:{is:"subordinated"},nested:[],context:{element:["child",0]}}],consent:{functional:!0},id:`${n}-${o}-${i}`,trigger:"test",entity:"entity",action:"action",timestamp:n,timing:3.14,group:o,count:i,version:{source:"0.2.0",tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},t,{merge:!1});if(t.name){const[n,a]=null!=(e=t.name.split(" "))?e:[];n&&a&&(r.entity=n,r.action=a)}return r}function r(t="entity action",e={}){const n=e.timestamp||(new Date).setHours(0,13,37,0),a={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},o={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return i({...{"cart view":{data:{currency:"EUR",value:2*a.data.price},context:{shopping:["cart",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",data:{...a.data,quantity:2},context:{shopping:["cart",0]},nested:[]}],trigger:"load"},"checkout view":{data:{step:"payment",currency:"EUR",value:a.data.price+o.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...a,context:{shopping:["checkout",0]},nested:[]},{entity:"product",...o,context:{shopping:["checkout",0]},nested:[]}],trigger:"load"},"order complete":{data:{id:"0rd3r1d",currency:"EUR",shipping:5.22,taxes:73.76,total:555},context:{shopping:["complete",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...a,context:{shopping:["complete",0]},nested:[]},{entity:"product",...o,context:{shopping:["complete",0]},nested:[]},{entity:"gift",data:{name:"Surprise"},context:{shopping:["complete",0]},nested:[]}],trigger:"load"},"page view":{data:{domain:"www.example.com",title:"walkerOS documentation",referrer:"https://www.elbwalker.com/",search:"?foo=bar",hash:"#hash",id:"/docs/"},globals:{pagegroup:"docs"},trigger:"load"},"product add":{...a,context:{shopping:["intent",0]},globals:{pagegroup:"shop"},nested:[],trigger:"click"},"product view":{...a,context:{shopping:["detail",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"product visible":{data:{...a.data,position:3,promo:!0},context:{shopping:["discover",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"promotion visible":{data:{name:"Setting up tracking easily",position:"hero"},context:{ab_test:["engagement",0]},globals:{pagegroup:"homepage"},trigger:"visible"},"session start":{data:{id:"s3ss10n",start:n,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,referrer:"",device:"c00k13"},user:{id:"us3r",device:"c00k13",session:"s3ss10n",hash:"h4sh",address:"street number",email:"user@example.com",phone:"+49 123 456 789",userAgent:"Mozilla...",browser:"Chrome",browserVersion:"90",deviceType:"desktop",language:"de-DE",country:"DE",region:"HH",city:"Hamburg",zip:"20354",timezone:"Berlin",os:"walkerOS",osVersion:"1.0",screenSize:"1337x420",ip:"127.0.0.0",internal:!0,custom:"value"}}}[t],...e,name:t})}import{getEnv as c}from"@walkeros/web-core";var s={},d={};e(d,{env:()=>u,events:()=>m,mapping:()=>f});var u={};e(u,{init:()=>l,push:()=>g});var p=()=>{},l={window:{fbq:void 0,_fbq:void 0},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},g={window:{fbq:Object.assign(p,{callMethod:p,queue:[],push:p,loaded:!0,version:"2.0"}),_fbq:Object.assign(p,{callMethod:p,queue:[],push:p,loaded:!0,version:"2.0"})},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},m={};function y(){const t=r("order complete");return["track","Purchase",{value:t.data.total,currency:"EUR",contents:t.nested.filter(t=>"product"===t.entity).map(t=>({id:t.data.id,quantity:1})),content_type:"product",num_items:2},{eventID:t.id}]}function h(){const t=r("product add");return["track","AddToCart",{currency:"EUR",value:t.data.price,contents:[{id:t.data.id,quantity:1}],content_type:"product"},{eventID:t.id}]}function v(){const t=r("cart view");return["track","InitiateCheckout",{currency:"EUR",value:t.data.value,contents:t.nested.filter(t=>"product"===t.entity).map(t=>({id:t.data.id,quantity:t.data.quantity})),num_items:t.nested.filter(t=>"product"===t.entity).length},{eventID:t.id}]}function b(){const t=r("product view");return["track","ViewContent",{currency:"EUR",value:t.data.price,contents:[{id:t.data.id,quantity:1}],content_type:"product"},{eventID:t.id}]}e(m,{AddToCart:()=>h,InitiateCheckout:()=>v,Purchase:()=>y,ViewContent:()=>b});var f={};e(f,{AddToCart:()=>k,InitiateCheckout:()=>q,Purchase:()=>w,ViewContent:()=>x,config:()=>C});var w={name:"Purchase",data:{map:{value:"data.total",currency:{value:"EUR"},contents:{loop:["nested",{condition:t=>o(t)&&"product"===t.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"},num_items:{fn:t=>t.nested.filter(t=>"product"===t.entity).length}}}},k={name:"AddToCart",data:{map:{value:"data.price",currency:{value:"EUR"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"}}}},q={name:"InitiateCheckout",data:{map:{value:"data.value",currency:{value:"EUR"},contents:{loop:["nested",{condition:t=>o(t)&&"product"===t.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},num_items:{fn:t=>t.nested.filter(t=>"product"===t.entity).length}}}},x={name:"ViewContent",data:{map:{value:"data.price",currency:{value:"EUR"},content_type:{value:"product"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]}}}},C={order:{complete:w},product:{view:x,add:k},cart:{view:q}},E={type:"meta-pixel",config:{},init({config:t,env:e}){const{settings:a={},loadScript:o}=t,{pixelId:i}=a;if(o&&function(t,e="https://connect.facebook.net/en_US/fbevents.js"){const{document:a}=n(t),o=a.createElement("script");o.src=e,o.async=!0,a.head.appendChild(o)}(e),!i)return!1;!function(t){const{window:e}=n(t),a=e;if(a.fbq)return;const o=function(...t){o.callMethod?o.callMethod.apply(o,t):o.queue.push(t)};a.fbq=o,a._fbq||(a._fbq=o),o.push=o,o.loaded=!0,o.version="2.0",o.queue=[]}(e);const{window:r}=c(e);return(0,r.fbq)("init",i),t},push(t,{config:e,mapping:n={},data:a,env:i}){const{track:r,trackCustom:s}=n.settings||{},{window:d}=c(i),u=d.fbq;"page view"!==t.name||n.settings||(t.name="PageView");const p=r||s||t.name;u(s?"trackCustom":"track",String(p),o(a)?a:{},{eventID:t.id})}},_=E;export{s as DestinationMeta,_ as default,E as destinationMeta,d as examples};//# sourceMappingURL=index.mjs.map
1
+ var e=Object.defineProperty,t=(t,a)=>{for(var n in a)e(t,n,{get:a[n],enumerable:!0})};import{getEnv as a}from"@walkeros/web-core";var n,r,s,i={};t(i,{BRAND:()=>ze,DIRTY:()=>w,EMPTY_PATH:()=>y,INVALID:()=>x,NEVER:()=>Et,OK:()=>Z,ParseStatus:()=>k,Schema:()=>I,ZodAny:()=>le,ZodArray:()=>fe,ZodBigInt:()=>se,ZodBoolean:()=>ie,ZodBranded:()=>De,ZodCatch:()=>Le,ZodDate:()=>oe,ZodDefault:()=>Re,ZodDiscriminatedUnion:()=>be,ZodEffects:()=>Ee,ZodEnum:()=>je,ZodError:()=>l,ZodFirstPartyTypeKind:()=>Ke,ZodFunction:()=>Pe,ZodIntersection:()=>xe,ZodIssueCode:()=>c,ZodLazy:()=>Te,ZodLiteral:()=>Oe,ZodMap:()=>Ae,ZodNaN:()=>Fe,ZodNativeEnum:()=>Ne,ZodNever:()=>me,ZodNull:()=>ue,ZodNullable:()=>$e,ZodNumber:()=>re,ZodObject:()=>ye,ZodOptional:()=>Me,ZodParsedType:()=>o,ZodPipeline:()=>Ue,ZodPromise:()=>Ie,ZodReadonly:()=>Ve,ZodRecord:()=>Ze,ZodSchema:()=>I,ZodSet:()=>Se,ZodString:()=>ae,ZodSymbol:()=>de,ZodTransformer:()=>Ee,ZodTuple:()=>we,ZodType:()=>I,ZodUndefined:()=>ce,ZodUnion:()=>ve,ZodUnknown:()=>pe,ZodVoid:()=>he,addIssueToContext:()=>v,any:()=>st,array:()=>ct,bigint:()=>Xe,boolean:()=>et,coerce:()=>It,custom:()=>Be,date:()=>tt,datetimeRegex:()=>Q,defaultErrorMap:()=>p,discriminatedUnion:()=>mt,effect:()=>At,enum:()=>xt,function:()=>_t,getErrorMap:()=>f,getParsedType:()=>d,instanceof:()=>Je,intersection:()=>ht,isAborted:()=>A,isAsync:()=>T,isDirty:()=>S,isValid:()=>P,late:()=>He,lazy:()=>bt,literal:()=>kt,makeIssue:()=>g,map:()=>yt,nan:()=>Qe,nativeEnum:()=>wt,never:()=>ot,null:()=>rt,nullable:()=>Pt,number:()=>Ge,object:()=>ut,objectUtil:()=>s,oboolean:()=>Nt,onumber:()=>jt,optional:()=>St,ostring:()=>Ct,pipeline:()=>Ot,preprocess:()=>Tt,promise:()=>Zt,quotelessJson:()=>u,record:()=>gt,set:()=>vt,setErrorMap:()=>h,strictObject:()=>lt,string:()=>Ye,symbol:()=>at,transformer:()=>At,tuple:()=>ft,undefined:()=>nt,union:()=>pt,unknown:()=>it,util:()=>n,void:()=>dt}),(r=n||(n={})).assertEqual=e=>{},r.assertIs=function(e){},r.assertNever=function(e){throw new Error},r.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},r.getValidEnumValues=e=>{const t=r.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),a={};for(const n of t)a[n]=e[n];return r.objectValues(a)},r.objectValues=e=>r.objectKeys(e).map(function(t){return e[t]}),r.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},r.find=(e,t)=>{for(const a of e)if(t(a))return a},r.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,r.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},r.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(s||(s={})).mergeShapes=(e,t)=>({...e,...t});var o=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),d=e=>{switch(typeof e){case"undefined":return o.undefined;case"string":return o.string;case"number":return Number.isNaN(e)?o.nan:o.number;case"boolean":return o.boolean;case"function":return o.function;case"bigint":return o.bigint;case"symbol":return o.symbol;case"object":return Array.isArray(e)?o.array:null===e?o.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?o.promise:"undefined"!=typeof Map&&e instanceof Map?o.map:"undefined"!=typeof Set&&e instanceof Set?o.set:"undefined"!=typeof Date&&e instanceof Date?o.date:o.object;default:return o.unknown}},c=n.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"]),u=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),l=class e 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},a={_errors:[]},n=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(n);else if("invalid_return_type"===r.code)n(r.returnTypeError);else if("invalid_arguments"===r.code)n(r.argumentsError);else if(0===r.path.length)a._errors.push(t(r));else{let e=a,n=0;for(;n<r.path.length;){const a=r.path[n];n===r.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(r))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(this),a}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,n.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const n of this.issues)if(n.path.length>0){const a=n.path[0];t[a]=t[a]||[],t[a].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}};l.create=e=>new l(e);var p=(e,t)=>{let a;switch(e.code){case c.invalid_type:a=e.received===o.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,n.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:a=`Unrecognized key(s) in object: ${n.joinValues(e.keys,", ")}`;break;case c.invalid_union:a="Invalid input";break;case c.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${n.joinValues(e.options)}`;break;case c.invalid_enum_value:a=`Invalid enum value. Expected ${n.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:a="Invalid function arguments";break;case c.invalid_return_type:a="Invalid function return type";break;case c.invalid_date:a="Invalid date";break;case c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:n.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case c.too_small:a="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 c.too_big:a="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 c.custom:a="Invalid input";break;case c.invalid_intersection_types:a="Intersection results could not be merged";break;case c.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:a="Number must be finite";break;default:a=t.defaultError,n.assertNever(e)}return{message:a}},m=p;function h(e){m=e}function f(){return m}var g=e=>{const{data:t,path:a,errorMaps:n,issueData:r}=e,s=[...a,...r.path||[]],i={...r,path:s};if(void 0!==r.message)return{...r,path:s,message:r.message};let o="";const d=n.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...r,path:s,message:o}},y=[];function v(e,t){const a=f(),n=g({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===p?void 0:p].filter(e=>!!e)});e.common.issues.push(n)}var _,b,k=class e{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 n of t){if("aborted"===n.status)return x;"dirty"===n.status&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(t,a){const n=[];for(const e of a){const t=await e.key,a=await e.value;n.push({key:t,value:a})}return e.mergeObjectSync(t,n)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:t,value:r}=n;if("aborted"===t.status)return x;if("aborted"===r.status)return x;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!n.alwaysSet||(a[t.value]=r.value)}return{status:e.value,value:a}}},x=Object.freeze({status:"aborted"}),w=e=>({status:"dirty",value:e}),Z=e=>({status:"valid",value:e}),A=e=>"aborted"===e.status,S=e=>"dirty"===e.status,P=e=>"valid"===e.status,T=e=>"undefined"!=typeof Promise&&e instanceof Promise;(b=_||(_={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},b.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;var O=class{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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}},C=(e,t)=>{if(P(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 l(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:n,description:r}=e;if(t&&(a||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:r.defaultError}:void 0===r.data?{message:null!=(s=null!=o?o:n)?s:r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:null!=(i=null!=o?o:a)?i:r.defaultError}},description:r}}var N,I=class{get description(){return this._def.description}_getType(e){return d(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:d(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:d(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(T(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 n={common:{issues:[],async:null!=(a=null==t?void 0:t.async)&&a,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)},r=this._parseSync({data:e,path:n.path,parent:n});return C(n,r)}"~validate"(e){var t,a;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:d(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return P(t)?{value:t.value}:{issues:n.common.issues}}catch(e){(null==(a=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())?void 0:a.includes("encountered"))&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>P(e)?{value:e.value}:{issues:n.common.issues})}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:d(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(T(n)?n:Promise.resolve(n));return C(a,r)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const r=e(t),s=()=>n.addIssue({code:c.custom,...a(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(s(),!1)):!!r||(s(),!1)})}refinement(e,t){return this._refinement((a,n)=>!!e(a)||(n.addIssue("function"==typeof t?t(a,n):t),!1))}_refinement(e){return new Ee({schema:this,typeName:Ke.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 Me.create(this,this._def)}nullable(){return $e.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this)}promise(){return Ie.create(this,this._def)}or(e){return ve.create([this,e],this._def)}and(e){return xe.create(this,e,this._def)}transform(e){return new Ee({...j(this._def),schema:this,typeName:Ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Re({...j(this._def),innerType:this,defaultValue:t,typeName:Ke.ZodDefault})}brand(){return new De({typeName:Ke.ZodBranded,type:this,...j(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Le({...j(this._def),innerType:this,catchValue:t,typeName:Ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ue.create(this,e)}readonly(){return Ve.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},E=/^c[^\s-]{8,}$/i,M=/^[0-9a-z]+$/,$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,R=/^[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,L=/^[a-z0-9_-]{21}$/i,F=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,z=/^[-+]?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)?)??$/,D=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,U=/^(?:(?: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])$/,V=/^(?:(?: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])$/,q=/^(([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]))$/,B=/^(([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])$/,K=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,W=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,H="((\\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])))",J=new RegExp(`^${H}$`);function Y(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function G(e){return new RegExp(`^${Y(e)}$`)}function Q(e){let t=`${H}T${Y(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}$`)}function X(e,t){return!("v4"!==t&&t||!U.test(e))||!("v6"!==t&&t||!q.test(e))}function ee(e,t){if(!F.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const n=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),r=JSON.parse(atob(n));return"object"==typeof r&&null!==r&&((!("typ"in r)||"JWT"===(null==r?void 0:r.typ))&&(!!r.alg&&(!t||r.alg===t)))}catch(e){return!1}}function te(e,t){return!("v4"!==t&&t||!V.test(e))||!("v6"!==t&&t||!B.test(e))}var ae=class e extends I{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==o.string){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.string,received:t.parsedType}),x}const t=new k;let a;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const n=e.data.length>r.value,s=e.data.length<r.value;(n||s)&&(a=this._getOrReturnCtx(e,a),n?v(a,{code:c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&v(a,{code:c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)D.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"email",code:c.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)N||(N=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),N.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"emoji",code:c.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)R.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"uuid",code:c.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)L.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"nanoid",code:c.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)E.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid",code:c.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)M.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid2",code:c.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)$.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ulid",code:c.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(n){a=this._getOrReturnCtx(e,a),v(a,{validation:"url",code:c.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"regex",code:c.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(a=this._getOrReturnCtx(e,a),v(a,{code:c.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:c.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:c.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){Q(r).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:c.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){J.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:c.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){G(r).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:c.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?z.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"duration",code:c.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?X(e.data,r.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ip",code:c.invalid_string,message:r.message}),t.dirty()):"jwt"===r.kind?ee(e.data,r.alg)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"jwt",code:c.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?te(e.data,r.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cidr",code:c.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?K.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64",code:c.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?W.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64url",code:c.invalid_string,message:r.message}),t.dirty()):n.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:c.invalid_string,..._.errToObj(a)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._.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)&&t,local:null!=(a=null==e?void 0:e.local)&&a,..._.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,..._.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,..._.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"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 ne(e,t){const a=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,r=a>n?a:n;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}ae.create=e=>{var t;return new ae({checks:[],typeName:Ke.ZodString,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...j(e)})};var re=class e extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==o.number){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.number,received:t.parsedType}),x}let t;const a=new k;for(const r of this._def.checks)if("int"===r.kind)n.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:c.invalid_type,expected:"integer",received:"float",message:r.message}),a.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:c.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:c.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else"multipleOf"===r.kind?0!==ne(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),v(t,{code:c.not_finite,message:r.message}),a.dirty()):n.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(t,a,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:_.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.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&&n.isInteger(e.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)}};re.create=e=>new re({checks:[],typeName:Ke.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});var se=class e extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==o.bigint)return this._getInvalidInput(e);let t;const a=new k;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:c.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),v(t,{code:c.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),v(t,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):n.assertNever(r);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(t,a,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:_.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.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}};se.create=e=>{var t;return new se({checks:[],typeName:Ke.ZodBigInt,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...j(e)})};var ie=class extends I{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==o.boolean){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.boolean,received:t.parsedType}),x}return Z(e.data)}};ie.create=e=>new ie({typeName:Ke.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...j(e)});var oe=class e extends I{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==o.date){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.date,received:t.parsedType}),x}if(Number.isNaN(e.data.getTime())){return v(this._getOrReturnCtx(e),{code:c.invalid_date}),x}const t=new k;let a;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:c.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:c.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):n.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.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}};oe.create=e=>new oe({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ke.ZodDate,...j(e)});var de=class extends I{_parse(e){if(this._getType(e)!==o.symbol){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.symbol,received:t.parsedType}),x}return Z(e.data)}};de.create=e=>new de({typeName:Ke.ZodSymbol,...j(e)});var ce=class extends I{_parse(e){if(this._getType(e)!==o.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.undefined,received:t.parsedType}),x}return Z(e.data)}};ce.create=e=>new ce({typeName:Ke.ZodUndefined,...j(e)});var ue=class extends I{_parse(e){if(this._getType(e)!==o.null){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.null,received:t.parsedType}),x}return Z(e.data)}};ue.create=e=>new ue({typeName:Ke.ZodNull,...j(e)});var le=class extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}};le.create=e=>new le({typeName:Ke.ZodAny,...j(e)});var pe=class extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}};pe.create=e=>new pe({typeName:Ke.ZodUnknown,...j(e)});var me=class extends I{_parse(e){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.never,received:t.parsedType}),x}};me.create=e=>new me({typeName:Ke.ZodNever,...j(e)});var he=class extends I{_parse(e){if(this._getType(e)!==o.undefined){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.void,received:t.parsedType}),x}return Z(e.data)}};he.create=e=>new he({typeName:Ke.ZodVoid,...j(e)});var fe=class e extends I{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==o.array)return v(t,{code:c.invalid_type,expected:o.array,received:t.parsedType}),x;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,r=t.data.length<n.exactLength.value;(e||r)&&(v(t,{code:e?c.too_big:c.too_small,minimum:r?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(v(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(v(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>n.type._parseAsync(new O(t,e,t.path,a)))).then(e=>k.mergeArray(a,e));const r=[...t.data].map((e,a)=>n.type._parseSync(new O(t,e,t.path,a)));return k.mergeArray(a,r)}get element(){return this._def.type}min(t,a){return new e({...this._def,minLength:{value:t,message:_.toString(a)}})}max(t,a){return new e({...this._def,maxLength:{value:t,message:_.toString(a)}})}length(t,a){return new e({...this._def,exactLength:{value:t,message:_.toString(a)}})}nonempty(e){return this.min(1,e)}};function ge(e){if(e instanceof ye){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=Me.create(ge(n))}return new ye({...e._def,shape:()=>t})}return e instanceof fe?new fe({...e._def,type:ge(e.element)}):e instanceof Me?Me.create(ge(e.unwrap())):e instanceof $e?$e.create(ge(e.unwrap())):e instanceof we?we.create(e.items.map(e=>ge(e))):e}fe.create=(e,t)=>new fe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ke.ZodArray,...j(t)});var ye=class e extends I{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=n.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==o.object){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.object,received:t.parsedType}),x}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:r}=this._getCached(),s=[];if(!(this._def.catchall instanceof me&&"strip"===this._def.unknownKeys))for(const e in a.data)r.includes(e)||s.push(e);const i=[];for(const e of r){const t=n[e],r=a.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new O(a,r,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof me){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)s.length>0&&(v(a,{code:c.unrecognized_keys,keys:s}),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 s){const n=a.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new O(a,n,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const a=await t.key,n=await t.value;e.push({key:a,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>k.mergeObjectSync(t,e)):k.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(e,a)=>{var n,r,s,i;const o=null!=(s=null==(r=(n=this._def).errorMap)?void 0:r.call(n,e,a).message)?s:a.defaultError;return"unrecognized_keys"===e.code?{message:null!=(i=_.errToObj(t).message)?i:o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){const a={};for(const e of n.objectKeys(t))t[e]&&this.shape[e]&&(a[e]=this.shape[e]);return new e({...this._def,shape:()=>a})}omit(t){const a={};for(const e of n.objectKeys(this.shape))t[e]||(a[e]=this.shape[e]);return new e({...this._def,shape:()=>a})}deepPartial(){return ge(this)}partial(t){const a={};for(const e of n.objectKeys(this.shape)){const n=this.shape[e];t&&!t[e]?a[e]=n:a[e]=n.optional()}return new e({...this._def,shape:()=>a})}required(t){const a={};for(const e of n.objectKeys(this.shape))if(t&&!t[e])a[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Me;)t=t._def.innerType;a[e]=t}return new e({...this._def,shape:()=>a})}keyof(){return Ce(n.objectKeys(this.shape))}};ye.create=(e,t)=>new ye({shape:()=>e,unknownKeys:"strip",catchall:me.create(),typeName:Ke.ZodObject,...j(t)}),ye.strictCreate=(e,t)=>new ye({shape:()=>e,unknownKeys:"strict",catchall:me.create(),typeName:Ke.ZodObject,...j(t)}),ye.lazycreate=(e,t)=>new ye({shape:e,unknownKeys:"strip",catchall:me.create(),typeName:Ke.ZodObject,...j(t)});var ve=class extends I{_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 l(e.ctx.common.issues));return v(t,{code:c.invalid_union,unionErrors:a}),x});{let e;const n=[];for(const r of a){const a={...t,common:{...t.common,issues:[]},parent:null},s=r._parseSync({data:t.data,path:t.path,parent:a});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:a}),a.common.issues.length&&n.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=n.map(e=>new l(e));return v(t,{code:c.invalid_union,unionErrors:r}),x}}get options(){return this._def.options}};ve.create=(e,t)=>new ve({options:e,typeName:Ke.ZodUnion,...j(t)});var _e=e=>e instanceof Te?_e(e.schema):e instanceof Ee?_e(e.innerType()):e instanceof Oe?[e.value]:e instanceof je?e.options:e instanceof Ne?n.objectValues(e.enum):e instanceof Re?_e(e._def.innerType):e instanceof ce?[void 0]:e instanceof ue?[null]:e instanceof Me?[void 0,..._e(e.unwrap())]:e instanceof $e?[null,..._e(e.unwrap())]:e instanceof De||e instanceof Ve?_e(e.unwrap()):e instanceof Le?_e(e._def.innerType):[],be=class e extends I{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.object)return v(t,{code:c.invalid_type,expected:o.object,received:t.parsedType}),x;const a=this.discriminator,n=t.data[a],r=this.optionsMap.get(n);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}):(v(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,a,n){const r=new Map;for(const e of a){const a=_e(e.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const n of a){if(r.has(n))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(n)}`);r.set(n,e)}}return new e({typeName:Ke.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:r,...j(n)})}};function ke(e,t){const a=d(e),r=d(t);if(e===t)return{valid:!0,data:e};if(a===o.object&&r===o.object){const a=n.objectKeys(t),r=n.objectKeys(e).filter(e=>-1!==a.indexOf(e)),s={...e,...t};for(const a of r){const n=ke(e[a],t[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(a===o.array&&r===o.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const r=ke(e[n],t[n]);if(!r.valid)return{valid:!1};a.push(r.data)}return{valid:!0,data:a}}return a===o.date&&r===o.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var xe=class extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(A(e)||A(n))return x;const r=ke(e.value,n.value);return r.valid?((S(e)||S(n))&&t.dirty(),{status:t.value,value:r.data}):(v(a,{code:c.invalid_intersection_types}),x)};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])=>n(e,t)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};xe.create=(e,t,a)=>new xe({left:e,right:t,typeName:Ke.ZodIntersection,...j(a)});var we=class e extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==o.array)return v(a,{code:c.invalid_type,expected:o.array,received:a.parsedType}),x;if(a.data.length<this._def.items.length)return v(a,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&a.data.length>this._def.items.length&&(v(a,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new O(a,e,a.path,t)):null}).filter(e=>!!e);return a.common.async?Promise.all(n).then(e=>k.mergeArray(t,e)):k.mergeArray(t,n)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};we.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new we({items:e,typeName:Ke.ZodTuple,rest:null,...j(t)})};var Ze=class e extends I{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!==o.object)return v(a,{code:c.invalid_type,expected:o.object,received:a.parsedType}),x;const n=[],r=this._def.keyType,s=this._def.valueType;for(const e in a.data)n.push({key:r._parse(new O(a,e,a.path,e)),value:s._parse(new O(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?k.mergeObjectAsync(t,n):k.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(t,a,n){return new e(a instanceof I?{keyType:t,valueType:a,typeName:Ke.ZodRecord,...j(n)}:{keyType:ae.create(),valueType:t,typeName:Ke.ZodRecord,...j(a)})}},Ae=class extends I{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!==o.map)return v(a,{code:c.invalid_type,expected:o.map,received:a.parsedType}),x;const n=this._def.keyType,r=this._def.valueType,s=[...a.data.entries()].map(([e,t],s)=>({key:n._parse(new O(a,e,a.path,[s,"key"])),value:r._parse(new O(a,t,a.path,[s,"value"]))}));if(a.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of s){const n=await a.key,r=await a.value;if("aborted"===n.status||"aborted"===r.status)return x;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of s){const n=a.key,r=a.value;if("aborted"===n.status||"aborted"===r.status)return x;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}}};Ae.create=(e,t,a)=>new Ae({valueType:t,keyType:e,typeName:Ke.ZodMap,...j(a)});var Se=class e extends I{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==o.set)return v(a,{code:c.invalid_type,expected:o.set,received:a.parsedType}),x;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(v(a,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&a.data.size>n.maxSize.value&&(v(a,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const r=this._def.valueType;function s(e){const a=new Set;for(const n of e){if("aborted"===n.status)return x;"dirty"===n.status&&t.dirty(),a.add(n.value)}return{status:t.value,value:a}}const i=[...a.data.values()].map((e,t)=>r._parse(new O(a,e,a.path,t)));return a.common.async?Promise.all(i).then(e=>s(e)):s(i)}min(t,a){return new e({...this._def,minSize:{value:t,message:_.toString(a)}})}max(t,a){return new e({...this._def,maxSize:{value:t,message:_.toString(a)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Se.create=(e,t)=>new Se({valueType:e,minSize:null,maxSize:null,typeName:Ke.ZodSet,...j(t)});var Pe=class e extends I{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.function)return v(t,{code:c.invalid_type,expected:o.function,received:t.parsedType}),x;function a(e,a){return g({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),p].filter(e=>!!e),issueData:{code:c.invalid_arguments,argumentsError:a}})}function n(e,a){return g({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),p].filter(e=>!!e),issueData:{code:c.invalid_return_type,returnTypeError:a}})}const r={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Ie){const e=this;return Z(async function(...t){const i=new l([]),o=await e._def.args.parseAsync(t,r).catch(e=>{throw i.addIssue(a(t,e)),i}),d=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(d,r).catch(e=>{throw i.addIssue(n(d,e)),i})})}{const e=this;return Z(function(...t){const i=e._def.args.safeParse(t,r);if(!i.success)throw new l([a(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,r);if(!d.success)throw new l([n(o,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:we.create(t).rest(pe.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,a,n){return new e({args:t||we.create([]).rest(pe.create()),returns:a||pe.create(),typeName:Ke.ZodFunction,...j(n)})}},Te=class extends I{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})}};Te.create=(e,t)=>new Te({getter:e,typeName:Ke.ZodLazy,...j(t)});var Oe=class extends I{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}};function Ce(e,t){return new je({values:e,typeName:Ke.ZodEnum,...j(t)})}Oe.create=(e,t)=>new Oe({value:e,typeName:Ke.ZodLiteral,...j(t)});var je=class e extends I{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return v(t,{expected:n.joinValues(a),received:t.parsedType,code:c.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return v(t,{received:t.data,code:c.invalid_enum_value,options:a}),x}return Z(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(t,a=this._def){return e.create(t,{...this._def,...a})}exclude(t,a=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...a})}};je.create=Ce;var Ne=class extends I{_parse(e){const t=n.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==o.string&&a.parsedType!==o.number){const e=n.objectValues(t);return v(a,{expected:n.joinValues(e),received:a.parsedType,code:c.invalid_type}),x}if(this._cache||(this._cache=new Set(n.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=n.objectValues(t);return v(a,{received:a.data,code:c.invalid_enum_value,options:e}),x}return Z(e.data)}get enum(){return this._def.values}};Ne.create=(e,t)=>new Ne({values:e,typeName:Ke.ZodNativeEnum,...j(t)});var Ie=class extends I{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==o.promise&&!1===t.common.async)return v(t,{code:c.invalid_type,expected:o.promise,received:t.parsedType}),x;const a=t.parsedType===o.promise?t.data:Promise.resolve(t.data);return Z(a.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ie.create=(e,t)=>new Ie({type:e,typeName:Ke.ZodPromise,...j(t)});var Ee=class extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,s={addIssue:e=>{v(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===r.type){const e=r.transform(a.data,s);if(a.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return x;const n=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===n.status?x:"dirty"===n.status||"dirty"===t.value?w(n.value):n});{if("aborted"===t.value)return x;const n=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===n.status?x:"dirty"===n.status||"dirty"===t.value?w(n.value):n}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,s);if(a.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===a.common.async){const n=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===n.status?x:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(a=>"aborted"===a.status?x:("dirty"===a.status&&t.dirty(),e(a.value).then(()=>({status:t.value,value:a.value}))))}if("transform"===r.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!P(e))return x;const n=r.transform(e.value,s);if(n instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:n}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(e=>P(e)?Promise.resolve(r.transform(e.value,s)).then(e=>({status:t.value,value:e})):x)}n.assertNever(r)}};Ee.create=(e,t,a)=>new Ee({schema:e,typeName:Ke.ZodEffects,effect:t,...j(a)}),Ee.createWithPreprocess=(e,t,a)=>new Ee({schema:t,effect:{type:"preprocess",transform:e},typeName:Ke.ZodEffects,...j(a)});var Me=class extends I{_parse(e){return this._getType(e)===o.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Me.create=(e,t)=>new Me({innerType:e,typeName:Ke.ZodOptional,...j(t)});var $e=class extends I{_parse(e){return this._getType(e)===o.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};$e.create=(e,t)=>new $e({innerType:e,typeName:Ke.ZodNullable,...j(t)});var Re=class extends I{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===o.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Re.create=(e,t)=>new Re({innerType:e,typeName:Ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});var Le=class extends I{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return T(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new l(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new l(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};Le.create=(e,t)=>new Le({innerType:e,typeName:Ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});var Fe=class extends I{_parse(e){if(this._getType(e)!==o.nan){const t=this._getOrReturnCtx(e);return v(t,{code:c.invalid_type,expected:o.nan,received:t.parsedType}),x}return{status:"valid",value:e.data}}};Fe.create=e=>new Fe({typeName:Ke.ZodNaN,...j(e)});var ze=Symbol("zod_brand"),De=class extends I{_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}},Ue=class e extends I{_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?x:"dirty"===e.status?(t.dirty(),w(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?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(t,a){return new e({in:t,out:a,typeName:Ke.ZodPipeline})}},Ve=class extends I{_parse(e){const t=this._def.innerType._parse(e),a=e=>(P(e)&&(e.value=Object.freeze(e.value)),e);return T(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}};function qe(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function Be(e,t={},a){return e?le.create().superRefine((n,r)=>{var s,i;const o=e(n);if(o instanceof Promise)return o.then(e=>{var s,i;if(!e){const e=qe(t,n),o=null==(i=null!=(s=e.fatal)?s:a)||i;r.addIssue({code:"custom",...e,fatal:o})}});if(!o){const e=qe(t,n),o=null==(i=null!=(s=e.fatal)?s:a)||i;r.addIssue({code:"custom",...e,fatal:o})}}):le.create()}Ve.create=(e,t)=>new Ve({innerType:e,typeName:Ke.ZodReadonly,...j(t)});var Ke,We,He={object:ye.lazycreate};(We=Ke||(Ke={})).ZodString="ZodString",We.ZodNumber="ZodNumber",We.ZodNaN="ZodNaN",We.ZodBigInt="ZodBigInt",We.ZodBoolean="ZodBoolean",We.ZodDate="ZodDate",We.ZodSymbol="ZodSymbol",We.ZodUndefined="ZodUndefined",We.ZodNull="ZodNull",We.ZodAny="ZodAny",We.ZodUnknown="ZodUnknown",We.ZodNever="ZodNever",We.ZodVoid="ZodVoid",We.ZodArray="ZodArray",We.ZodObject="ZodObject",We.ZodUnion="ZodUnion",We.ZodDiscriminatedUnion="ZodDiscriminatedUnion",We.ZodIntersection="ZodIntersection",We.ZodTuple="ZodTuple",We.ZodRecord="ZodRecord",We.ZodMap="ZodMap",We.ZodSet="ZodSet",We.ZodFunction="ZodFunction",We.ZodLazy="ZodLazy",We.ZodLiteral="ZodLiteral",We.ZodEnum="ZodEnum",We.ZodEffects="ZodEffects",We.ZodNativeEnum="ZodNativeEnum",We.ZodOptional="ZodOptional",We.ZodNullable="ZodNullable",We.ZodDefault="ZodDefault",We.ZodCatch="ZodCatch",We.ZodPromise="ZodPromise",We.ZodBranded="ZodBranded",We.ZodPipeline="ZodPipeline",We.ZodReadonly="ZodReadonly";var Je=(e,t={message:`Input not instance of ${e.name}`})=>Be(t=>t instanceof e,t),Ye=ae.create,Ge=re.create,Qe=Fe.create,Xe=se.create,et=ie.create,tt=oe.create,at=de.create,nt=ce.create,rt=ue.create,st=le.create,it=pe.create,ot=me.create,dt=he.create,ct=fe.create,ut=ye.create,lt=ye.strictCreate,pt=ve.create,mt=be.create,ht=xe.create,ft=we.create,gt=Ze.create,yt=Ae.create,vt=Se.create,_t=Pe.create,bt=Te.create,kt=Oe.create,xt=je.create,wt=Ne.create,Zt=Ie.create,At=Ee.create,St=Me.create,Pt=$e.create,Tt=Ee.createWithPreprocess,Ot=Ue.create,Ct=()=>Ye().optional(),jt=()=>Ge().optional(),Nt=()=>et().optional(),It={string:e=>ae.create({...e,coerce:!0}),number:e=>re.create({...e,coerce:!0}),boolean:e=>ie.create({...e,coerce:!0}),bigint:e=>se.create({...e,coerce:!0}),date:e=>oe.create({...e,coerce:!0})},Et=x,Mt=Symbol("Let zodToJsonSchema decide on which parser to use"),$t={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},Rt=e=>{const t=(e=>"string"==typeof e?{...$t,name:e}:{...$t,...e})(e),a=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,a])=>[a._def,{def:a._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}};function Lt(e,t,a,n){(null==n?void 0:n.errorMessages)&&a&&(e.errorMessage={...e.errorMessage,[t]:a})}function Ft(e,t,a,n,r){e[t]=a,Lt(e,t,n,r)}var zt=(e,t)=>{let a=0;for(;a<e.length&&a<t.length&&e[a]===t[a];a++);return[(e.length-a).toString(),...t.slice(a)].join("/")};function Dt(e){if("openAi"!==e.target)return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?zt(t,e.currentPath):t.join("/")}}function Ut(e,t){return fa(e.type._def,t)}function Vt(e,t,a){const n=null!=a?a:t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((a,n)=>Vt(e,t,a))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return qt(e,t)}}var qt=(e,t)=>{const a={type:"integer",format:"unix-time"};if("openApi3"===t.target)return a;for(const n of e.checks)switch(n.kind){case"min":Ft(a,"minimum",n.value,n.message,t);break;case"max":Ft(a,"maximum",n.value,n.message,t)}return a};var Bt=void 0,Kt=/^[cC][^\s-]{8,}$/,Wt=/^[0-9a-z]+$/,Ht=/^[0-9A-HJKMNP-TV-Z]{26}$/,Jt=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,Yt=()=>(void 0===Bt&&(Bt=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Bt),Gt=/^(?:(?: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])$/,Qt=/^(([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])$/,Xt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ea=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ta=/^[a-zA-Z0-9_-]{21}$/,aa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function na(e,t){const a={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":Ft(a,"minLength","number"==typeof a.minLength?Math.max(a.minLength,n.value):n.value,n.message,t);break;case"max":Ft(a,"maxLength","number"==typeof a.maxLength?Math.min(a.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":ia(a,"email",n.message,t);break;case"format:idn-email":ia(a,"idn-email",n.message,t);break;case"pattern:zod":oa(a,Jt,n.message,t)}break;case"url":ia(a,"uri",n.message,t);break;case"uuid":ia(a,"uuid",n.message,t);break;case"regex":oa(a,n.regex,n.message,t);break;case"cuid":oa(a,Kt,n.message,t);break;case"cuid2":oa(a,Wt,n.message,t);break;case"startsWith":oa(a,RegExp(`^${ra(n.value,t)}`),n.message,t);break;case"endsWith":oa(a,RegExp(`${ra(n.value,t)}$`),n.message,t);break;case"datetime":ia(a,"date-time",n.message,t);break;case"date":ia(a,"date",n.message,t);break;case"time":ia(a,"time",n.message,t);break;case"duration":ia(a,"duration",n.message,t);break;case"length":Ft(a,"minLength","number"==typeof a.minLength?Math.max(a.minLength,n.value):n.value,n.message,t),Ft(a,"maxLength","number"==typeof a.maxLength?Math.min(a.maxLength,n.value):n.value,n.message,t);break;case"includes":oa(a,RegExp(ra(n.value,t)),n.message,t);break;case"ip":"v6"!==n.version&&ia(a,"ipv4",n.message,t),"v4"!==n.version&&ia(a,"ipv6",n.message,t);break;case"base64url":oa(a,ea,n.message,t);break;case"jwt":oa(a,aa,n.message,t);break;case"cidr":"v6"!==n.version&&oa(a,Gt,n.message,t),"v4"!==n.version&&oa(a,Qt,n.message,t);break;case"emoji":oa(a,Yt(),n.message,t);break;case"ulid":oa(a,Ht,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":ia(a,"binary",n.message,t);break;case"contentEncoding:base64":Ft(a,"contentEncoding","base64",n.message,t);break;case"pattern:zod":oa(a,Xt,n.message,t)}break;case"nanoid":oa(a,ta,n.message,t)}return a}function ra(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let a=0;a<e.length;a++)sa.has(e[a])||(t+="\\"),t+=e[a];return t}(e):e}var sa=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ia(e,t,a,n){var r;e.format||(null==(r=e.anyOf)?void 0:r.some(e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.anyOf.push({format:t,...a&&n.errorMessages&&{errorMessage:{format:a}}})):Ft(e,"format",t,a,n)}function oa(e,t,a,n){var r;e.pattern||(null==(r=e.allOf)?void 0:r.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length&&delete e.errorMessage)),e.allOf.push({pattern:da(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):Ft(e,"pattern",da(t,n),a,n)}function da(e,t){var a;if(!t.applyRegexFlags||!e.flags)return e.source;const n=e.flags.includes("i"),r=e.flags.includes("m"),s=e.flags.includes("s"),i=n?e.source.toLowerCase():e.source;let o="",d=!1,c=!1,u=!1;for(let e=0;e<i.length;e++)if(d)o+=i[e],d=!1;else{if(n)if(c){if(i[e].match(/[a-z]/)){u?(o+=i[e],o+=`${i[e-2]}-${i[e]}`.toUpperCase(),u=!1):"-"===i[e+1]&&(null==(a=i[e+2])?void 0:a.match(/[a-z]/))?(o+=i[e],u=!0):o+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){o+=`[${i[e]}${i[e].toUpperCase()}]`;continue}if(r){if("^"===i[e]){o+="(^|(?<=[\r\n]))";continue}if("$"===i[e]){o+="($|(?=[\r\n]))";continue}}s&&"."===i[e]?o+=c?`${i[e]}\r\n`:`[${i[e]}\r\n]`:(o+=i[e],"\\"===i[e]?d=!0:c&&"]"===i[e]?c=!1:c||"["!==i[e]||(c=!0))}try{new RegExp(o)}catch(a){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function ca(e,t){var a,n,r,s,i,o,d;if("openAi"===t.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===t.target&&(null==(a=e.keyType)?void 0:a._def.typeName)===Ke.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((a,n)=>{var r;return{...a,[n]:null!=(r=fa(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]}))?r:Dt(t)}},{}),additionalProperties:t.rejectedAdditionalProperties};const c={type:"object",additionalProperties:null!=(n=fa(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if("openApi3"===t.target)return c;if((null==(r=e.keyType)?void 0:r._def.typeName)===Ke.ZodString&&(null==(s=e.keyType._def.checks)?void 0:s.length)){const{type:a,...n}=na(e.keyType._def,t);return{...c,propertyNames:n}}if((null==(i=e.keyType)?void 0:i._def.typeName)===Ke.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if((null==(o=e.keyType)?void 0:o._def.typeName)===Ke.ZodBranded&&e.keyType._def.type._def.typeName===Ke.ZodString&&(null==(d=e.keyType._def.type._def.checks)?void 0:d.length)){const{type:a,...n}=Ut(e.keyType._def,t);return{...c,propertyNames:n}}return c}var ua={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};var la=(e,t)=>{const a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,a)=>fa(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return a.length?{anyOf:a}:void 0};function pa(e,t){const a="openAi"===t.target,n={type:"object",properties:{}},r=[],s=e.shape();for(const e in s){let i=s[e];if(void 0===i||void 0===i._def)continue;let o=ma(i);o&&a&&("ZodOptional"===i._def.typeName&&(i=i._def.innerType),i.isNullable()||(i=i.nullable()),o=!1);const d=fa(i._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==d&&(n.properties[e]=d,o||r.push(e))}r.length&&(n.required=r);const i=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return fa(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==i&&(n.additionalProperties=i),n}function ma(e){try{return e.isOptional()}catch(e){return!0}}var ha=(e,t,a)=>{switch(t){case Ke.ZodString:return na(e,a);case Ke.ZodNumber:return function(e,t){const a={type:"number"};if(!e.checks)return a;for(const n of e.checks)switch(n.kind){case"int":a.type="integer",Lt(a,"type",n.message,t);break;case"min":"jsonSchema7"===t.target?n.inclusive?Ft(a,"minimum",n.value,n.message,t):Ft(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),Ft(a,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?Ft(a,"maximum",n.value,n.message,t):Ft(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),Ft(a,"maximum",n.value,n.message,t));break;case"multipleOf":Ft(a,"multipleOf",n.value,n.message,t)}return a}(e,a);case Ke.ZodObject:return pa(e,a);case Ke.ZodBigInt:return function(e,t){const a={type:"integer",format:"int64"};if(!e.checks)return a;for(const n of e.checks)switch(n.kind){case"min":"jsonSchema7"===t.target?n.inclusive?Ft(a,"minimum",n.value,n.message,t):Ft(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),Ft(a,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?Ft(a,"maximum",n.value,n.message,t):Ft(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),Ft(a,"maximum",n.value,n.message,t));break;case"multipleOf":Ft(a,"multipleOf",n.value,n.message,t)}return a}(e,a);case Ke.ZodBoolean:return{type:"boolean"};case Ke.ZodDate:return Vt(e,a);case Ke.ZodUndefined:return function(e){return{not:Dt(e)}}(a);case Ke.ZodNull:return function(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}(a);case Ke.ZodArray:return function(e,t){var a,n,r;const s={type:"array"};return(null==(a=e.type)?void 0:a._def)&&(null==(r=null==(n=e.type)?void 0:n._def)?void 0:r.typeName)!==Ke.ZodAny&&(s.items=fa(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&Ft(s,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&Ft(s,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(Ft(s,"minItems",e.exactLength.value,e.exactLength.message,t),Ft(s,"maxItems",e.exactLength.value,e.exactLength.message,t)),s}(e,a);case Ke.ZodUnion:case Ke.ZodDiscriminatedUnion:return function(e,t){if("openApi3"===t.target)return la(e,t);const a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(e=>e._def.typeName in ua&&(!e._def.checks||!e._def.checks.length))){const e=a.reduce((e,t)=>{const a=ua[t._def.typeName];return a&&!e.includes(a)?[...e,a]:e},[]);return{type:e.length>1?e:e[0]}}if(a.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){const e=a.reduce((e,t)=>{const a=typeof t._def.value;switch(a){case"string":case"number":case"boolean":return[...e,a];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===a.length){const t=e.filter((e,t,a)=>a.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:a.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(a.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:a.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return la(e,t)}(e,a);case Ke.ZodIntersection:return function(e,t){const a=[fa(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),fa(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(e=>!!e);let n="jsonSchema2019-09"===t.target?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(e=>{if("type"in(t=e)&&"string"===t.type||!("allOf"in t)){let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){const{additionalProperties:a,...n}=e;t=n}else n=void 0;r.push(t)}else r.push(...e.allOf),void 0===e.unevaluatedProperties&&(n=void 0);var t}),r.length?{allOf:r,...n}:void 0}(e,a);case Ke.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,a)=>fa(e._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:fa(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,a)=>fa(e._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,a);case Ke.ZodRecord:return ca(e,a);case Ke.ZodLiteral:return function(e,t){const a=typeof e.value;return"bigint"!==a&&"number"!==a&&"boolean"!==a&&"string"!==a?{type:Array.isArray(e.value)?"array":"object"}:"openApi3"===t.target?{type:"bigint"===a?"integer":a,enum:[e.value]}:{type:"bigint"===a?"integer":a,const:e.value}}(e,a);case Ke.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case Ke.ZodNativeEnum:return function(e){const t=e.values,a=Object.keys(e.values).filter(e=>"number"!=typeof t[t[e]]).map(e=>t[e]),n=Array.from(new Set(a.map(e=>typeof e)));return{type:1===n.length?"string"===n[0]?"string":"number":["string","number"],enum:a}}(e);case Ke.ZodNullable:return function(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return"openApi3"===t.target?{type:ua[e.innerType._def.typeName],nullable:!0}:{type:[ua[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){const a=fa(e.innerType._def,{...t,currentPath:[...t.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}const a=fa(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}(e,a);case Ke.ZodOptional:return((e,t)=>{var a;if(t.currentPath.toString()===(null==(a=t.propertyPath)?void 0:a.toString()))return fa(e.innerType._def,t);const n=fa(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Dt(t)},n]}:Dt(t)})(e,a);case Ke.ZodMap:return function(e,t){return"record"===t.mapStrategy?ca(e,t):{type:"array",maxItems:125,items:{type:"array",items:[fa(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Dt(t),fa(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Dt(t)],minItems:2,maxItems:2}}}(e,a);case Ke.ZodSet:return function(e,t){const a={type:"array",uniqueItems:!0,items:fa(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&Ft(a,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&Ft(a,"maxItems",e.maxSize.value,e.maxSize.message,t),a}(e,a);case Ke.ZodLazy:return()=>e.getter()._def;case Ke.ZodPromise:return function(e,t){return fa(e.type._def,t)}(e,a);case Ke.ZodNaN:case Ke.ZodNever:return function(e){return"openAi"===e.target?void 0:{not:Dt({...e,currentPath:[...e.currentPath,"not"]})}}(a);case Ke.ZodEffects:return function(e,t){return"input"===t.effectStrategy?fa(e.schema._def,t):Dt(t)}(e,a);case Ke.ZodAny:return Dt(a);case Ke.ZodUnknown:return function(e){return Dt(e)}(a);case Ke.ZodDefault:return function(e,t){return{...fa(e.innerType._def,t),default:e.defaultValue()}}(e,a);case Ke.ZodBranded:return Ut(e,a);case Ke.ZodReadonly:case Ke.ZodCatch:return((e,t)=>fa(e.innerType._def,t))(e,a);case Ke.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return fa(e.in._def,t);if("output"===t.pipeStrategy)return fa(e.out._def,t);const a=fa(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[a,fa(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]})].filter(e=>void 0!==e)}})(e,a);case Ke.ZodFunction:case Ke.ZodVoid:case Ke.ZodSymbol:default:return}};function fa(e,t,a=!1){var n;const r=t.seen.get(e);if(t.override){const s=null==(n=t.override)?void 0:n.call(t,e,t,r,a);if(s!==Mt)return s}if(r&&!a){const e=ga(r,t);if(void 0!==e)return e}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const i=ha(e,e.typeName,t),o="function"==typeof i?fa(i(),t):i;if(o&&ya(e,t,o),t.postProcess){const a=t.postProcess(o,e,t);return s.jsonSchema=o,a}return s.jsonSchema=o,o}var ga=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:zt(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((e,a)=>t.currentPath[a]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Dt(t)):"seen"===t.$refStrategy?Dt(t):void 0}},ya=(e,t,a)=>(e.description&&(a.description=e.description,t.markdownDescription&&(a.markdownDescription=e.description)),a),va=(e,t)=>{var a;const n=Rt(t);let r="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,a])=>{var r;return{...e,[t]:null!=(r=fa(a._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0))?r:Dt(n)}},{}):void 0;const s="string"==typeof t?t:"title"===(null==t?void 0:t.nameStrategy)||null==t?void 0:t.name,i=null!=(a=fa(e._def,void 0===s?n:{...n,currentPath:[...n.basePath,n.definitionPath,s]},!1))?a:Dt(n),o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(i.title=o),n.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[n.openAiAnyTypeName]||(r[n.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===n.$refStrategy?"1":[...n.basePath,n.definitionPath,n.openAiAnyTypeName].join("/")}}));const d=void 0===s?r?{...i,[n.definitionPath]:r}:i:{$ref:[..."relative"===n.$refStrategy?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:{...r,[s]:i}};return"jsonSchema7"===n.target?d.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==n.target&&"openAi"!==n.target||(d.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===n.target&&("anyOf"in d||"oneOf"in d||"allOf"in d||"type"in d&&Array.isArray(d.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),d},_a=i.record(i.string(),i.boolean()).describe("Consent requirement mapping"),ba=i.lazy(()=>i.union([i.string(),i.number(),i.boolean(),Za,i.array(ba)])),ka=i.tuple([ba,ba]).describe("Loop: [source, transform] tuple for array transformations"),xa=i.array(ba).describe("Set: Array of values"),wa=i.record(i.string(),ba).describe("Map: Object mapping keys to values"),Za=i.object({key:i.string().optional().describe('Property path (e.g., "data.id")'),value:i.union([i.string(),i.number(),i.boolean()]).optional().describe("Static primitive value"),fn:i.string().optional().describe("Function string for custom transformation"),map:wa.optional().describe("Object with key-value mappings"),loop:ka.optional().describe("Tuple [source, transform]"),set:xa.optional().describe("Array of values"),consent:_a.optional().describe("Required consent states"),condition:i.string().optional().describe("Condition function string"),validate:i.string().optional().describe("Validation function string")}).refine(e=>Object.keys(e).length>0,{message:"ValueConfig must have at least one property"}).describe("Value configuration for transformations"),Aa=ka,Sa=xa,Pa=wa;va(Za,{target:"jsonSchema7",$refStrategy:"relative",name:"ValueConfig"}),va(Aa,{target:"jsonSchema7",$refStrategy:"relative",name:"Loop"}),va(Sa,{target:"jsonSchema7",$refStrategy:"relative",name:"Set"}),va(Pa,{target:"jsonSchema7",$refStrategy:"relative",name:"Map"});function Ta(e,t){const a=[],n={};for(const[t,r]of Object.entries(e)){r.required&&a.push(t);const e={type:r.type};if(r.description&&(e.description=r.description),r.pattern&&(e.pattern=r.pattern),void 0!==r.minLength&&(e.minLength=r.minLength),void 0!==r.maxLength&&(e.maxLength=r.maxLength),void 0!==r.minimum&&(e.minimum=r.minimum),void 0!==r.maximum&&(e.maximum=r.maximum),r.enum&&(e.enum=[...r.enum]),void 0!==r.default&&(e.default=r.default),"object"===r.type&&r.properties){const t={};for(const[e,a]of Object.entries(r.properties))t[e]=Oa(a);e.properties=t}"array"===r.type&&r.items&&(e.items=Oa(r.items)),n[t]=e}const r={type:"object",properties:n};return t&&(r.title=t),a.length>0&&(r.required=a),r}function Oa(e){const t={type:e.type};if(e.description&&(t.description=e.description),e.pattern&&(t.pattern=e.pattern),void 0!==e.minLength&&(t.minLength=e.minLength),void 0!==e.maxLength&&(t.maxLength=e.maxLength),void 0!==e.minimum&&(t.minimum=e.minimum),void 0!==e.maximum&&(t.maximum=e.maximum),e.enum&&(t.enum=[...e.enum]),void 0!==e.default&&(t.default=e.default),"object"===e.type&&e.properties){const a={};for(const[t,n]of Object.entries(e.properties))a[t]=Oa(n);t.properties=a}return"array"===e.type&&e.items&&(t.items=Oa(e.items)),t}var Ca={merge:!0,shallow:!0,extend:!0};function ja(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}function Na(e={}){var t;const a=e.timestamp||(new Date).setHours(0,13,37,0),n=e.group||"gr0up",r=e.count||1,s=function(e,t={},a={}){a={...Ca,...a};const n=Object.entries(t).reduce((t,[n,r])=>{const s=e[n];return a.merge&&Array.isArray(s)&&Array.isArray(r)?t[n]=r.reduce((e,t)=>e.includes(t)?e:[...e,t],[...s]):(a.extend||n in e)&&(t[n]=r),t},{});return a.shallow?{...e,...n}:(Object.assign(e,n),e)}({name:"entity action",data:{string:"foo",number:1,boolean:!0,array:[0,"text",!1],not:void 0},context:{dev:["test",1]},globals:{lang:"elb"},custom:{completely:"random"},user:{id:"us3r",device:"c00k13",session:"s3ss10n"},nested:[{entity:"child",data:{is:"subordinated"},nested:[],context:{element:["child",0]}}],consent:{functional:!0},id:`${a}-${n}-${r}`,trigger:"test",entity:"entity",action:"action",timestamp:a,timing:3.14,group:n,count:r,version:{source:"0.2.1",tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){const[a,n]=null!=(t=e.name.split(" "))?t:[];a&&n&&(s.entity=a,s.action=n)}return s}function Ia(e="entity action",t={}){const a=t.timestamp||(new Date).setHours(0,13,37,0),n={data:{id:"ers",name:"Everyday Ruck Snack",color:"black",size:"l",price:420}},r={data:{id:"cc",name:"Cool Cap",size:"one size",price:42}};return Na({...{"cart view":{data:{currency:"EUR",value:2*n.data.price},context:{shopping:["cart",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",data:{...n.data,quantity:2},context:{shopping:["cart",0]},nested:[]}],trigger:"load"},"checkout view":{data:{step:"payment",currency:"EUR",value:n.data.price+r.data.price},context:{shopping:["checkout",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...n,context:{shopping:["checkout",0]},nested:[]},{entity:"product",...r,context:{shopping:["checkout",0]},nested:[]}],trigger:"load"},"order complete":{data:{id:"0rd3r1d",currency:"EUR",shipping:5.22,taxes:73.76,total:555},context:{shopping:["complete",0]},globals:{pagegroup:"shop"},nested:[{entity:"product",...n,context:{shopping:["complete",0]},nested:[]},{entity:"product",...r,context:{shopping:["complete",0]},nested:[]},{entity:"gift",data:{name:"Surprise"},context:{shopping:["complete",0]},nested:[]}],trigger:"load"},"page view":{data:{domain:"www.example.com",title:"walkerOS documentation",referrer:"https://www.elbwalker.com/",search:"?foo=bar",hash:"#hash",id:"/docs/"},globals:{pagegroup:"docs"},trigger:"load"},"product add":{...n,context:{shopping:["intent",0]},globals:{pagegroup:"shop"},nested:[],trigger:"click"},"product view":{...n,context:{shopping:["detail",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"product visible":{data:{...n.data,position:3,promo:!0},context:{shopping:["discover",0]},globals:{pagegroup:"shop"},nested:[],trigger:"load"},"promotion visible":{data:{name:"Setting up tracking easily",position:"hero"},context:{ab_test:["engagement",0]},globals:{pagegroup:"homepage"},trigger:"visible"},"session start":{data:{id:"s3ss10n",start:a,isNew:!0,count:1,runs:1,isStart:!0,storage:!0,referrer:"",device:"c00k13"},user:{id:"us3r",device:"c00k13",session:"s3ss10n",hash:"h4sh",address:"street number",email:"user@example.com",phone:"+49 123 456 789",userAgent:"Mozilla...",browser:"Chrome",browserVersion:"90",deviceType:"desktop",language:"de-DE",country:"DE",region:"HH",city:"Hamburg",zip:"20354",timezone:"Berlin",os:"walkerOS",osVersion:"1.0",screenSize:"1337x420",ip:"127.0.0.0",internal:!0,custom:"value"}}}[e],...t,name:e})}import{getEnv as Ea}from"@walkeros/web-core";var Ma={},$a={};t($a,{env:()=>Ra,events:()=>Da,mapping:()=>Ka});var Ra={};t(Ra,{init:()=>Fa,push:()=>za});var La=()=>{},Fa={window:{fbq:void 0,_fbq:void 0},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},za={window:{fbq:Object.assign(La,{callMethod:La,queue:[],push:La,loaded:!0,version:"2.0"}),_fbq:Object.assign(La,{callMethod:La,queue:[],push:La,loaded:!0,version:"2.0"})},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},Da={};function Ua(){const e=Ia("order complete");return["track","Purchase",{value:e.data.total,currency:"EUR",contents:e.nested.filter(e=>"product"===e.entity).map(e=>({id:e.data.id,quantity:1})),content_type:"product",num_items:2},{eventID:e.id}]}function Va(){const e=Ia("product add");return["track","AddToCart",{currency:"EUR",value:e.data.price,contents:[{id:e.data.id,quantity:1}],content_type:"product"},{eventID:e.id}]}function qa(){const e=Ia("cart view");return["track","InitiateCheckout",{currency:"EUR",value:e.data.value,contents:e.nested.filter(e=>"product"===e.entity).map(e=>({id:e.data.id,quantity:e.data.quantity})),num_items:e.nested.filter(e=>"product"===e.entity).length},{eventID:e.id}]}function Ba(){const e=Ia("product view");return["track","ViewContent",{currency:"EUR",value:e.data.price,contents:[{id:e.data.id,quantity:1}],content_type:"product"},{eventID:e.id}]}t(Da,{AddToCart:()=>Va,InitiateCheckout:()=>qa,Purchase:()=>Ua,ViewContent:()=>Ba});var Ka={};t(Ka,{AddToCart:()=>Ha,InitiateCheckout:()=>Ja,Purchase:()=>Wa,ViewContent:()=>Ya,config:()=>Ga});var Wa={name:"Purchase",data:{map:{value:"data.total",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>ja(e)&&"product"===e.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"},num_items:{fn:e=>e.nested.filter(e=>"product"===e.entity).length}}}},Ha={name:"AddToCart",data:{map:{value:"data.price",currency:{value:"EUR"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},content_type:{value:"product"}}}},Ja={name:"InitiateCheckout",data:{map:{value:"data.value",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>ja(e)&&"product"===e.entity,map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]},num_items:{fn:e=>e.nested.filter(e=>"product"===e.entity).length}}}},Ya={name:"ViewContent",data:{map:{value:"data.price",currency:{value:"EUR"},content_type:{value:"product"},contents:{set:[{map:{id:"data.id",quantity:{key:"data.quantity",value:1}}}]}}}},Ga={order:{complete:Wa},product:{view:Ya,add:Ha},cart:{view:Ja}},Qa={};t(Qa,{dataSchema:()=>nn,dataUiSchema:()=>rn,mappingSchema:()=>tn,mappingUiSchema:()=>an,settingsSchema:()=>Xa,settingsUiSchema:()=>en});var Xa={type:"object",title:"Meta Pixel Settings",properties:{pixelId:{type:"string",title:"Pixel ID",description:"Your Meta (Facebook) Pixel ID",minLength:1,pattern:"^[0-9]+$"}},required:["pixelId"]},en={pixelId:{"ui:placeholder":"e.g., 1234567890123456","ui:help":"Find your Pixel ID in Meta Events Manager"}},tn={type:"object",title:"Meta Pixel Mapping",properties:{track:{type:"string",title:"Standard Event Name",description:"Meta Pixel standard event name",enum:["PageView","AddPaymentInfo","AddToCart","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","InitiateCheckout","Lead","Purchase","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent"]},trackCustom:{type:"string",title:"Custom Event Name",description:"Custom event name for trackCustom"}}},an={track:{"ui:placeholder":"Select standard event","ui:help":"Use standard events for better conversion tracking"},trackCustom:{"ui:placeholder":"e.g., CustomEventName","ui:help":"Custom events for tracking non-standard actions"},"ui:order":["track","trackCustom"]},nn={type:"object",title:"Meta Pixel Event Data",description:"Properties that can be sent with Meta Pixel events",properties:{value:{type:"number",title:"Value",description:"Monetary value of the event (e.g., purchase total, product price)"},currency:{type:"string",title:"Currency",description:"Currency code in ISO 4217 format (e.g., USD, EUR, GBP)",enum:["USD","EUR","GBP","JPY","CAD","AUD","CHF","CNY","SEK","NZD","KRW","SGD","NOK","MXN","INR","BRL","ZAR","DKK","PLN","THB","IDR","HUF","CZK","ILS","CLP","PHP","AED","COP","SAR","MYR","RON"]},content_name:{type:"string",title:"Content Name",description:"Name of the page, product, or content"},content_category:{type:"string",title:"Content Category",description:"Category of the page or product"},content_ids:{type:"array",title:"Content IDs",description:"Array of product IDs, SKUs, or content identifiers",items:{type:"string"}},contents:{type:"array",title:"Contents",description:"Array of product items with details (id, quantity, etc.)",items:{type:"object",properties:{id:{type:"string",title:"Product ID",description:"Product identifier or SKU"},quantity:{type:"number",title:"Quantity",description:"Quantity of this product"},item_price:{type:"number",title:"Item Price",description:"Price per item"}}}},content_type:{type:"string",title:"Content Type",description:"Type of content (product or product_group)",enum:["product","product_group"]},num_items:{type:"number",title:"Number of Items",description:"Total number of items (e.g., in cart or order)"},predicted_ltv:{type:"number",title:"Predicted LTV",description:"Predicted lifetime value of the customer"},search_string:{type:"string",title:"Search String",description:"Search query entered by the user"},status:{type:"boolean",title:"Status",description:"Status of the registration or checkout"}},additionalProperties:!0},rn={value:{"ui:placeholder":"e.g., 99.99","ui:help":"The monetary value associated with this event"},currency:{"ui:placeholder":"Select currency","ui:help":"Use the ISO 4217 currency code"},content_name:{"ui:placeholder":"e.g., Blue Running Shoes","ui:help":"Descriptive name of the content or product"},content_category:{"ui:placeholder":"e.g., Shoes > Running","ui:help":"Category hierarchy for the content"},content_ids:{"ui:placeholder":"Add product IDs","ui:help":"List of product identifiers"},contents:{"ui:help":"Array of products with detailed information"},content_type:{"ui:placeholder":"Select content type","ui:help":"Specify whether tracking individual products or product groups"},num_items:{"ui:placeholder":"e.g., 3","ui:help":"Total quantity of items"},search_string:{"ui:placeholder":"e.g., running shoes","ui:help":"The search term used by the customer"}},sn=Ta({pixelId:{type:"string",required:!0,pattern:"^[0-9]+$",description:"Your Meta (Facebook) Pixel ID",minLength:1}},"Meta Pixel Settings"),on=Ta({track:{type:"string",description:"Meta Pixel standard event name",enum:["PageView","AddPaymentInfo","AddToCart","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","InitiateCheckout","Lead","Purchase","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent"]},trackCustom:{type:"string",description:"Custom event name for trackCustom"},enabled:{type:"boolean",description:"Enable or disable this tracking rule"}},"Meta Pixel Mapping"),dn={pixelId:{"ui:placeholder":"e.g., 1234567890123456","ui:help":"Find your Pixel ID in Meta Events Manager"}},cn={track:{"ui:placeholder":"Select standard event","ui:help":"Use standard events for better conversion tracking"},trackCustom:{"ui:placeholder":"e.g., CustomEventName","ui:help":"Custom events for tracking non-standard actions"},"ui:order":["track","trackCustom"]},un={type:"meta-pixel",config:{},init({config:e,env:t}){const{settings:n={},loadScript:r}=e,{pixelId:s}=n;if(r&&function(e,t="https://connect.facebook.net/en_US/fbevents.js"){const{document:n}=a(e),r=n.createElement("script");r.src=t,r.async=!0,n.head.appendChild(r)}(t),!s)return!1;!function(e){const{window:t}=a(e),n=t;if(n.fbq)return;const r=function(...e){r.callMethod?r.callMethod.apply(r,e):r.queue.push(e)};n.fbq=r,n._fbq||(n._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[]}(t);const{window:i}=Ea(t);return(0,i.fbq)("init",s),e},push(e,{config:t,mapping:a={},data:n,env:r}){const{track:s,trackCustom:i}=a.settings||{},{window:o}=Ea(r),d=o.fbq;"page view"!==e.name||a.settings||(e.name="PageView");const c=s||i||e.name;d(i?"trackCustom":"track",String(c),ja(n)?n:{},{eventID:e.id})}},ln=un;export{Ma as DestinationMeta,ln as default,un as destinationMeta,$a as examples,on as mappingSchemaGenerated,cn as mappingUiSchemaGenerated,Qa as schema,sn as settingsSchemaGenerated,dn as settingsUiSchemaGenerated};//# sourceMappingURL=index.mjs.map