@walkeros/web-destination-meta 0.1.2 → 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/README.md +2 -2
- package/dist/examples/index.d.mts +32 -10
- package/dist/examples/index.d.ts +32 -10
- package/dist/examples/index.js +5449 -34
- package/dist/examples/index.mjs +5448 -34
- package/dist/index.browser.js +1 -1
- package/dist/index.d.mts +105 -14
- package/dist/index.d.ts +105 -14
- package/dist/index.es5.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,r=(e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})},i={};r(i,{DestinationMeta:()=>b,default:()=>R,destinationMeta:()=>D,examples:()=>w}),module.exports=(e=i,((e,r,i,s)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let c of a(r))o.call(e,c)||c===i||t(e,c,{get:()=>r[c],enumerable:!(s=n(r,c))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s,c,d=require("@walkeros/web-core");var u=Object.getOwnPropertyNames,p=(s={"package.json"(e,t){t.exports={name:"@walkeros/core",description:"Core types and platform-agnostic utilities for walkerOS",version:"0.1.2",main:"./dist/index.js",module:"./dist/index.mjs",types:"./dist/index.d.ts",license:"MIT",files:["dist/**"],scripts:{build:"tsup --silent",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",dev:"jest --watchAll --colors",lint:'tsc && eslint "**/*.ts*"',test:"jest",update:"npx npm-check-updates -u && npm update"},dependencies:{},devDependencies:{},repository:{url:"git+https://github.com/elbwalker/walkerOS.git",directory:"packages/core"},author:"elbwalker <hello@elbwalker.com>",homepage:"https://github.com/elbwalker/walkerOS#readme",bugs:{url:"https://github.com/elbwalker/walkerOS/issues"},keywords:["walker","walkerOS","analytics","tracking","data collection","measurement","data privacy","privacy friendly","web analytics","product analytics","core","types","utils"],funding:[{type:"GitHub Sponsors",url:"https://github.com/sponsors/elbwalker"}]}}},function(){return c||(0,s[u(s)[0]])((c={exports:{}}).exports,c),c.exports}),l={merge:!0,shallow:!0,extend:!0};function g(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}var{version:m}=p();function y(e={}){var t;const n=e.timestamp||(new Date).setHours(0,13,37,0),a=e.group||"gr0up",o=e.count||1,r=function(e,t={},n={}){n={...l,...n};const a=Object.entries(t).reduce((t,[a,o])=>{const r=e[a];return n.merge&&Array.isArray(r)&&Array.isArray(o)?t[a]=o.reduce((e,t)=>e.includes(t)?e:[...e,t],[...r]):(n.extend||a in e)&&(t[a]=o),t},{});return n.shallow?{...e,...a}:(Object.assign(e,a),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:`${n}-${a}-${o}`,trigger:"test",entity:"entity",action:"action",timestamp:n,timing:3.14,group:a,count:o,version:{source:m,tagging:1},source:{type:"web",id:"https://localhost:80",previous_id:"http://remotehost:9001"}},e,{merge:!1});if(e.name){const[n,a]=null!=(t=e.name.split(" "))?t:[];n&&a&&(r.entity=n,r.action=a)}return r}function h(e="entity action",t={}){const n=t.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 y({...{"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"}}}[e],...t,name:e})}var v=require("@walkeros/web-core"),b={},w={};r(w,{events:()=>f,mapping:()=>C});var f={};function k(){const e=h("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 x(){const e=h("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 q(){const e=h("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 O(){const e=h("product view");return["track","ViewContent",{currency:"EUR",value:e.data.price,contents:[{id:e.data.id,quantity:1}],content_type:"product"},{eventID:e.id}]}r(f,{AddToCart:()=>x,InitiateCheckout:()=>q,Purchase:()=>k,ViewContent:()=>O});var C={};r(C,{AddToCart:()=>j,InitiateCheckout:()=>_,Purchase:()=>E,ViewContent:()=>S,config:()=>A});var E={name:"Purchase",data:{map:{value:"data.total",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>g(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}}}},j={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"}}}},_={name:"InitiateCheckout",data:{map:{value:"data.value",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>g(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}}}},S={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}}}]}}}},A={order:{complete:E},product:{view:S,add:j},cart:{view:_}},D={type:"meta-pixel",config:{},init({config:e,env:t}){const{settings:n={},loadScript:a}=e,{pixelId:o}=n;if(a&&function(e,t="https://connect.facebook.net/en_US/fbevents.js"){const{document:n}=(0,d.getEnvironment)(e),a=n.createElement("script");a.src=t,a.async=!0,n.head.appendChild(a)}(t),!o)return!1;!function(e){const{window:t}=(0,d.getEnvironment)(e),n=t;if(n.fbq)return;const a=function(...e){a.callMethod?a.callMethod.apply(a,e):a.queue.push(e)};n.fbq=a,n._fbq||(n._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[]}(t);const{window:r}=(0,v.getEnvironment)(t);return(0,r.fbq)("init",o),e},push(e,{config:t,mapping:n={},data:a,env:o}){const{track:r,trackCustom:i}=n.settings||{},{window:s}=(0,v.getEnvironment)(o),c=s.fbq;"page view"!==e.name||n.settings||(e.name="PageView");const d=r||i||e.name;c(i?"trackCustom":"track",String(d),g(a)?a:{},{eventID:e.id})}},R=D;//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,a=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,s=(e,a)=>{for(var n in a)t(e,n,{get:a[n],enumerable:!0})},i={};s(i,{DestinationMeta:()=>Fa,default:()=>gn,destinationMeta:()=>fn,examples:()=>za,mappingSchemaGenerated:()=>pn,mappingUiSchemaGenerated:()=>hn,schema:()=>nn,settingsSchemaGenerated:()=>ln,settingsUiSchemaGenerated:()=>mn}),module.exports=(e=i,((e,s,i,o)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let d of n(s))r.call(e,d)||d===i||t(e,d,{get:()=>s[d],enumerable:!(o=a(s,d))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var o=require("@walkeros/web-core");var d,c,u,l={};s(l,{BRAND:()=>Be,DIRTY:()=>T,EMPTY_PATH:()=>x,INVALID:()=>P,NEVER:()=>Dt,OK:()=>O,ParseStatus:()=>S,Schema:()=>L,ZodAny:()=>ge,ZodArray:()=>be,ZodBigInt:()=>ue,ZodBoolean:()=>le,ZodBranded:()=>Ke,ZodCatch:()=>Ve,ZodDate:()=>pe,ZodDefault:()=>Ue,ZodDiscriminatedUnion:()=>Ae,ZodEffects:()=>De,ZodEnum:()=>$e,ZodError:()=>g,ZodFirstPartyTypeKind:()=>Ge,ZodFunction:()=>Ne,ZodIntersection:()=>Pe,ZodIssueCode:()=>h,ZodLazy:()=>Ie,ZodLiteral:()=>Ee,ZodMap:()=>Ce,ZodNaN:()=>qe,ZodNativeEnum:()=>Re,ZodNever:()=>ve,ZodNull:()=>fe,ZodNullable:()=>ze,ZodNumber:()=>ce,ZodObject:()=>xe,ZodOptional:()=>Fe,ZodParsedType:()=>p,ZodPipeline:()=>We,ZodPromise:()=>Le,ZodReadonly:()=>He,ZodRecord:()=>Oe,ZodSchema:()=>L,ZodSet:()=>je,ZodString:()=>oe,ZodSymbol:()=>me,ZodTransformer:()=>De,ZodTuple:()=>Te,ZodType:()=>L,ZodUndefined:()=>he,ZodUnion:()=>we,ZodUnknown:()=>ye,ZodVoid:()=>_e,addIssueToContext:()=>w,any:()=>ut,array:()=>ht,bigint:()=>rt,boolean:()=>st,coerce:()=>Lt,custom:()=>Ye,date:()=>it,datetimeRegex:()=>ne,defaultErrorMap:()=>y,discriminatedUnion:()=>vt,effect:()=>Ct,enum:()=>Pt,function:()=>Zt,getErrorMap:()=>b,getParsedType:()=>m,instanceof:()=>et,intersection:()=>_t,isAborted:()=>C,isAsync:()=>I,isDirty:()=>j,isValid:()=>N,late:()=>Xe,lazy:()=>At,literal:()=>St,makeIssue:()=>k,map:()=>xt,nan:()=>nt,nativeEnum:()=>Tt,never:()=>pt,null:()=>ct,nullable:()=>Nt,number:()=>at,object:()=>ft,objectUtil:()=>u,oboolean:()=>Rt,onumber:()=>$t,optional:()=>jt,ostring:()=>Mt,pipeline:()=>Et,preprocess:()=>It,promise:()=>Ot,quotelessJson:()=>f,record:()=>kt,set:()=>wt,setErrorMap:()=>_,strictObject:()=>gt,string:()=>tt,symbol:()=>ot,transformer:()=>Ct,tuple:()=>bt,undefined:()=>dt,union:()=>yt,unknown:()=>lt,util:()=>d,void:()=>mt}),(c=d||(d={})).assertEqual=e=>{},c.assertIs=function(e){},c.assertNever=function(e){throw new Error},c.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},c.getValidEnumValues=e=>{const t=c.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),a={};for(const n of t)a[n]=e[n];return c.objectValues(a)},c.objectValues=e=>c.objectKeys(e).map(function(t){return e[t]}),c.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},c.find=(e,t)=>{for(const a of e)if(t(a))return a},c.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,c.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},c.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(u||(u={})).mergeShapes=(e,t)=>({...e,...t});var p=d.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),m=e=>{switch(typeof e){case"undefined":return p.undefined;case"string":return p.string;case"number":return Number.isNaN(e)?p.nan:p.number;case"boolean":return p.boolean;case"function":return p.function;case"bigint":return p.bigint;case"symbol":return p.symbol;case"object":return Array.isArray(e)?p.array:null===e?p.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?p.promise:"undefined"!=typeof Map&&e instanceof Map?p.map:"undefined"!=typeof Set&&e instanceof Set?p.set:"undefined"!=typeof Date&&e instanceof Date?p.date:p.object;default:return p.unknown}},h=d.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"]),f=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),g=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,d.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()}};g.create=e=>new g(e);var y=(e,t)=>{let a;switch(e.code){case h.invalid_type:a=e.received===p.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case h.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,d.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:a=`Unrecognized key(s) in object: ${d.joinValues(e.keys,", ")}`;break;case h.invalid_union:a="Invalid input";break;case h.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${d.joinValues(e.options)}`;break;case h.invalid_enum_value:a=`Invalid enum value. Expected ${d.joinValues(e.options)}, received '${e.received}'`;break;case h.invalid_arguments:a="Invalid function arguments";break;case h.invalid_return_type:a="Invalid function return type";break;case h.invalid_date:a="Invalid date";break;case h.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}"`:d.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case h.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 h.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 h.custom:a="Invalid input";break;case h.invalid_intersection_types:a="Intersection results could not be merged";break;case h.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case h.not_finite:a="Number must be finite";break;default:a=t.defaultError,d.assertNever(e)}return{message:a}},v=y;function _(e){v=e}function b(){return v}var k=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}},x=[];function w(e,t){const a=b(),n=k({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===y?void 0:y].filter(e=>!!e)});e.common.issues.push(n)}var Z,A,S=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 P;"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 P;if("aborted"===r.status)return P;"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}}},P=Object.freeze({status:"aborted"}),T=e=>({status:"dirty",value:e}),O=e=>({status:"valid",value:e}),C=e=>"aborted"===e.status,j=e=>"dirty"===e.status,N=e=>"valid"===e.status,I=e=>"undefined"!=typeof Promise&&e instanceof Promise;(A=Z||(Z={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},A.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;var E=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}},M=(e,t)=>{if(N(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 g(e.common.issues);return this._error=t,this._error}}};function $(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 R,L=class{get description(){return this._def.description}_getType(e){return m(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:m(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(I(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:m(e)},r=this._parseSync({data:e,path:n.path,parent:n});return M(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:m(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return N(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=>N(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:m(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(I(n)?n:Promise.resolve(n));return M(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:h.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 De({schema:this,typeName:Ge.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 Fe.create(this,this._def)}nullable(){return ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return be.create(this)}promise(){return Le.create(this,this._def)}or(e){return we.create([this,e],this._def)}and(e){return Pe.create(this,e,this._def)}transform(e){return new De({...$(this._def),schema:this,typeName:Ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ue({...$(this._def),innerType:this,defaultValue:t,typeName:Ge.ZodDefault})}brand(){return new Ke({typeName:Ge.ZodBranded,type:this,...$(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ve({...$(this._def),innerType:this,catchValue:t,typeName:Ge.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return We.create(this,e)}readonly(){return He.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},D=/^c[^\s-]{8,}$/i,F=/^[0-9a-z]+$/,z=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U=/^[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,V=/^[a-z0-9_-]{21}$/i,q=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,B=/^[-+]?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)?)??$/,K=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W=/^(?:(?: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])$/,H=/^(?:(?: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])$/,J=/^(([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]))$/,Y=/^(([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])$/,G=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,X="((\\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])))",ee=new RegExp(`^${X}$`);function te(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 ae(e){return new RegExp(`^${te(e)}$`)}function ne(e){let t=`${X}T${te(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 re(e,t){return!("v4"!==t&&t||!W.test(e))||!("v6"!==t&&t||!J.test(e))}function se(e,t){if(!q.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 ie(e,t){return!("v4"!==t&&t||!H.test(e))||!("v6"!==t&&t||!Y.test(e))}var oe=class e extends L{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==p.string){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.string,received:t.parsedType}),P}const t=new S;let a;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:h.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:h.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const r=e.data.length>n.value,s=e.data.length<n.value;(r||s)&&(a=this._getOrReturnCtx(e,a),r?w(a,{code:h.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):s&&w(a,{code:h.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)K.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"email",code:h.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)R||(R=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),R.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"emoji",code:h.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)U.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"uuid",code:h.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)V.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"nanoid",code:h.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)D.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"cuid",code:h.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)F.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"cuid2",code:h.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)z.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"ulid",code:h.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch(r){a=this._getOrReturnCtx(e,a),w(a,{validation:"url",code:h.invalid_string,message:n.message}),t.dirty()}else if("regex"===n.kind){n.regex.lastIndex=0;n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"regex",code:h.invalid_string,message:n.message}),t.dirty())}else if("trim"===n.kind)e.data=e.data.trim();else if("includes"===n.kind)e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),w(a,{code:h.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty());else if("toLowerCase"===n.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===n.kind)e.data=e.data.toUpperCase();else if("startsWith"===n.kind)e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),w(a,{code:h.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty());else if("endsWith"===n.kind)e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),w(a,{code:h.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty());else if("datetime"===n.kind){ne(n).test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{code:h.invalid_string,validation:"datetime",message:n.message}),t.dirty())}else if("date"===n.kind){ee.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{code:h.invalid_string,validation:"date",message:n.message}),t.dirty())}else if("time"===n.kind){ae(n).test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{code:h.invalid_string,validation:"time",message:n.message}),t.dirty())}else"duration"===n.kind?B.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"duration",code:h.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?re(e.data,n.version)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"ip",code:h.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?se(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"jwt",code:h.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?ie(e.data,n.version)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"cidr",code:h.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?G.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"base64",code:h.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?Q.test(e.data)||(a=this._getOrReturnCtx(e,a),w(a,{validation:"base64url",code:h.invalid_string,message:n.message}),t.dirty()):d.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:h.invalid_string,...Z.errToObj(a)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:"email",...Z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Z.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,...Z.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,...Z.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Z.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Z.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...Z.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Z.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Z.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Z.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Z.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Z.errToObj(t)})}nonempty(e){return this.min(1,Z.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 de(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}oe.create=e=>{var t;return new oe({checks:[],typeName:Ge.ZodString,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...$(e)})};var ce=class e extends L{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)!==p.number){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.number,received:t.parsedType}),P}let t;const a=new S;for(const n of this._def.checks)if("int"===n.kind)d.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),w(t,{code:h.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty())}else"multipleOf"===n.kind?0!==de(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),w(t,{code:h.not_finite,message:n.message}),a.dirty()):d.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(t,a,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:Z.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:"int",message:Z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Z.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&&d.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)}};ce.create=e=>new ce({checks:[],typeName:Ge.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});var ue=class e extends L{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)!==p.bigint)return this._getInvalidInput(e);let t;const a=new S;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),w(t,{code:h.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):d.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.bigint,received:t.parsedType}),P}gte(e,t){return this.setLimit("min",e,!0,Z.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Z.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Z.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Z.toString(t))}setLimit(t,a,n,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:a,inclusive:n,message:Z.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:Z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Z.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Z.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}};ue.create=e=>{var t;return new ue({checks:[],typeName:Ge.ZodBigInt,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...$(e)})};var le=class extends L{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==p.boolean){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.boolean,received:t.parsedType}),P}return O(e.data)}};le.create=e=>new le({typeName:Ge.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});var pe=class e extends L{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==p.date){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.date,received:t.parsedType}),P}if(Number.isNaN(e.data.getTime())){return w(this._getOrReturnCtx(e),{code:h.invalid_date}),P}const t=new S;let a;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:h.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),w(a,{code:h.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):d.assertNever(n);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:Z.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Z.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}};pe.create=e=>new pe({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ge.ZodDate,...$(e)});var me=class extends L{_parse(e){if(this._getType(e)!==p.symbol){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.symbol,received:t.parsedType}),P}return O(e.data)}};me.create=e=>new me({typeName:Ge.ZodSymbol,...$(e)});var he=class extends L{_parse(e){if(this._getType(e)!==p.undefined){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.undefined,received:t.parsedType}),P}return O(e.data)}};he.create=e=>new he({typeName:Ge.ZodUndefined,...$(e)});var fe=class extends L{_parse(e){if(this._getType(e)!==p.null){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.null,received:t.parsedType}),P}return O(e.data)}};fe.create=e=>new fe({typeName:Ge.ZodNull,...$(e)});var ge=class extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return O(e.data)}};ge.create=e=>new ge({typeName:Ge.ZodAny,...$(e)});var ye=class extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return O(e.data)}};ye.create=e=>new ye({typeName:Ge.ZodUnknown,...$(e)});var ve=class extends L{_parse(e){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.never,received:t.parsedType}),P}};ve.create=e=>new ve({typeName:Ge.ZodNever,...$(e)});var _e=class extends L{_parse(e){if(this._getType(e)!==p.undefined){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.void,received:t.parsedType}),P}return O(e.data)}};_e.create=e=>new _e({typeName:Ge.ZodVoid,...$(e)});var be=class e extends L{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==p.array)return w(t,{code:h.invalid_type,expected:p.array,received:t.parsedType}),P;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,r=t.data.length<n.exactLength.value;(e||r)&&(w(t,{code:e?h.too_big:h.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&&(w(t,{code:h.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&&(w(t,{code:h.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 E(t,e,t.path,a)))).then(e=>S.mergeArray(a,e));const r=[...t.data].map((e,a)=>n.type._parseSync(new E(t,e,t.path,a)));return S.mergeArray(a,r)}get element(){return this._def.type}min(t,a){return new e({...this._def,minLength:{value:t,message:Z.toString(a)}})}max(t,a){return new e({...this._def,maxLength:{value:t,message:Z.toString(a)}})}length(t,a){return new e({...this._def,exactLength:{value:t,message:Z.toString(a)}})}nonempty(e){return this.min(1,e)}};function ke(e){if(e instanceof xe){const t={};for(const a in e.shape){const n=e.shape[a];t[a]=Fe.create(ke(n))}return new xe({...e._def,shape:()=>t})}return e instanceof be?new be({...e._def,type:ke(e.element)}):e instanceof Fe?Fe.create(ke(e.unwrap())):e instanceof ze?ze.create(ke(e.unwrap())):e instanceof Te?Te.create(e.items.map(e=>ke(e))):e}be.create=(e,t)=>new be({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ge.ZodArray,...$(t)});var xe=class e extends L{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=d.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==p.object){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.object,received:t.parsedType}),P}const{status:t,ctx:a}=this._processInputParams(e),{shape:n,keys:r}=this._getCached(),s=[];if(!(this._def.catchall instanceof ve&&"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 E(a,r,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof ve){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&&(w(a,{code:h.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 E(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=>S.mergeObjectSync(t,e)):S.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(t){return Z.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=Z.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:Ge.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 d.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 d.objectKeys(this.shape))t[e]||(a[e]=this.shape[e]);return new e({...this._def,shape:()=>a})}deepPartial(){return ke(this)}partial(t){const a={};for(const e of d.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 d.objectKeys(this.shape))if(t&&!t[e])a[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Fe;)t=t._def.innerType;a[e]=t}return new e({...this._def,shape:()=>a})}keyof(){return Me(d.objectKeys(this.shape))}};xe.create=(e,t)=>new xe({shape:()=>e,unknownKeys:"strip",catchall:ve.create(),typeName:Ge.ZodObject,...$(t)}),xe.strictCreate=(e,t)=>new xe({shape:()=>e,unknownKeys:"strict",catchall:ve.create(),typeName:Ge.ZodObject,...$(t)}),xe.lazycreate=(e,t)=>new xe({shape:e,unknownKeys:"strip",catchall:ve.create(),typeName:Ge.ZodObject,...$(t)});var we=class extends L{_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 g(e.ctx.common.issues));return w(t,{code:h.invalid_union,unionErrors:a}),P});{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 g(e));return w(t,{code:h.invalid_union,unionErrors:r}),P}}get options(){return this._def.options}};we.create=(e,t)=>new we({options:e,typeName:Ge.ZodUnion,...$(t)});var Ze=e=>e instanceof Ie?Ze(e.schema):e instanceof De?Ze(e.innerType()):e instanceof Ee?[e.value]:e instanceof $e?e.options:e instanceof Re?d.objectValues(e.enum):e instanceof Ue?Ze(e._def.innerType):e instanceof he?[void 0]:e instanceof fe?[null]:e instanceof Fe?[void 0,...Ze(e.unwrap())]:e instanceof ze?[null,...Ze(e.unwrap())]:e instanceof Ke||e instanceof He?Ze(e.unwrap()):e instanceof Ve?Ze(e._def.innerType):[],Ae=class e extends L{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.object)return w(t,{code:h.invalid_type,expected:p.object,received:t.parsedType}),P;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}):(w(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),P)}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=Ze(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:Ge.ZodDiscriminatedUnion,discriminator:t,options:a,optionsMap:r,...$(n)})}};function Se(e,t){const a=m(e),n=m(t);if(e===t)return{valid:!0,data:e};if(a===p.object&&n===p.object){const a=d.objectKeys(t),n=d.objectKeys(e).filter(e=>-1!==a.indexOf(e)),r={...e,...t};for(const a of n){const n=Se(e[a],t[a]);if(!n.valid)return{valid:!1};r[a]=n.data}return{valid:!0,data:r}}if(a===p.array&&n===p.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let n=0;n<e.length;n++){const r=Se(e[n],t[n]);if(!r.valid)return{valid:!1};a.push(r.data)}return{valid:!0,data:a}}return a===p.date&&n===p.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}var Pe=class extends L{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(e,n)=>{if(C(e)||C(n))return P;const r=Se(e.value,n.value);return r.valid?((j(e)||j(n))&&t.dirty(),{status:t.value,value:r.data}):(w(a,{code:h.invalid_intersection_types}),P)};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}))}};Pe.create=(e,t,a)=>new Pe({left:e,right:t,typeName:Ge.ZodIntersection,...$(a)});var Te=class e extends L{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.array)return w(a,{code:h.invalid_type,expected:p.array,received:a.parsedType}),P;if(a.data.length<this._def.items.length)return w(a,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&a.data.length>this._def.items.length&&(w(a,{code:h.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 E(a,e,a.path,t)):null}).filter(e=>!!e);return a.common.async?Promise.all(n).then(e=>S.mergeArray(t,e)):S.mergeArray(t,n)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Te.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Te({items:e,typeName:Ge.ZodTuple,rest:null,...$(t)})};var Oe=class e extends L{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!==p.object)return w(a,{code:h.invalid_type,expected:p.object,received:a.parsedType}),P;const n=[],r=this._def.keyType,s=this._def.valueType;for(const e in a.data)n.push({key:r._parse(new E(a,e,a.path,e)),value:s._parse(new E(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?S.mergeObjectAsync(t,n):S.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(t,a,n){return new e(a instanceof L?{keyType:t,valueType:a,typeName:Ge.ZodRecord,...$(n)}:{keyType:oe.create(),valueType:t,typeName:Ge.ZodRecord,...$(a)})}},Ce=class extends L{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!==p.map)return w(a,{code:h.invalid_type,expected:p.map,received:a.parsedType}),P;const n=this._def.keyType,r=this._def.valueType,s=[...a.data.entries()].map(([e,t],s)=>({key:n._parse(new E(a,e,a.path,[s,"key"])),value:r._parse(new E(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 P;"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 P;"dirty"!==n.status&&"dirty"!==r.status||t.dirty(),e.set(n.value,r.value)}return{status:t.value,value:e}}}};Ce.create=(e,t,a)=>new Ce({valueType:t,keyType:e,typeName:Ge.ZodMap,...$(a)});var je=class e extends L{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==p.set)return w(a,{code:h.invalid_type,expected:p.set,received:a.parsedType}),P;const n=this._def;null!==n.minSize&&a.data.size<n.minSize.value&&(w(a,{code:h.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&&(w(a,{code:h.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 P;"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 E(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:Z.toString(a)}})}max(t,a){return new e({...this._def,maxSize:{value:t,message:Z.toString(a)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};je.create=(e,t)=>new je({valueType:e,minSize:null,maxSize:null,typeName:Ge.ZodSet,...$(t)});var Ne=class e extends L{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.function)return w(t,{code:h.invalid_type,expected:p.function,received:t.parsedType}),P;function a(e,a){return k({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b(),y].filter(e=>!!e),issueData:{code:h.invalid_arguments,argumentsError:a}})}function n(e,a){return k({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,b(),y].filter(e=>!!e),issueData:{code:h.invalid_return_type,returnTypeError:a}})}const r={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Le){const e=this;return O(async function(...t){const i=new g([]),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 O(function(...t){const i=e._def.args.safeParse(t,r);if(!i.success)throw new g([a(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,r);if(!d.success)throw new g([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:Te.create(t).rest(ye.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||Te.create([]).rest(ye.create()),returns:a||ye.create(),typeName:Ge.ZodFunction,...$(n)})}},Ie=class extends L{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})}};Ie.create=(e,t)=>new Ie({getter:e,typeName:Ge.ZodLazy,...$(t)});var Ee=class extends L{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return w(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}};function Me(e,t){return new $e({values:e,typeName:Ge.ZodEnum,...$(t)})}Ee.create=(e,t)=>new Ee({value:e,typeName:Ge.ZodLiteral,...$(t)});var $e=class e extends L{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return w(t,{expected:d.joinValues(a),received:t.parsedType,code:h.invalid_type}),P}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 w(t,{received:t.data,code:h.invalid_enum_value,options:a}),P}return O(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})}};$e.create=Me;var Re=class extends L{_parse(e){const t=d.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==p.string&&a.parsedType!==p.number){const e=d.objectValues(t);return w(a,{expected:d.joinValues(e),received:a.parsedType,code:h.invalid_type}),P}if(this._cache||(this._cache=new Set(d.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=d.objectValues(t);return w(a,{received:a.data,code:h.invalid_enum_value,options:e}),P}return O(e.data)}get enum(){return this._def.values}};Re.create=(e,t)=>new Re({values:e,typeName:Ge.ZodNativeEnum,...$(t)});var Le=class extends L{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==p.promise&&!1===t.common.async)return w(t,{code:h.invalid_type,expected:p.promise,received:t.parsedType}),P;const a=t.parsedType===p.promise?t.data:Promise.resolve(t.data);return O(a.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Le.create=(e,t)=>new Le({type:e,typeName:Ge.ZodPromise,...$(t)});var De=class extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:e=>{w(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===n.type){const e=n.transform(a.data,r);if(a.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return P;const n=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===n.status?P:"dirty"===n.status||"dirty"===t.value?T(n.value):n});{if("aborted"===t.value)return P;const n=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===n.status?P:"dirty"===n.status||"dirty"===t.value?T(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,r);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?P:("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?P:("dirty"===a.status&&t.dirty(),e(a.value).then(()=>({status:t.value,value:a.value}))))}if("transform"===n.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!N(e))return P;const s=n.transform(e.value,r);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(e=>N(e)?Promise.resolve(n.transform(e.value,r)).then(e=>({status:t.value,value:e})):P)}d.assertNever(n)}};De.create=(e,t,a)=>new De({schema:e,typeName:Ge.ZodEffects,effect:t,...$(a)}),De.createWithPreprocess=(e,t,a)=>new De({schema:t,effect:{type:"preprocess",transform:e},typeName:Ge.ZodEffects,...$(a)});var Fe=class extends L{_parse(e){return this._getType(e)===p.undefined?O(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Fe.create=(e,t)=>new Fe({innerType:e,typeName:Ge.ZodOptional,...$(t)});var ze=class extends L{_parse(e){return this._getType(e)===p.null?O(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ze.create=(e,t)=>new ze({innerType:e,typeName:Ge.ZodNullable,...$(t)});var Ue=class extends L{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===p.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Ue.create=(e,t)=>new Ue({innerType:e,typeName:Ge.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$(t)});var Ve=class extends L{_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 I(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new g(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new g(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};Ve.create=(e,t)=>new Ve({innerType:e,typeName:Ge.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$(t)});var qe=class extends L{_parse(e){if(this._getType(e)!==p.nan){const t=this._getOrReturnCtx(e);return w(t,{code:h.invalid_type,expected:p.nan,received:t.parsedType}),P}return{status:"valid",value:e.data}}};qe.create=e=>new qe({typeName:Ge.ZodNaN,...$(e)});var Be=Symbol("zod_brand"),Ke=class extends L{_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}},We=class e extends L{_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?P:"dirty"===e.status?(t.dirty(),T(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?P:"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:Ge.ZodPipeline})}},He=class extends L{_parse(e){const t=this._def.innerType._parse(e),a=e=>(N(e)&&(e.value=Object.freeze(e.value)),e);return I(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}};function Je(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function Ye(e,t={},a){return e?ge.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=Je(t,n),o=null==(i=null!=(s=e.fatal)?s:a)||i;r.addIssue({code:"custom",...e,fatal:o})}});if(!o){const e=Je(t,n),o=null==(i=null!=(s=e.fatal)?s:a)||i;r.addIssue({code:"custom",...e,fatal:o})}}):ge.create()}He.create=(e,t)=>new He({innerType:e,typeName:Ge.ZodReadonly,...$(t)});var Ge,Qe,Xe={object:xe.lazycreate};(Qe=Ge||(Ge={})).ZodString="ZodString",Qe.ZodNumber="ZodNumber",Qe.ZodNaN="ZodNaN",Qe.ZodBigInt="ZodBigInt",Qe.ZodBoolean="ZodBoolean",Qe.ZodDate="ZodDate",Qe.ZodSymbol="ZodSymbol",Qe.ZodUndefined="ZodUndefined",Qe.ZodNull="ZodNull",Qe.ZodAny="ZodAny",Qe.ZodUnknown="ZodUnknown",Qe.ZodNever="ZodNever",Qe.ZodVoid="ZodVoid",Qe.ZodArray="ZodArray",Qe.ZodObject="ZodObject",Qe.ZodUnion="ZodUnion",Qe.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Qe.ZodIntersection="ZodIntersection",Qe.ZodTuple="ZodTuple",Qe.ZodRecord="ZodRecord",Qe.ZodMap="ZodMap",Qe.ZodSet="ZodSet",Qe.ZodFunction="ZodFunction",Qe.ZodLazy="ZodLazy",Qe.ZodLiteral="ZodLiteral",Qe.ZodEnum="ZodEnum",Qe.ZodEffects="ZodEffects",Qe.ZodNativeEnum="ZodNativeEnum",Qe.ZodOptional="ZodOptional",Qe.ZodNullable="ZodNullable",Qe.ZodDefault="ZodDefault",Qe.ZodCatch="ZodCatch",Qe.ZodPromise="ZodPromise",Qe.ZodBranded="ZodBranded",Qe.ZodPipeline="ZodPipeline",Qe.ZodReadonly="ZodReadonly";var et=(e,t={message:`Input not instance of ${e.name}`})=>Ye(t=>t instanceof e,t),tt=oe.create,at=ce.create,nt=qe.create,rt=ue.create,st=le.create,it=pe.create,ot=me.create,dt=he.create,ct=fe.create,ut=ge.create,lt=ye.create,pt=ve.create,mt=_e.create,ht=be.create,ft=xe.create,gt=xe.strictCreate,yt=we.create,vt=Ae.create,_t=Pe.create,bt=Te.create,kt=Oe.create,xt=Ce.create,wt=je.create,Zt=Ne.create,At=Ie.create,St=Ee.create,Pt=$e.create,Tt=Re.create,Ot=Le.create,Ct=De.create,jt=Fe.create,Nt=ze.create,It=De.createWithPreprocess,Et=We.create,Mt=()=>tt().optional(),$t=()=>at().optional(),Rt=()=>st().optional(),Lt={string:e=>oe.create({...e,coerce:!0}),number:e=>ce.create({...e,coerce:!0}),boolean:e=>le.create({...e,coerce:!0}),bigint:e=>ue.create({...e,coerce:!0}),date:e=>pe.create({...e,coerce:!0})},Dt=P,Ft=Symbol("Let zodToJsonSchema decide on which parser to use"),zt={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"},Ut=e=>{const t=(e=>"string"==typeof e?{...zt,name:e}:{...zt,...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 Vt(e,t,a,n){(null==n?void 0:n.errorMessages)&&a&&(e.errorMessage={...e.errorMessage,[t]:a})}function qt(e,t,a,n,r){e[t]=a,Vt(e,t,n,r)}var Bt=(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 Kt(e){if("openAi"!==e.target)return{};const t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===e.$refStrategy?Bt(t,e.currentPath):t.join("/")}}function Wt(e,t){return ba(e.type._def,t)}function Ht(e,t,a){const n=null!=a?a:t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((a,n)=>Ht(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 Jt(e,t)}}var Jt=(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":qt(a,"minimum",n.value,n.message,t);break;case"max":qt(a,"maximum",n.value,n.message,t)}return a};var Yt=void 0,Gt=/^[cC][^\s-]{8,}$/,Qt=/^[0-9a-z]+$/,Xt=/^[0-9A-HJKMNP-TV-Z]{26}$/,ea=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,ta=()=>(void 0===Yt&&(Yt=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Yt),aa=/^(?:(?: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])$/,na=/^(([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])$/,ra=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sa=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ia=/^[a-zA-Z0-9_-]{21}$/,oa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function da(e,t){const a={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":qt(a,"minLength","number"==typeof a.minLength?Math.max(a.minLength,n.value):n.value,n.message,t);break;case"max":qt(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":la(a,"email",n.message,t);break;case"format:idn-email":la(a,"idn-email",n.message,t);break;case"pattern:zod":pa(a,ea,n.message,t)}break;case"url":la(a,"uri",n.message,t);break;case"uuid":la(a,"uuid",n.message,t);break;case"regex":pa(a,n.regex,n.message,t);break;case"cuid":pa(a,Gt,n.message,t);break;case"cuid2":pa(a,Qt,n.message,t);break;case"startsWith":pa(a,RegExp(`^${ca(n.value,t)}`),n.message,t);break;case"endsWith":pa(a,RegExp(`${ca(n.value,t)}$`),n.message,t);break;case"datetime":la(a,"date-time",n.message,t);break;case"date":la(a,"date",n.message,t);break;case"time":la(a,"time",n.message,t);break;case"duration":la(a,"duration",n.message,t);break;case"length":qt(a,"minLength","number"==typeof a.minLength?Math.max(a.minLength,n.value):n.value,n.message,t),qt(a,"maxLength","number"==typeof a.maxLength?Math.min(a.maxLength,n.value):n.value,n.message,t);break;case"includes":pa(a,RegExp(ca(n.value,t)),n.message,t);break;case"ip":"v6"!==n.version&&la(a,"ipv4",n.message,t),"v4"!==n.version&&la(a,"ipv6",n.message,t);break;case"base64url":pa(a,sa,n.message,t);break;case"jwt":pa(a,oa,n.message,t);break;case"cidr":"v6"!==n.version&&pa(a,aa,n.message,t),"v4"!==n.version&&pa(a,na,n.message,t);break;case"emoji":pa(a,ta(),n.message,t);break;case"ulid":pa(a,Xt,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":la(a,"binary",n.message,t);break;case"contentEncoding:base64":qt(a,"contentEncoding","base64",n.message,t);break;case"pattern:zod":pa(a,ra,n.message,t)}break;case"nanoid":pa(a,ia,n.message,t)}return a}function ca(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let a=0;a<e.length;a++)ua.has(e[a])||(t+="\\"),t+=e[a];return t}(e):e}var ua=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function la(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}}})):qt(e,"format",t,a,n)}function pa(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:ma(t,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):qt(e,"pattern",ma(t,n),a,n)}function ma(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 ha(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)===Ge.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((a,n)=>{var r;return{...a,[n]:null!=(r=ba(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",n]}))?r:Kt(t)}},{}),additionalProperties:t.rejectedAdditionalProperties};const c={type:"object",additionalProperties:null!=(n=ba(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)===Ge.ZodString&&(null==(s=e.keyType._def.checks)?void 0:s.length)){const{type:a,...n}=da(e.keyType._def,t);return{...c,propertyNames:n}}if((null==(i=e.keyType)?void 0:i._def.typeName)===Ge.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if((null==(o=e.keyType)?void 0:o._def.typeName)===Ge.ZodBranded&&e.keyType._def.type._def.typeName===Ge.ZodString&&(null==(d=e.keyType._def.type._def.checks)?void 0:d.length)){const{type:a,...n}=Wt(e.keyType._def,t);return{...c,propertyNames:n}}return c}var fa={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};var ga=(e,t)=>{const a=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,a)=>ba(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 ya(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=va(i);o&&a&&("ZodOptional"===i._def.typeName&&(i=i._def.innerType),i.isNullable()||(i=i.nullable()),o=!1);const d=ba(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 ba(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 va(e){try{return e.isOptional()}catch(e){return!0}}var _a=(e,t,a)=>{switch(t){case Ge.ZodString:return da(e,a);case Ge.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",Vt(a,"type",n.message,t);break;case"min":"jsonSchema7"===t.target?n.inclusive?qt(a,"minimum",n.value,n.message,t):qt(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),qt(a,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?qt(a,"maximum",n.value,n.message,t):qt(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),qt(a,"maximum",n.value,n.message,t));break;case"multipleOf":qt(a,"multipleOf",n.value,n.message,t)}return a}(e,a);case Ge.ZodObject:return ya(e,a);case Ge.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?qt(a,"minimum",n.value,n.message,t):qt(a,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(a.exclusiveMinimum=!0),qt(a,"minimum",n.value,n.message,t));break;case"max":"jsonSchema7"===t.target?n.inclusive?qt(a,"maximum",n.value,n.message,t):qt(a,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(a.exclusiveMaximum=!0),qt(a,"maximum",n.value,n.message,t));break;case"multipleOf":qt(a,"multipleOf",n.value,n.message,t)}return a}(e,a);case Ge.ZodBoolean:return{type:"boolean"};case Ge.ZodDate:return Ht(e,a);case Ge.ZodUndefined:return function(e){return{not:Kt(e)}}(a);case Ge.ZodNull:return function(e){return"openApi3"===e.target?{enum:["null"],nullable:!0}:{type:"null"}}(a);case Ge.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)!==Ge.ZodAny&&(s.items=ba(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&qt(s,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&qt(s,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(qt(s,"minItems",e.exactLength.value,e.exactLength.message,t),qt(s,"maxItems",e.exactLength.value,e.exactLength.message,t)),s}(e,a);case Ge.ZodUnion:case Ge.ZodDiscriminatedUnion:return function(e,t){if("openApi3"===t.target)return ga(e,t);const a=e.options instanceof Map?Array.from(e.options.values()):e.options;if(a.every(e=>e._def.typeName in fa&&(!e._def.checks||!e._def.checks.length))){const e=a.reduce((e,t)=>{const a=fa[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 ga(e,t)}(e,a);case Ge.ZodIntersection:return function(e,t){const a=[ba(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ba(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 Ge.ZodTuple:return function(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,a)=>ba(e._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:ba(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,a)=>ba(e._def,{...t,currentPath:[...t.currentPath,"items",`${a}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])}}(e,a);case Ge.ZodRecord:return ha(e,a);case Ge.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 Ge.ZodEnum:return function(e){return{type:"string",enum:Array.from(e.values)}}(e);case Ge.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 Ge.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:fa[e.innerType._def.typeName],nullable:!0}:{type:[fa[e.innerType._def.typeName],"null"]};if("openApi3"===t.target){const a=ba(e.innerType._def,{...t,currentPath:[...t.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}const a=ba(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return a&&{anyOf:[a,{type:"null"}]}}(e,a);case Ge.ZodOptional:return((e,t)=>{var a;if(t.currentPath.toString()===(null==(a=t.propertyPath)?void 0:a.toString()))return ba(e.innerType._def,t);const n=ba(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:Kt(t)},n]}:Kt(t)})(e,a);case Ge.ZodMap:return function(e,t){return"record"===t.mapStrategy?ha(e,t):{type:"array",maxItems:125,items:{type:"array",items:[ba(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Kt(t),ba(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Kt(t)],minItems:2,maxItems:2}}}(e,a);case Ge.ZodSet:return function(e,t){const a={type:"array",uniqueItems:!0,items:ba(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&qt(a,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&qt(a,"maxItems",e.maxSize.value,e.maxSize.message,t),a}(e,a);case Ge.ZodLazy:return()=>e.getter()._def;case Ge.ZodPromise:return function(e,t){return ba(e.type._def,t)}(e,a);case Ge.ZodNaN:case Ge.ZodNever:return function(e){return"openAi"===e.target?void 0:{not:Kt({...e,currentPath:[...e.currentPath,"not"]})}}(a);case Ge.ZodEffects:return function(e,t){return"input"===t.effectStrategy?ba(e.schema._def,t):Kt(t)}(e,a);case Ge.ZodAny:return Kt(a);case Ge.ZodUnknown:return function(e){return Kt(e)}(a);case Ge.ZodDefault:return function(e,t){return{...ba(e.innerType._def,t),default:e.defaultValue()}}(e,a);case Ge.ZodBranded:return Wt(e,a);case Ge.ZodReadonly:case Ge.ZodCatch:return((e,t)=>ba(e.innerType._def,t))(e,a);case Ge.ZodPipeline:return((e,t)=>{if("input"===t.pipeStrategy)return ba(e.in._def,t);if("output"===t.pipeStrategy)return ba(e.out._def,t);const a=ba(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]});return{allOf:[a,ba(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",a?"1":"0"]})].filter(e=>void 0!==e)}})(e,a);case Ge.ZodFunction:case Ge.ZodVoid:case Ge.ZodSymbol:default:return}};function ba(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!==Ft)return s}if(r&&!a){const e=ka(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=_a(e,e.typeName,t),o="function"==typeof i?ba(i(),t):i;if(o&&xa(e,t,o),t.postProcess){const a=t.postProcess(o,e,t);return s.jsonSchema=o,a}return s.jsonSchema=o,o}var ka=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Bt(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`),Kt(t)):"seen"===t.$refStrategy?Kt(t):void 0}},xa=(e,t,a)=>(e.description&&(a.description=e.description,t.markdownDescription&&(a.markdownDescription=e.description)),a),wa=(e,t)=>{var a;const n=Ut(t);let r="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,a])=>{var r;return{...e,[t]:null!=(r=ba(a._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0))?r:Kt(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=ba(e._def,void 0===s?n:{...n,currentPath:[...n.basePath,n.definitionPath,s]},!1))?a:Kt(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},Za=l.record(l.string(),l.boolean()).describe("Consent requirement mapping"),Aa=l.lazy(()=>l.union([l.string(),l.number(),l.boolean(),Oa,l.array(Aa)])),Sa=l.tuple([Aa,Aa]).describe("Loop: [source, transform] tuple for array transformations"),Pa=l.array(Aa).describe("Set: Array of values"),Ta=l.record(l.string(),Aa).describe("Map: Object mapping keys to values"),Oa=l.object({key:l.string().optional().describe('Property path (e.g., "data.id")'),value:l.union([l.string(),l.number(),l.boolean()]).optional().describe("Static primitive value"),fn:l.string().optional().describe("Function string for custom transformation"),map:Ta.optional().describe("Object with key-value mappings"),loop:Sa.optional().describe("Tuple [source, transform]"),set:Pa.optional().describe("Array of values"),consent:Za.optional().describe("Required consent states"),condition:l.string().optional().describe("Condition function string"),validate:l.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"),Ca=Sa,ja=Pa,Na=Ta;wa(Oa,{target:"jsonSchema7",$refStrategy:"relative",name:"ValueConfig"}),wa(Ca,{target:"jsonSchema7",$refStrategy:"relative",name:"Loop"}),wa(ja,{target:"jsonSchema7",$refStrategy:"relative",name:"Set"}),wa(Na,{target:"jsonSchema7",$refStrategy:"relative",name:"Map"});function Ia(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]=Ea(a);e.properties=t}"array"===r.type&&r.items&&(e.items=Ea(r.items)),n[t]=e}const r={type:"object",properties:n};return t&&(r.title=t),a.length>0&&(r.required=a),r}function Ea(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]=Ea(n);t.properties=a}return"array"===e.type&&e.items&&(t.items=Ea(e.items)),t}var Ma={merge:!0,shallow:!0,extend:!0};function $a(e){return"object"==typeof e&&null!==e&&!function(e){return Array.isArray(e)}(e)&&"[object Object]"===Object.prototype.toString.call(e)}function Ra(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={...Ma,...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 La(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 Ra({...{"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})}var Da=require("@walkeros/web-core"),Fa={},za={};s(za,{env:()=>Ua,events:()=>Ka,mapping:()=>Ga});var Ua={};s(Ua,{init:()=>qa,push:()=>Ba});var Va=()=>{},qa={window:{fbq:void 0,_fbq:void 0},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},Ba={window:{fbq:Object.assign(Va,{callMethod:Va,queue:[],push:Va,loaded:!0,version:"2.0"}),_fbq:Object.assign(Va,{callMethod:Va,queue:[],push:Va,loaded:!0,version:"2.0"})},document:{createElement:()=>({src:"",async:!1,setAttribute:()=>{},removeAttribute:()=>{}}),head:{appendChild:()=>{}}}},Ka={};function Wa(){const e=La("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 Ha(){const e=La("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 Ja(){const e=La("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 Ya(){const e=La("product view");return["track","ViewContent",{currency:"EUR",value:e.data.price,contents:[{id:e.data.id,quantity:1}],content_type:"product"},{eventID:e.id}]}s(Ka,{AddToCart:()=>Ha,InitiateCheckout:()=>Ja,Purchase:()=>Wa,ViewContent:()=>Ya});var Ga={};s(Ga,{AddToCart:()=>Xa,InitiateCheckout:()=>en,Purchase:()=>Qa,ViewContent:()=>tn,config:()=>an});var Qa={name:"Purchase",data:{map:{value:"data.total",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>$a(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}}}},Xa={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"}}}},en={name:"InitiateCheckout",data:{map:{value:"data.value",currency:{value:"EUR"},contents:{loop:["nested",{condition:e=>$a(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}}}},tn={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}}}]}}}},an={order:{complete:Qa},product:{view:tn,add:Xa},cart:{view:en}},nn={};s(nn,{dataSchema:()=>cn,dataUiSchema:()=>un,mappingSchema:()=>on,mappingUiSchema:()=>dn,settingsSchema:()=>rn,settingsUiSchema:()=>sn});var rn={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"]},sn={pixelId:{"ui:placeholder":"e.g., 1234567890123456","ui:help":"Find your Pixel ID in Meta Events Manager"}},on={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"}}},dn={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"]},cn={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},un={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"}},ln=Ia({pixelId:{type:"string",required:!0,pattern:"^[0-9]+$",description:"Your Meta (Facebook) Pixel ID",minLength:1}},"Meta Pixel Settings"),pn=Ia({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"),mn={pixelId:{"ui:placeholder":"e.g., 1234567890123456","ui:help":"Find your Pixel ID in Meta Events Manager"}},hn={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"]},fn={type:"meta-pixel",config:{},init({config:e,env:t}){const{settings:a={},loadScript:n}=e,{pixelId:r}=a;if(n&&function(e,t="https://connect.facebook.net/en_US/fbevents.js"){const{document:a}=(0,o.getEnv)(e),n=a.createElement("script");n.src=t,n.async=!0,a.head.appendChild(n)}(t),!r)return!1;!function(e){const{window:t}=(0,o.getEnv)(e),a=t;if(a.fbq)return;const n=function(...e){n.callMethod?n.callMethod.apply(n,e):n.queue.push(e)};a.fbq=n,a._fbq||(a._fbq=n),n.push=n,n.loaded=!0,n.version="2.0",n.queue=[]}(t);const{window:s}=(0,Da.getEnv)(t);return(0,s.fbq)("init",r),e},push(e,{config:t,mapping:a={},data:n,env:r}){const{track:s,trackCustom:i}=a.settings||{},{window:o}=(0,Da.getEnv)(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),$a(n)?n:{},{eventID:e.id})}},gn=fn;//# sourceMappingURL=index.js.map
|