@platforma-sdk/ui-vue 1.18.7 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/lib.js +1 -1
- package/dist/lib.umd.cjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/lib.js
CHANGED
package/dist/lib.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(F,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@ag-grid-enterprise/core"),require("@ag-grid-community/core"),require("@ag-grid-community/client-side-row-model"),require("@ag-grid-community/infinite-row-model"),require("@ag-grid-enterprise/server-side-row-model"),require("@ag-grid-community/csv-export"),require("@ag-grid-enterprise/clipboard"),require("@ag-grid-enterprise/range-selection"),require("@ag-grid-enterprise/rich-select"),require("@ag-grid-enterprise/menu"),require("@ag-grid-enterprise/excel-export"),require("@ag-grid-community/theming"),require("@ag-grid-community/vue3")):typeof define=="function"&&define.amd?define(["exports","vue","@ag-grid-enterprise/core","@ag-grid-community/core","@ag-grid-community/client-side-row-model","@ag-grid-community/infinite-row-model","@ag-grid-enterprise/server-side-row-model","@ag-grid-community/csv-export","@ag-grid-enterprise/clipboard","@ag-grid-enterprise/range-selection","@ag-grid-enterprise/rich-select","@ag-grid-enterprise/menu","@ag-grid-enterprise/excel-export","@ag-grid-community/theming","@ag-grid-community/vue3"],r):(F=typeof globalThis<"u"?globalThis:F||self,r(F.SdkVueLib={},F.Vue,F.core$1,F.core,F.clientSideRowModel,F.infiniteRowModel,F.serverSideRowModel,F.csvExport,F.clipboard,F.rangeSelection,F.richSelect,F.menu,F.excelExport,F.theming,F.vue3))})(this,function(F,r,Me,x,fs,Pg,Qa,Rg,Hd,qd,Dg,Ig,Fg,Kd,Lg){"use strict";var QM=Object.defineProperty;var Vg=F=>{throw TypeError(F)};var eG=(F,r,Me)=>r in F?QM(F,r,{enumerable:!0,configurable:!0,writable:!0,value:Me}):F[r]=Me;var Ze=(F,r,Me)=>eG(F,typeof r!="symbol"?r+"":r,Me),zd=(F,r,Me)=>r.has(F)||Vg("Cannot "+Me);var b=(F,r,Me)=>(zd(F,r,"read from private field"),Me?Me.call(F):r.get(F)),ze=(F,r,Me)=>r.has(F)?Vg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(F):r.set(F,Me),ye=(F,r,Me,x)=>(zd(F,r,"write to private field"),x?x.call(F,Me):r.set(F,Me),Me),ue=(F,r,Me)=>(zd(F,r,"access private method"),Me);var Ya=(F,r,Me,x)=>({set _(fs){ye(F,r,fs,Me)},get _(){return b(F,r,x)}});var qh,Po,Kh,Yh,vn,Ht,wn,bn,Ro,Do,pt,xn,dt,Je,ke,Pt,qt,St,gt,kn,yt,En,Sn,Kt,Tn,Ar,Rt,re,Ud,eo,Qn,Ui,Yt,Bg,to,Io,Zi,Gr,$r,Zd,Xa,Ja,et,Wd,hs,zr,jd;function Og(t,e){if(t==null)throw Error(e??"Empty (null | undefined) value");return t}function Mg(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t}function Gg(t){let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(Mg(65,91));return e}function $g(){return Gg(42)}const Yd=Array.isArray;function zg(t){return t!==null&&typeof t=="object"}function Xd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null}function Dn(t){if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++)e[n]=Dn(t[n]);return e}else if(zg(t)){const e={};return Object.keys(t).forEach(n=>{e[n]=Dn(t[n])}),e}else return t}function Jd(t,e){return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],i=e[n];Xd(o)&&Xd(i)||Yd(o)&&Yd(i)&&o.length===i.length?Jd(o,i):t[n]=i}),t}function el(t,e,n=!0){let o=0,i;return function(...l){i=()=>{t.apply(this,l),o=new Date().getTime()+e,i=null,n&&setTimeout(()=>{i==null||i()},e)},new Date().getTime()>o&&i()}}function Ug(t){let e=0n,n;return async function(...o){const i=++e;try{await n}catch{}if(e!==i)return{ok:!1};const l=t(...o);return n=l,{ok:!0,value:await l}}}var Xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Zg=function t(e){if(typeof e=="number"&&isNaN(e))throw new Error("NaN is not allowed");if(typeof e=="number"&&!isFinite(e))throw new Error("Infinity is not allowed");return e===null||typeof e!="object"?JSON.stringify(e):e.toJSON instanceof Function?t(e.toJSON()):Array.isArray(e)?`[${e.reduce((i,l,c)=>`${i}${c===0?"":","}${t(l===void 0||typeof l=="symbol"?null:l)}`,"")}]`:`{${Object.keys(e).sort().reduce((o,i)=>{if(e[i]===void 0||typeof e[i]=="symbol")return o;const l=o.length===0?"":",";return`${o}${l}${t(i)}:${t(e[i])}`},"")}}`};const dr=Qd(Zg);class tl extends Error{}class ms extends Error{constructor(e){super(e.join(`
|
|
2
2
|
`)),this.errors=e}toString(){return this.errors.join(`
|
|
3
|
-
`)}}function Wg(t){return{ok:!0,value:t}}function eu(t){if(!t)throw new tl;if(!t.ok)throw new ms(t.errors);return t.value}function tu(t){return{value:t,errors:void 0}}function jg(t){if(t.errors)throw new ms(t.errors);if(!t.value)throw new tl;return t.value}function Hg(t){return t!==void 0}function nl(t,e){return dr(t)===dr(e)}const rl=t=>t,ol=t=>t instanceof Error?t:Error(String(t)),il=t=>t.name==="ZodError",sl=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function al(t){const e=t.validate??rl,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=S=>{i.value={model:Dn(S)}};r.watch(()=>t.get(),S=>l(S),{immediate:!0});const c=()=>{var S;t.onSave(e(Dn((S=i.value)==null?void 0:S.model)))},d=()=>{l(t.get()),o.value=void 0},p=S=>{const G=ol(S);il(G)?o.value=Error(sl(G)):o.value=G},h=S=>{o.value=void 0;try{e(S),n&&c()}catch(G){p(G)}},m=r.computed({get:()=>{var S;return(S=i.value)==null?void 0:S.model},set(S){l(S),h(S)}});r.watch(i,(S,G)=>{S&&S===G&&h(S.model)},{deep:!0});const y=r.computed(()=>!o.value),w=r.computed(()=>!nl(t.get(),r.unref(i))),v=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:w,error:o,errorString:v,save:c,revert:d,setError:p})}function qg(t,e,n){const o=t.validate??rl,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=M=>{var k;if(n.deepPatchModel){const B=(k=c.value)==null?void 0:k.model,D=Object.assign(Dn(M),e??{});c.value={model:B?Jd(B,D):D,stage:Symbol()}}else c.value={model:Object.assign(Dn(M),e??{}),stage:Symbol()}};r.watch(()=>t.get(),M=>d(M),{immediate:!0});const p=()=>{var M;t.onSave(o(Dn((M=c.value)==null?void 0:M.model)))},h=()=>{d(t.get()),l.value=void 0},m=M=>{const k=ol(M);il(k)?l.value=Error(sl(k)):l.value=k},y=M=>{l.value=void 0;try{o(M),i&&p()}catch(k){m(k)}},w=r.computed({get:()=>{var M;return(M=c.value)==null?void 0:M.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:w.value.args,ui:w.value.ui}),()=>{var M;return(M=c.value)==null?void 0:M.stage}],([M,k],[B,D])=>{k===D&&y(M)},{deep:!0});const v=r.computed(()=>!l.value),S=r.computed(()=>{var B;const{args:M,ui:k}=((B=r.unref(c))==null?void 0:B.model)??{};return!nl(t.get(),{args:M,ui:k})}),G=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:w,valid:v,isChanged:S,error:l,errorString:G,save:p,revert:h,setError:m})}const Kg=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Yg(t,e,n){const o=(k,...B)=>{n.debug&&console.log(`%c>>> %c${k}`,"color: orange; font-weight: bold","color: orange",...B)},l=el(e.setBlockArgs,100),c=el(e.setBlockUiState,100),d=el(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async k=>{k.forEach(B=>{B.key==="args"&&(p.args=Object.freeze(B.value),o("args patch",p.args)),B.key==="ui"&&(p.ui=Object.freeze(B.value),o("ui patch",p.ui)),B.key==="outputs"&&(p.outputs=Object.freeze(B.value),o("outputs patch",p.outputs)),B.key==="navigationState"&&(p.navigationState=Object.freeze(B.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),w={createArgsModel(k={}){return al({get(){return k.transform?k.transform(p.args):p.args},validate:k.validate,autoSave:!0,onSave(B){l(B)}})},createUiModel(k={},B){return al({get(){return k.transform?k.transform(p.ui):p.ui??B()},validate:k.validate,autoSave:!0,onSave(D){c(D)}})},useOutputs(...k){const B=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(B,{value:this.unwrapOutputs(...k),errors:void 0})}catch(D){Object.assign(B,{value:void 0,errors:[String(D)]})}},{immediate:!0,deep:!0}),B},unwrapOutputs(...k){const B=p.outputs,D=k.map(j=>[j,eu(B[j])]);return Object.fromEntries(D)},updateArgs(k){const B=h();return k(B),e.setBlockArgs(B)},updateUiState(k){const B=m();return e.setBlockUiState(k(B))},updateNavigationState(k){const B=y();return k(B),e.setNavigationState(B)},navigateTo(k){const B=y();return B.href=k,e.setNavigationState(B)}},v=r.computed(()=>{const k=Object.entries(p.outputs).map(([B,D])=>[B,D.ok&&D.value!==void 0?D.value:void 0]);return Object.fromEntries(k)}),S=r.computed(()=>{const k=Object.entries(p.outputs).map(([B,D])=>[B,D&&!D.ok?new ms(D.errors):void 0]);return Object.fromEntries(k)}),G={snapshot:p,queryParams:r.computed(()=>Kg(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(k=>!(k!=null&&k.ok)))},M=qg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(k){d(k.args,k.ui)}},{outputs:v,outputErrors:S},n);return r.reactive(Object.assign(M,w,G))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var ll;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ll||(ll={}));const ae=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ur=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ee=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Xg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Zt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Zt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Zt.create=t=>new Zt(t);const ho=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ge.assertNever(t)}return{message:n}};let nu=ho;function Jg(t){nu=t}function gs(){return nu}const ys=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},Qg=[];function ie(t,e){const n=gs(),o=ys({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ho?void 0:ho].filter(i=>!!i)});t.common.issues.push(o)}class xt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return xt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),fo=t=>({status:"dirty",value:t}),Vt=t=>({status:"valid",value:t}),cl=t=>t.status==="aborted",dl=t=>t.status==="dirty",Jo=t=>t.status==="valid",Qo=t=>typeof Promise<"u"&&t instanceof Promise;function _s(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ru(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var he;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(he||(he={}));var ei,ti;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ou=(t,e)=>{if(Jo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ur(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ur(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xt,ctx:{common:e.parent.common,data:e.data,parsedType:ur(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Qo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ur(e)},l=this._parseSync({data:e,path:i.path,parent:i});return ou(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ur(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Qo(i)?i:Promise.resolve(i));return ou(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return _o.create(this,this._def)}or(e){return ii.create([this,e],this._def)}and(e){return si.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ve(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new hl({typeName:ve.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pi({...Ve(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return hi.create(this,e)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ey=/^c[^\s-]{8,}$/i,ty=/^[0-9a-z]+$/,ny=/^[0-9A-HJKMNP-TV-Z]{26}$/,ry=/^[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,oy=/^[a-z0-9_-]{21}$/i,iy=/^[-+]?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)?)??$/,sy=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ay="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ul;const ly=/^(?:(?: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])$/,cy=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dy=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iu="((\\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])))",uy=new RegExp(`^${iu}$`);function su(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function py(t){return new RegExp(`^${su(t)}$`)}function au(t){let e=`${iu}T${su(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function hy(t,e){return!!((e==="v4"||!e)&&ly.test(t)||(e==="v6"||!e)&&cy.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.string,received:l.parsedType}),be}const o=new xt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")sy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")ul||(ul=new RegExp(ay,"u")),ul.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")ry.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")oy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")ty.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")ny.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?au(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?uy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?py(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?iy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?hy(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?dy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...he.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...he.errToObj(e)})}url(e){return this._addCheck({kind:"url",...he.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...he.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...he.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...he.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...he.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...he.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...he.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...he.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...he.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...he.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...he.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...he.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...he.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...he.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...he.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...he.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...he.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...he.errToObj(n)})}nonempty(e){return this.min(1,he.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}pn.create=t=>{var e;return new pn({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function fy(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class pr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.number,received:l.parsedType}),be}let o;const i=new xt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?fy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new pr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new pr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:he.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:he.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}pr.create=t=>new pr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class hr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.bigint,received:l.parsedType}),be}let o;const i=new xt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new hr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new hr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}hr.create=t=>{var e;return new hr({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ni extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.boolean,received:o.parsedType}),be}return Vt(e.data)}}ni.create=t=>new ni({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class Ur extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new xt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ur({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:he.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:he.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Ur.create=t=>new Ur({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ve(t)});class Cs extends Pe{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.symbol,received:o.parsedType}),be}return Vt(e.data)}}Cs.create=t=>new Cs({typeName:ve.ZodSymbol,...Ve(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.undefined,received:o.parsedType}),be}return Vt(e.data)}}ri.create=t=>new ri({typeName:ve.ZodUndefined,...Ve(t)});class oi extends Pe{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.null,received:o.parsedType}),be}return Vt(e.data)}}oi.create=t=>new oi({typeName:ve.ZodNull,...Ve(t)});class mo extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Vt(e.data)}}mo.create=t=>new mo({typeName:ve.ZodAny,...Ve(t)});class Zr extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Vt(e.data)}}Zr.create=t=>new Zr({typeName:ve.ZodUnknown,...Ve(t)});class Kn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:ae.never,received:n.parsedType}),be}}Kn.create=t=>new Kn({typeName:ve.ZodNever,...Ve(t)});class vs extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.void,received:o.parsedType}),be}return Vt(e.data)}}vs.create=t=>new vs({typeName:ve.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==ae.array)return ie(n,{code:ee.invalid_type,expected:ae.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>xt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return xt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:he.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:he.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:he.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ve(e)});function go(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(go(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:go(t.element)}):t instanceof Ln?Ln.create(go(t.unwrap())):t instanceof mr?mr.create(go(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>go(e))):t}class nt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:ae.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Kn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,w=await m.value;h.push({key:y,value:w,alwaysSet:m.alwaysSet})}return h}).then(h=>xt.mergeObjectSync(o,h)):xt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return he.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=he.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return go(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return lu(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)});class ii extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Zt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Zt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}ii.create=(t,e)=>new ii({options:t,typeName:ve.ZodUnion,...Ve(e)});const Yn=t=>t instanceof li?Yn(t.schema):t instanceof fn?Yn(t.innerType()):t instanceof ci?[t.value]:t instanceof fr?t.options:t instanceof di?Ge.objectValues(t.enum):t instanceof ui?Yn(t._def.innerType):t instanceof ri?[void 0]:t instanceof oi?[null]:t instanceof Ln?[void 0,...Yn(t.unwrap())]:t instanceof mr?[null,...Yn(t.unwrap())]:t instanceof hl||t instanceof fi?Yn(t.unwrap()):t instanceof pi?Yn(t._def.innerType):[];class ws extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:ee.invalid_type,expected:ae.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Yn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new ws({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function pl(t,e){const n=ur(t),o=ur(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=pl(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=pl(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class si extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(cl(l)||cl(c))return be;const d=pl(l.value,c.value);return d.valid?((dl(l)||dl(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}si.create=(t,e,n)=>new si({left:t,right:e,typeName:ve.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:ee.invalid_type,expected:ae.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>xt.mergeArray(n,c)):xt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:ve.ZodTuple,rest:null,...Ve(e)})};class ai extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:ee.invalid_type,expected:ae.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?xt.mergeObjectAsync(n,i):xt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new ai({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ve(o)}):new ai({keyType:pn.create(),valueType:e,typeName:ve.ZodRecord,...Ve(n)})}}class bs extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:ee.invalid_type,expected:ae.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}bs.create=(t,e,n)=>new bs({valueType:e,keyType:t,typeName:ve.ZodMap,...Ve(n)});class Wr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:ee.invalid_type,expected:ae.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Wr({...this._def,minSize:{value:e,message:he.toString(n)}})}max(e,n){return new Wr({...this._def,maxSize:{value:e,message:he.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Wr.create=(t,e)=>new Wr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ve(e)});class yo extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:ee.invalid_type,expected:ae.function,received:n.parsedType}),be;function o(d,p){return ys({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),ho].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return ys({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),ho].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof _o){const d=this;return Vt(async function(...p){const h=new Zt([]),m=await d._def.args.parseAsync(p,l).catch(v=>{throw h.addIssue(o(p,v)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(v=>{throw h.addIssue(i(y,v)),h})})}else{const d=this;return Vt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Zt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Zt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new yo({...this._def,args:Fn.create(e).rest(Zr.create())})}returns(e){return new yo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new yo({args:e||Fn.create([]).rest(Zr.create()),returns:n||Zr.create(),typeName:ve.ZodFunction,...Ve(o)})}}class li extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}li.create=(t,e)=>new li({getter:t,typeName:ve.ZodLazy,...Ve(e)});class ci extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}ci.create=(t,e)=>new ci({value:t,typeName:ve.ZodLiteral,...Ve(e)});function lu(t,e){return new fr({values:t,typeName:ve.ZodEnum,...Ve(e)})}class fr extends Pe{constructor(){super(...arguments),ei.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(_s(this,ei)||ru(this,ei,new Set(this._def.values)),!_s(this,ei).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Vt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return fr.create(e,{...this._def,...n})}exclude(e,n=this._def){return fr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}ei=new WeakMap,fr.create=lu;class di extends Pe{constructor(){super(...arguments),ti.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(_s(this,ti)||ru(this,ti,new Set(Ge.getValidEnumValues(this._def.values))),!_s(this,ti).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Vt(e.data)}get enum(){return this._def.values}}ti=new WeakMap,di.create=(t,e)=>new di({values:t,typeName:ve.ZodNativeEnum,...Ve(e)});class _o extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:ae.promise,received:n.parsedType}),be;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Vt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}_o.create=(t,e)=>new _o({type:t,typeName:ve.ZodPromise,...Ve(e)});class fn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?fo(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?fo(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Jo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Jo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:ve.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===ae.undefined?Vt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:ve.ZodOptional,...Ve(e)});class mr extends Pe{_parse(e){return this._getType(e)===ae.null?Vt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mr.create=(t,e)=>new mr({innerType:t,typeName:ve.ZodNullable,...Ve(e)});class ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class pi extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Qo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Zt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}pi.create=(t,e)=>new pi({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class xs extends Pe{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}xs.create=t=>new xs({typeName:ve.ZodNaN,...Ve(t)});const my=Symbol("zod_brand");class hl extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class hi extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?be:l.status==="dirty"?(n.dirty(),fo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new hi({in:e,out:n,typeName:ve.ZodPipeline})}}class fi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Jo(i)&&(i.value=Object.freeze(i.value)),i);return Qo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}fi.create=(t,e)=>new fi({innerType:t,typeName:ve.ZodReadonly,...Ve(e)});function cu(t,e={},n){return t?mo.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):mo.create()}const gy={object:nt.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const yy=(t,e={message:`Input not instance of ${t.name}`})=>cu(n=>n instanceof t,e),du=pn.create,uu=pr.create,_y=xs.create,Cy=hr.create,pu=ni.create,vy=Ur.create,wy=Cs.create,by=ri.create,xy=oi.create,ky=mo.create,Ey=Zr.create,Sy=Kn.create,Ty=vs.create,Ny=hn.create,Vy=nt.create,Ay=nt.strictCreate,By=ii.create,Py=ws.create,Ry=si.create,Dy=Fn.create,Iy=ai.create,Fy=bs.create,Ly=Wr.create,Oy=yo.create,My=li.create,Gy=ci.create,$y=fr.create,zy=di.create,Uy=_o.create,hu=fn.create,Zy=Ln.create,Wy=mr.create,jy=fn.createWithPreprocess,Hy=hi.create;var On=Object.freeze({__proto__:null,defaultErrorMap:ho,setErrorMap:Jg,getErrorMap:gs,makeIssue:ys,EMPTY_PATH:Qg,addIssueToContext:ie,ParseStatus:xt,INVALID:be,DIRTY:fo,OK:Vt,isAborted:cl,isDirty:dl,isValid:Jo,isAsync:Qo,get util(){return Ge},get objectUtil(){return ll},ZodParsedType:ae,getParsedType:ur,ZodType:Pe,datetimeRegex:au,ZodString:pn,ZodNumber:pr,ZodBigInt:hr,ZodBoolean:ni,ZodDate:Ur,ZodSymbol:Cs,ZodUndefined:ri,ZodNull:oi,ZodAny:mo,ZodUnknown:Zr,ZodNever:Kn,ZodVoid:vs,ZodArray:hn,ZodObject:nt,ZodUnion:ii,ZodDiscriminatedUnion:ws,ZodIntersection:si,ZodTuple:Fn,ZodRecord:ai,ZodMap:bs,ZodSet:Wr,ZodFunction:yo,ZodLazy:li,ZodLiteral:ci,ZodEnum:fr,ZodNativeEnum:di,ZodPromise:_o,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:mr,ZodDefault:ui,ZodCatch:pi,ZodNaN:xs,BRAND:my,ZodBranded:hl,ZodPipeline:hi,ZodReadonly:fi,custom:cu,Schema:Pe,ZodSchema:Pe,late:gy,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>pr.create({...t,coerce:!0}),boolean:t=>ni.create({...t,coerce:!0}),bigint:t=>hr.create({...t,coerce:!0}),date:t=>Ur.create({...t,coerce:!0})},any:ky,array:Ny,bigint:Cy,boolean:pu,date:vy,discriminatedUnion:Py,effect:hu,enum:$y,function:Oy,instanceof:yy,intersection:Ry,lazy:My,literal:Gy,map:Fy,nan:_y,nativeEnum:zy,never:Sy,null:xy,nullable:Wy,number:uu,object:Vy,oboolean:()=>pu().optional(),onumber:()=>uu().optional(),optional:Zy,ostring:()=>du().optional(),pipeline:Hy,preprocess:jy,promise:Uy,record:Iy,set:Ly,strictObject:Ay,string:du,symbol:wy,transformer:hu,tuple:Dy,undefined:by,union:By,unknown:Ey,void:Ty,NEVER:be,ZodIssueCode:ee,quotelessJson:Xg,ZodError:Zt});const qy=-2147483648,fu=-9007199254740991n,Ky=NaN,Yy=NaN,Xy=null,Jy=null;function Qy(t,e){switch(e){case"Int":return t===qy;case"Long":return t===Number(fu)||t===fu;case"Float":return t===Ky;case"Double":return t===Yy;case"String":return t===Xy;case"Bytes":return t===Jy;default:throw Error(`unsupported data type: ${e}`)}}function e_(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}const t_={type:"absent"},n_=null;function mu(t,e){if(e_(t.absent,e))return t_;const n=t.data[e],o=t.type;if(Qy(n,o))return n_;switch(o){case"Int":return n;case"Long":return Number(n);case"Float":return n;case"Double":return n;case"String":return n;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function jr(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function r_(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const o_=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(o_);const i_="1.18.0";function ks(){return r_({sdkVersion:i_})}function s_(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function Co(t){return!!t&&typeof t.children<"u"}function gr(t){return Co(t)?t.groupId:t.colId}function gu(t,e,n){const o=(c,d)=>{const p=c.children.map(gr),h=x._includes(p,gr(d)),m=x._last(c.children),y=m&&gr(m)!==gr(d);return h&&y};if(!Co(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(gr);if(!x._includes(c,gr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!gu(i.children[c],e,n);c--);return!1}function a_(t){const e=(i,l)=>Co(i)&&Co(l)&&gr(i)===gr(l),n=(i,l)=>{if(!Co(l))return i;const c=i,d=l;return d.children&&d.groupId&&gu(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var l_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(Co(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new x.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=a_(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function c_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function d_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function u_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function p_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function h_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function f_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function m_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function g_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function y_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function __(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var C_=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
3
|
+
`)}}function Wg(t){return{ok:!0,value:t}}function eu(t){if(!t)throw new tl;if(!t.ok)throw new ms(t.errors);return t.value}function tu(t){return{value:t,errors:void 0}}function jg(t){if(t.errors)throw new ms(t.errors);if(!t.value)throw new tl;return t.value}function Hg(t){return t!==void 0}function nl(t,e){return dr(t)===dr(e)}const rl=t=>t,ol=t=>t instanceof Error?t:Error(String(t)),il=t=>t.name==="ZodError",sl=t=>{const{formErrors:e,fieldErrors:n}=t.flatten(),o=Object.entries(n).map(([i,l])=>i+":"+(l==null?void 0:l.join(",")));return e.concat(o).join("; ")};function al(t){const e=t.validate??rl,{autoSave:n}=t,o=r.ref(),i=r.ref(),l=S=>{i.value={model:Dn(S)}};r.watch(()=>t.get(),S=>l(S),{immediate:!0});const c=()=>{var S;t.onSave(e(Dn((S=i.value)==null?void 0:S.model)))},d=()=>{l(t.get()),o.value=void 0},p=S=>{const G=ol(S);il(G)?o.value=Error(sl(G)):o.value=G},h=S=>{o.value=void 0;try{e(S),n&&c()}catch(G){p(G)}},m=r.computed({get:()=>{var S;return(S=i.value)==null?void 0:S.model},set(S){l(S),h(S)}});r.watch(i,(S,G)=>{S&&S===G&&h(S.model)},{deep:!0});const y=r.computed(()=>!o.value),w=r.computed(()=>!nl(t.get(),r.unref(i))),v=r.computed(()=>o.value?o.value.message:"");return r.reactive({model:m,valid:y,isChanged:w,error:o,errorString:v,save:c,revert:d,setError:p})}function qg(t,e,n){const o=t.validate??rl,{autoSave:i}=t,l=r.ref(),c=r.ref(),d=M=>{var k;if(n.deepPatchModel){const B=(k=c.value)==null?void 0:k.model,D=Object.assign(Dn(M),e??{});c.value={model:B?Jd(B,D):D,stage:Symbol()}}else c.value={model:Object.assign(Dn(M),e??{}),stage:Symbol()}};r.watch(()=>t.get(),M=>d(M),{immediate:!0});const p=()=>{var M;t.onSave(o(Dn((M=c.value)==null?void 0:M.model)))},h=()=>{d(t.get()),l.value=void 0},m=M=>{const k=ol(M);il(k)?l.value=Error(sl(k)):l.value=k},y=M=>{l.value=void 0;try{o(M),i&&p()}catch(k){m(k)}},w=r.computed({get:()=>{var M;return(M=c.value)==null?void 0:M.model},set(){throw Error("Cannot replace base model")}});r.watch([()=>({args:w.value.args,ui:w.value.ui}),()=>{var M;return(M=c.value)==null?void 0:M.stage}],([M,k],[B,D])=>{k===D&&y(M)},{deep:!0});const v=r.computed(()=>!l.value),S=r.computed(()=>{var B;const{args:M,ui:k}=((B=r.unref(c))==null?void 0:B.model)??{};return!nl(t.get(),{args:M,ui:k})}),G=r.computed(()=>l.value?l.value.message:"");return r.reactive({model:w,valid:v,isChanged:S,error:l,errorString:G,save:p,revert:h,setError:m})}const Kg=t=>Object.fromEntries(new URL(t,"http://dummy").searchParams);function Yg(t,e,n){const o=(k,...B)=>{n.debug&&console.log(`%c>>> %c${k}`,"color: orange; font-weight: bold","color: orange",...B)},l=el(e.setBlockArgs,100),c=el(e.setBlockUiState,100),d=el(e.setBlockArgsAndUiState,100),p=r.reactive({args:Object.freeze(t.args),outputs:Object.freeze(t.outputs),ui:Object.freeze(t.ui),navigationState:Object.freeze(t.navigationState)});e.onStateUpdates(async k=>{k.forEach(B=>{B.key==="args"&&(p.args=Object.freeze(B.value),o("args patch",p.args)),B.key==="ui"&&(p.ui=Object.freeze(B.value),o("ui patch",p.ui)),B.key==="outputs"&&(p.outputs=Object.freeze(B.value),o("outputs patch",p.outputs)),B.key==="navigationState"&&(p.navigationState=Object.freeze(B.value),o("navigationState patch",p.navigationState))}),await r.nextTick()});const h=()=>Dn(p.args),m=()=>Dn(p.ui),y=()=>Dn(p.navigationState),w={createArgsModel(k={}){return al({get(){return k.transform?k.transform(p.args):p.args},validate:k.validate,autoSave:!0,onSave(B){l(B)}})},createUiModel(k={},B){return al({get(){return k.transform?k.transform(p.ui):p.ui??B()},validate:k.validate,autoSave:!0,onSave(D){c(D)}})},useOutputs(...k){const B=r.reactive({errors:void 0,value:void 0});return r.watch(()=>p.outputs,()=>{try{Object.assign(B,{value:this.unwrapOutputs(...k),errors:void 0})}catch(D){Object.assign(B,{value:void 0,errors:[String(D)]})}},{immediate:!0,deep:!0}),B},unwrapOutputs(...k){const B=p.outputs,D=k.map(j=>[j,eu(B[j])]);return Object.fromEntries(D)},updateArgs(k){const B=h();return k(B),e.setBlockArgs(B)},updateUiState(k){const B=m();return e.setBlockUiState(k(B))},updateNavigationState(k){const B=y();return k(B),e.setNavigationState(B)},navigateTo(k){const B=y();return B.href=k,e.setNavigationState(B)}},v=r.computed(()=>{const k=Object.entries(p.outputs).map(([B,D])=>[B,D.ok&&D.value!==void 0?D.value:void 0]);return Object.fromEntries(k)}),S=r.computed(()=>{const k=Object.entries(p.outputs).map(([B,D])=>[B,D&&!D.ok?new ms(D.errors):void 0]);return Object.fromEntries(k)}),G={snapshot:p,queryParams:r.computed(()=>Kg(p.navigationState.href)),href:r.computed(()=>p.navigationState.href),hasErrors:r.computed(()=>Object.values(p.outputs).some(k=>!(k!=null&&k.ok)))},M=qg({get(){return{args:p.args,ui:p.ui}},autoSave:!0,onSave(k){d(k.args,k.ui)}},{outputs:v,outputErrors:S},n);return r.reactive(Object.assign(M,w,G))}var Ge;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const l={};for(const c of i)l[c]=c;return l},t.getValidEnumValues=i=>{const l=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),c={};for(const d of l)c[d]=i[d];return t.objectValues(c)},t.objectValues=i=>t.objectKeys(i).map(function(l){return i[l]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const l=[];for(const c in i)Object.prototype.hasOwnProperty.call(i,c)&&l.push(c);return l},t.find=(i,l)=>{for(const c of i)if(l(c))return c},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function o(i,l=" | "){return i.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}t.joinValues=o,t.jsonStringifyReplacer=(i,l)=>typeof l=="bigint"?l.toString():l})(Ge||(Ge={}));var ll;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ll||(ll={}));const ae=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ur=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ee=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Xg=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Zt extends Error{constructor(e){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},o={_errors:[]},i=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(i);else if(c.code==="invalid_return_type")i(c.returnTypeError);else if(c.code==="invalid_arguments")i(c.argumentsError);else if(c.path.length===0)o._errors.push(n(c));else{let d=o,p=0;for(;p<c.path.length;){const h=c.path[p];p===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],p++}}};return i(this),o}static assert(e){if(!(e instanceof Zt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},o=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):o.push(e(i));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}}Zt.create=t=>new Zt(t);const ho=(t,e)=>{let n;switch(t.code){case ee.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ge.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(t.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(t.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(t.options)}, received '${t.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ge.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ee.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ee.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ge.assertNever(t)}return{message:n}};let nu=ho;function Jg(t){nu=t}function gs(){return nu}const ys=t=>{const{data:e,path:n,errorMaps:o,issueData:i}=t,l=[...n,...i.path||[]],c={...i,path:l};if(i.message!==void 0)return{...i,path:l,message:i.message};let d="";const p=o.filter(h=>!!h).slice().reverse();for(const h of p)d=h(c,{data:e,defaultError:d}).message;return{...i,path:l,message:d}},Qg=[];function ie(t,e){const n=gs(),o=ys({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ho?void 0:ho].filter(i=>!!i)});t.common.issues.push(o)}class xt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const o=[];for(const i of n){if(i.status==="aborted")return be;i.status==="dirty"&&e.dirty(),o.push(i.value)}return{status:e.value,value:o}}static async mergeObjectAsync(e,n){const o=[];for(const i of n){const l=await i.key,c=await i.value;o.push({key:l,value:c})}return xt.mergeObjectSync(e,o)}static mergeObjectSync(e,n){const o={};for(const i of n){const{key:l,value:c}=i;if(l.status==="aborted"||c.status==="aborted")return be;l.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||i.alwaysSet)&&(o[l.value]=c.value)}return{status:e.value,value:o}}}const be=Object.freeze({status:"aborted"}),fo=t=>({status:"dirty",value:t}),Vt=t=>({status:"valid",value:t}),cl=t=>t.status==="aborted",dl=t=>t.status==="dirty",Jo=t=>t.status==="valid",Qo=t=>typeof Promise<"u"&&t instanceof Promise;function _s(t,e,n,o){if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function ru(t,e,n,o,i){if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var he;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(he||(he={}));var ei,ti;class In{constructor(e,n,o,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=o,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ou=(t,e)=>{if(Jo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zt(t.common.issues);return this._error=n,this._error}}};function Ve(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:o,description:i}=t;if(e&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(c,d)=>{var p,h;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:(p=m??o)!==null&&p!==void 0?p:d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:(h=m??n)!==null&&h!==void 0?h:d.defaultError}},description:i}}class Pe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ur(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ur(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new xt,ctx:{common:e.parent.common,data:e.data,parsedType:ur(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(Qo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const o=this.safeParse(e,n);if(o.success)return o.data;throw o.error}safeParse(e,n){var o;const i={common:{issues:[],async:(o=n==null?void 0:n.async)!==null&&o!==void 0?o:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ur(e)},l=this._parseSync({data:e,path:i.path,parent:i});return ou(i,l)}async parseAsync(e,n){const o=await this.safeParseAsync(e,n);if(o.success)return o.data;throw o.error}async safeParseAsync(e,n){const o={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ur(e)},i=this._parse({data:e,path:o.path,parent:o}),l=await(Qo(i)?i:Promise.resolve(i));return ou(o,l)}refine(e,n){const o=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,l)=>{const c=e(i),d=()=>l.addIssue({code:ee.custom,...o(i)});return typeof Promise<"u"&&c instanceof Promise?c.then(p=>p?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(e,n){return this._refinement((o,i)=>e(o)?!0:(i.addIssue(typeof n=="function"?n(o,i):n),!1))}_refinement(e){return new fn({schema:this,typeName:ve.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ln.create(this,this._def)}nullable(){return mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hn.create(this,this._def)}promise(){return _o.create(this,this._def)}or(e){return ii.create([this,e],this._def)}and(e){return si.create(this,e,this._def)}transform(e){return new fn({...Ve(this._def),schema:this,typeName:ve.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new ui({...Ve(this._def),innerType:this,defaultValue:n,typeName:ve.ZodDefault})}brand(){return new hl({typeName:ve.ZodBranded,type:this,...Ve(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new pi({...Ve(this._def),innerType:this,catchValue:n,typeName:ve.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return hi.create(this,e)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ey=/^c[^\s-]{8,}$/i,ty=/^[0-9a-z]+$/,ny=/^[0-9A-HJKMNP-TV-Z]{26}$/,ry=/^[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,oy=/^[a-z0-9_-]{21}$/i,iy=/^[-+]?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)?)??$/,sy=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ay="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ul;const ly=/^(?:(?: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])$/,cy=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dy=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iu="((\\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])))",uy=new RegExp(`^${iu}$`);function su(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function py(t){return new RegExp(`^${su(t)}$`)}function au(t){let e=`${iu}T${su(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function hy(t,e){return!!((e==="v4"||!e)&&ly.test(t)||(e==="v6"||!e)&&cy.test(t))}class pn extends Pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.string,received:l.parsedType}),be}const o=new xt;let i;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="max")e.data.length>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if(l.kind==="length"){const c=e.data.length>l.value,d=e.data.length<l.value;(c||d)&&(i=this._getOrReturnCtx(e,i),c?ie(i,{code:ee.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&ie(i,{code:ee.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if(l.kind==="email")sy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"email",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="emoji")ul||(ul=new RegExp(ay,"u")),ul.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"emoji",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="uuid")ry.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"uuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="nanoid")oy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"nanoid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid")ey.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="cuid2")ty.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"cuid2",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="ulid")ny.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ulid",code:ee.invalid_string,message:l.message}),o.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ie(i,{validation:"url",code:ee.invalid_string,message:l.message}),o.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"regex",code:ee.invalid_string,message:l.message}),o.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):l.kind==="datetime"?au(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"datetime",message:l.message}),o.dirty()):l.kind==="date"?uy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"date",message:l.message}),o.dirty()):l.kind==="time"?py(l).test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.invalid_string,validation:"time",message:l.message}),o.dirty()):l.kind==="duration"?iy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"duration",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="ip"?hy(e.data,l.version)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"ip",code:ee.invalid_string,message:l.message}),o.dirty()):l.kind==="base64"?dy.test(e.data)||(i=this._getOrReturnCtx(e,i),ie(i,{validation:"base64",code:ee.invalid_string,message:l.message}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:e.data}}_regex(e,n,o){return this.refinement(i=>e.test(i),{validation:n,code:ee.invalid_string,...he.errToObj(o)})}_addCheck(e){return new pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...he.errToObj(e)})}url(e){return this._addCheck({kind:"url",...he.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...he.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...he.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...he.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...he.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...he.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...he.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...he.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...he.errToObj(e)})}datetime(e){var n,o;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,local:(o=e==null?void 0:e.local)!==null&&o!==void 0?o:!1,...he.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...he.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...he.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...he.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...he.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...he.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...he.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...he.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...he.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...he.errToObj(n)})}nonempty(e){return this.min(1,he.errToObj(e))}trim(){return new pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}pn.create=t=>{var e;return new pn({checks:[],typeName:ve.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};function fy(t,e){const n=(t.toString().split(".")[1]||"").length,o=(e.toString().split(".")[1]||"").length,i=n>o?n:o,l=parseInt(t.toFixed(i).replace(".","")),c=parseInt(e.toFixed(i).replace(".",""));return l%c/Math.pow(10,i)}class pr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.number,received:l.parsedType}),be}let o;const i=new xt;for(const l of this._def.checks)l.kind==="int"?Ge.isInteger(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.invalid_type,expected:"integer",received:"float",message:l.message}),i.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),i.dirty()):l.kind==="multipleOf"?fy(e.data,l.value)!==0&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_finite,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new pr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new pr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:he.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:he.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:he.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:he.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ge.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(e===null||o.value<e)&&(e=o.value)}return Number.isFinite(n)&&Number.isFinite(e)}}pr.create=t=>new pr({checks:[],typeName:ve.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class hr extends Pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.bigint,received:l.parsedType}),be}let o;const i=new xt;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),i.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(o=this._getOrReturnCtx(e,o),ie(o,{code:ee.not_multiple_of,multipleOf:l.value,message:l.message}),i.dirty()):Ge.assertNever(l);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,he.toString(n))}gt(e,n){return this.setLimit("min",e,!1,he.toString(n))}lte(e,n){return this.setLimit("max",e,!0,he.toString(n))}lt(e,n){return this.setLimit("max",e,!1,he.toString(n))}setLimit(e,n,o,i){return new hr({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:o,message:he.toString(i)}]})}_addCheck(e){return new hr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:he.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:he.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:he.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:he.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:he.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}hr.create=t=>{var e;return new hr({checks:[],typeName:ve.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ve(t)})};class ni extends Pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.boolean,received:o.parsedType}),be}return Vt(e.data)}}ni.create=t=>new ni({typeName:ve.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ve(t)});class Ur extends Pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_type,expected:ae.date,received:l.parsedType}),be}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return ie(l,{code:ee.invalid_date}),be}const o=new xt;let i;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),o.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(i=this._getOrReturnCtx(e,i),ie(i,{code:ee.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),o.dirty()):Ge.assertNever(l);return{status:o.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ur({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:he.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:he.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Ur.create=t=>new Ur({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ve.ZodDate,...Ve(t)});class Cs extends Pe{_parse(e){if(this._getType(e)!==ae.symbol){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.symbol,received:o.parsedType}),be}return Vt(e.data)}}Cs.create=t=>new Cs({typeName:ve.ZodSymbol,...Ve(t)});class ri extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.undefined,received:o.parsedType}),be}return Vt(e.data)}}ri.create=t=>new ri({typeName:ve.ZodUndefined,...Ve(t)});class oi extends Pe{_parse(e){if(this._getType(e)!==ae.null){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.null,received:o.parsedType}),be}return Vt(e.data)}}oi.create=t=>new oi({typeName:ve.ZodNull,...Ve(t)});class mo extends Pe{constructor(){super(...arguments),this._any=!0}_parse(e){return Vt(e.data)}}mo.create=t=>new mo({typeName:ve.ZodAny,...Ve(t)});class Zr extends Pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Vt(e.data)}}Zr.create=t=>new Zr({typeName:ve.ZodUnknown,...Ve(t)});class Kn extends Pe{_parse(e){const n=this._getOrReturnCtx(e);return ie(n,{code:ee.invalid_type,expected:ae.never,received:n.parsedType}),be}}Kn.create=t=>new Kn({typeName:ve.ZodNever,...Ve(t)});class vs extends Pe{_parse(e){if(this._getType(e)!==ae.undefined){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.void,received:o.parsedType}),be}return Vt(e.data)}}vs.create=t=>new vs({typeName:ve.ZodVoid,...Ve(t)});class hn extends Pe{_parse(e){const{ctx:n,status:o}=this._processInputParams(e),i=this._def;if(n.parsedType!==ae.array)return ie(n,{code:ee.invalid_type,expected:ae.array,received:n.parsedType}),be;if(i.exactLength!==null){const c=n.data.length>i.exactLength.value,d=n.data.length<i.exactLength.value;(c||d)&&(ie(n,{code:c?ee.too_big:ee.too_small,minimum:d?i.exactLength.value:void 0,maximum:c?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),o.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ie(n,{code:ee.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),o.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ie(n,{code:ee.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>i.type._parseAsync(new In(n,c,n.path,d)))).then(c=>xt.mergeArray(o,c));const l=[...n.data].map((c,d)=>i.type._parseSync(new In(n,c,n.path,d)));return xt.mergeArray(o,l)}get element(){return this._def.type}min(e,n){return new hn({...this._def,minLength:{value:e,message:he.toString(n)}})}max(e,n){return new hn({...this._def,maxLength:{value:e,message:he.toString(n)}})}length(e,n){return new hn({...this._def,exactLength:{value:e,message:he.toString(n)}})}nonempty(e){return this.min(1,e)}}hn.create=(t,e)=>new hn({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ve.ZodArray,...Ve(e)});function go(t){if(t instanceof nt){const e={};for(const n in t.shape){const o=t.shape[n];e[n]=Ln.create(go(o))}return new nt({...t._def,shape:()=>e})}else return t instanceof hn?new hn({...t._def,type:go(t.element)}):t instanceof Ln?Ln.create(go(t.unwrap())):t instanceof mr?mr.create(go(t.unwrap())):t instanceof Fn?Fn.create(t.items.map(e=>go(e))):t}class nt extends Pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ge.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const h=this._getOrReturnCtx(e);return ie(h,{code:ee.invalid_type,expected:ae.object,received:h.parsedType}),be}const{status:o,ctx:i}=this._processInputParams(e),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(const h in i.data)c.includes(h)||d.push(h);const p=[];for(const h of c){const m=l[h],y=i.data[h];p.push({key:{status:"valid",value:h},value:m._parse(new In(i,y,i.path,h)),alwaysSet:h in i.data})}if(this._def.catchall instanceof Kn){const h=this._def.unknownKeys;if(h==="passthrough")for(const m of d)p.push({key:{status:"valid",value:m},value:{status:"valid",value:i.data[m]}});else if(h==="strict")d.length>0&&(ie(i,{code:ee.unrecognized_keys,keys:d}),o.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const m of d){const y=i.data[m];p.push({key:{status:"valid",value:m},value:h._parse(new In(i,y,i.path,m)),alwaysSet:m in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const h=[];for(const m of p){const y=await m.key,w=await m.value;h.push({key:y,value:w,alwaysSet:m.alwaysSet})}return h}).then(h=>xt.mergeObjectSync(o,h)):xt.mergeObjectSync(o,p)}get shape(){return this._def.shape()}strict(e){return he.errToObj,new nt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,o)=>{var i,l,c,d;const p=(c=(l=(i=this._def).errorMap)===null||l===void 0?void 0:l.call(i,n,o).message)!==null&&c!==void 0?c:o.defaultError;return n.code==="unrecognized_keys"?{message:(d=he.errToObj(e).message)!==null&&d!==void 0?d:p}:{message:p}}}:{}})}strip(){return new nt({...this._def,unknownKeys:"strip"})}passthrough(){return new nt({...this._def,unknownKeys:"passthrough"})}extend(e){return new nt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new nt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ve.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new nt({...this._def,catchall:e})}pick(e){const n={};return Ge.objectKeys(e).forEach(o=>{e[o]&&this.shape[o]&&(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}omit(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{e[o]||(n[o]=this.shape[o])}),new nt({...this._def,shape:()=>n})}deepPartial(){return go(this)}partial(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{const i=this.shape[o];e&&!e[o]?n[o]=i:n[o]=i.optional()}),new nt({...this._def,shape:()=>n})}required(e){const n={};return Ge.objectKeys(this.shape).forEach(o=>{if(e&&!e[o])n[o]=this.shape[o];else{let l=this.shape[o];for(;l instanceof Ln;)l=l._def.innerType;n[o]=l}}),new nt({...this._def,shape:()=>n})}keyof(){return lu(Ge.objectKeys(this.shape))}}nt.create=(t,e)=>new nt({shape:()=>t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.strictCreate=(t,e)=>new nt({shape:()=>t,unknownKeys:"strict",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)}),nt.lazycreate=(t,e)=>new nt({shape:t,unknownKeys:"strip",catchall:Kn.create(),typeName:ve.ZodObject,...Ve(e)});class ii extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=this._def.options;function i(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new Zt(d.ctx.common.issues));return ie(n,{code:ee.invalid_union,unionErrors:c}),be}if(n.common.async)return Promise.all(o.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(i);{let l;const c=[];for(const p of o){const h={...n,common:{...n.common,issues:[]},parent:null},m=p._parseSync({data:n.data,path:n.path,parent:h});if(m.status==="valid")return m;m.status==="dirty"&&!l&&(l={result:m,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(p=>new Zt(p));return ie(n,{code:ee.invalid_union,unionErrors:d}),be}}get options(){return this._def.options}}ii.create=(t,e)=>new ii({options:t,typeName:ve.ZodUnion,...Ve(e)});const Yn=t=>t instanceof li?Yn(t.schema):t instanceof fn?Yn(t.innerType()):t instanceof ci?[t.value]:t instanceof fr?t.options:t instanceof di?Ge.objectValues(t.enum):t instanceof ui?Yn(t._def.innerType):t instanceof ri?[void 0]:t instanceof oi?[null]:t instanceof Ln?[void 0,...Yn(t.unwrap())]:t instanceof mr?[null,...Yn(t.unwrap())]:t instanceof hl||t instanceof fi?Yn(t.unwrap()):t instanceof pi?Yn(t._def.innerType):[];class ws extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ie(n,{code:ee.invalid_type,expected:ae.object,received:n.parsedType}),be;const o=this.discriminator,i=n.data[o],l=this.optionsMap.get(i);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(ie(n,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,o){const i=new Map;for(const l of n){const c=Yn(l.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of c){if(i.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);i.set(d,l)}}return new ws({typeName:ve.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Ve(o)})}}function pl(t,e){const n=ur(t),o=ur(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&o===ae.object){const i=Ge.objectKeys(e),l=Ge.objectKeys(t).filter(d=>i.indexOf(d)!==-1),c={...t,...e};for(const d of l){const p=pl(t[d],e[d]);if(!p.valid)return{valid:!1};c[d]=p.data}return{valid:!0,data:c}}else if(n===ae.array&&o===ae.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let l=0;l<t.length;l++){const c=t[l],d=e[l],p=pl(c,d);if(!p.valid)return{valid:!1};i.push(p.data)}return{valid:!0,data:i}}else return n===ae.date&&o===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class si extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=(l,c)=>{if(cl(l)||cl(c))return be;const d=pl(l.value,c.value);return d.valid?((dl(l)||dl(c))&&n.dirty(),{status:n.value,value:d.data}):(ie(o,{code:ee.invalid_intersection_types}),be)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([l,c])=>i(l,c)):i(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}}si.create=(t,e,n)=>new si({left:t,right:e,typeName:ve.ZodIntersection,...Ve(n)});class Fn extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.array)return ie(o,{code:ee.invalid_type,expected:ae.array,received:o.parsedType}),be;if(o.data.length<this._def.items.length)return ie(o,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&o.data.length>this._def.items.length&&(ie(o,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...o.data].map((c,d)=>{const p=this._def.items[d]||this._def.rest;return p?p._parse(new In(o,c,o.path,d)):null}).filter(c=>!!c);return o.common.async?Promise.all(l).then(c=>xt.mergeArray(n,c)):xt.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new Fn({...this._def,rest:e})}}Fn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fn({items:t,typeName:ve.ZodTuple,rest:null,...Ve(e)})};class ai extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.object)return ie(o,{code:ee.invalid_type,expected:ae.object,received:o.parsedType}),be;const i=[],l=this._def.keyType,c=this._def.valueType;for(const d in o.data)i.push({key:l._parse(new In(o,d,o.path,d)),value:c._parse(new In(o,o.data[d],o.path,d)),alwaysSet:d in o.data});return o.common.async?xt.mergeObjectAsync(n,i):xt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,o){return n instanceof Pe?new ai({keyType:e,valueType:n,typeName:ve.ZodRecord,...Ve(o)}):new ai({keyType:pn.create(),valueType:e,typeName:ve.ZodRecord,...Ve(n)})}}class bs extends Pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.map)return ie(o,{code:ee.invalid_type,expected:ae.map,received:o.parsedType}),be;const i=this._def.keyType,l=this._def.valueType,c=[...o.data.entries()].map(([d,p],h)=>({key:i._parse(new In(o,d,o.path,[h,"key"])),value:l._parse(new In(o,p,o.path,[h,"value"]))}));if(o.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const p of c){const h=await p.key,m=await p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const p of c){const h=p.key,m=p.value;if(h.status==="aborted"||m.status==="aborted")return be;(h.status==="dirty"||m.status==="dirty")&&n.dirty(),d.set(h.value,m.value)}return{status:n.value,value:d}}}}bs.create=(t,e,n)=>new bs({valueType:e,keyType:t,typeName:ve.ZodMap,...Ve(n)});class Wr extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.parsedType!==ae.set)return ie(o,{code:ee.invalid_type,expected:ae.set,received:o.parsedType}),be;const i=this._def;i.minSize!==null&&o.data.size<i.minSize.value&&(ie(o,{code:ee.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&o.data.size>i.maxSize.value&&(ie(o,{code:ee.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const l=this._def.valueType;function c(p){const h=new Set;for(const m of p){if(m.status==="aborted")return be;m.status==="dirty"&&n.dirty(),h.add(m.value)}return{status:n.value,value:h}}const d=[...o.data.values()].map((p,h)=>l._parse(new In(o,p,o.path,h)));return o.common.async?Promise.all(d).then(p=>c(p)):c(d)}min(e,n){return new Wr({...this._def,minSize:{value:e,message:he.toString(n)}})}max(e,n){return new Wr({...this._def,maxSize:{value:e,message:he.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Wr.create=(t,e)=>new Wr({valueType:t,minSize:null,maxSize:null,typeName:ve.ZodSet,...Ve(e)});class yo extends Pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ie(n,{code:ee.invalid_type,expected:ae.function,received:n.parsedType}),be;function o(d,p){return ys({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),ho].filter(h=>!!h),issueData:{code:ee.invalid_arguments,argumentsError:p}})}function i(d,p){return ys({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,gs(),ho].filter(h=>!!h),issueData:{code:ee.invalid_return_type,returnTypeError:p}})}const l={errorMap:n.common.contextualErrorMap},c=n.data;if(this._def.returns instanceof _o){const d=this;return Vt(async function(...p){const h=new Zt([]),m=await d._def.args.parseAsync(p,l).catch(v=>{throw h.addIssue(o(p,v)),h}),y=await Reflect.apply(c,this,m);return await d._def.returns._def.type.parseAsync(y,l).catch(v=>{throw h.addIssue(i(y,v)),h})})}else{const d=this;return Vt(function(...p){const h=d._def.args.safeParse(p,l);if(!h.success)throw new Zt([o(p,h.error)]);const m=Reflect.apply(c,this,h.data),y=d._def.returns.safeParse(m,l);if(!y.success)throw new Zt([i(m,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new yo({...this._def,args:Fn.create(e).rest(Zr.create())})}returns(e){return new yo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,o){return new yo({args:e||Fn.create([]).rest(Zr.create()),returns:n||Zr.create(),typeName:ve.ZodFunction,...Ve(o)})}}class li extends Pe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}li.create=(t,e)=>new li({getter:t,typeName:ve.ZodLazy,...Ve(e)});class ci extends Pe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ie(n,{received:n.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}}ci.create=(t,e)=>new ci({value:t,typeName:ve.ZodLiteral,...Ve(e)});function lu(t,e){return new fr({values:t,typeName:ve.ZodEnum,...Ve(e)})}class fr extends Pe{constructor(){super(...arguments),ei.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{expected:Ge.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(_s(this,ei)||ru(this,ei,new Set(this._def.values)),!_s(this,ei).has(e.data)){const n=this._getOrReturnCtx(e),o=this._def.values;return ie(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Vt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return fr.create(e,{...this._def,...n})}exclude(e,n=this._def){return fr.create(this.options.filter(o=>!e.includes(o)),{...this._def,...n})}}ei=new WeakMap,fr.create=lu;class di extends Pe{constructor(){super(...arguments),ti.set(this,void 0)}_parse(e){const n=Ge.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(e);if(o.parsedType!==ae.string&&o.parsedType!==ae.number){const i=Ge.objectValues(n);return ie(o,{expected:Ge.joinValues(i),received:o.parsedType,code:ee.invalid_type}),be}if(_s(this,ti)||ru(this,ti,new Set(Ge.getValidEnumValues(this._def.values))),!_s(this,ti).has(e.data)){const i=Ge.objectValues(n);return ie(o,{received:o.data,code:ee.invalid_enum_value,options:i}),be}return Vt(e.data)}get enum(){return this._def.values}}ti=new WeakMap,di.create=(t,e)=>new di({values:t,typeName:ve.ZodNativeEnum,...Ve(e)});class _o extends Pe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ie(n,{code:ee.invalid_type,expected:ae.promise,received:n.parsedType}),be;const o=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Vt(o.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}_o.create=(t,e)=>new _o({type:t,typeName:ve.ZodPromise,...Ve(e)});class fn extends Pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ve.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:o}=this._processInputParams(e),i=this._def.effect||null,l={addIssue:c=>{ie(o,c),c.fatal?n.abort():n.dirty()},get path(){return o.path}};if(l.addIssue=l.addIssue.bind(l),i.type==="preprocess"){const c=i.transform(o.data,l);if(o.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return be;const p=await this._def.schema._parseAsync({data:d,path:o.path,parent:o});return p.status==="aborted"?be:p.status==="dirty"||n.value==="dirty"?fo(p.value):p});{if(n.value==="aborted")return be;const d=this._def.schema._parseSync({data:c,path:o.path,parent:o});return d.status==="aborted"?be:d.status==="dirty"||n.value==="dirty"?fo(d.value):d}}if(i.type==="refinement"){const c=d=>{const p=i.refinement(d,l);if(o.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(o.common.async===!1){const d=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(d=>d.status==="aborted"?be:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(i.type==="transform")if(o.common.async===!1){const c=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Jo(c))return c;const d=i.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(c=>Jo(c)?Promise.resolve(i.transform(c.value,l)).then(d=>({status:n.value,value:d})):c);Ge.assertNever(i)}}fn.create=(t,e,n)=>new fn({schema:t,typeName:ve.ZodEffects,effect:e,...Ve(n)}),fn.createWithPreprocess=(t,e,n)=>new fn({schema:e,effect:{type:"preprocess",transform:t},typeName:ve.ZodEffects,...Ve(n)});class Ln extends Pe{_parse(e){return this._getType(e)===ae.undefined?Vt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ln.create=(t,e)=>new Ln({innerType:t,typeName:ve.ZodOptional,...Ve(e)});class mr extends Pe{_parse(e){return this._getType(e)===ae.null?Vt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mr.create=(t,e)=>new mr({innerType:t,typeName:ve.ZodNullable,...Ve(e)});class ui extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e);let o=n.data;return n.parsedType===ae.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:ve.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ve(e)});class pi extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Qo(i)?i.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Zt(o.common.issues)},input:o.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zt(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}}pi.create=(t,e)=>new pi({innerType:t,typeName:ve.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ve(e)});class xs extends Pe{_parse(e){if(this._getType(e)!==ae.nan){const o=this._getOrReturnCtx(e);return ie(o,{code:ee.invalid_type,expected:ae.nan,received:o.parsedType}),be}return{status:"valid",value:e.data}}}xs.create=t=>new xs({typeName:ve.ZodNaN,...Ve(t)});const my=Symbol("zod_brand");class hl extends Pe{_parse(e){const{ctx:n}=this._processInputParams(e),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}}class hi extends Pe{_parse(e){const{status:n,ctx:o}=this._processInputParams(e);if(o.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return l.status==="aborted"?be:l.status==="dirty"?(n.dirty(),fo(l.value)):this._def.out._parseAsync({data:l.value,path:o.path,parent:o})})();{const i=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?be:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:o.path,parent:o})}}static create(e,n){return new hi({in:e,out:n,typeName:ve.ZodPipeline})}}class fi extends Pe{_parse(e){const n=this._def.innerType._parse(e),o=i=>(Jo(i)&&(i.value=Object.freeze(i.value)),i);return Qo(n)?n.then(i=>o(i)):o(n)}unwrap(){return this._def.innerType}}fi.create=(t,e)=>new fi({innerType:t,typeName:ve.ZodReadonly,...Ve(e)});function cu(t,e={},n){return t?mo.create().superRefine((o,i)=>{var l,c;if(!t(o)){const d=typeof e=="function"?e(o):typeof e=="string"?{message:e}:e,p=(c=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&c!==void 0?c:!0,h=typeof d=="string"?{message:d}:d;i.addIssue({code:"custom",...h,fatal:p})}}):mo.create()}const gy={object:nt.lazycreate};var ve;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ve||(ve={}));const yy=(t,e={message:`Input not instance of ${t.name}`})=>cu(n=>n instanceof t,e),du=pn.create,uu=pr.create,_y=xs.create,Cy=hr.create,pu=ni.create,vy=Ur.create,wy=Cs.create,by=ri.create,xy=oi.create,ky=mo.create,Ey=Zr.create,Sy=Kn.create,Ty=vs.create,Ny=hn.create,Vy=nt.create,Ay=nt.strictCreate,By=ii.create,Py=ws.create,Ry=si.create,Dy=Fn.create,Iy=ai.create,Fy=bs.create,Ly=Wr.create,Oy=yo.create,My=li.create,Gy=ci.create,$y=fr.create,zy=di.create,Uy=_o.create,hu=fn.create,Zy=Ln.create,Wy=mr.create,jy=fn.createWithPreprocess,Hy=hi.create;var On=Object.freeze({__proto__:null,defaultErrorMap:ho,setErrorMap:Jg,getErrorMap:gs,makeIssue:ys,EMPTY_PATH:Qg,addIssueToContext:ie,ParseStatus:xt,INVALID:be,DIRTY:fo,OK:Vt,isAborted:cl,isDirty:dl,isValid:Jo,isAsync:Qo,get util(){return Ge},get objectUtil(){return ll},ZodParsedType:ae,getParsedType:ur,ZodType:Pe,datetimeRegex:au,ZodString:pn,ZodNumber:pr,ZodBigInt:hr,ZodBoolean:ni,ZodDate:Ur,ZodSymbol:Cs,ZodUndefined:ri,ZodNull:oi,ZodAny:mo,ZodUnknown:Zr,ZodNever:Kn,ZodVoid:vs,ZodArray:hn,ZodObject:nt,ZodUnion:ii,ZodDiscriminatedUnion:ws,ZodIntersection:si,ZodTuple:Fn,ZodRecord:ai,ZodMap:bs,ZodSet:Wr,ZodFunction:yo,ZodLazy:li,ZodLiteral:ci,ZodEnum:fr,ZodNativeEnum:di,ZodPromise:_o,ZodEffects:fn,ZodTransformer:fn,ZodOptional:Ln,ZodNullable:mr,ZodDefault:ui,ZodCatch:pi,ZodNaN:xs,BRAND:my,ZodBranded:hl,ZodPipeline:hi,ZodReadonly:fi,custom:cu,Schema:Pe,ZodSchema:Pe,late:gy,get ZodFirstPartyTypeKind(){return ve},coerce:{string:t=>pn.create({...t,coerce:!0}),number:t=>pr.create({...t,coerce:!0}),boolean:t=>ni.create({...t,coerce:!0}),bigint:t=>hr.create({...t,coerce:!0}),date:t=>Ur.create({...t,coerce:!0})},any:ky,array:Ny,bigint:Cy,boolean:pu,date:vy,discriminatedUnion:Py,effect:hu,enum:$y,function:Oy,instanceof:yy,intersection:Ry,lazy:My,literal:Gy,map:Fy,nan:_y,nativeEnum:zy,never:Sy,null:xy,nullable:Wy,number:uu,object:Vy,oboolean:()=>pu().optional(),onumber:()=>uu().optional(),optional:Zy,ostring:()=>du().optional(),pipeline:Hy,preprocess:jy,promise:Uy,record:Iy,set:Ly,strictObject:Ay,string:du,symbol:wy,transformer:hu,tuple:Dy,undefined:by,union:By,unknown:Ey,void:Ty,NEVER:be,ZodIssueCode:ee,quotelessJson:Xg,ZodError:Zt});const qy=-2147483648,fu=-9007199254740991n,Ky=NaN,Yy=NaN,Xy=null,Jy=null;function Qy(t,e){switch(e){case"Int":return t===qy;case"Long":return t===Number(fu)||t===fu;case"Float":return t===Ky;case"Double":return t===Yy;case"String":return t===Xy;case"Bytes":return t===Jy;default:throw Error(`unsupported data type: ${e}`)}}function e_(t,e){const n=Math.floor(e/8),o=1<<7-e%8;return(t[n]&o)>0}const t_={type:"absent"},n_=null;function mu(t,e){if(e_(t.absent,e))return t_;const n=t.data[e],o=t.type;if(Qy(n,o))return n_;switch(o){case"Int":return n;case"Long":return Number(n);case"Float":return n;case"Double":return n;case"String":return n;case"Bytes":throw Error("Bytes not yet supported");default:throw Error(`unsupported data type: ${o}`)}}function jr(t){const{type:e,name:n,domain:o}=t;return{type:e,name:n,...o&&{domain:o}}}On.object({__isRef:On.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),blockId:On.string().describe("Upstream block id"),name:On.string().describe("Name of the output provided to the upstream block's output context")}).describe("Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees.").strict().readonly();function r_(t){if(t&&typeof globalThis.getPlatforma=="function")return globalThis.getPlatforma(t);if(typeof globalThis.platforma<"u")return globalThis.platforma;throw new Error("Can't get platforma instance.")}const o_=On.object({type:On.string(),importance:On.number().optional(),id:On.string().optional(),label:On.string()});On.array(o_);const i_="1.19.0";function ks(){return r_({sdkVersion:i_})}function s_(t){if(typeof globalThis.getEnvironmentValue=="function")return globalThis.getEnvironmentValue(t)}function Co(t){return!!t&&typeof t.children<"u"}function gr(t){return Co(t)?t.groupId:t.colId}function gu(t,e,n){const o=(c,d)=>{const p=c.children.map(gr),h=x._includes(p,gr(d)),m=x._last(c.children),y=m&&gr(m)!==gr(d);return h&&y};if(!Co(t))return!0;const i=t,l=n;if(o(i,l))return i.children.push(l),!0;if(i.groupId===e){const c=i.children.map(gr);if(!x._includes(c,gr(l)))return i.children.push(l),!0}for(let c=i.children.length-1;c>=0&&!gu(i.children[c],e,n);c--);return!1}function a_(t){const e=(i,l)=>Co(i)&&Co(l)&&gr(i)===gr(l),n=(i,l)=>{if(!Co(l))return i;const c=i,d=l;return d.children&&d.groupId&&gu(c,d.groupId,d.children[0])||d.children.forEach(p=>n(c,p)),c},o=[];for(let i=1;i<=t.length;i++){const l=t[i-1],c=t[i];e(l,c)?t[i]=n(l,c):o.push(l)}return o}var l_=class extends x.BeanStub{constructor(){super(...arguments),this.beanName="toolPanelColDefService"}wireBeans(t){this.columnModel=t.columnModel}createColumnTree(t){const e=[],n=(i,l)=>{if(Co(i)){const c=i,d=typeof c.groupId<"u"?c.groupId:c.headerName,p=new x.AgProvidedColumnGroup(c,d,!1,l),h=[];return c.children.forEach(m=>{const y=n(m,l+1);y&&h.push(y)}),p.setChildren(h),p}else{const c=i,d=c.colId?c.colId:c.field,p=this.columnModel.getColDefCol(d);return p||e.push(c),p}},o=[];return t.forEach(i=>{const l=n(i,0);l&&o.push(l)}),e.length>0&&x._warnOnce("unable to find grid columns for the supplied colDef(s):",e),o}syncLayoutWithGrid(t){const e=this.getLeafPathTrees(),n=a_(e);t(n)}getLeafPathTrees(){const t=(o,i)=>{let l;if(x.isProvidedColumnGroup(o))if(o.isPadding())l=i;else{const d=Object.assign({},o.getColGroupDef());d.groupId=o.getGroupId(),d.children=[i],l=d}else{const d=Object.assign({},o.getColDef());d.colId=o.getColId(),l=d}const c=o.getOriginalParent();return c?t(c,l):l};return this.columnModel.getCols().filter(o=>{const i=o.getColDef();return o.isPrimary()&&!i.showRowGroup}).map(o=>t(o,o.getColDef()))}};function c_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isDisplayed())??!1}function d_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setDisplayed(e)}function u_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().setSideBarPosition(e)}function p_(t,e){var n;(n=t.sideBarService)==null||n.getSideBarComp().openToolPanel(e,"api")}function h_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().close("api")}function f_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().openedItem())??null}function m_(t){var e;(e=t.sideBarService)==null||e.getSideBarComp().refresh()}function g_(t){var e;return((e=t.sideBarService)==null?void 0:e.getSideBarComp().isToolPanelShowing())??!1}function y_(t,e){var o;const n=(o=t.sideBarService)==null?void 0:o.getSideBarComp().getToolPanelInstance(e);return x._unwrapUserComp(n)}function __(t){var e;return(e=t.sideBarService)==null?void 0:e.getSideBarComp().getDef()}var C_=class extends x.Component{constructor(t){super(),this.eToggleButton=x.RefPlaceholder,this.eIconWrapper=x.RefPlaceholder,this.eLabel=x.RefPlaceholder,this.toolPanelDef=t}getToolPanelId(){return this.toolPanelDef.id}postConstruct(){const t=this.createTemplate();this.setTemplate(t,[]),this.setLabel(),this.setIcon(),this.addManagedElementListeners(this.eToggleButton,{click:this.onButtonPressed.bind(this)}),this.eToggleButton.setAttribute("id",`ag-${this.getCompId()}-button`)}createTemplate(){return`<div class="ag-side-button" role="presentation">
|
|
4
4
|
<button type="button" data-ref="eToggleButton" tabindex="-1" role="tab" aria-expanded="false" class="ag-button ag-side-button-button">
|
|
5
5
|
<div data-ref="eIconWrapper" class="ag-side-button-icon-wrapper" aria-hidden="true"></div>
|
|
6
6
|
<span data-ref="eLabel" class="ag-side-button-label"></span>
|