@botpress/sdk 4.3.0 → 4.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var mg=Object.create;var Hr=Object.defineProperty;var yg=Object.getOwnPropertyDescriptor;var vg=Object.getOwnPropertyNames;var _g=Object.getPrototypeOf,Tg=Object.prototype.hasOwnProperty;var Ma=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),er=(t,e)=>{for(var r in e)Hr(t,r,{get:e[r],enumerable:!0})},Wi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of vg(e))!Tg.call(t,a)&&a!==r&&Hr(t,a,{get:()=>e[a],enumerable:!(n=yg(e,a))||n.enumerable});return t};var at=(t,e,r)=>(r=t!=null?mg(_g(t)):{},Wi(e||!t||!t.__esModule?Hr(r,"default",{value:t,enumerable:!0}):r,t)),bg=t=>Wi(Hr({},"__esModule",{value:!0}),t);var ao=Ma($=>{"use strict";var tr=Symbol.for("react.element"),wg=Symbol.for("react.portal"),Pg=Symbol.for("react.fragment"),kg=Symbol.for("react.strict_mode"),Eg=Symbol.for("react.profiler"),xg=Symbol.for("react.provider"),Sg=Symbol.for("react.context"),Og=Symbol.for("react.forward_ref"),Cg=Symbol.for("react.suspense"),Ig=Symbol.for("react.memo"),Bg=Symbol.for("react.lazy"),Vi=Symbol.iterator;function Rg(t){return t===null||typeof t!="object"?null:(t=Vi&&t[Vi]||t["@@iterator"],typeof t=="function"?t:null)}var Ji={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Yi=Object.assign,Xi={};function St(t,e,r){this.props=t,this.context=e,this.refs=Xi,this.updater=r||Ji}St.prototype.isReactComponent={};St.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};St.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Qi(){}Qi.prototype=St.prototype;function Na(t,e,r){this.props=t,this.context=e,this.refs=Xi,this.updater=r||Ji}var $a=Na.prototype=new Qi;$a.constructor=Na;Yi($a,St.prototype);$a.isPureReactComponent=!0;var qi=Array.isArray,eo=Object.prototype.hasOwnProperty,Ua={current:null},to={key:!0,ref:!0,__self:!0,__source:!0};function ro(t,e,r){var n,a={},s=null,i=null;if(e!=null)for(n in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(s=""+e.key),e)eo.call(e,n)&&!to.hasOwnProperty(n)&&(a[n]=e[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var c=Array(o),p=0;p<o;p++)c[p]=arguments[p+2];a.children=c}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:tr,type:t,key:s,ref:i,props:a,_owner:Ua.current}}function Zg(t,e){return{$$typeof:tr,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Ka(t){return typeof t=="object"&&t!==null&&t.$$typeof===tr}function Ag(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Gi=/\/+/g;function ja(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Ag(""+t.key):e.toString(36)}function jr(t,e,r,n,a){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case tr:case wg:i=!0}}if(i)return i=t,a=a(i),t=n===""?"."+ja(i,0):n,qi(a)?(r="",t!=null&&(r=t.replace(Gi,"$&/")+"/"),jr(a,e,r,"",function(p){return p})):a!=null&&(Ka(a)&&(a=Zg(a,r+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(Gi,"$&/")+"/")+t)),e.push(a)),1;if(i=0,n=n===""?".":n+":",qi(t))for(var o=0;o<t.length;o++){s=t[o];var c=n+ja(s,o);i+=jr(s,e,r,c,a)}else if(c=Rg(t),typeof c=="function")for(t=c.call(t),o=0;!(s=t.next()).done;)s=s.value,c=n+ja(s,o++),i+=jr(s,e,r,c,a);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return i}function Mr(t,e,r){if(t==null)return t;var n=[],a=0;return jr(t,n,"","",function(s){return e.call(r,s,a++)}),n}function Dg(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ye={current:null},Nr={transition:null},Hg={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:Nr,ReactCurrentOwner:Ua};function no(){throw Error("act(...) is not supported in production builds of React.")}$.Children={map:Mr,forEach:function(t,e,r){Mr(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Mr(t,function(){e++}),e},toArray:function(t){return Mr(t,function(e){return e})||[]},only:function(t){if(!Ka(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};$.Component=St;$.Fragment=Pg;$.Profiler=Eg;$.PureComponent=Na;$.StrictMode=kg;$.Suspense=Cg;$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hg;$.act=no;$.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=Yi({},t.props),a=t.key,s=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,i=Ua.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(c in e)eo.call(e,c)&&!to.hasOwnProperty(c)&&(n[c]=e[c]===void 0&&o!==void 0?o[c]:e[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){o=Array(c);for(var p=0;p<c;p++)o[p]=arguments[p+2];n.children=o}return{$$typeof:tr,type:t.type,key:a,ref:s,props:n,_owner:i}};$.createContext=function(t){return t={$$typeof:Sg,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:xg,_context:t},t.Consumer=t};$.createElement=ro;$.createFactory=function(t){var e=ro.bind(null,t);return e.type=t,e};$.createRef=function(){return{current:null}};$.forwardRef=function(t){return{$$typeof:Og,render:t}};$.isValidElement=Ka;$.lazy=function(t){return{$$typeof:Bg,_payload:{_status:-1,_result:t},_init:Dg}};$.memo=function(t,e){return{$$typeof:Ig,type:t,compare:e===void 0?null:e}};$.startTransition=function(t){var e=Nr.transition;Nr.transition={};try{t()}finally{Nr.transition=e}};$.unstable_act=no;$.useCallback=function(t,e){return ye.current.useCallback(t,e)};$.useContext=function(t){return ye.current.useContext(t)};$.useDebugValue=function(){};$.useDeferredValue=function(t){return ye.current.useDeferredValue(t)};$.useEffect=function(t,e){return ye.current.useEffect(t,e)};$.useId=function(){return ye.current.useId()};$.useImperativeHandle=function(t,e,r){return ye.current.useImperativeHandle(t,e,r)};$.useInsertionEffect=function(t,e){return ye.current.useInsertionEffect(t,e)};$.useLayoutEffect=function(t,e){return ye.current.useLayoutEffect(t,e)};$.useMemo=function(t,e){return ye.current.useMemo(t,e)};$.useReducer=function(t,e,r){return ye.current.useReducer(t,e,r)};$.useRef=function(t){return ye.current.useRef(t)};$.useState=function(t){return ye.current.useState(t)};$.useSyncExternalStore=function(t,e,r){return ye.current.useSyncExternalStore(t,e,r)};$.useTransition=function(){return ye.current.useTransition()};$.version="18.3.1"});var so=Ma((U,$r)=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),S=Symbol.iterator,W="@@iterator";function q(u){if(u===null||typeof u!="object")return null;var f=S&&u[S]||u[W];return typeof f=="function"?f:null}var re={current:null},J={transition:null},N={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},F={current:null},ue={},Le=null;function rt(u){Le=u}ue.setExtraStackFrame=function(u){Le=u},ue.getCurrentStack=null,ue.getStackAddendum=function(){var u="";Le&&(u+=Le);var f=ue.getCurrentStack;return f&&(u+=f()||""),u};var Ce=!1,we=!1,va=!1,_a=!1,Pe=!1,Te={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:J,ReactCurrentOwner:F};Te.ReactDebugCurrentFrame=ue,Te.ReactCurrentActQueue=N;function ke(u){{for(var f=arguments.length,g=new Array(f>1?f-1:0),y=1;y<f;y++)g[y-1]=arguments[y];Ie("warn",u,g)}}function j(u){{for(var f=arguments.length,g=new Array(f>1?f-1:0),y=1;y<f;y++)g[y-1]=arguments[y];Ie("error",u,g)}}function Ie(u,f,g){{var y=Te.ReactDebugCurrentFrame,b=y.getStackAddendum();b!==""&&(f+="%s",g=g.concat([b]));var B=g.map(function(x){return String(x)});B.unshift("Warning: "+f),Function.prototype.apply.call(console[u],console,B)}}var Oe={};function ze(u,f){{var g=u.constructor,y=g&&(g.displayName||g.name)||"ReactClass",b=y+"."+f;if(Oe[b])return;j("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",f,y),Oe[b]=!0}}var oi={isMounted:function(u){return!1},enqueueForceUpdate:function(u,f,g){ze(u,"forceUpdate")},enqueueReplaceState:function(u,f,g,y){ze(u,"replaceState")},enqueueSetState:function(u,f,g,y){ze(u,"setState")}},Ze=Object.assign,Ta={};Object.freeze(Ta);function nt(u,f,g){this.props=u,this.context=f,this.refs=Ta,this.updater=g||oi}nt.prototype.isReactComponent={},nt.prototype.setState=function(u,f){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,f,"setState")},nt.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};{var ba={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},up=function(u,f){Object.defineProperty(nt.prototype,u,{get:function(){ke("%s(...) is deprecated in plain JavaScript React classes. %s",f[0],f[1])}})};for(var wa in ba)ba.hasOwnProperty(wa)&&up(wa,ba[wa])}function li(){}li.prototype=nt.prototype;function Pa(u,f,g){this.props=u,this.context=f,this.refs=Ta,this.updater=g||oi}var ka=Pa.prototype=new li;ka.constructor=Pa,Ze(ka,nt.prototype),ka.isPureReactComponent=!0;function cp(){var u={current:null};return Object.seal(u),u}var dp=Array.isArray;function Er(u){return dp(u)}function fp(u){{var f=typeof Symbol=="function"&&Symbol.toStringTag,g=f&&u[Symbol.toStringTag]||u.constructor.name||"Object";return g}}function pp(u){try{return ui(u),!1}catch{return!0}}function ui(u){return""+u}function xr(u){if(pp(u))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fp(u)),ui(u)}function gp(u,f,g){var y=u.displayName;if(y)return y;var b=f.displayName||f.name||"";return b!==""?g+"("+b+")":g}function ci(u){return u.displayName||"Context"}function We(u){if(u==null)return null;if(typeof u.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case a:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case o:var f=u;return ci(f)+".Consumer";case i:var g=u;return ci(g._context)+".Provider";case c:return gp(u,u.render,"ForwardRef");case T:var y=u.displayName||null;return y!==null?y:We(u.type)||"Memo";case O:{var b=u,B=b._payload,x=b._init;try{return We(x(B))}catch{return null}}}return null}var Yt=Object.prototype.hasOwnProperty,di={key:!0,ref:!0,__self:!0,__source:!0},fi,pi,Ea;Ea={};function gi(u){if(Yt.call(u,"ref")){var f=Object.getOwnPropertyDescriptor(u,"ref").get;if(f&&f.isReactWarning)return!1}return u.ref!==void 0}function hi(u){if(Yt.call(u,"key")){var f=Object.getOwnPropertyDescriptor(u,"key").get;if(f&&f.isReactWarning)return!1}return u.key!==void 0}function hp(u,f){var g=function(){fi||(fi=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(u,"key",{get:g,configurable:!0})}function mp(u,f){var g=function(){pi||(pi=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(u,"ref",{get:g,configurable:!0})}function yp(u){if(typeof u.ref=="string"&&F.current&&u.__self&&F.current.stateNode!==u.__self){var f=We(F.current.type);Ea[f]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',f,u.ref),Ea[f]=!0)}}var xa=function(u,f,g,y,b,B,x){var D={$$typeof:e,type:u,key:f,ref:g,props:x,_owner:B};return D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(D,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(D,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D};function vp(u,f,g){var y,b={},B=null,x=null,D=null,L=null;if(f!=null){gi(f)&&(x=f.ref,yp(f)),hi(f)&&(xr(f.key),B=""+f.key),D=f.__self===void 0?null:f.__self,L=f.__source===void 0?null:f.__source;for(y in f)Yt.call(f,y)&&!di.hasOwnProperty(y)&&(b[y]=f[y])}var Y=arguments.length-2;if(Y===1)b.children=g;else if(Y>1){for(var Q=Array(Y),ee=0;ee<Y;ee++)Q[ee]=arguments[ee+2];Object.freeze&&Object.freeze(Q),b.children=Q}if(u&&u.defaultProps){var ne=u.defaultProps;for(y in ne)b[y]===void 0&&(b[y]=ne[y])}if(B||x){var oe=typeof u=="function"?u.displayName||u.name||"Unknown":u;B&&hp(b,oe),x&&mp(b,oe)}return xa(u,B,x,D,L,F.current,b)}function _p(u,f){var g=xa(u.type,f,u.ref,u._self,u._source,u._owner,u.props);return g}function Tp(u,f,g){if(u==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+u+".");var y,b=Ze({},u.props),B=u.key,x=u.ref,D=u._self,L=u._source,Y=u._owner;if(f!=null){gi(f)&&(x=f.ref,Y=F.current),hi(f)&&(xr(f.key),B=""+f.key);var Q;u.type&&u.type.defaultProps&&(Q=u.type.defaultProps);for(y in f)Yt.call(f,y)&&!di.hasOwnProperty(y)&&(f[y]===void 0&&Q!==void 0?b[y]=Q[y]:b[y]=f[y])}var ee=arguments.length-2;if(ee===1)b.children=g;else if(ee>1){for(var ne=Array(ee),oe=0;oe<ee;oe++)ne[oe]=arguments[oe+2];b.children=ne}return xa(u.type,B,x,D,L,Y,b)}function kt(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}var mi=".",bp=":";function wp(u){var f=/[=:]/g,g={"=":"=0",":":"=2"},y=u.replace(f,function(b){return g[b]});return"$"+y}var yi=!1,Pp=/\/+/g;function vi(u){return u.replace(Pp,"$&/")}function Sa(u,f){return typeof u=="object"&&u!==null&&u.key!=null?(xr(u.key),wp(""+u.key)):f.toString(36)}function Sr(u,f,g,y,b){var B=typeof u;(B==="undefined"||B==="boolean")&&(u=null);var x=!1;if(u===null)x=!0;else switch(B){case"string":case"number":x=!0;break;case"object":switch(u.$$typeof){case e:case r:x=!0}}if(x){var D=u,L=b(D),Y=y===""?mi+Sa(D,0):y;if(Er(L)){var Q="";Y!=null&&(Q=vi(Y)+"/"),Sr(L,f,Q,"",function(hg){return hg})}else L!=null&&(kt(L)&&(L.key&&(!D||D.key!==L.key)&&xr(L.key),L=_p(L,g+(L.key&&(!D||D.key!==L.key)?vi(""+L.key)+"/":"")+Y)),f.push(L));return 1}var ee,ne,oe=0,de=y===""?mi:y+bp;if(Er(u))for(var Dr=0;Dr<u.length;Dr++)ee=u[Dr],ne=de+Sa(ee,Dr),oe+=Sr(ee,f,g,ne,b);else{var Ha=q(u);if(typeof Ha=="function"){var Fi=u;Ha===Fi.entries&&(yi||ke("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),yi=!0);for(var pg=Ha.call(Fi),Li,gg=0;!(Li=pg.next()).done;)ee=Li.value,ne=de+Sa(ee,gg++),oe+=Sr(ee,f,g,ne,b)}else if(B==="object"){var zi=String(u);throw new Error("Objects are not valid as a React child (found: "+(zi==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":zi)+"). If you meant to render a collection of children, use an array instead.")}}return oe}function Or(u,f,g){if(u==null)return u;var y=[],b=0;return Sr(u,y,"","",function(B){return f.call(g,B,b++)}),y}function kp(u){var f=0;return Or(u,function(){f++}),f}function Ep(u,f,g){Or(u,function(){f.apply(this,arguments)},g)}function xp(u){return Or(u,function(f){return f})||[]}function Sp(u){if(!kt(u))throw new Error("React.Children.only expected to receive a single React element child.");return u}function Op(u){var f={$$typeof:o,_currentValue:u,_currentValue2:u,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};f.Provider={$$typeof:i,_context:f};var g=!1,y=!1,b=!1;{var B={$$typeof:o,_context:f};Object.defineProperties(B,{Provider:{get:function(){return y||(y=!0,j("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),f.Provider},set:function(x){f.Provider=x}},_currentValue:{get:function(){return f._currentValue},set:function(x){f._currentValue=x}},_currentValue2:{get:function(){return f._currentValue2},set:function(x){f._currentValue2=x}},_threadCount:{get:function(){return f._threadCount},set:function(x){f._threadCount=x}},Consumer:{get:function(){return g||(g=!0,j("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),f.Consumer}},displayName:{get:function(){return f.displayName},set:function(x){b||(ke("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",x),b=!0)}}}),f.Consumer=B}return f._currentRenderer=null,f._currentRenderer2=null,f}var Xt=-1,Oa=0,_i=1,Cp=2;function Ip(u){if(u._status===Xt){var f=u._result,g=f();if(g.then(function(B){if(u._status===Oa||u._status===Xt){var x=u;x._status=_i,x._result=B}},function(B){if(u._status===Oa||u._status===Xt){var x=u;x._status=Cp,x._result=B}}),u._status===Xt){var y=u;y._status=Oa,y._result=g}}if(u._status===_i){var b=u._result;return b===void 0&&j(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ "use strict";var mg=Object.create;var Hr=Object.defineProperty;var yg=Object.getOwnPropertyDescriptor;var vg=Object.getOwnPropertyNames;var _g=Object.getPrototypeOf,Tg=Object.prototype.hasOwnProperty;var Ma=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),er=(t,e)=>{for(var r in e)Hr(t,r,{get:e[r],enumerable:!0})},Vi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of vg(e))!Tg.call(t,a)&&a!==r&&Hr(t,a,{get:()=>e[a],enumerable:!(n=yg(e,a))||n.enumerable});return t};var St=(t,e,r)=>(r=t!=null?mg(_g(t)):{},Vi(e||!t||!t.__esModule?Hr(r,"default",{value:t,enumerable:!0}):r,t)),bg=t=>Vi(Hr({},"__esModule",{value:!0}),t);var so=Ma($=>{"use strict";var tr=Symbol.for("react.element"),wg=Symbol.for("react.portal"),Pg=Symbol.for("react.fragment"),kg=Symbol.for("react.strict_mode"),Eg=Symbol.for("react.profiler"),xg=Symbol.for("react.provider"),Sg=Symbol.for("react.context"),Og=Symbol.for("react.forward_ref"),Cg=Symbol.for("react.suspense"),Ig=Symbol.for("react.memo"),Bg=Symbol.for("react.lazy"),qi=Symbol.iterator;function Rg(t){return t===null||typeof t!="object"?null:(t=qi&&t[qi]||t["@@iterator"],typeof t=="function"?t:null)}var Yi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xi=Object.assign,Qi={};function Ot(t,e,r){this.props=t,this.context=e,this.refs=Qi,this.updater=r||Yi}Ot.prototype.isReactComponent={};Ot.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Ot.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function eo(){}eo.prototype=Ot.prototype;function Na(t,e,r){this.props=t,this.context=e,this.refs=Qi,this.updater=r||Yi}var $a=Na.prototype=new eo;$a.constructor=Na;Xi($a,Ot.prototype);$a.isPureReactComponent=!0;var Gi=Array.isArray,to=Object.prototype.hasOwnProperty,Ua={current:null},ro={key:!0,ref:!0,__self:!0,__source:!0};function no(t,e,r){var n,a={},s=null,i=null;if(e!=null)for(n in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(s=""+e.key),e)to.call(e,n)&&!ro.hasOwnProperty(n)&&(a[n]=e[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var c=Array(o),p=0;p<o;p++)c[p]=arguments[p+2];a.children=c}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:tr,type:t,key:s,ref:i,props:a,_owner:Ua.current}}function Zg(t,e){return{$$typeof:tr,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Ka(t){return typeof t=="object"&&t!==null&&t.$$typeof===tr}function Ag(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Ji=/\/+/g;function ja(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Ag(""+t.key):e.toString(36)}function jr(t,e,r,n,a){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case tr:case wg:i=!0}}if(i)return i=t,a=a(i),t=n===""?"."+ja(i,0):n,Gi(a)?(r="",t!=null&&(r=t.replace(Ji,"$&/")+"/"),jr(a,e,r,"",function(p){return p})):a!=null&&(Ka(a)&&(a=Zg(a,r+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(Ji,"$&/")+"/")+t)),e.push(a)),1;if(i=0,n=n===""?".":n+":",Gi(t))for(var o=0;o<t.length;o++){s=t[o];var c=n+ja(s,o);i+=jr(s,e,r,c,a)}else if(c=Rg(t),typeof c=="function")for(t=c.call(t),o=0;!(s=t.next()).done;)s=s.value,c=n+ja(s,o++),i+=jr(s,e,r,c,a);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return i}function Mr(t,e,r){if(t==null)return t;var n=[],a=0;return jr(t,n,"","",function(s){return e.call(r,s,a++)}),n}function Dg(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ye={current:null},Nr={transition:null},Hg={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:Nr,ReactCurrentOwner:Ua};function ao(){throw Error("act(...) is not supported in production builds of React.")}$.Children={map:Mr,forEach:function(t,e,r){Mr(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Mr(t,function(){e++}),e},toArray:function(t){return Mr(t,function(e){return e})||[]},only:function(t){if(!Ka(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};$.Component=Ot;$.Fragment=Pg;$.Profiler=Eg;$.PureComponent=Na;$.StrictMode=kg;$.Suspense=Cg;$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hg;$.act=ao;$.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=Xi({},t.props),a=t.key,s=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,i=Ua.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(c in e)to.call(e,c)&&!ro.hasOwnProperty(c)&&(n[c]=e[c]===void 0&&o!==void 0?o[c]:e[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){o=Array(c);for(var p=0;p<c;p++)o[p]=arguments[p+2];n.children=o}return{$$typeof:tr,type:t.type,key:a,ref:s,props:n,_owner:i}};$.createContext=function(t){return t={$$typeof:Sg,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:xg,_context:t},t.Consumer=t};$.createElement=no;$.createFactory=function(t){var e=no.bind(null,t);return e.type=t,e};$.createRef=function(){return{current:null}};$.forwardRef=function(t){return{$$typeof:Og,render:t}};$.isValidElement=Ka;$.lazy=function(t){return{$$typeof:Bg,_payload:{_status:-1,_result:t},_init:Dg}};$.memo=function(t,e){return{$$typeof:Ig,type:t,compare:e===void 0?null:e}};$.startTransition=function(t){var e=Nr.transition;Nr.transition={};try{t()}finally{Nr.transition=e}};$.unstable_act=ao;$.useCallback=function(t,e){return ye.current.useCallback(t,e)};$.useContext=function(t){return ye.current.useContext(t)};$.useDebugValue=function(){};$.useDeferredValue=function(t){return ye.current.useDeferredValue(t)};$.useEffect=function(t,e){return ye.current.useEffect(t,e)};$.useId=function(){return ye.current.useId()};$.useImperativeHandle=function(t,e,r){return ye.current.useImperativeHandle(t,e,r)};$.useInsertionEffect=function(t,e){return ye.current.useInsertionEffect(t,e)};$.useLayoutEffect=function(t,e){return ye.current.useLayoutEffect(t,e)};$.useMemo=function(t,e){return ye.current.useMemo(t,e)};$.useReducer=function(t,e,r){return ye.current.useReducer(t,e,r)};$.useRef=function(t){return ye.current.useRef(t)};$.useState=function(t){return ye.current.useState(t)};$.useSyncExternalStore=function(t,e,r){return ye.current.useSyncExternalStore(t,e,r)};$.useTransition=function(){return ye.current.useTransition()};$.version="18.3.1"});var io=Ma((U,$r)=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),S=Symbol.iterator,W="@@iterator";function q(u){if(u===null||typeof u!="object")return null;var f=S&&u[S]||u[W];return typeof f=="function"?f:null}var re={current:null},J={transition:null},N={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},F={current:null},ue={},Le=null;function rt(u){Le=u}ue.setExtraStackFrame=function(u){Le=u},ue.getCurrentStack=null,ue.getStackAddendum=function(){var u="";Le&&(u+=Le);var f=ue.getCurrentStack;return f&&(u+=f()||""),u};var Ce=!1,we=!1,va=!1,_a=!1,Pe=!1,Te={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:J,ReactCurrentOwner:F};Te.ReactDebugCurrentFrame=ue,Te.ReactCurrentActQueue=N;function ke(u){{for(var f=arguments.length,g=new Array(f>1?f-1:0),y=1;y<f;y++)g[y-1]=arguments[y];Ie("warn",u,g)}}function j(u){{for(var f=arguments.length,g=new Array(f>1?f-1:0),y=1;y<f;y++)g[y-1]=arguments[y];Ie("error",u,g)}}function Ie(u,f,g){{var y=Te.ReactDebugCurrentFrame,b=y.getStackAddendum();b!==""&&(f+="%s",g=g.concat([b]));var B=g.map(function(x){return String(x)});B.unshift("Warning: "+f),Function.prototype.apply.call(console[u],console,B)}}var Oe={};function ze(u,f){{var g=u.constructor,y=g&&(g.displayName||g.name)||"ReactClass",b=y+"."+f;if(Oe[b])return;j("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",f,y),Oe[b]=!0}}var li={isMounted:function(u){return!1},enqueueForceUpdate:function(u,f,g){ze(u,"forceUpdate")},enqueueReplaceState:function(u,f,g,y){ze(u,"replaceState")},enqueueSetState:function(u,f,g,y){ze(u,"setState")}},Ze=Object.assign,Ta={};Object.freeze(Ta);function nt(u,f,g){this.props=u,this.context=f,this.refs=Ta,this.updater=g||li}nt.prototype.isReactComponent={},nt.prototype.setState=function(u,f){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,f,"setState")},nt.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};{var ba={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},up=function(u,f){Object.defineProperty(nt.prototype,u,{get:function(){ke("%s(...) is deprecated in plain JavaScript React classes. %s",f[0],f[1])}})};for(var wa in ba)ba.hasOwnProperty(wa)&&up(wa,ba[wa])}function ui(){}ui.prototype=nt.prototype;function Pa(u,f,g){this.props=u,this.context=f,this.refs=Ta,this.updater=g||li}var ka=Pa.prototype=new ui;ka.constructor=Pa,Ze(ka,nt.prototype),ka.isPureReactComponent=!0;function cp(){var u={current:null};return Object.seal(u),u}var dp=Array.isArray;function Er(u){return dp(u)}function fp(u){{var f=typeof Symbol=="function"&&Symbol.toStringTag,g=f&&u[Symbol.toStringTag]||u.constructor.name||"Object";return g}}function pp(u){try{return ci(u),!1}catch{return!0}}function ci(u){return""+u}function xr(u){if(pp(u))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fp(u)),ci(u)}function gp(u,f,g){var y=u.displayName;if(y)return y;var b=f.displayName||f.name||"";return b!==""?g+"("+b+")":g}function di(u){return u.displayName||"Context"}function We(u){if(u==null)return null;if(typeof u.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case a:return"StrictMode";case p:return"Suspense";case m:return"SuspenseList"}if(typeof u=="object")switch(u.$$typeof){case o:var f=u;return di(f)+".Consumer";case i:var g=u;return di(g._context)+".Provider";case c:return gp(u,u.render,"ForwardRef");case T:var y=u.displayName||null;return y!==null?y:We(u.type)||"Memo";case O:{var b=u,B=b._payload,x=b._init;try{return We(x(B))}catch{return null}}}return null}var Yt=Object.prototype.hasOwnProperty,fi={key:!0,ref:!0,__self:!0,__source:!0},pi,gi,Ea;Ea={};function hi(u){if(Yt.call(u,"ref")){var f=Object.getOwnPropertyDescriptor(u,"ref").get;if(f&&f.isReactWarning)return!1}return u.ref!==void 0}function mi(u){if(Yt.call(u,"key")){var f=Object.getOwnPropertyDescriptor(u,"key").get;if(f&&f.isReactWarning)return!1}return u.key!==void 0}function hp(u,f){var g=function(){pi||(pi=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(u,"key",{get:g,configurable:!0})}function mp(u,f){var g=function(){gi||(gi=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(u,"ref",{get:g,configurable:!0})}function yp(u){if(typeof u.ref=="string"&&F.current&&u.__self&&F.current.stateNode!==u.__self){var f=We(F.current.type);Ea[f]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',f,u.ref),Ea[f]=!0)}}var xa=function(u,f,g,y,b,B,x){var D={$$typeof:e,type:u,key:f,ref:g,props:x,_owner:B};return D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(D,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(D,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D};function vp(u,f,g){var y,b={},B=null,x=null,D=null,L=null;if(f!=null){hi(f)&&(x=f.ref,yp(f)),mi(f)&&(xr(f.key),B=""+f.key),D=f.__self===void 0?null:f.__self,L=f.__source===void 0?null:f.__source;for(y in f)Yt.call(f,y)&&!fi.hasOwnProperty(y)&&(b[y]=f[y])}var Y=arguments.length-2;if(Y===1)b.children=g;else if(Y>1){for(var Q=Array(Y),ee=0;ee<Y;ee++)Q[ee]=arguments[ee+2];Object.freeze&&Object.freeze(Q),b.children=Q}if(u&&u.defaultProps){var ne=u.defaultProps;for(y in ne)b[y]===void 0&&(b[y]=ne[y])}if(B||x){var oe=typeof u=="function"?u.displayName||u.name||"Unknown":u;B&&hp(b,oe),x&&mp(b,oe)}return xa(u,B,x,D,L,F.current,b)}function _p(u,f){var g=xa(u.type,f,u.ref,u._self,u._source,u._owner,u.props);return g}function Tp(u,f,g){if(u==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+u+".");var y,b=Ze({},u.props),B=u.key,x=u.ref,D=u._self,L=u._source,Y=u._owner;if(f!=null){hi(f)&&(x=f.ref,Y=F.current),mi(f)&&(xr(f.key),B=""+f.key);var Q;u.type&&u.type.defaultProps&&(Q=u.type.defaultProps);for(y in f)Yt.call(f,y)&&!fi.hasOwnProperty(y)&&(f[y]===void 0&&Q!==void 0?b[y]=Q[y]:b[y]=f[y])}var ee=arguments.length-2;if(ee===1)b.children=g;else if(ee>1){for(var ne=Array(ee),oe=0;oe<ee;oe++)ne[oe]=arguments[oe+2];b.children=ne}return xa(u.type,B,x,D,L,Y,b)}function kt(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}var yi=".",bp=":";function wp(u){var f=/[=:]/g,g={"=":"=0",":":"=2"},y=u.replace(f,function(b){return g[b]});return"$"+y}var vi=!1,Pp=/\/+/g;function _i(u){return u.replace(Pp,"$&/")}function Sa(u,f){return typeof u=="object"&&u!==null&&u.key!=null?(xr(u.key),wp(""+u.key)):f.toString(36)}function Sr(u,f,g,y,b){var B=typeof u;(B==="undefined"||B==="boolean")&&(u=null);var x=!1;if(u===null)x=!0;else switch(B){case"string":case"number":x=!0;break;case"object":switch(u.$$typeof){case e:case r:x=!0}}if(x){var D=u,L=b(D),Y=y===""?yi+Sa(D,0):y;if(Er(L)){var Q="";Y!=null&&(Q=_i(Y)+"/"),Sr(L,f,Q,"",function(hg){return hg})}else L!=null&&(kt(L)&&(L.key&&(!D||D.key!==L.key)&&xr(L.key),L=_p(L,g+(L.key&&(!D||D.key!==L.key)?_i(""+L.key)+"/":"")+Y)),f.push(L));return 1}var ee,ne,oe=0,de=y===""?yi:y+bp;if(Er(u))for(var Dr=0;Dr<u.length;Dr++)ee=u[Dr],ne=de+Sa(ee,Dr),oe+=Sr(ee,f,g,ne,b);else{var Ha=q(u);if(typeof Ha=="function"){var Li=u;Ha===Li.entries&&(vi||ke("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),vi=!0);for(var pg=Ha.call(Li),zi,gg=0;!(zi=pg.next()).done;)ee=zi.value,ne=de+Sa(ee,gg++),oe+=Sr(ee,f,g,ne,b)}else if(B==="object"){var Wi=String(u);throw new Error("Objects are not valid as a React child (found: "+(Wi==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":Wi)+"). If you meant to render a collection of children, use an array instead.")}}return oe}function Or(u,f,g){if(u==null)return u;var y=[],b=0;return Sr(u,y,"","",function(B){return f.call(g,B,b++)}),y}function kp(u){var f=0;return Or(u,function(){f++}),f}function Ep(u,f,g){Or(u,function(){f.apply(this,arguments)},g)}function xp(u){return Or(u,function(f){return f})||[]}function Sp(u){if(!kt(u))throw new Error("React.Children.only expected to receive a single React element child.");return u}function Op(u){var f={$$typeof:o,_currentValue:u,_currentValue2:u,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};f.Provider={$$typeof:i,_context:f};var g=!1,y=!1,b=!1;{var B={$$typeof:o,_context:f};Object.defineProperties(B,{Provider:{get:function(){return y||(y=!0,j("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),f.Provider},set:function(x){f.Provider=x}},_currentValue:{get:function(){return f._currentValue},set:function(x){f._currentValue=x}},_currentValue2:{get:function(){return f._currentValue2},set:function(x){f._currentValue2=x}},_threadCount:{get:function(){return f._threadCount},set:function(x){f._threadCount=x}},Consumer:{get:function(){return g||(g=!0,j("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),f.Consumer}},displayName:{get:function(){return f.displayName},set:function(x){b||(ke("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",x),b=!0)}}}),f.Consumer=B}return f._currentRenderer=null,f._currentRenderer2=null,f}var Xt=-1,Oa=0,Ti=1,Cp=2;function Ip(u){if(u._status===Xt){var f=u._result,g=f();if(g.then(function(B){if(u._status===Oa||u._status===Xt){var x=u;x._status=Ti,x._result=B}},function(B){if(u._status===Oa||u._status===Xt){var x=u;x._status=Cp,x._result=B}}),u._status===Xt){var y=u;y._status=Oa,y._result=g}}if(u._status===Ti){var b=u._result;return b===void 0&&j(`lazy: Expected the result of a dynamic import() call. Instead received: %s
2
2
 
3
3
  Your code should look like:
4
4
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -6,31 +6,31 @@ Your code should look like:
6
6
  Did you accidentally put curly braces around the import?`,b),"default"in b||j(`lazy: Expected the result of a dynamic import() call. Instead received: %s
7
7
 
8
8
  Your code should look like:
9
- const MyComponent = lazy(() => import('./MyComponent'))`,b),b.default}else throw u._result}function Bp(u){var f={_status:Xt,_result:u},g={$$typeof:O,_payload:f,_init:Ip};{var y,b;Object.defineProperties(g,{defaultProps:{configurable:!0,get:function(){return y},set:function(B){j("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),y=B,Object.defineProperty(g,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return b},set:function(B){j("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),b=B,Object.defineProperty(g,"propTypes",{enumerable:!0})}}})}return g}function Rp(u){u!=null&&u.$$typeof===T?j("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof u!="function"?j("forwardRef requires a render function but was given %s.",u===null?"null":typeof u):u.length!==0&&u.length!==2&&j("forwardRef render functions accept exactly two parameters: props and ref. %s",u.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),u!=null&&(u.defaultProps!=null||u.propTypes!=null)&&j("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var f={$$typeof:c,render:u};{var g;Object.defineProperty(f,"displayName",{enumerable:!1,configurable:!0,get:function(){return g},set:function(y){g=y,!u.name&&!u.displayName&&(u.displayName=y)}})}return f}var Ti;Ti=Symbol.for("react.module.reference");function bi(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===s||Pe||u===a||u===p||u===m||_a||u===w||Ce||we||va||typeof u=="object"&&u!==null&&(u.$$typeof===O||u.$$typeof===T||u.$$typeof===i||u.$$typeof===o||u.$$typeof===c||u.$$typeof===Ti||u.getModuleId!==void 0))}function Zp(u,f){bi(u)||j("memo: The first argument must be a component. Instead received: %s",u===null?"null":typeof u);var g={$$typeof:T,type:u,compare:f===void 0?null:f};{var y;Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return y},set:function(b){y=b,!u.name&&!u.displayName&&(u.displayName=b)}})}return g}function me(){var u=re.current;return u===null&&j(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
9
+ const MyComponent = lazy(() => import('./MyComponent'))`,b),b.default}else throw u._result}function Bp(u){var f={_status:Xt,_result:u},g={$$typeof:O,_payload:f,_init:Ip};{var y,b;Object.defineProperties(g,{defaultProps:{configurable:!0,get:function(){return y},set:function(B){j("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),y=B,Object.defineProperty(g,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return b},set:function(B){j("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),b=B,Object.defineProperty(g,"propTypes",{enumerable:!0})}}})}return g}function Rp(u){u!=null&&u.$$typeof===T?j("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof u!="function"?j("forwardRef requires a render function but was given %s.",u===null?"null":typeof u):u.length!==0&&u.length!==2&&j("forwardRef render functions accept exactly two parameters: props and ref. %s",u.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),u!=null&&(u.defaultProps!=null||u.propTypes!=null)&&j("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var f={$$typeof:c,render:u};{var g;Object.defineProperty(f,"displayName",{enumerable:!1,configurable:!0,get:function(){return g},set:function(y){g=y,!u.name&&!u.displayName&&(u.displayName=y)}})}return f}var bi;bi=Symbol.for("react.module.reference");function wi(u){return!!(typeof u=="string"||typeof u=="function"||u===n||u===s||Pe||u===a||u===p||u===m||_a||u===w||Ce||we||va||typeof u=="object"&&u!==null&&(u.$$typeof===O||u.$$typeof===T||u.$$typeof===i||u.$$typeof===o||u.$$typeof===c||u.$$typeof===bi||u.getModuleId!==void 0))}function Zp(u,f){wi(u)||j("memo: The first argument must be a component. Instead received: %s",u===null?"null":typeof u);var g={$$typeof:T,type:u,compare:f===void 0?null:f};{var y;Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return y},set:function(b){y=b,!u.name&&!u.displayName&&(u.displayName=b)}})}return g}function me(){var u=re.current;return u===null&&j(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
10
10
  1. You might have mismatching versions of React and the renderer (such as React DOM)
11
11
  2. You might be breaking the Rules of Hooks
12
12
  3. You might have more than one copy of React in the same app
13
- See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),u}function Ap(u){var f=me();if(u._context!==void 0){var g=u._context;g.Consumer===u?j("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):g.Provider===u&&j("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return f.useContext(u)}function Dp(u){var f=me();return f.useState(u)}function Hp(u,f,g){var y=me();return y.useReducer(u,f,g)}function Mp(u){var f=me();return f.useRef(u)}function jp(u,f){var g=me();return g.useEffect(u,f)}function Np(u,f){var g=me();return g.useInsertionEffect(u,f)}function $p(u,f){var g=me();return g.useLayoutEffect(u,f)}function Up(u,f){var g=me();return g.useCallback(u,f)}function Kp(u,f){var g=me();return g.useMemo(u,f)}function Fp(u,f,g){var y=me();return y.useImperativeHandle(u,f,g)}function Lp(u,f){{var g=me();return g.useDebugValue(u,f)}}function zp(){var u=me();return u.useTransition()}function Wp(u){var f=me();return f.useDeferredValue(u)}function Vp(){var u=me();return u.useId()}function qp(u,f,g){var y=me();return y.useSyncExternalStore(u,f,g)}var Qt=0,wi,Pi,ki,Ei,xi,Si,Oi;function Ci(){}Ci.__reactDisabledLog=!0;function Gp(){{if(Qt===0){wi=console.log,Pi=console.info,ki=console.warn,Ei=console.error,xi=console.group,Si=console.groupCollapsed,Oi=console.groupEnd;var u={configurable:!0,enumerable:!0,value:Ci,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}Qt++}}function Jp(){{if(Qt--,Qt===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ze({},u,{value:wi}),info:Ze({},u,{value:Pi}),warn:Ze({},u,{value:ki}),error:Ze({},u,{value:Ei}),group:Ze({},u,{value:xi}),groupCollapsed:Ze({},u,{value:Si}),groupEnd:Ze({},u,{value:Oi})})}Qt<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ca=Te.ReactCurrentDispatcher,Ia;function Cr(u,f,g){{if(Ia===void 0)try{throw Error()}catch(b){var y=b.stack.trim().match(/\n( *(at )?)/);Ia=y&&y[1]||""}return`
14
- `+Ia+u}}var Ba=!1,Ir;{var Yp=typeof WeakMap=="function"?WeakMap:Map;Ir=new Yp}function Ii(u,f){if(!u||Ba)return"";{var g=Ir.get(u);if(g!==void 0)return g}var y;Ba=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var B;B=Ca.current,Ca.current=null,Gp();try{if(f){var x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(de){y=de}Reflect.construct(u,[],x)}else{try{x.call()}catch(de){y=de}u.call(x.prototype)}}else{try{throw Error()}catch(de){y=de}u()}}catch(de){if(de&&y&&typeof de.stack=="string"){for(var D=de.stack.split(`
13
+ See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),u}function Ap(u){var f=me();if(u._context!==void 0){var g=u._context;g.Consumer===u?j("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):g.Provider===u&&j("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return f.useContext(u)}function Dp(u){var f=me();return f.useState(u)}function Hp(u,f,g){var y=me();return y.useReducer(u,f,g)}function Mp(u){var f=me();return f.useRef(u)}function jp(u,f){var g=me();return g.useEffect(u,f)}function Np(u,f){var g=me();return g.useInsertionEffect(u,f)}function $p(u,f){var g=me();return g.useLayoutEffect(u,f)}function Up(u,f){var g=me();return g.useCallback(u,f)}function Kp(u,f){var g=me();return g.useMemo(u,f)}function Fp(u,f,g){var y=me();return y.useImperativeHandle(u,f,g)}function Lp(u,f){{var g=me();return g.useDebugValue(u,f)}}function zp(){var u=me();return u.useTransition()}function Wp(u){var f=me();return f.useDeferredValue(u)}function Vp(){var u=me();return u.useId()}function qp(u,f,g){var y=me();return y.useSyncExternalStore(u,f,g)}var Qt=0,Pi,ki,Ei,xi,Si,Oi,Ci;function Ii(){}Ii.__reactDisabledLog=!0;function Gp(){{if(Qt===0){Pi=console.log,ki=console.info,Ei=console.warn,xi=console.error,Si=console.group,Oi=console.groupCollapsed,Ci=console.groupEnd;var u={configurable:!0,enumerable:!0,value:Ii,writable:!0};Object.defineProperties(console,{info:u,log:u,warn:u,error:u,group:u,groupCollapsed:u,groupEnd:u})}Qt++}}function Jp(){{if(Qt--,Qt===0){var u={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ze({},u,{value:Pi}),info:Ze({},u,{value:ki}),warn:Ze({},u,{value:Ei}),error:Ze({},u,{value:xi}),group:Ze({},u,{value:Si}),groupCollapsed:Ze({},u,{value:Oi}),groupEnd:Ze({},u,{value:Ci})})}Qt<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ca=Te.ReactCurrentDispatcher,Ia;function Cr(u,f,g){{if(Ia===void 0)try{throw Error()}catch(b){var y=b.stack.trim().match(/\n( *(at )?)/);Ia=y&&y[1]||""}return`
14
+ `+Ia+u}}var Ba=!1,Ir;{var Yp=typeof WeakMap=="function"?WeakMap:Map;Ir=new Yp}function Bi(u,f){if(!u||Ba)return"";{var g=Ir.get(u);if(g!==void 0)return g}var y;Ba=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var B;B=Ca.current,Ca.current=null,Gp();try{if(f){var x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[])}catch(de){y=de}Reflect.construct(u,[],x)}else{try{x.call()}catch(de){y=de}u.call(x.prototype)}}else{try{throw Error()}catch(de){y=de}u()}}catch(de){if(de&&y&&typeof de.stack=="string"){for(var D=de.stack.split(`
15
15
  `),L=y.stack.split(`
16
16
  `),Y=D.length-1,Q=L.length-1;Y>=1&&Q>=0&&D[Y]!==L[Q];)Q--;for(;Y>=1&&Q>=0;Y--,Q--)if(D[Y]!==L[Q]){if(Y!==1||Q!==1)do if(Y--,Q--,Q<0||D[Y]!==L[Q]){var ee=`
17
- `+D[Y].replace(" at new "," at ");return u.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",u.displayName)),typeof u=="function"&&Ir.set(u,ee),ee}while(Y>=1&&Q>=0);break}}}finally{Ba=!1,Ca.current=B,Jp(),Error.prepareStackTrace=b}var ne=u?u.displayName||u.name:"",oe=ne?Cr(ne):"";return typeof u=="function"&&Ir.set(u,oe),oe}function Xp(u,f,g){return Ii(u,!1)}function Qp(u){var f=u.prototype;return!!(f&&f.isReactComponent)}function Br(u,f,g){if(u==null)return"";if(typeof u=="function")return Ii(u,Qp(u));if(typeof u=="string")return Cr(u);switch(u){case p:return Cr("Suspense");case m:return Cr("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return Xp(u.render);case T:return Br(u.type,f,g);case O:{var y=u,b=y._payload,B=y._init;try{return Br(B(b),f,g)}catch{}}}return""}var Bi={},Ri=Te.ReactDebugCurrentFrame;function Rr(u){if(u){var f=u._owner,g=Br(u.type,u._source,f?f.type:null);Ri.setExtraStackFrame(g)}else Ri.setExtraStackFrame(null)}function eg(u,f,g,y,b){{var B=Function.call.bind(Yt);for(var x in u)if(B(u,x)){var D=void 0;try{if(typeof u[x]!="function"){var L=Error((y||"React class")+": "+g+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw L.name="Invariant Violation",L}D=u[x](f,x,y,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){D=Y}D&&!(D instanceof Error)&&(Rr(b),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",y||"React class",g,x,typeof D),Rr(null)),D instanceof Error&&!(D.message in Bi)&&(Bi[D.message]=!0,Rr(b),j("Failed %s type: %s",g,D.message),Rr(null))}}}function Et(u){if(u){var f=u._owner,g=Br(u.type,u._source,f?f.type:null);rt(g)}else rt(null)}var Ra;Ra=!1;function Zi(){if(F.current){var u=We(F.current.type);if(u)return`
17
+ `+D[Y].replace(" at new "," at ");return u.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",u.displayName)),typeof u=="function"&&Ir.set(u,ee),ee}while(Y>=1&&Q>=0);break}}}finally{Ba=!1,Ca.current=B,Jp(),Error.prepareStackTrace=b}var ne=u?u.displayName||u.name:"",oe=ne?Cr(ne):"";return typeof u=="function"&&Ir.set(u,oe),oe}function Xp(u,f,g){return Bi(u,!1)}function Qp(u){var f=u.prototype;return!!(f&&f.isReactComponent)}function Br(u,f,g){if(u==null)return"";if(typeof u=="function")return Bi(u,Qp(u));if(typeof u=="string")return Cr(u);switch(u){case p:return Cr("Suspense");case m:return Cr("SuspenseList")}if(typeof u=="object")switch(u.$$typeof){case c:return Xp(u.render);case T:return Br(u.type,f,g);case O:{var y=u,b=y._payload,B=y._init;try{return Br(B(b),f,g)}catch{}}}return""}var Ri={},Zi=Te.ReactDebugCurrentFrame;function Rr(u){if(u){var f=u._owner,g=Br(u.type,u._source,f?f.type:null);Zi.setExtraStackFrame(g)}else Zi.setExtraStackFrame(null)}function eg(u,f,g,y,b){{var B=Function.call.bind(Yt);for(var x in u)if(B(u,x)){var D=void 0;try{if(typeof u[x]!="function"){var L=Error((y||"React class")+": "+g+" type `"+x+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof u[x]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw L.name="Invariant Violation",L}D=u[x](f,x,y,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){D=Y}D&&!(D instanceof Error)&&(Rr(b),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",y||"React class",g,x,typeof D),Rr(null)),D instanceof Error&&!(D.message in Ri)&&(Ri[D.message]=!0,Rr(b),j("Failed %s type: %s",g,D.message),Rr(null))}}}function Et(u){if(u){var f=u._owner,g=Br(u.type,u._source,f?f.type:null);rt(g)}else rt(null)}var Ra;Ra=!1;function Ai(){if(F.current){var u=We(F.current.type);if(u)return`
18
18
 
19
19
  Check the render method of \``+u+"`."}return""}function tg(u){if(u!==void 0){var f=u.fileName.replace(/^.*[\\\/]/,""),g=u.lineNumber;return`
20
20
 
21
- Check your code at `+f+":"+g+"."}return""}function rg(u){return u!=null?tg(u.__source):""}var Ai={};function ng(u){var f=Zi();if(!f){var g=typeof u=="string"?u:u.displayName||u.name;g&&(f=`
21
+ Check your code at `+f+":"+g+"."}return""}function rg(u){return u!=null?tg(u.__source):""}var Di={};function ng(u){var f=Ai();if(!f){var g=typeof u=="string"?u:u.displayName||u.name;g&&(f=`
22
22
 
23
- Check the top-level render call using <`+g+">.")}return f}function Di(u,f){if(!(!u._store||u._store.validated||u.key!=null)){u._store.validated=!0;var g=ng(f);if(!Ai[g]){Ai[g]=!0;var y="";u&&u._owner&&u._owner!==F.current&&(y=" It was passed a child from "+We(u._owner.type)+"."),Et(u),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,y),Et(null)}}}function Hi(u,f){if(typeof u=="object"){if(Er(u))for(var g=0;g<u.length;g++){var y=u[g];kt(y)&&Di(y,f)}else if(kt(u))u._store&&(u._store.validated=!0);else if(u){var b=q(u);if(typeof b=="function"&&b!==u.entries)for(var B=b.call(u),x;!(x=B.next()).done;)kt(x.value)&&Di(x.value,f)}}}function Mi(u){{var f=u.type;if(f==null||typeof f=="string")return;var g;if(typeof f=="function")g=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===c||f.$$typeof===T))g=f.propTypes;else return;if(g){var y=We(f);eg(g,u.props,"prop",y,u)}else if(f.PropTypes!==void 0&&!Ra){Ra=!0;var b=We(f);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ag(u){{for(var f=Object.keys(u.props),g=0;g<f.length;g++){var y=f[g];if(y!=="children"&&y!=="key"){Et(u),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),Et(null);break}}u.ref!==null&&(Et(u),j("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function ji(u,f,g){var y=bi(u);if(!y){var b="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(b+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var B=rg(f);B?b+=B:b+=Zi();var x;u===null?x="null":Er(u)?x="array":u!==void 0&&u.$$typeof===e?(x="<"+(We(u.type)||"Unknown")+" />",b=" Did you accidentally export a JSX literal instead of a component?"):x=typeof u,j("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",x,b)}var D=vp.apply(this,arguments);if(D==null)return D;if(y)for(var L=2;L<arguments.length;L++)Hi(arguments[L],u);return u===n?ag(D):Mi(D),D}var Ni=!1;function sg(u){var f=ji.bind(null,u);return f.type=u,Ni||(Ni=!0,ke("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(f,"type",{enumerable:!1,get:function(){return ke("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:u}),u}}),f}function ig(u,f,g){for(var y=Tp.apply(this,arguments),b=2;b<arguments.length;b++)Hi(arguments[b],y.type);return Mi(y),y}function og(u,f){var g=J.transition;J.transition={};var y=J.transition;J.transition._updatedFibers=new Set;try{u()}finally{if(J.transition=g,g===null&&y._updatedFibers){var b=y._updatedFibers.size;b>10&&ke("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),y._updatedFibers.clear()}}}var $i=!1,Zr=null;function lg(u){if(Zr===null)try{var f=("require"+Math.random()).slice(0,7),g=$r&&$r[f];Zr=g.call($r,"timers").setImmediate}catch{Zr=function(b){$i===!1&&($i=!0,typeof MessageChannel>"u"&&j("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var B=new MessageChannel;B.port1.onmessage=b,B.port2.postMessage(void 0)}}return Zr(u)}var xt=0,Ui=!1;function Ki(u){{var f=xt;xt++,N.current===null&&(N.current=[]);var g=N.isBatchingLegacy,y;try{if(N.isBatchingLegacy=!0,y=u(),!g&&N.didScheduleLegacyUpdate){var b=N.current;b!==null&&(N.didScheduleLegacyUpdate=!1,Da(b))}}catch(ne){throw Ar(f),ne}finally{N.isBatchingLegacy=g}if(y!==null&&typeof y=="object"&&typeof y.then=="function"){var B=y,x=!1,D={then:function(ne,oe){x=!0,B.then(function(de){Ar(f),xt===0?Za(de,ne,oe):ne(de)},function(de){Ar(f),oe(de)})}};return!Ui&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){x||(Ui=!0,j("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),D}else{var L=y;if(Ar(f),xt===0){var Y=N.current;Y!==null&&(Da(Y),N.current=null);var Q={then:function(ne,oe){N.current===null?(N.current=[],Za(L,ne,oe)):ne(L)}};return Q}else{var ee={then:function(ne,oe){ne(L)}};return ee}}}}function Ar(u){u!==xt-1&&j("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),xt=u}function Za(u,f,g){{var y=N.current;if(y!==null)try{Da(y),lg(function(){y.length===0?(N.current=null,f(u)):Za(u,f,g)})}catch(b){g(b)}else f(u)}}var Aa=!1;function Da(u){if(!Aa){Aa=!0;var f=0;try{for(;f<u.length;f++){var g=u[f];do g=g(!0);while(g!==null)}u.length=0}catch(y){throw u=u.slice(f+1),y}finally{Aa=!1}}}var ug=ji,cg=ig,dg=sg,fg={map:Or,forEach:Ep,count:kp,toArray:xp,only:Sp};U.Children=fg,U.Component=nt,U.Fragment=n,U.Profiler=s,U.PureComponent=Pa,U.StrictMode=a,U.Suspense=p,U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Te,U.act=Ki,U.cloneElement=cg,U.createContext=Op,U.createElement=ug,U.createFactory=dg,U.createRef=cp,U.forwardRef=Rp,U.isValidElement=kt,U.lazy=Bp,U.memo=Zp,U.startTransition=og,U.unstable_act=Ki,U.useCallback=Up,U.useContext=Ap,U.useDebugValue=Lp,U.useDeferredValue=Wp,U.useEffect=jp,U.useId=Vp,U.useImperativeHandle=Fp,U.useInsertionEffect=Np,U.useLayoutEffect=$p,U.useMemo=Kp,U.useReducer=Hp,U.useRef=Mp,U.useState=Dp,U.useSyncExternalStore=qp,U.useTransition=zp,U.version=t,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var Ot=Ma((kT,Fa)=>{"use strict";process.env.NODE_ENV==="production"?Fa.exports=ao():Fa.exports=so()});var bT={};er(bT,{BRAND:()=>Ac,Bot:()=>pa,BotDefinition:()=>fa,BotLogger:()=>Xe,BotSpecificClient:()=>Re,DIRTY:()=>ct,EMPTY_PATH:()=>Oc,ErrorBoundary:()=>Ht,INVALID:()=>I,Integration:()=>da,IntegrationDefinition:()=>oa,IntegrationLogger:()=>Ye,IntegrationSpecificClient:()=>qt,InterfaceDefinition:()=>ga,NEVER:()=>Sf,OK:()=>pe,ParseInputLazyPath:()=>xe,ParseStatus:()=>ve,Plugin:()=>ma,PluginDefinition:()=>ha,RuntimeError:()=>ya.RuntimeError,Schema:()=>H,WELL_KNOWN_ATTRIBUTES:()=>$_,ZodAny:()=>gr,ZodArray:()=>$t,ZodBigInt:()=>Ln,ZodBoolean:()=>zn,ZodBranded:()=>Wn,ZodCatch:()=>Vn,ZodDate:()=>qn,ZodDefault:()=>mr,ZodDiscriminatedUnion:()=>Ss,ZodEffects:()=>Je,ZodEnum:()=>bt,ZodError:()=>Be,ZodFirstPartyTypeKind:()=>Ps,ZodFunction:()=>Cs,ZodIntersection:()=>Gn,ZodIssueCode:()=>_,ZodLazy:()=>Jn,ZodLiteral:()=>Yn,ZodMap:()=>Is,ZodNaN:()=>Bs,ZodNativeEnum:()=>Xn,ZodNever:()=>qe,ZodNull:()=>Qn,ZodNullable:()=>ft,ZodNumber:()=>ea,ZodObject:()=>pt,ZodOptional:()=>je,ZodParsedType:()=>k,ZodPipeline:()=>ta,ZodPromise:()=>vr,ZodReadonly:()=>_r,ZodRecord:()=>Rs,ZodRef:()=>Zs,ZodSchema:()=>H,ZodSet:()=>As,ZodString:()=>ge,ZodSymbol:()=>Fs,ZodTransformer:()=>Je,ZodTuple:()=>gt,ZodType:()=>H,ZodUndefined:()=>ra,ZodUnion:()=>na,ZodUnknown:()=>Dt,ZodVoid:()=>Ls,ZuiForm:()=>R_,addIssueToContext:()=>P,agent:()=>Rd,aimodel:()=>Md,any:()=>qd,array:()=>Xd,bigint:()=>Fd,boolean:()=>Js,botIdHeader:()=>br,botUserIdHeader:()=>Qs,coerce:()=>xf,configurationHeader:()=>wr,configurationTypeHeader:()=>ri,conversation:()=>Cd,createZodEnum:()=>yr,cuid2Regex:()=>Hs,cuidRegex:()=>Ds,custom:()=>xs,datasource:()=>jd,date:()=>Ld,datetimeRegex:()=>Ks,defaultComponentDefinitions:()=>Z_,discriminatedUnion:()=>rf,effect:()=>fs,emailRegex:()=>Ns,enum:()=>gf,errorUtil:()=>C,event:()=>Zd,fromJsonSchema:()=>kf,fromObject:()=>Ef,function:()=>df,getErrorMap:()=>jt,getParsedType:()=>He,instanceof:()=>Ud,integrationIdHeader:()=>ei,intent:()=>Hd,intersection:()=>nf,ipv4Regex:()=>$s,ipv6Regex:()=>Us,isAborted:()=>rn,isApiError:()=>ya.isApiError,isAsync:()=>pr,isDirty:()=>nn,isEmojiRegex:()=>Yc,isValid:()=>Nt,jsonSchemaToZui:()=>Tr,knowledgebase:()=>Nd,late:()=>$d,lazy:()=>ff,literal:()=>pf,makeIssue:()=>fr,map:()=>uf,mergeObjectSchemas:()=>Wt,message:()=>Bd,messages:()=>Xs,nan:()=>Kd,nativeEnum:()=>hf,never:()=>Jd,null:()=>Vd,nullable:()=>vf,number:()=>Gs,object:()=>Qd,objectToZui:()=>Kt,objectUtil:()=>en,oboolean:()=>Pf,onumber:()=>wf,operationHeader:()=>Pr,optional:()=>yf,ostring:()=>bf,parseBody:()=>Se,pipeline:()=>Tf,preprocess:()=>_f,processCreateParams:()=>Z,promise:()=>mf,quotelessJson:()=>Ec,readonly:()=>lf,record:()=>sf,ref:()=>of,serve:()=>kr,set:()=>cf,setErrorMap:()=>Es,strictObject:()=>ef,string:()=>qs,symbol:()=>zd,table:()=>Ad,tablerow:()=>Dd,transformer:()=>fs,transforms:()=>A_,tuple:()=>af,typeHeader:()=>ni,ulidRegex:()=>Ms,undefined:()=>Wd,union:()=>tf,unknown:()=>Gd,user:()=>Id,util:()=>M,uuidRegex:()=>js,variable:()=>Od,void:()=>Yd,webhookIdHeader:()=>ti,withErrorBoundary:()=>Bf,z:()=>E,zuiToJsonSchema:()=>aa});module.exports=bg(bT);var Xs={};er(Xs,{defaults:()=>N_,markdown:()=>j_});var Hn=at(Ot(),1),ae=at(Ot(),1),Ne=at(Ot(),1),Ft=at(Ot(),1),be=at(Ot(),1),ps=Object.defineProperty,Mg=Object.defineProperties,jg=Object.getOwnPropertyDescriptors,Yr=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,io=(t,e,r)=>e in t?ps(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d=(t,e)=>{for(var r in e||(e={}))Uo.call(e,r)&&io(t,r,e[r]);if(Yr)for(var r of Yr(e))Ko.call(e,r)&&io(t,r,e[r]);return t},h=(t,e)=>Mg(t,jg(e)),l=(t,e)=>ps(t,"name",{value:e,configurable:!0}),Fo=(t,e)=>{var r={};for(var n in t)Uo.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Yr)for(var n of Yr(t))e.indexOf(n)<0&&Ko.call(t,n)&&(r[n]=t[n]);return r},Lo=(t,e)=>{for(var r in e)ps(t,r,{get:e[r],enumerable:!0})},E={};Lo(E,{BRAND:()=>Ac,DIRTY:()=>ct,EMPTY_PATH:()=>Oc,INVALID:()=>I,NEVER:()=>Sf,OK:()=>pe,ParseInputLazyPath:()=>xe,ParseStatus:()=>ve,Schema:()=>H,ZodAny:()=>gr,ZodArray:()=>$t,ZodBigInt:()=>Ln,ZodBoolean:()=>zn,ZodBranded:()=>Wn,ZodCatch:()=>Vn,ZodDate:()=>qn,ZodDefault:()=>mr,ZodDiscriminatedUnion:()=>Ss,ZodEffects:()=>Je,ZodEnum:()=>bt,ZodError:()=>Be,ZodFirstPartyTypeKind:()=>Ps,ZodFunction:()=>Cs,ZodIntersection:()=>Gn,ZodIssueCode:()=>_,ZodLazy:()=>Jn,ZodLiteral:()=>Yn,ZodMap:()=>Is,ZodNaN:()=>Bs,ZodNativeEnum:()=>Xn,ZodNever:()=>qe,ZodNull:()=>Qn,ZodNullable:()=>ft,ZodNumber:()=>ea,ZodObject:()=>pt,ZodOptional:()=>je,ZodParsedType:()=>k,ZodPipeline:()=>ta,ZodPromise:()=>vr,ZodReadonly:()=>_r,ZodRecord:()=>Rs,ZodRef:()=>Zs,ZodSchema:()=>H,ZodSet:()=>As,ZodString:()=>ge,ZodSymbol:()=>Fs,ZodTransformer:()=>Je,ZodTuple:()=>gt,ZodType:()=>H,ZodUndefined:()=>ra,ZodUnion:()=>na,ZodUnknown:()=>Dt,ZodVoid:()=>Ls,addIssueToContext:()=>P,agent:()=>Rd,aimodel:()=>Md,any:()=>qd,array:()=>Xd,bigint:()=>Fd,boolean:()=>Js,coerce:()=>xf,conversation:()=>Cd,createZodEnum:()=>yr,cuid2Regex:()=>Hs,cuidRegex:()=>Ds,custom:()=>xs,datasource:()=>jd,date:()=>Ld,datetimeRegex:()=>Ks,default:()=>l_,discriminatedUnion:()=>rf,effect:()=>fs,emailRegex:()=>Ns,enum:()=>gf,errorUtil:()=>C,event:()=>Zd,fromJsonSchema:()=>kf,fromObject:()=>Ef,function:()=>df,getErrorMap:()=>jt,getParsedType:()=>He,instanceof:()=>Ud,intent:()=>Hd,intersection:()=>nf,ipv4Regex:()=>$s,ipv6Regex:()=>Us,isAborted:()=>rn,isAsync:()=>pr,isDirty:()=>nn,isEmojiRegex:()=>Yc,isValid:()=>Nt,jsonSchemaToZui:()=>Tr,knowledgebase:()=>Nd,late:()=>$d,lazy:()=>ff,literal:()=>pf,makeIssue:()=>fr,map:()=>uf,message:()=>Bd,nan:()=>Kd,nativeEnum:()=>hf,never:()=>Jd,null:()=>Vd,nullable:()=>vf,number:()=>Gs,object:()=>Qd,objectToZui:()=>Kt,objectUtil:()=>en,oboolean:()=>Pf,onumber:()=>wf,optional:()=>yf,ostring:()=>bf,pipeline:()=>Tf,preprocess:()=>_f,processCreateParams:()=>Z,promise:()=>mf,quotelessJson:()=>Ec,readonly:()=>lf,record:()=>sf,ref:()=>of,set:()=>cf,setErrorMap:()=>Es,strictObject:()=>ef,string:()=>qs,symbol:()=>zd,table:()=>Ad,tablerow:()=>Dd,transformer:()=>fs,tuple:()=>af,ulidRegex:()=>Ms,undefined:()=>Wd,union:()=>tf,unknown:()=>Gd,user:()=>Id,util:()=>M,uuidRegex:()=>js,variable:()=>Od,void:()=>Yd,zuiToJsonSchema:()=>aa});var K="x-zui",zo=(0,ae.createContext)({formData:void 0,formSchema:void 0,setFormData:l(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:l(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:l(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),oo=l((t,e,r)=>{var n;let a=(n=e[K])==null?void 0:n[t];if(typeof a>"u")return!1;if(typeof a=="boolean")return a;if(typeof a=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;let i=new Function("return "+a)()(r);switch(typeof i){case"object":case"boolean":return i;default:return!1}}return!1},"parseMaskableField"),Wo=l((t,e)=>{let r=(0,ae.useContext)(zo);if(r===void 0)throw new Error("useFormData must be used within a FormDataProvider");let n=(0,ae.useMemo)(()=>lt(r.formData,e),[r.formData,e]),a=(0,ae.useMemo)(()=>{var w;return r.validation.formValid===null?{formValid:null,formErrors:null}:r.validation.formValid===!1?{formValid:!1,formErrors:((w=r.validation.formErrors)==null?void 0:w.filter(S=>Go(S.path,e)).map(S=>({message:S.message,code:S.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[r.validation.formValid,r.validation.formErrors,e]),s=r.dataTransform?r.dataTransform(n):n,i=(0,ae.useMemo)(()=>oo("hidden",t,s),[t,s]),o=(0,ae.useMemo)(()=>oo("disabled",t,s),[t,s]);(0,ae.useEffect)(()=>{r.setHiddenState(w=>Ct(w,e,i||{})),r.setDisabledState(w=>Ct(w,e,o||{}))},[JSON.stringify({fieldSchema:t,data:n})]);let{disabled:c,hidden:p}=(0,ae.useMemo)(()=>{let w=i===!0||lt(r.hiddenState,e),S=o===!0||lt(r.disabledState,e);return{hidden:w===!0,disabled:S===!0}},[r.hiddenState,r.disabledState,i,o,e]),m=(0,ae.useCallback)((w,S)=>{r.setFormData(W=>Ct(W,w,S))},[r.setFormData]),T=(0,ae.useCallback)((w,S=void 0)=>{let W=At(t.items);r.setFormData(q=>{let re=lt(q,w)||[];return S===void 0&&(S=W),Ct(q,w,Array.isArray(re)?[...re,S]:[S])})},[r.setFormData]),O=(0,ae.useCallback)((w,S)=>{r.setFormData(W=>{let q=lt(W,w)||[];return Array.isArray(q)?(q.splice(S,1),Ct(W,w,q)):W})},[r.setFormData]);return d(h(d({},r),{data:n,disabled:c,hidden:p,handlePropertyChange:m,addArrayItem:T,removeArrayItem:O}),a)},"useFormData");function Ct(t,e,r){if(e.length===0)return r;let n=e.length;return e.reduce((a,s,i)=>(i===n-1?a[s]=r:a[s]||(a[s]=isNaN(Number(s))?{}:[]),a[s]),t??{}),d({},t)}l(Ct,"setObjectPath");var At=l((t,e)=>{var r,n,a,s;if(Array.isArray(t))return At(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((r=t.anyOf)!=null&&r.length)return At(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([o,c])=>{var p;i[o]=At(c,!((p=t.required)!=null&&p.includes(o))||Vo(c)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[At(t.items)]:[];if(t.type==="string")return(n=t.enum)!=null&&n.length?t.enum[0]:"";if(t.type==="number")return(a=t.enum)!=null&&a.length?t.enum[0]:0;if(t.type==="boolean")return(s=t.enum)!=null&&s.length?t.enum[0]:!1}},"getDefaultValues"),Ng=l(({children:t,setFormData:e,formData:r,formSchema:n,disableValidation:a,onValidation:s,dataTransform:i})=>{let[o,c]=(0,ae.useState)({}),[p,m]=(0,ae.useState)({}),T=i?i(r):r,O=(0,ae.useMemo)(()=>{if(a)return{formValid:null,formErrors:null};if(!n)return{formValid:null,formErrors:null};let w=Tr(n).safeParse(T);return w.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:w.error.issues}},[JSON.stringify({transformedData:T})]);return(0,ae.useEffect)(()=>{s&&s(O)},[O]),ae.default.createElement(zo.Provider,{value:{formData:r,setFormData:e,formSchema:n,validation:O,hiddenState:o,setHiddenState:c,disabledState:p,setDisabledState:m,dataTransform:i}},t)},"FormDataProvider");function lt(t,e){return e.reduce((r,n)=>r?r[n]:null,t)}l(lt,"getPathData");function Vo(t){var e;return((e=t.anyOf)==null?void 0:e.some(r=>r.not&&Object.keys(r.not).length===0))||!1}l(Vo,"isOptional");function Xr(t,e){let r=d({},t);for(let n in e)e.hasOwnProperty(n)&&(typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])?typeof r[n]=="object"&&r[n]!==null&&!Array.isArray(r[n])?r[n]=Xr(r[n],e[n]):r[n]=Xr({},e[n]):r[n]=e[n]);return r}l(Xr,"deepMerge");var $g=l((t,e)=>{let{handlePropertyChange:r,data:n}=Wo(t,e),{discriminator:a,value:s,discriminatedSchema:i}=(0,Hn.useMemo)(()=>{let o=qo(t.anyOf),c=o?.key?n?.[o.key]:t.default||null,p=Ug(o?.key||null,c,t.anyOf);return{discriminator:o,value:c,discriminatedSchema:p}},[t.anyOf,n]);return(0,Hn.useEffect)(()=>{a?.key&&a?.values.length&&Object.keys(n||{}).length<1&&!t.default&&r(e,{[a.key]:a.values[0]})},[]),{discriminator:a,discriminatorValue:s,discriminatedSchema:i}},"useDiscriminator"),qo=l(t=>{let e=t?.map(r=>r.type!=="object"||!r.properties?null:Object.entries(r.properties).map(([n,a])=>{var s;return a.type==="string"&&((s=a.enum)!=null&&s.length)?{key:n,value:a.enum[0]}:null}).filter(n=>!!n)).flat().reduce((r,n)=>{if(!n)return r;let{key:a,value:s}=n;return r.key===null&&(r.key=a),r.key===a&&r.values.push(s),r},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),Ug=l((t,e,r)=>{var n,a;if(!r?.length||!t||!e)return null;for(let s of r){if(s.type!=="object")continue;let i=(n=s.properties)==null?void 0:n[t];if(i?.type==="string"&&((a=i.enum)!=null&&a.length)&&i.enum[0]===e)return h(d({},s),{properties:h(d({},s.properties),{[t]:h(d({},i),{[K]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),Kg=l(t=>{var e;return(e=t.anyOf)!=null&&e.length?qo(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),Fg=l((t,e)=>{var r,n,a;let s=Kg(e),i=((r=e[K])==null?void 0:r.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let m=(n=t?.[s])==null?void 0:n.default;return m?{Component:m,type:s,id:"default",params:{}}:null}let o=i[0],c=((a=t?.[s])==null?void 0:a[o])||null;if(!c)return console.warn(`Component ${s}.${o} not found`),null;let p=i[1]||{};return{Component:c,type:s,id:o,params:p}},"resolveComponent");function Go(t,e){return t.length!==e.length?!1:t.every((r,n)=>r===e[n])}l(Go,"pathMatches");function qa(t,e){return e||(e=new RegExp("/s|-|_| ","g")),Xo(t).split(e).map(Jo).map(Qo).reduce(Yo)}l(qa,"formatTitle");function Jo(t){return t.charAt(0).toUpperCase()+t.substring(1)}l(Jo,"capitalize");function Yo(t,e){return`${t} ${e}`}l(Yo,"combine");function Xo(t){return t.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}l(Xo,"decamelize");function Qo(t,e,r){let n=t.toLowerCase(),a=t.toUpperCase();for(let s of qg)if(s.toLowerCase()===n)return s;return Lg.includes(a)?a:e===0||e===r.length-1||t.length>=4?t:Vg.includes(n)||Wg.includes(n)||zg.includes(n)?n:t}l(Qo,"handleSpecialWords");var Lg=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],zg=["a","an","the"],Wg=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],Vg=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],qg=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function el(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:Me(t)}l(el,"primitiveToTypscriptLiteralType");function Me(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${Me(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}l(Me,"primitiveToTypescriptValue");function tl(t){return typeof t>"u"?"undefined":JSON.stringify(t)}l(tl,"unknownToTypescriptValue");var lo=l(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:Me(t),"toPropertyKey"),Gg=l(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),rl=l(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(Gg).filter(n=>!!n).join("")},"toTypeArgumentName"),R=l(t=>{let e=(t??"").split(`
23
+ Check the top-level render call using <`+g+">.")}return f}function Hi(u,f){if(!(!u._store||u._store.validated||u.key!=null)){u._store.validated=!0;var g=ng(f);if(!Di[g]){Di[g]=!0;var y="";u&&u._owner&&u._owner!==F.current&&(y=" It was passed a child from "+We(u._owner.type)+"."),Et(u),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,y),Et(null)}}}function Mi(u,f){if(typeof u=="object"){if(Er(u))for(var g=0;g<u.length;g++){var y=u[g];kt(y)&&Hi(y,f)}else if(kt(u))u._store&&(u._store.validated=!0);else if(u){var b=q(u);if(typeof b=="function"&&b!==u.entries)for(var B=b.call(u),x;!(x=B.next()).done;)kt(x.value)&&Hi(x.value,f)}}}function ji(u){{var f=u.type;if(f==null||typeof f=="string")return;var g;if(typeof f=="function")g=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===c||f.$$typeof===T))g=f.propTypes;else return;if(g){var y=We(f);eg(g,u.props,"prop",y,u)}else if(f.PropTypes!==void 0&&!Ra){Ra=!0;var b=We(f);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ag(u){{for(var f=Object.keys(u.props),g=0;g<f.length;g++){var y=f[g];if(y!=="children"&&y!=="key"){Et(u),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),Et(null);break}}u.ref!==null&&(Et(u),j("Invalid attribute `ref` supplied to `React.Fragment`."),Et(null))}}function Ni(u,f,g){var y=wi(u);if(!y){var b="";(u===void 0||typeof u=="object"&&u!==null&&Object.keys(u).length===0)&&(b+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var B=rg(f);B?b+=B:b+=Ai();var x;u===null?x="null":Er(u)?x="array":u!==void 0&&u.$$typeof===e?(x="<"+(We(u.type)||"Unknown")+" />",b=" Did you accidentally export a JSX literal instead of a component?"):x=typeof u,j("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",x,b)}var D=vp.apply(this,arguments);if(D==null)return D;if(y)for(var L=2;L<arguments.length;L++)Mi(arguments[L],u);return u===n?ag(D):ji(D),D}var $i=!1;function sg(u){var f=Ni.bind(null,u);return f.type=u,$i||($i=!0,ke("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(f,"type",{enumerable:!1,get:function(){return ke("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:u}),u}}),f}function ig(u,f,g){for(var y=Tp.apply(this,arguments),b=2;b<arguments.length;b++)Mi(arguments[b],y.type);return ji(y),y}function og(u,f){var g=J.transition;J.transition={};var y=J.transition;J.transition._updatedFibers=new Set;try{u()}finally{if(J.transition=g,g===null&&y._updatedFibers){var b=y._updatedFibers.size;b>10&&ke("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),y._updatedFibers.clear()}}}var Ui=!1,Zr=null;function lg(u){if(Zr===null)try{var f=("require"+Math.random()).slice(0,7),g=$r&&$r[f];Zr=g.call($r,"timers").setImmediate}catch{Zr=function(b){Ui===!1&&(Ui=!0,typeof MessageChannel>"u"&&j("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var B=new MessageChannel;B.port1.onmessage=b,B.port2.postMessage(void 0)}}return Zr(u)}var xt=0,Ki=!1;function Fi(u){{var f=xt;xt++,N.current===null&&(N.current=[]);var g=N.isBatchingLegacy,y;try{if(N.isBatchingLegacy=!0,y=u(),!g&&N.didScheduleLegacyUpdate){var b=N.current;b!==null&&(N.didScheduleLegacyUpdate=!1,Da(b))}}catch(ne){throw Ar(f),ne}finally{N.isBatchingLegacy=g}if(y!==null&&typeof y=="object"&&typeof y.then=="function"){var B=y,x=!1,D={then:function(ne,oe){x=!0,B.then(function(de){Ar(f),xt===0?Za(de,ne,oe):ne(de)},function(de){Ar(f),oe(de)})}};return!Ki&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){x||(Ki=!0,j("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),D}else{var L=y;if(Ar(f),xt===0){var Y=N.current;Y!==null&&(Da(Y),N.current=null);var Q={then:function(ne,oe){N.current===null?(N.current=[],Za(L,ne,oe)):ne(L)}};return Q}else{var ee={then:function(ne,oe){ne(L)}};return ee}}}}function Ar(u){u!==xt-1&&j("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),xt=u}function Za(u,f,g){{var y=N.current;if(y!==null)try{Da(y),lg(function(){y.length===0?(N.current=null,f(u)):Za(u,f,g)})}catch(b){g(b)}else f(u)}}var Aa=!1;function Da(u){if(!Aa){Aa=!0;var f=0;try{for(;f<u.length;f++){var g=u[f];do g=g(!0);while(g!==null)}u.length=0}catch(y){throw u=u.slice(f+1),y}finally{Aa=!1}}}var ug=Ni,cg=ig,dg=sg,fg={map:Or,forEach:Ep,count:kp,toArray:xp,only:Sp};U.Children=fg,U.Component=nt,U.Fragment=n,U.Profiler=s,U.PureComponent=Pa,U.StrictMode=a,U.Suspense=p,U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Te,U.act=Fi,U.cloneElement=cg,U.createContext=Op,U.createElement=ug,U.createFactory=dg,U.createRef=cp,U.forwardRef=Rp,U.isValidElement=kt,U.lazy=Bp,U.memo=Zp,U.startTransition=og,U.unstable_act=Fi,U.useCallback=Up,U.useContext=Ap,U.useDebugValue=Lp,U.useDeferredValue=Wp,U.useEffect=jp,U.useId=Vp,U.useImperativeHandle=Fp,U.useInsertionEffect=Np,U.useLayoutEffect=$p,U.useMemo=Kp,U.useReducer=Hp,U.useRef=Mp,U.useState=Dp,U.useSyncExternalStore=qp,U.useTransition=zp,U.version=t,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var Ct=Ma((kT,Fa)=>{"use strict";process.env.NODE_ENV==="production"?Fa.exports=so():Fa.exports=io()});var bT={};er(bT,{BRAND:()=>Dc,Bot:()=>pa,BotDefinition:()=>fa,BotLogger:()=>Xe,BotSpecificClient:()=>Re,DIRTY:()=>ut,EMPTY_PATH:()=>Cc,ErrorBoundary:()=>Mt,INVALID:()=>I,Integration:()=>da,IntegrationDefinition:()=>oa,IntegrationLogger:()=>Ye,IntegrationSpecificClient:()=>qt,InterfaceDefinition:()=>ga,NEVER:()=>Of,OK:()=>pe,ParseInputLazyPath:()=>xe,ParseStatus:()=>ve,Plugin:()=>ma,PluginDefinition:()=>ha,RuntimeError:()=>ya.RuntimeError,Schema:()=>H,WELL_KNOWN_ATTRIBUTES:()=>$_,ZodAny:()=>gr,ZodArray:()=>Ut,ZodBigInt:()=>Ln,ZodBoolean:()=>zn,ZodBranded:()=>Wn,ZodCatch:()=>Vn,ZodDate:()=>qn,ZodDefault:()=>mr,ZodDiscriminatedUnion:()=>Ss,ZodEffects:()=>Je,ZodEnum:()=>Tt,ZodError:()=>Be,ZodFirstPartyTypeKind:()=>Ps,ZodFunction:()=>Cs,ZodIntersection:()=>Gn,ZodIssueCode:()=>_,ZodLazy:()=>Jn,ZodLiteral:()=>Yn,ZodMap:()=>Is,ZodNaN:()=>Bs,ZodNativeEnum:()=>Xn,ZodNever:()=>qe,ZodNull:()=>Qn,ZodNullable:()=>dt,ZodNumber:()=>ea,ZodObject:()=>ft,ZodOptional:()=>je,ZodParsedType:()=>k,ZodPipeline:()=>ta,ZodPromise:()=>vr,ZodReadonly:()=>_r,ZodRecord:()=>Rs,ZodRef:()=>Zs,ZodSchema:()=>H,ZodSet:()=>As,ZodString:()=>ge,ZodSymbol:()=>Fs,ZodTransformer:()=>Je,ZodTuple:()=>pt,ZodType:()=>H,ZodUndefined:()=>ra,ZodUnion:()=>na,ZodUnknown:()=>Ht,ZodVoid:()=>Ls,ZuiForm:()=>R_,addIssueToContext:()=>P,agent:()=>Zd,aimodel:()=>jd,any:()=>Gd,array:()=>Qd,bigint:()=>Ld,boolean:()=>Js,botIdHeader:()=>br,botUserIdHeader:()=>Qs,coerce:()=>Sf,configurationHeader:()=>wr,configurationTypeHeader:()=>ri,conversation:()=>Id,createZodEnum:()=>yr,cuid2Regex:()=>Hs,cuidRegex:()=>Ds,custom:()=>xs,datasource:()=>Nd,date:()=>zd,datetimeRegex:()=>Ks,defaultComponentDefinitions:()=>Z_,discriminatedUnion:()=>nf,effect:()=>fs,emailRegex:()=>Ns,enum:()=>hf,errorUtil:()=>C,event:()=>Ad,fromJsonSchema:()=>Ef,fromObject:()=>xf,function:()=>ff,getErrorMap:()=>Nt,getParsedType:()=>He,instanceof:()=>Kd,integrationIdHeader:()=>ei,intent:()=>Md,intersection:()=>af,ipv4Regex:()=>$s,ipv6Regex:()=>Us,isAborted:()=>rn,isApiError:()=>ya.isApiError,isAsync:()=>pr,isDirty:()=>nn,isEmojiRegex:()=>Xc,isValid:()=>$t,jsonSchemaToZui:()=>Tr,knowledgebase:()=>$d,late:()=>Ud,lazy:()=>pf,literal:()=>gf,makeIssue:()=>fr,map:()=>cf,mergeObjectSchemas:()=>Vt,message:()=>Rd,messages:()=>Xs,nan:()=>Fd,nativeEnum:()=>mf,never:()=>Yd,null:()=>qd,nullable:()=>_f,number:()=>Gs,object:()=>ef,objectToZui:()=>Ft,objectUtil:()=>en,oboolean:()=>kf,onumber:()=>Pf,operationHeader:()=>Pr,optional:()=>vf,ostring:()=>wf,parseBody:()=>Se,pipeline:()=>bf,preprocess:()=>Tf,processCreateParams:()=>Z,promise:()=>yf,quotelessJson:()=>xc,readonly:()=>uf,record:()=>of,ref:()=>lf,serve:()=>kr,set:()=>df,setErrorMap:()=>Es,strictObject:()=>tf,string:()=>qs,symbol:()=>Wd,table:()=>Dd,tablerow:()=>Hd,transformer:()=>fs,transforms:()=>A_,tuple:()=>sf,typeHeader:()=>ni,ulidRegex:()=>Ms,undefined:()=>Vd,union:()=>rf,unknown:()=>Jd,user:()=>Bd,util:()=>M,uuidRegex:()=>js,variable:()=>Cd,void:()=>Xd,webhookIdHeader:()=>ti,withErrorBoundary:()=>Rf,z:()=>E,zuiToJsonSchema:()=>aa});module.exports=bg(bT);var Xs={};er(Xs,{defaults:()=>N_,markdown:()=>j_});var Hn=St(Ct(),1),ae=St(Ct(),1),Ne=St(Ct(),1),Lt=St(Ct(),1),be=St(Ct(),1),ps=Object.defineProperty,Mg=Object.defineProperties,jg=Object.getOwnPropertyDescriptors,Yr=Object.getOwnPropertySymbols,Ko=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable,oo=(t,e,r)=>e in t?ps(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,d=(t,e)=>{for(var r in e||(e={}))Ko.call(e,r)&&oo(t,r,e[r]);if(Yr)for(var r of Yr(e))Fo.call(e,r)&&oo(t,r,e[r]);return t},h=(t,e)=>Mg(t,jg(e)),l=(t,e)=>ps(t,"name",{value:e,configurable:!0}),Lo=(t,e)=>{var r={};for(var n in t)Ko.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Yr)for(var n of Yr(t))e.indexOf(n)<0&&Fo.call(t,n)&&(r[n]=t[n]);return r},zo=(t,e)=>{for(var r in e)ps(t,r,{get:e[r],enumerable:!0})},E={};zo(E,{BRAND:()=>Dc,DIRTY:()=>ut,EMPTY_PATH:()=>Cc,INVALID:()=>I,NEVER:()=>Of,OK:()=>pe,ParseInputLazyPath:()=>xe,ParseStatus:()=>ve,Schema:()=>H,ZodAny:()=>gr,ZodArray:()=>Ut,ZodBigInt:()=>Ln,ZodBoolean:()=>zn,ZodBranded:()=>Wn,ZodCatch:()=>Vn,ZodDate:()=>qn,ZodDefault:()=>mr,ZodDiscriminatedUnion:()=>Ss,ZodEffects:()=>Je,ZodEnum:()=>Tt,ZodError:()=>Be,ZodFirstPartyTypeKind:()=>Ps,ZodFunction:()=>Cs,ZodIntersection:()=>Gn,ZodIssueCode:()=>_,ZodLazy:()=>Jn,ZodLiteral:()=>Yn,ZodMap:()=>Is,ZodNaN:()=>Bs,ZodNativeEnum:()=>Xn,ZodNever:()=>qe,ZodNull:()=>Qn,ZodNullable:()=>dt,ZodNumber:()=>ea,ZodObject:()=>ft,ZodOptional:()=>je,ZodParsedType:()=>k,ZodPipeline:()=>ta,ZodPromise:()=>vr,ZodReadonly:()=>_r,ZodRecord:()=>Rs,ZodRef:()=>Zs,ZodSchema:()=>H,ZodSet:()=>As,ZodString:()=>ge,ZodSymbol:()=>Fs,ZodTransformer:()=>Je,ZodTuple:()=>pt,ZodType:()=>H,ZodUndefined:()=>ra,ZodUnion:()=>na,ZodUnknown:()=>Ht,ZodVoid:()=>Ls,addIssueToContext:()=>P,agent:()=>Zd,aimodel:()=>jd,any:()=>Gd,array:()=>Qd,bigint:()=>Ld,boolean:()=>Js,coerce:()=>Sf,conversation:()=>Id,createZodEnum:()=>yr,cuid2Regex:()=>Hs,cuidRegex:()=>Ds,custom:()=>xs,datasource:()=>Nd,date:()=>zd,datetimeRegex:()=>Ks,default:()=>l_,discriminatedUnion:()=>nf,effect:()=>fs,emailRegex:()=>Ns,enum:()=>hf,errorUtil:()=>C,event:()=>Ad,fromJsonSchema:()=>Ef,fromObject:()=>xf,function:()=>ff,getErrorMap:()=>Nt,getParsedType:()=>He,instanceof:()=>Kd,intent:()=>Md,intersection:()=>af,ipv4Regex:()=>$s,ipv6Regex:()=>Us,isAborted:()=>rn,isAsync:()=>pr,isDirty:()=>nn,isEmojiRegex:()=>Xc,isValid:()=>$t,jsonSchemaToZui:()=>Tr,knowledgebase:()=>$d,late:()=>Ud,lazy:()=>pf,literal:()=>gf,makeIssue:()=>fr,map:()=>cf,message:()=>Rd,nan:()=>Fd,nativeEnum:()=>mf,never:()=>Yd,null:()=>qd,nullable:()=>_f,number:()=>Gs,object:()=>ef,objectToZui:()=>Ft,objectUtil:()=>en,oboolean:()=>kf,onumber:()=>Pf,optional:()=>vf,ostring:()=>wf,pipeline:()=>bf,preprocess:()=>Tf,processCreateParams:()=>Z,promise:()=>yf,quotelessJson:()=>xc,readonly:()=>uf,record:()=>of,ref:()=>lf,set:()=>df,setErrorMap:()=>Es,strictObject:()=>tf,string:()=>qs,symbol:()=>Wd,table:()=>Dd,tablerow:()=>Hd,transformer:()=>fs,tuple:()=>sf,ulidRegex:()=>Ms,undefined:()=>Vd,union:()=>rf,unknown:()=>Jd,user:()=>Bd,util:()=>M,uuidRegex:()=>js,variable:()=>Cd,void:()=>Xd,zuiToJsonSchema:()=>aa});var K="x-zui",Wo=(0,ae.createContext)({formData:void 0,formSchema:void 0,setFormData:l(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:l(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:l(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),lo=l((t,e,r)=>{var n;let a=(n=e[K])==null?void 0:n[t];if(typeof a>"u")return!1;if(typeof a=="boolean")return a;if(typeof a=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;let i=new Function("return "+a)()(r);switch(typeof i){case"object":case"boolean":return i;default:return!1}}return!1},"parseMaskableField"),Vo=l((t,e)=>{let r=(0,ae.useContext)(Wo);if(r===void 0)throw new Error("useFormData must be used within a FormDataProvider");let n=(0,ae.useMemo)(()=>ot(r.formData,e),[r.formData,e]),a=(0,ae.useMemo)(()=>{var w;return r.validation.formValid===null?{formValid:null,formErrors:null}:r.validation.formValid===!1?{formValid:!1,formErrors:((w=r.validation.formErrors)==null?void 0:w.filter(S=>Jo(S.path,e)).map(S=>({message:S.message,code:S.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[r.validation.formValid,r.validation.formErrors,e]),s=r.dataTransform?r.dataTransform(n):n,i=(0,ae.useMemo)(()=>lo("hidden",t,s),[t,s]),o=(0,ae.useMemo)(()=>lo("disabled",t,s),[t,s]);(0,ae.useEffect)(()=>{r.setHiddenState(w=>It(w,e,i||{})),r.setDisabledState(w=>It(w,e,o||{}))},[JSON.stringify({fieldSchema:t,data:n})]);let{disabled:c,hidden:p}=(0,ae.useMemo)(()=>{let w=i===!0||ot(r.hiddenState,e),S=o===!0||ot(r.disabledState,e);return{hidden:w===!0,disabled:S===!0}},[r.hiddenState,r.disabledState,i,o,e]),m=(0,ae.useCallback)((w,S)=>{r.setFormData(W=>It(W,w,S))},[r.setFormData]),T=(0,ae.useCallback)((w,S=void 0)=>{let W=Dt(t.items);r.setFormData(q=>{let re=ot(q,w)||[];return S===void 0&&(S=W),It(q,w,Array.isArray(re)?[...re,S]:[S])})},[r.setFormData]),O=(0,ae.useCallback)((w,S)=>{r.setFormData(W=>{let q=ot(W,w)||[];return Array.isArray(q)?(q.splice(S,1),It(W,w,q)):W})},[r.setFormData]);return d(h(d({},r),{data:n,disabled:c,hidden:p,handlePropertyChange:m,addArrayItem:T,removeArrayItem:O}),a)},"useFormData");function It(t,e,r){if(e.length===0)return r;let n=e.length;return e.reduce((a,s,i)=>(i===n-1?a[s]=r:a[s]||(a[s]=isNaN(Number(s))?{}:[]),a[s]),t??{}),d({},t)}l(It,"setObjectPath");var Dt=l((t,e)=>{var r,n,a,s;if(Array.isArray(t))return Dt(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((r=t.anyOf)!=null&&r.length)return Dt(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([o,c])=>{var p;i[o]=Dt(c,!((p=t.required)!=null&&p.includes(o))||qo(c)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[Dt(t.items)]:[];if(t.type==="string")return(n=t.enum)!=null&&n.length?t.enum[0]:"";if(t.type==="number")return(a=t.enum)!=null&&a.length?t.enum[0]:0;if(t.type==="boolean")return(s=t.enum)!=null&&s.length?t.enum[0]:!1}},"getDefaultValues"),Ng=l(({children:t,setFormData:e,formData:r,formSchema:n,disableValidation:a,onValidation:s,dataTransform:i})=>{let[o,c]=(0,ae.useState)({}),[p,m]=(0,ae.useState)({}),T=i?i(r):r,O=(0,ae.useMemo)(()=>{if(a)return{formValid:null,formErrors:null};if(!n)return{formValid:null,formErrors:null};let w=Tr(n).safeParse(T);return w.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:w.error.issues}},[JSON.stringify({transformedData:T})]);return(0,ae.useEffect)(()=>{s&&s(O)},[O]),ae.default.createElement(Wo.Provider,{value:{formData:r,setFormData:e,formSchema:n,validation:O,hiddenState:o,setHiddenState:c,disabledState:p,setDisabledState:m,dataTransform:i}},t)},"FormDataProvider");function ot(t,e){return e.reduce((r,n)=>r?r[n]:null,t)}l(ot,"getPathData");function qo(t){var e;return((e=t.anyOf)==null?void 0:e.some(r=>r.not&&Object.keys(r.not).length===0))||!1}l(qo,"isOptional");function Xr(t,e){let r=d({},t);for(let n in e)e.hasOwnProperty(n)&&(typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])?typeof r[n]=="object"&&r[n]!==null&&!Array.isArray(r[n])?r[n]=Xr(r[n],e[n]):r[n]=Xr({},e[n]):r[n]=e[n]);return r}l(Xr,"deepMerge");var $g=l((t,e)=>{let{handlePropertyChange:r,data:n}=Vo(t,e),{discriminator:a,value:s,discriminatedSchema:i}=(0,Hn.useMemo)(()=>{let o=Go(t.anyOf),c=o?.key?n?.[o.key]:t.default||null,p=Ug(o?.key||null,c,t.anyOf);return{discriminator:o,value:c,discriminatedSchema:p}},[t.anyOf,n]);return(0,Hn.useEffect)(()=>{a?.key&&a?.values.length&&Object.keys(n||{}).length<1&&!t.default&&r(e,{[a.key]:a.values[0]})},[]),{discriminator:a,discriminatorValue:s,discriminatedSchema:i}},"useDiscriminator"),Go=l(t=>{let e=t?.map(r=>r.type!=="object"||!r.properties?null:Object.entries(r.properties).map(([n,a])=>{var s;return a.type==="string"&&((s=a.enum)!=null&&s.length)?{key:n,value:a.enum[0]}:null}).filter(n=>!!n)).flat().reduce((r,n)=>{if(!n)return r;let{key:a,value:s}=n;return r.key===null&&(r.key=a),r.key===a&&r.values.push(s),r},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),Ug=l((t,e,r)=>{var n,a;if(!r?.length||!t||!e)return null;for(let s of r){if(s.type!=="object")continue;let i=(n=s.properties)==null?void 0:n[t];if(i?.type==="string"&&((a=i.enum)!=null&&a.length)&&i.enum[0]===e)return h(d({},s),{properties:h(d({},s.properties),{[t]:h(d({},i),{[K]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),Kg=l(t=>{var e;return(e=t.anyOf)!=null&&e.length?Go(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),Fg=l((t,e)=>{var r,n,a;let s=Kg(e),i=((r=e[K])==null?void 0:r.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let m=(n=t?.[s])==null?void 0:n.default;return m?{Component:m,type:s,id:"default",params:{}}:null}let o=i[0],c=((a=t?.[s])==null?void 0:a[o])||null;if(!c)return console.warn(`Component ${s}.${o} not found`),null;let p=i[1]||{};return{Component:c,type:s,id:o,params:p}},"resolveComponent");function Jo(t,e){return t.length!==e.length?!1:t.every((r,n)=>r===e[n])}l(Jo,"pathMatches");function qa(t,e){return e||(e=new RegExp("/s|-|_| ","g")),Qo(t).split(e).map(Yo).map(el).reduce(Xo)}l(qa,"formatTitle");function Yo(t){return t.charAt(0).toUpperCase()+t.substring(1)}l(Yo,"capitalize");function Xo(t,e){return`${t} ${e}`}l(Xo,"combine");function Qo(t){return t.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}l(Qo,"decamelize");function el(t,e,r){let n=t.toLowerCase(),a=t.toUpperCase();for(let s of qg)if(s.toLowerCase()===n)return s;return Lg.includes(a)?a:e===0||e===r.length-1||t.length>=4?t:Vg.includes(n)||Wg.includes(n)||zg.includes(n)?n:t}l(el,"handleSpecialWords");var Lg=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],zg=["a","an","the"],Wg=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],Vg=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],qg=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function tl(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:Me(t)}l(tl,"primitiveToTypscriptLiteralType");function Me(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${Me(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}l(Me,"primitiveToTypescriptValue");function rl(t){return typeof t>"u"?"undefined":JSON.stringify(t)}l(rl,"unknownToTypescriptValue");var uo=l(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:Me(t),"toPropertyKey"),Gg=l(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),nl=l(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(Gg).filter(n=>!!n).join("")},"toTypeArgumentName"),R=l(t=>{let e=(t??"").split(`
24
24
  `).filter(r=>r.trim().length>0);return e.length===0?"":e.length===1?`/** ${e[0]} */`:`/**
25
25
  * ${e.join(`
26
26
  * `)}
27
- */`},"getMultilineComment"),nl={};Lo(nl,{JsonSchemaToZuiError:()=>il,ObjectToZuiError:()=>Ga,UnrepresentableGenericError:()=>Ja,UnsupportedZuiToJsonSchemaError:()=>Jg,UnsupportedZuiToTypescriptSchemaError:()=>it,UnsupportedZuiToTypescriptTypeError:()=>ml,UntitledDeclarationError:()=>vl,ZuiToJsonSchemaError:()=>ul,ZuiToTypescriptSchemaError:()=>fl,ZuiToTypescriptTypeError:()=>Mn,ZuiTransformError:()=>Lt});var al=class extends Error{constructor(e,r){super(r),this.transform=e}};l(al,"ZuiTransformError");var Lt=al,sl=class extends Lt{constructor(e){super("json-schema-to-zui",e)}};l(sl,"JsonSchemaToZuiError");var il=sl,ol=class extends Lt{constructor(e){super("object-to-zui",e)}};l(ol,"ObjectToZuiError");var Ga=ol,ll=class extends Lt{constructor(e){super("zui-to-json-schema",e)}};l(ll,"ZuiToJsonSchemaError");var ul=ll,cl=class extends ul{constructor(e){super(`Zod type ${e} cannot be transformed to JSON Schema.`)}};l(cl,"UnsupportedZuiToJsonSchemaError");var Jg=cl,dl=class extends Lt{constructor(e){super("zui-to-typescript-schema",e)}};l(dl,"ZuiToTypescriptSchemaError");var fl=dl,pl=class extends fl{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};l(pl,"UnsupportedZuiToTypescriptSchemaError");var it=pl,gl=class extends Lt{constructor(e){super("zui-to-typescript-type",e)}};l(gl,"ZuiToTypescriptTypeError");var Mn=gl,hl=class extends Mn{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};l(hl,"UnsupportedZuiToTypescriptTypeError");var ml=hl,yl=class extends Mn{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};l(yl,"UntitledDeclarationError");var vl=yl,_l=class extends Mn{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};l(_l,"UnrepresentableGenericError");var Ja=_l,Tl=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],Yg=l(t=>Tl.includes(t),"isPrimitive"),Xg=l(t=>Tl.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),uo=l(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),bl=class{constructor(e,r,n=!1){this.key=e,this.value=r,this.optional=n}};l(bl,"KeyValue");var Ur=bl,wl=class{constructor(e){this.schema=e}};l(wl,"FnParameters");var co=wl,Pl=class{constructor(e){this.schema=e}};l(Pl,"FnReturn");var fo=Pl,kl=class{constructor(e){this.props=e}};l(kl,"Declaration");var Fr=kl;function Qr(t,e={}){let r=th(t,e),n=z(r,{});return e.formatter&&(n=e.formatter(n)),n}l(Qr,"toTypescript");function z(t,e){var r,n,a;let s=h(d({},e),{parent:t});if(t===null)return"";if(t instanceof Fr)return Qg(t,s);if(t instanceof Ur){if(t.value instanceof v.ZodOptional){let w=t.value._def.innerType;return w instanceof v.Schema&&!w.description&&t.value.description&&(w=w?.describe(t.value.description)),z(new Ur(t.key,w,!0),s)}let c=R(t.value._def.description),p=c?.trim().length>0?`
28
- `:"",m=t.value.describe(""),O=t.optional||t.value.isOptional()?"?":"";return`${p}${c}${p}${t.key}${O}: ${z(m,s)}${p}`}if(t instanceof co){if(t.schema instanceof v.ZodTuple){let m="";for(let T=0;T<t.schema.items.length;T++){let O=(a=(n=(r=t.schema.items[T])==null?void 0:r.ui)==null?void 0:n.title)!=null?a:`arg${T}`,w=t.schema.items[T];m+=`${z(new Ur(lo(O),w),s)}${T<t.schema.items.length-1?", ":""} `}return m}let c=z(t.schema,s);return c.startsWith("{")&&c.endsWith("}")||c.startsWith("[")&&c.endsWith("]")||c.startsWith("(")&&c.endsWith(")")||c.startsWith("Array<")&&c.endsWith(">")||c.startsWith("Record<")&&c.endsWith(">")||Xg(c)?`args: ${c}`:c}if(t instanceof fo)return t.schema instanceof v.ZodOptional?`${z(t.schema.unwrap(),s)} | undefined`:z(t.schema,s);let o=t._def;switch(o.typeName){case v.ZodFirstPartyTypeKind.ZodString:return`${R(o.description)} string`.trim();case v.ZodFirstPartyTypeKind.ZodNumber:case v.ZodFirstPartyTypeKind.ZodNaN:case v.ZodFirstPartyTypeKind.ZodBigInt:return`${R(o.description)} number`.trim();case v.ZodFirstPartyTypeKind.ZodBoolean:return`${R(t._def.description)} boolean`.trim();case v.ZodFirstPartyTypeKind.ZodDate:return`${R(o.description)} Date`.trim();case v.ZodFirstPartyTypeKind.ZodUndefined:return`${R(o.description)} undefined`.trim();case v.ZodFirstPartyTypeKind.ZodNull:return`${R(o.description)} null`.trim();case v.ZodFirstPartyTypeKind.ZodAny:return`${R(o.description)} any`.trim();case v.ZodFirstPartyTypeKind.ZodUnknown:return`${R(o.description)} unknown`.trim();case v.ZodFirstPartyTypeKind.ZodNever:return`${R(o.description)} never`.trim();case v.ZodFirstPartyTypeKind.ZodVoid:return`${R(o.description)} void`.trim();case v.ZodFirstPartyTypeKind.ZodArray:let c=z(o.type,s);return Yg(c)?`${c}[]`:`Array<${c}>`;case v.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(o.shape()).map(([N,F])=>z(new Ur(lo(N),F),s)).join("; ")} }`;case v.ZodFirstPartyTypeKind.ZodUnion:let m=o.options.map(N=>z(N,s));return`${R(o.description)}
27
+ */`},"getMultilineComment"),al={};zo(al,{JsonSchemaToZuiError:()=>ol,ObjectToZuiError:()=>Ga,UnrepresentableGenericError:()=>Ja,UnsupportedZuiToJsonSchemaError:()=>Jg,UnsupportedZuiToTypescriptSchemaError:()=>st,UnsupportedZuiToTypescriptTypeError:()=>yl,UntitledDeclarationError:()=>_l,ZuiToJsonSchemaError:()=>cl,ZuiToTypescriptSchemaError:()=>pl,ZuiToTypescriptTypeError:()=>Mn,ZuiTransformError:()=>zt});var sl=class extends Error{constructor(e,r){super(r),this.transform=e}};l(sl,"ZuiTransformError");var zt=sl,il=class extends zt{constructor(e){super("json-schema-to-zui",e)}};l(il,"JsonSchemaToZuiError");var ol=il,ll=class extends zt{constructor(e){super("object-to-zui",e)}};l(ll,"ObjectToZuiError");var Ga=ll,ul=class extends zt{constructor(e){super("zui-to-json-schema",e)}};l(ul,"ZuiToJsonSchemaError");var cl=ul,dl=class extends cl{constructor(e){super(`Zod type ${e} cannot be transformed to JSON Schema.`)}};l(dl,"UnsupportedZuiToJsonSchemaError");var Jg=dl,fl=class extends zt{constructor(e){super("zui-to-typescript-schema",e)}};l(fl,"ZuiToTypescriptSchemaError");var pl=fl,gl=class extends pl{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};l(gl,"UnsupportedZuiToTypescriptSchemaError");var st=gl,hl=class extends zt{constructor(e){super("zui-to-typescript-type",e)}};l(hl,"ZuiToTypescriptTypeError");var Mn=hl,ml=class extends Mn{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};l(ml,"UnsupportedZuiToTypescriptTypeError");var yl=ml,vl=class extends Mn{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};l(vl,"UntitledDeclarationError");var _l=vl,Tl=class extends Mn{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};l(Tl,"UnrepresentableGenericError");var Ja=Tl,bl=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],Yg=l(t=>bl.includes(t),"isPrimitive"),Xg=l(t=>bl.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),co=l(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),wl=class{constructor(e,r,n=!1){this.key=e,this.value=r,this.optional=n}};l(wl,"KeyValue");var Ur=wl,Pl=class{constructor(e){this.schema=e}};l(Pl,"FnParameters");var fo=Pl,kl=class{constructor(e){this.schema=e}};l(kl,"FnReturn");var po=kl,El=class{constructor(e){this.props=e}};l(El,"Declaration");var Fr=El;function Qr(t,e={}){let r=th(t,e),n=z(r,{});return e.formatter&&(n=e.formatter(n)),n}l(Qr,"toTypescript");function z(t,e){var r,n,a;let s=h(d({},e),{parent:t});if(t===null)return"";if(t instanceof Fr)return Qg(t,s);if(t instanceof Ur){if(t.value instanceof v.ZodOptional){let w=t.value._def.innerType;return w instanceof v.Schema&&!w.description&&t.value.description&&(w=w?.describe(t.value.description)),z(new Ur(t.key,w,!0),s)}let c=R(t.value._def.description),p=c?.trim().length>0?`
28
+ `:"",m=t.value.describe(""),O=t.optional||t.value.isOptional()?"?":"";return`${p}${c}${p}${t.key}${O}: ${z(m,s)}${p}`}if(t instanceof fo){if(t.schema instanceof v.ZodTuple){let m="";for(let T=0;T<t.schema.items.length;T++){let O=(a=(n=(r=t.schema.items[T])==null?void 0:r.ui)==null?void 0:n.title)!=null?a:`arg${T}`,w=t.schema.items[T];m+=`${z(new Ur(uo(O),w),s)}${T<t.schema.items.length-1?", ":""} `}return m}let c=z(t.schema,s);return c.startsWith("{")&&c.endsWith("}")||c.startsWith("[")&&c.endsWith("]")||c.startsWith("(")&&c.endsWith(")")||c.startsWith("Array<")&&c.endsWith(">")||c.startsWith("Record<")&&c.endsWith(">")||Xg(c)?`args: ${c}`:c}if(t instanceof po)return t.schema instanceof v.ZodOptional?`${z(t.schema.unwrap(),s)} | undefined`:z(t.schema,s);let o=t._def;switch(o.typeName){case v.ZodFirstPartyTypeKind.ZodString:return`${R(o.description)} string`.trim();case v.ZodFirstPartyTypeKind.ZodNumber:case v.ZodFirstPartyTypeKind.ZodNaN:case v.ZodFirstPartyTypeKind.ZodBigInt:return`${R(o.description)} number`.trim();case v.ZodFirstPartyTypeKind.ZodBoolean:return`${R(t._def.description)} boolean`.trim();case v.ZodFirstPartyTypeKind.ZodDate:return`${R(o.description)} Date`.trim();case v.ZodFirstPartyTypeKind.ZodUndefined:return`${R(o.description)} undefined`.trim();case v.ZodFirstPartyTypeKind.ZodNull:return`${R(o.description)} null`.trim();case v.ZodFirstPartyTypeKind.ZodAny:return`${R(o.description)} any`.trim();case v.ZodFirstPartyTypeKind.ZodUnknown:return`${R(o.description)} unknown`.trim();case v.ZodFirstPartyTypeKind.ZodNever:return`${R(o.description)} never`.trim();case v.ZodFirstPartyTypeKind.ZodVoid:return`${R(o.description)} void`.trim();case v.ZodFirstPartyTypeKind.ZodArray:let c=z(o.type,s);return Yg(c)?`${c}[]`:`Array<${c}>`;case v.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(o.shape()).map(([N,F])=>z(new Ur(uo(N),F),s)).join("; ")} }`;case v.ZodFirstPartyTypeKind.ZodUnion:let m=o.options.map(N=>z(N,s));return`${R(o.description)}
29
29
  ${m.join(" | ")}`;case v.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let T=o.options.map(N=>z(N,s));return`${R(t._def.description)}
30
- ${T.join(" | ")}`;case v.ZodFirstPartyTypeKind.ZodIntersection:return`${z(o.left,s)} & ${z(o.right,s)}`;case v.ZodFirstPartyTypeKind.ZodTuple:return o.items.length===0?"":`[${o.items.map(N=>z(N,s)).join(", ")}]`;case v.ZodFirstPartyTypeKind.ZodRecord:let w=z(o.keyType,s),S=z(o.valueType,s);return`${R(o.description)} { [key: ${w}]: ${S} }`;case v.ZodFirstPartyTypeKind.ZodMap:return`Map<${z(o.keyType,s)}, ${z(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodSet:return`Set<${z(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodFunction:let W=z(new co(o.args),s),q=z(new fo(o.returns),s);return`${R(o.description)}
31
- (${W}) => ${q}`;case v.ZodFirstPartyTypeKind.ZodLazy:return z(o.getter(),s);case v.ZodFirstPartyTypeKind.ZodLiteral:let re=el(o.value);return`${R(o.description)}
32
- ${re}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(Me).join(" | ");case v.ZodFirstPartyTypeKind.ZodEffects:return z(o.schema,s);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new ml(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${z(o.innerType,s)} | undefined`;case v.ZodFirstPartyTypeKind.ZodNullable:return`${z(o.innerType,s)} | null`;case v.ZodFirstPartyTypeKind.ZodDefault:return z(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodCatch:return z(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${z(o.type,s)}>`;case v.ZodFirstPartyTypeKind.ZodBranded:return z(o.type,s);case v.ZodFirstPartyTypeKind.ZodPipeline:return z(o.in,s);case v.ZodFirstPartyTypeKind.ZodSymbol:return`${R(o.description)} symbol`.trim();case v.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${z(o.innerType,s)}>`;case v.ZodFirstPartyTypeKind.ZodRef:return rl(o.uri);default:M.assertNever(o)}}l(z,"sUnwrapZod");var Qg=l((t,e)=>{if(t.props.type==="none")return z(t.props.schema,e);let r=R(t.props.schema.description),n=t.props.schema.describe(""),a=z(n,e);if(t.props.type==="variable")return uo(`${r}declare const ${t.props.identifier}: ${a};`);let s=t.props.args.length>0?`<${t.props.args.map(rl).join(", ")}>`:"";return uo(`${r}type ${t.props.identifier}${s} = ${a};`)},"unwrapDeclaration"),eh=l(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),th=l((t,e)=>{let r=eh(e),n=t.getReferences();if(r==="none"){if(n.length>0)throw new Ja;return new Fr({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new vl;if(r==="variable"){if(n.length>0)throw new Ja;return new Fr({type:"variable",identifier:a,schema:t})}return new Fr({type:"type",identifier:a,schema:t,args:n})},"getDeclarationProps"),rh=typeof global=="object"&&global&&global.Object===Object&&global,El=rh,nh=typeof self=="object"&&self&&self.Object===Object&&self,ah=El||nh||Function("return this")(),Ue=ah,sh=Ue.Symbol,Ve=sh,xl=Object.prototype,ih=xl.hasOwnProperty,oh=xl.toString,rr=Ve?Ve.toStringTag:void 0;function Sl(t){var e=ih.call(t,rr),r=t[rr];try{t[rr]=void 0;var n=!0}catch{}var a=oh.call(t);return n&&(e?t[rr]=r:delete t[rr]),a}l(Sl,"getRawTag");var lh=Sl,uh=Object.prototype,ch=uh.toString;function Ol(t){return ch.call(t)}l(Ol,"objectToString");var dh=Ol,fh="[object Null]",ph="[object Undefined]",po=Ve?Ve.toStringTag:void 0;function Cl(t){return t==null?t===void 0?ph:fh:po&&po in Object(t)?lh(t):dh(t)}l(Cl,"baseGetTag");var zt=Cl;function Il(t){return t!=null&&typeof t=="object"}l(Il,"isObjectLike");var Mt=Il,gh="[object Symbol]";function Bl(t){return typeof t=="symbol"||Mt(t)&&zt(t)==gh}l(Bl,"isSymbol");var gs=Bl;function Rl(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}l(Rl,"arrayMap");var hh=Rl,mh=Array.isArray,$e=mh,yh=1/0,go=Ve?Ve.prototype:void 0,ho=go?go.toString:void 0;function hs(t){if(typeof t=="string")return t;if($e(t))return hh(t,hs)+"";if(gs(t))return ho?ho.call(t):"";var e=t+"";return e=="0"&&1/t==-yh?"-0":e}l(hs,"baseToString");var vh=hs;function Zl(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}l(Zl,"isObject");var ms=Zl;function Al(t){return t}l(Al,"identity");var _h=Al,Th="[object AsyncFunction]",bh="[object Function]",wh="[object GeneratorFunction]",Ph="[object Proxy]";function Dl(t){if(!ms(t))return!1;var e=zt(t);return e==bh||e==wh||e==Th||e==Ph}l(Dl,"isFunction");var Hl=Dl,kh=Ue["__core-js_shared__"],La=kh,mo=function(){var t=/[^.]+$/.exec(La&&La.keys&&La.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Ml(t){return!!mo&&mo in t}l(Ml,"isMasked");var Eh=Ml,xh=Function.prototype,Sh=xh.toString;function jl(t){if(t!=null){try{return Sh.call(t)}catch{}try{return t+""}catch{}}return""}l(jl,"toSource");var ht=jl,Oh=/[\\^$.*+?()[\]{}|]/g,Ch=/^\[object .+?Constructor\]$/,Ih=Function.prototype,Bh=Object.prototype,Rh=Ih.toString,Zh=Bh.hasOwnProperty,Ah=RegExp("^"+Rh.call(Zh).replace(Oh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Nl(t){if(!ms(t)||Eh(t))return!1;var e=Hl(t)?Ah:Ch;return e.test(ht(t))}l(Nl,"baseIsNative");var Dh=Nl;function $l(t,e){return t?.[e]}l($l,"getValue");var Hh=$l;function Ul(t,e){var r=Hh(t,e);return Dh(r)?r:void 0}l(Ul,"getNative");var mt=Ul,Mh=mt(Ue,"WeakMap"),Ya=Mh,jh=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch{}}(),yo=jh,Nh=9007199254740991,$h=/^(?:0|[1-9]\d*)$/;function Kl(t,e){var r=typeof t;return e=e??Nh,!!e&&(r=="number"||r!="symbol"&&$h.test(t))&&t>-1&&t%1==0&&t<e}l(Kl,"isIndex");var Fl=Kl;function Ll(t,e,r){e=="__proto__"&&yo?yo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}l(Ll,"baseAssignValue");var Uh=Ll;function zl(t,e){return t===e||t!==t&&e!==e}l(zl,"eq");var Wl=zl,Kh=9007199254740991;function Vl(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Kh}l(Vl,"isLength");var ys=Vl;function ql(t){return t!=null&&ys(t.length)&&!Hl(t)}l(ql,"isArrayLike");var Fh=ql,Lh=Object.prototype;function Gl(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Lh;return t===r}l(Gl,"isPrototype");var zh=Gl;function Jl(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}l(Jl,"baseTimes");var Wh=Jl,Vh="[object Arguments]";function Yl(t){return Mt(t)&&zt(t)==Vh}l(Yl,"baseIsArguments");var vo=Yl,Xl=Object.prototype,qh=Xl.hasOwnProperty,Gh=Xl.propertyIsEnumerable,Jh=vo(function(){return arguments}())?vo:function(t){return Mt(t)&&qh.call(t,"callee")&&!Gh.call(t,"callee")},Ql=Jh;function eu(){return!1}l(eu,"stubFalse");var Yh=eu,tu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_o=tu&&typeof module=="object"&&module&&!module.nodeType&&module,Xh=_o&&_o.exports===tu,To=Xh?Ue.Buffer:void 0,Qh=To?To.isBuffer:void 0,em=Qh||Yh,Xa=em,tm="[object Arguments]",rm="[object Array]",nm="[object Boolean]",am="[object Date]",sm="[object Error]",im="[object Function]",om="[object Map]",lm="[object Number]",um="[object Object]",cm="[object RegExp]",dm="[object Set]",fm="[object String]",pm="[object WeakMap]",gm="[object ArrayBuffer]",hm="[object DataView]",mm="[object Float32Array]",ym="[object Float64Array]",vm="[object Int8Array]",_m="[object Int16Array]",Tm="[object Int32Array]",bm="[object Uint8Array]",wm="[object Uint8ClampedArray]",Pm="[object Uint16Array]",km="[object Uint32Array]",X={};X[mm]=X[ym]=X[vm]=X[_m]=X[Tm]=X[bm]=X[wm]=X[Pm]=X[km]=!0;X[tm]=X[rm]=X[gm]=X[nm]=X[hm]=X[am]=X[sm]=X[im]=X[om]=X[lm]=X[um]=X[cm]=X[dm]=X[fm]=X[pm]=!1;function ru(t){return Mt(t)&&ys(t.length)&&!!X[zt(t)]}l(ru,"baseIsTypedArray");var Em=ru;function nu(t){return function(e){return t(e)}}l(nu,"baseUnary");var xm=nu,au=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lr=au&&typeof module=="object"&&module&&!module.nodeType&&module,Sm=lr&&lr.exports===au,za=Sm&&El.process,Om=function(){try{var t=lr&&lr.require&&lr.require("util").types;return t||za&&za.binding&&za.binding("util")}catch{}}(),bo=Om,wo=bo&&bo.isTypedArray,Cm=wo?xm(wo):Em,su=Cm,Im=Object.prototype,Bm=Im.hasOwnProperty;function iu(t,e){var r=$e(t),n=!r&&Ql(t),a=!r&&!n&&Xa(t),s=!r&&!n&&!a&&su(t),i=r||n||a||s,o=i?Wh(t.length,String):[],c=o.length;for(var p in t)(e||Bm.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Fl(p,c)))&&o.push(p);return o}l(iu,"arrayLikeKeys");var Rm=iu;function ou(t,e){return function(r){return t(e(r))}}l(ou,"overArg");var Zm=ou,Am=Zm(Object.keys,Object),Dm=Am,Hm=Object.prototype,Mm=Hm.hasOwnProperty;function lu(t){if(!zh(t))return Dm(t);var e=[];for(var r in Object(t))Mm.call(t,r)&&r!="constructor"&&e.push(r);return e}l(lu,"baseKeys");var jm=lu;function uu(t){return Fh(t)?Rm(t):jm(t)}l(uu,"keys");var vs=uu,Nm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$m=/^\w*$/;function cu(t,e){if($e(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||gs(t)?!0:$m.test(t)||!Nm.test(t)||e!=null&&t in Object(e)}l(cu,"isKey");var _s=cu,Um=mt(Object,"create"),ur=Um;function du(){this.__data__=ur?ur(null):{},this.size=0}l(du,"hashClear");var Km=du;function fu(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}l(fu,"hashDelete");var Fm=fu,Lm="__lodash_hash_undefined__",zm=Object.prototype,Wm=zm.hasOwnProperty;function pu(t){var e=this.__data__;if(ur){var r=e[t];return r===Lm?void 0:r}return Wm.call(e,t)?e[t]:void 0}l(pu,"hashGet");var Vm=pu,qm=Object.prototype,Gm=qm.hasOwnProperty;function gu(t){var e=this.__data__;return ur?e[t]!==void 0:Gm.call(e,t)}l(gu,"hashHas");var Jm=gu,Ym="__lodash_hash_undefined__";function hu(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ur&&e===void 0?Ym:e,this}l(hu,"hashSet");var Xm=hu;function yt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l(yt,"Hash");yt.prototype.clear=Km;yt.prototype.delete=Fm;yt.prototype.get=Vm;yt.prototype.has=Jm;yt.prototype.set=Xm;var Po=yt;function mu(){this.__data__=[],this.size=0}l(mu,"listCacheClear");var Qm=mu;function yu(t,e){for(var r=t.length;r--;)if(Wl(t[r][0],e))return r;return-1}l(yu,"assocIndexOf");var jn=yu,ey=Array.prototype,ty=ey.splice;function vu(t){var e=this.__data__,r=jn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ty.call(e,r,1),--this.size,!0}l(vu,"listCacheDelete");var ry=vu;function _u(t){var e=this.__data__,r=jn(e,t);return r<0?void 0:e[r][1]}l(_u,"listCacheGet");var ny=_u;function Tu(t){return jn(this.__data__,t)>-1}l(Tu,"listCacheHas");var ay=Tu;function bu(t,e){var r=this.__data__,n=jn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}l(bu,"listCacheSet");var sy=bu;function vt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l(vt,"ListCache");vt.prototype.clear=Qm;vt.prototype.delete=ry;vt.prototype.get=ny;vt.prototype.has=ay;vt.prototype.set=sy;var Nn=vt,iy=mt(Ue,"Map"),cr=iy;function wu(){this.size=0,this.__data__={hash:new Po,map:new(cr||Nn),string:new Po}}l(wu,"mapCacheClear");var oy=wu;function Pu(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}l(Pu,"isKeyable");var ly=Pu;function ku(t,e){var r=t.__data__;return ly(e)?r[typeof e=="string"?"string":"hash"]:r.map}l(ku,"getMapData");var $n=ku;function Eu(t){var e=$n(this,t).delete(t);return this.size-=e?1:0,e}l(Eu,"mapCacheDelete");var uy=Eu;function xu(t){return $n(this,t).get(t)}l(xu,"mapCacheGet");var cy=xu;function Su(t){return $n(this,t).has(t)}l(Su,"mapCacheHas");var dy=Su;function Ou(t,e){var r=$n(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}l(Ou,"mapCacheSet");var fy=Ou;function _t(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l(_t,"MapCache");_t.prototype.clear=oy;_t.prototype.delete=uy;_t.prototype.get=cy;_t.prototype.has=dy;_t.prototype.set=fy;var Un=_t,py="Expected a function";function Kn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(py);var r=l(function(){var n=arguments,a=e?e.apply(this,n):n[0],s=r.cache;if(s.has(a))return s.get(a);var i=t.apply(this,n);return r.cache=s.set(a,i)||s,i},"memoized");return r.cache=new(Kn.Cache||Un),r}l(Kn,"memoize");Kn.Cache=Un;var gy=Kn,hy=500;function Cu(t){var e=gy(t,function(n){return r.size===hy&&r.clear(),n}),r=e.cache;return e}l(Cu,"memoizeCapped");var my=Cu,yy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vy=/\\(\\)?/g,_y=my(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(yy,function(r,n,a,s){e.push(a?s.replace(vy,"$1"):n||r)}),e}),Ty=_y;function Iu(t){return t==null?"":vh(t)}l(Iu,"toString");var by=Iu;function Bu(t,e){return $e(t)?t:_s(t,e)?[t]:Ty(by(t))}l(Bu,"castPath");var Ru=Bu,wy=1/0;function Zu(t){if(typeof t=="string"||gs(t))return t;var e=t+"";return e=="0"&&1/t==-wy?"-0":e}l(Zu,"toKey");var Fn=Zu;function Au(t,e){e=Ru(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Fn(e[r++])];return r&&r==n?t:void 0}l(Au,"baseGet");var Du=Au;function Hu(t,e,r){var n=t==null?void 0:Du(t,e);return n===void 0?r:n}l(Hu,"get");var Py=Hu;function Mu(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}l(Mu,"arrayPush");var ky=Mu;function ju(){this.__data__=new Nn,this.size=0}l(ju,"stackClear");var Ey=ju;function Nu(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}l(Nu,"stackDelete");var xy=Nu;function $u(t){return this.__data__.get(t)}l($u,"stackGet");var Sy=$u;function Uu(t){return this.__data__.has(t)}l(Uu,"stackHas");var Oy=Uu,Cy=200;function Ku(t,e){var r=this.__data__;if(r instanceof Nn){var n=r.__data__;if(!cr||n.length<Cy-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Un(n)}return r.set(t,e),this.size=r.size,this}l(Ku,"stackSet");var Iy=Ku;function Tt(t){var e=this.__data__=new Nn(t);this.size=e.size}l(Tt,"Stack");Tt.prototype.clear=Ey;Tt.prototype.delete=xy;Tt.prototype.get=Sy;Tt.prototype.has=Oy;Tt.prototype.set=Iy;var Lr=Tt;function Fu(t,e){for(var r=-1,n=t==null?0:t.length,a=0,s=[];++r<n;){var i=t[r];e(i,r,t)&&(s[a++]=i)}return s}l(Fu,"arrayFilter");var By=Fu;function Lu(){return[]}l(Lu,"stubArray");var Ry=Lu,Zy=Object.prototype,Ay=Zy.propertyIsEnumerable,ko=Object.getOwnPropertySymbols,Dy=ko?function(t){return t==null?[]:(t=Object(t),By(ko(t),function(e){return Ay.call(t,e)}))}:Ry,Hy=Dy;function zu(t,e,r){var n=e(t);return $e(t)?n:ky(n,r(t))}l(zu,"baseGetAllKeys");var My=zu;function Wu(t){return My(t,vs,Hy)}l(Wu,"getAllKeys");var Eo=Wu,jy=mt(Ue,"DataView"),Qa=jy,Ny=mt(Ue,"Promise"),es=Ny,$y=mt(Ue,"Set"),ts=$y,xo="[object Map]",Uy="[object Object]",So="[object Promise]",Oo="[object Set]",Co="[object WeakMap]",Io="[object DataView]",Ky=ht(Qa),Fy=ht(cr),Ly=ht(es),zy=ht(ts),Wy=ht(Ya),ot=zt;(Qa&&ot(new Qa(new ArrayBuffer(1)))!=Io||cr&&ot(new cr)!=xo||es&&ot(es.resolve())!=So||ts&&ot(new ts)!=Oo||Ya&&ot(new Ya)!=Co)&&(ot=l(function(t){var e=zt(t),r=e==Uy?t.constructor:void 0,n=r?ht(r):"";if(n)switch(n){case Ky:return Io;case Fy:return xo;case Ly:return So;case zy:return Oo;case Wy:return Co}return e},"getTag"));var Bo=ot,Vy=Ue.Uint8Array,Ro=Vy,qy="__lodash_hash_undefined__";function Vu(t){return this.__data__.set(t,qy),this}l(Vu,"setCacheAdd");var Gy=Vu;function qu(t){return this.__data__.has(t)}l(qu,"setCacheHas");var Jy=qu;function dr(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Un;++e<r;)this.add(t[e])}l(dr,"SetCache");dr.prototype.add=dr.prototype.push=Gy;dr.prototype.has=Jy;var Yy=dr;function Gu(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}l(Gu,"arraySome");var Xy=Gu;function Ju(t,e){return t.has(e)}l(Ju,"cacheHas");var Qy=Ju,ev=1,tv=2;function Yu(t,e,r,n,a,s){var i=r&ev,o=t.length,c=e.length;if(o!=c&&!(i&&c>o))return!1;var p=s.get(t),m=s.get(e);if(p&&m)return p==e&&m==t;var T=-1,O=!0,w=r&tv?new Yy:void 0;for(s.set(t,e),s.set(e,t);++T<o;){var S=t[T],W=e[T];if(n)var q=i?n(W,S,T,e,t,s):n(S,W,T,t,e,s);if(q!==void 0){if(q)continue;O=!1;break}if(w){if(!Xy(e,function(re,J){if(!Qy(w,J)&&(S===re||a(S,re,r,n,s)))return w.push(J)})){O=!1;break}}else if(!(S===W||a(S,W,r,n,s))){O=!1;break}}return s.delete(t),s.delete(e),O}l(Yu,"equalArrays");var Xu=Yu;function Qu(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}l(Qu,"mapToArray");var rv=Qu;function ec(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}l(ec,"setToArray");var nv=ec,av=1,sv=2,iv="[object Boolean]",ov="[object Date]",lv="[object Error]",uv="[object Map]",cv="[object Number]",dv="[object RegExp]",fv="[object Set]",pv="[object String]",gv="[object Symbol]",hv="[object ArrayBuffer]",mv="[object DataView]",Zo=Ve?Ve.prototype:void 0,Wa=Zo?Zo.valueOf:void 0;function tc(t,e,r,n,a,s,i){switch(r){case mv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case hv:return!(t.byteLength!=e.byteLength||!s(new Ro(t),new Ro(e)));case iv:case ov:case cv:return Wl(+t,+e);case lv:return t.name==e.name&&t.message==e.message;case dv:case pv:return t==e+"";case uv:var o=rv;case fv:var c=n&av;if(o||(o=nv),t.size!=e.size&&!c)return!1;var p=i.get(t);if(p)return p==e;n|=sv,i.set(t,e);var m=Xu(o(t),o(e),n,a,s,i);return i.delete(t),m;case gv:if(Wa)return Wa.call(t)==Wa.call(e)}return!1}l(tc,"equalByTag");var yv=tc,vv=1,_v=Object.prototype,Tv=_v.hasOwnProperty;function rc(t,e,r,n,a,s){var i=r&vv,o=Eo(t),c=o.length,p=Eo(e),m=p.length;if(c!=m&&!i)return!1;for(var T=c;T--;){var O=o[T];if(!(i?O in e:Tv.call(e,O)))return!1}var w=s.get(t),S=s.get(e);if(w&&S)return w==e&&S==t;var W=!0;s.set(t,e),s.set(e,t);for(var q=i;++T<c;){O=o[T];var re=t[O],J=e[O];if(n)var N=i?n(J,re,O,e,t,s):n(re,J,O,t,e,s);if(!(N===void 0?re===J||a(re,J,r,n,s):N)){W=!1;break}q||(q=O=="constructor")}if(W&&!q){var F=t.constructor,ue=e.constructor;F!=ue&&"constructor"in t&&"constructor"in e&&!(typeof F=="function"&&F instanceof F&&typeof ue=="function"&&ue instanceof ue)&&(W=!1)}return s.delete(t),s.delete(e),W}l(rc,"equalObjects");var bv=rc,wv=1,Ao="[object Arguments]",Do="[object Array]",Kr="[object Object]",Pv=Object.prototype,Ho=Pv.hasOwnProperty;function nc(t,e,r,n,a,s){var i=$e(t),o=$e(e),c=i?Do:Bo(t),p=o?Do:Bo(e);c=c==Ao?Kr:c,p=p==Ao?Kr:p;var m=c==Kr,T=p==Kr,O=c==p;if(O&&Xa(t)){if(!Xa(e))return!1;i=!0,m=!1}if(O&&!m)return s||(s=new Lr),i||su(t)?Xu(t,e,r,n,a,s):yv(t,e,c,r,n,a,s);if(!(r&wv)){var w=m&&Ho.call(t,"__wrapped__"),S=T&&Ho.call(e,"__wrapped__");if(w||S){var W=w?t.value():t,q=S?e.value():e;return s||(s=new Lr),a(W,q,r,n,s)}}return O?(s||(s=new Lr),bv(t,e,r,n,a,s)):!1}l(nc,"baseIsEqualDeep");var kv=nc;function Ts(t,e,r,n,a){return t===e?!0:t==null||e==null||!Mt(t)&&!Mt(e)?t!==t&&e!==e:kv(t,e,r,n,Ts,a)}l(Ts,"baseIsEqual");var bs=Ts,Ev=1,xv=2;function ac(t,e,r,n){var a=r.length,s=a,i=!n;if(t==null)return!s;for(t=Object(t);a--;){var o=r[a];if(i&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<s;){o=r[a];var c=o[0],p=t[c],m=o[1];if(i&&o[2]){if(p===void 0&&!(c in t))return!1}else{var T=new Lr;if(n)var O=n(p,m,c,t,e,T);if(!(O===void 0?bs(m,p,Ev|xv,n,T):O))return!1}}return!0}l(ac,"baseIsMatch");var Sv=ac;function sc(t){return t===t&&!ms(t)}l(sc,"isStrictComparable");var ic=sc;function oc(t){for(var e=vs(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,ic(a)]}return e}l(oc,"getMatchData");var Ov=oc;function lc(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}l(lc,"matchesStrictComparable");var uc=lc;function cc(t){var e=Ov(t);return e.length==1&&e[0][2]?uc(e[0][0],e[0][1]):function(r){return r===t||Sv(r,t,e)}}l(cc,"baseMatches");var Cv=cc;function dc(t,e){return t!=null&&e in Object(t)}l(dc,"baseHasIn");var Iv=dc;function fc(t,e,r){e=Ru(e,t);for(var n=-1,a=e.length,s=!1;++n<a;){var i=Fn(e[n]);if(!(s=t!=null&&r(t,i)))break;t=t[i]}return s||++n!=a?s:(a=t==null?0:t.length,!!a&&ys(a)&&Fl(i,a)&&($e(t)||Ql(t)))}l(fc,"hasPath");var Bv=fc;function pc(t,e){return t!=null&&Bv(t,e,Iv)}l(pc,"hasIn");var Rv=pc,Zv=1,Av=2;function gc(t,e){return _s(t)&&ic(e)?uc(Fn(t),e):function(r){var n=Py(r,t);return n===void 0&&n===e?Rv(r,t):bs(e,n,Zv|Av)}}l(gc,"baseMatchesProperty");var Dv=gc;function hc(t){return function(e){return e?.[t]}}l(hc,"baseProperty");var Hv=hc;function mc(t){return function(e){return Du(e,t)}}l(mc,"basePropertyDeep");var Mv=mc;function yc(t){return _s(t)?Hv(Fn(t)):Mv(t)}l(yc,"property");var jv=yc;function vc(t){return typeof t=="function"?t:t==null?_h:typeof t=="object"?$e(t)?Dv(t[0],t[1]):Cv(t):jv(t)}l(vc,"baseIteratee");var Nv=vc;function _c(t){return function(e,r,n){for(var a=-1,s=Object(e),i=n(e),o=i.length;o--;){var c=i[t?o:++a];if(r(s[c],c,s)===!1)break}return e}}l(_c,"createBaseFor");var $v=_c,Uv=$v(),Kv=Uv;function Tc(t,e){return t&&Kv(t,e,vs)}l(Tc,"baseForOwn");var Fv=Tc;function bc(t,e){return bs(t,e)}l(bc,"isEqual");var dt=bc;function wc(t,e){var r={};return e=Nv(e,3),Fv(t,function(n,a,s){Uh(r,a,e(n,a,s))}),r}l(wc,"mapValues");var Lv=wc;function ws(t){return se(t)}l(ws,"toTypescriptSchema");function se(t){let r=t._def;switch(r.typeName){case v.ZodFirstPartyTypeKind.ZodString:return`${R(r.description)}z.string()`.trim();case v.ZodFirstPartyTypeKind.ZodNumber:return`${R(r.description)}z.number()`.trim();case v.ZodFirstPartyTypeKind.ZodNaN:return`${R(r.description)}z.nan()`.trim();case v.ZodFirstPartyTypeKind.ZodBigInt:return`${R(r.description)}z.bigint()`.trim();case v.ZodFirstPartyTypeKind.ZodBoolean:return`${R(t._def.description)}z.boolean()`.trim();case v.ZodFirstPartyTypeKind.ZodDate:return`${R(r.description)}z.date()`.trim();case v.ZodFirstPartyTypeKind.ZodUndefined:return`${R(r.description)}z.undefined()`.trim();case v.ZodFirstPartyTypeKind.ZodNull:return`${R(r.description)}z.null()`.trim();case v.ZodFirstPartyTypeKind.ZodAny:return`${R(r.description)}z.any()`.trim();case v.ZodFirstPartyTypeKind.ZodUnknown:return`${R(r.description)}z.unknown()`.trim();case v.ZodFirstPartyTypeKind.ZodNever:return`${R(r.description)}z.never()`.trim();case v.ZodFirstPartyTypeKind.ZodVoid:return`${R(r.description)}z.void()`.trim();case v.ZodFirstPartyTypeKind.ZodArray:return`z.array(${se(r.type)})`;case v.ZodFirstPartyTypeKind.ZodObject:let n=Lv(r.shape(),ue=>ue instanceof v.Schema?se(ue):"z.any()");return[`${R(r.description)}z.object({`,...Object.entries(n).map(([ue,Le])=>` ${ue}: ${Le},`),"})"].join(`
33
- `).trim();case v.ZodFirstPartyTypeKind.ZodUnion:let a=r.options.map(se);return`${R(r.description)}z.union([${a.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let s=r.options.map(se),i=Me(r.discriminator);return`${R(r.description)}z.discriminatedUnion(${i}, [${s.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodIntersection:let o=se(r.left),c=se(r.right);return`${R(r.description)}z.intersection(${o}, ${c})`.trim();case v.ZodFirstPartyTypeKind.ZodTuple:let p=r.items.map(se);return`${R(r.description)}z.tuple([${p.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodRecord:let m=se(r.keyType),T=se(r.valueType);return`${R(r.description)}z.record(${m}, ${T})`.trim();case v.ZodFirstPartyTypeKind.ZodMap:let O=se(r.keyType),w=se(r.valueType);return`${R(r.description)}z.map(${O}, ${w})`.trim();case v.ZodFirstPartyTypeKind.ZodSet:return`${R(r.description)}z.set(${se(r.valueType)})`.trim();case v.ZodFirstPartyTypeKind.ZodFunction:let S=r.args.items.map(se),W=S.length?`.args(${S.join(", ")})`:"",q=se(r.returns);return`${R(r.description)}z.function()${W}.returns(${q})`.trim();case v.ZodFirstPartyTypeKind.ZodLazy:return`${R(r.description)}z.lazy(() => ${se(r.getter())})`.trim();case v.ZodFirstPartyTypeKind.ZodLiteral:let re=Me(r.value);return`${R(r.description)}z.literal(${re})`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:let J=r.values.map(Me);return`${R(r.description)}z.enum([${J.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodEffects:throw new it(v.ZodFirstPartyTypeKind.ZodEffects);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new it(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${R(r.description)}z.optional(${se(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodNullable:return`${R(r.description)}z.nullable(${se(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodDefault:let N=tl(r.defaultValue());return`${R(r.description)}${se(r.innerType)}.default(${N})`.trim();case v.ZodFirstPartyTypeKind.ZodCatch:throw new it(v.ZodFirstPartyTypeKind.ZodCatch);case v.ZodFirstPartyTypeKind.ZodPromise:return`${R(r.description)}z.promise(${se(r.type)})`.trim();case v.ZodFirstPartyTypeKind.ZodBranded:throw new it(v.ZodFirstPartyTypeKind.ZodBranded);case v.ZodFirstPartyTypeKind.ZodPipeline:throw new it(v.ZodFirstPartyTypeKind.ZodPipeline);case v.ZodFirstPartyTypeKind.ZodSymbol:throw new it(v.ZodFirstPartyTypeKind.ZodSymbol);case v.ZodFirstPartyTypeKind.ZodReadonly:return`${R(r.description)}z.readonly(${se(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodRef:let F=Me(r.uri);return`${R(r.description)}z.ref(${F})`.trim();default:M.assertNever(r)}}l(se,"sUnwrapZod");var Pc=class{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}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}};l(Pc,"ParseInputLazyPath");var xe=Pc,Mo=l((t,e)=>{if(Nt(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;let r=new Be(t.common.issues);return this._error=r,this._error}}},"handleResult"),kc=class{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}dereference(e){return this}getReferences(){return[]}_getType(e){return He(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ve,ctx:{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(pr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let a={common:{issues:[],async:(n=r?.async)!=null?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},s=this._parseSync({data:e,path:a.path,parent:a});return Mo(a,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(pr(a)?a:Promise.resolve(a));return Mo(n,s)}refine(e,r){let n=l(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let i=e(a),o=l(()=>s.addIssue(d({code:_.custom},n(a))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new Je({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return je.create(this,this._def)}nullable(){return ft.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $t.create(this,this._def)}promise(){return vr.create(this,this._def)}or(e){return na.create([this,e],this._def)}and(e){return Gn.create(this,e,this._def)}transform(e){return new Je(h(d({},Z(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let r=typeof e=="function"?e:()=>e;return new mr(h(d({},Z(this._def)),{innerType:this,defaultValue:r,typeName:"ZodDefault"}))}brand(){return new Wn(d({typeName:"ZodBranded",type:this},Z(this._def)))}catch(e){let r=typeof e=="function"?e:()=>e;return new Vn(h(d({},Z(this._def)),{innerType:this,catchValue:r,typeName:"ZodCatch"}))}describe(e){let r=this.constructor;return new r(h(d({},this._def),{description:e}))}pipe(e){return ta.create(this,e)}readonly(){return _r.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){for(let[r,n]of Object.entries(e))this._def[K]=h(d({},this._def[K]),{[r]:n});return this}getMetadata(){return d({},this._def[K])}setMetadata(e){this._def[K]=d({},e)}get ui(){let e=this._getMetadataRoot();return d({},e._def[K])}_setZuiMeta(e,r){let n=this._getMetadataRoot();n._def[K]=h(d({},n._def[K]),{[e]:r})}_getMetadataRoot(){let e=this._def;switch(e.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":return e.innerType;case"ZodEffects":return e.schema;default:return this}}displayAs(e){var r,n,a;return(a=(r=this._def)[n=K])!=null||(r[n]={}),this._def[K].displayAs=[e.id,e.params],this}title(e){return this._setZuiMeta("title",e),this}hidden(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("hidden",r),this}disabled(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("disabled",r),this}placeholder(e){return this._setZuiMeta("placeholder",e),this}toJsonSchema(e){return aa(this,e)}toTypescript(e){return Qr(this,e)}toTypescriptSchema(){return ws(this)}async toTypescriptAsync(e){let r=Qr(this,h(d({},e),{formatter:void 0}));return e?.formatter&&(r=await e.formatter(r)),r}static fromObject(e,r){return Kt(e,r)}static fromJsonSchema(e){return Tr(e)}};l(kc,"ZodType");var H=kc,Ps=(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.ZodRef="ZodRef",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",t))(Ps||{}),M;(t=>{t.assertEqual=l(a=>a,"assertEqual");function e(a){}t.assertIs=e,l(e,"assertIs");function r(a){throw new Error("assertNever called")}t.assertNever=r,l(r,"assertNever"),t.arrayToEnum=l(a=>{let s={};for(let i of a)s[i]=i;return s},"arrayToEnum"),t.getValidEnumValues=l(a=>{let s=(0,t.objectKeys)(a).filter(o=>typeof a[a[o]]!="number"),i={};for(let o of s)i[o]=a[o];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=l(a=>(0,t.objectKeys)(a).map(function(s){return a[s]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},t.find=l((a,s)=>{for(let i of a)if(s(i))return i},"find"),t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,l(n,"joinValues"),t.jsonStringifyReplacer=l((a,s)=>typeof s=="bigint"?s.toString():s,"jsonStringifyReplacer"),t.compareFunctions=l((a,s)=>a.toString()===s.toString(),"compareFunctions")})(M||(M={}));var en;(t=>{t.mergeShapes=l((e,r)=>d(d({},e),r),"mergeShapes")})(en||(en={}));var k=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),He=l(t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},"getParsedType");function Z(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a,[K]:t?.[K]}:{errorMap:l((i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:r??o.defaultError},"customMap"),description:a,[K]:t?.[K]}}l(Z,"processCreateParams");var ks=l((t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===k.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:M.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;case _.unresolved_reference:r="Unresolved reference";break;default:r=e.defaultError,M.assertNever(t)}return{message:r}},"errorMap"),jo=ks,_=M.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","unresolved_reference"]),Ec=l(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),tn=class xc extends Error{constructor(e){super(),this.issues=[],this.addIssue=l(n=>{this.issues=[...this.issues,n]},"addIssue"),this.addIssues=l((n=[])=>{this.issues=[...this.issues,...n]},"addIssues");let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},a=l(s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){let p=i.path[c];c===i.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(r(i))):o[p]=o[p]||{_errors:[]},o=o[p],c++}}},"processError");return a(this),n}static assert(e){if(!(e instanceof xc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};l(tn,"ZodError");tn.create=l(t=>new tn(t),"create");var Be=tn,Sc=ks;function Es(t){Sc=t}l(Es,"setErrorMap");function jt(){return Sc}l(jt,"getErrorMap");var fr=l(t=>{var e;let{data:r,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o=h(d({},s),{path:i}),c="",p=a.filter(m=>!!m).slice().reverse();for(let m of p)c=m(o,{data:r,defaultError:c}).message;return h(d({},s),{path:i,message:(e=s.message)!=null?e:c})},"makeIssue"),Oc=[];function P(t,e){let r=fr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,jt(),ks].filter(n=>!!n)});t.common.issues.push(r)}l(P,"addIssueToContext");var Cc=class Ic{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let a of r){if(a.status==="aborted")return I;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let a of r)n.push({key:await a.key,value:await a.value});return Ic.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let a of r){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return I;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}};l(Cc,"ParseStatus");var ve=Cc,I=Object.freeze({status:"aborted"}),ct=l(t=>({status:"dirty",value:t}),"DIRTY"),pe=l(t=>({status:"valid",value:t}),"OK"),rn=l(t=>t.status==="aborted","isAborted"),nn=l(t=>t.status==="dirty","isDirty"),Nt=l(t=>t.status==="valid","isValid"),pr=l(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),C;(t=>{t.errToObj=l(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=l(e=>typeof e=="string"?e:e?.message,"toString")})(C||(C={}));var an=class Bc extends H{constructor(){super(...arguments),this._any=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof Bc}};l(an,"ZodAny");an.create=l(t=>new an(d({typeName:"ZodAny"},Z(t))),"create");var gr=an,sn=class It extends H{dereference(e){return new It(h(d({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var r,n,a,s,i,o;return e instanceof It?dt((r=this._def.exactLength)==null?void 0:r.value,(n=e._def.exactLength)==null?void 0:n.value)&&dt((a=this._def.maxLength)==null?void 0:a.value,(s=e._def.maxLength)==null?void 0:s.value)&&dt((i=this._def.minLength)==null?void 0:i.value,(o=e._def.minLength)==null?void 0:o.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==k.array)return P(r,{code:_.invalid_type,expected:k.array,received:r.parsedType}),I;if(a.exactLength!==null){let i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(P(r,{code:i?_.too_big:_.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(P(r,{code:_.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(P(r,{code:_.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new xe(r,i,r.path,o)))).then(i=>ve.mergeArray(n,i));let s=[...r.data].map((i,o)=>a.type._parseSync(new xe(r,i,r.path,o)));return ve.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new It(h(d({},this._def),{minLength:{value:e,message:C.toString(r)}}))}max(e,r){return new It(h(d({},this._def),{maxLength:{value:e,message:C.toString(r)}}))}length(e,r){return new It(h(d({},this._def),{exactLength:{value:e,message:C.toString(r)}}))}nonempty(e){return this.min(1,e)}};l(sn,"ZodArray");sn.create=l((t,e)=>new sn(d({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},Z(e))),"create");var $t=sn,zv={compare:dt},Rc=class{constructor(e=[],r={}){this._options=d(d({},zv),r),this._items=[];for(let n of e)this.add(n)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(r=>this._options.compare(r,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(r=>e.has(r))}};l(Rc,"CustomSet");var le=Rc,on=class zr extends H{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)!==k.bigint){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.bigint,received:s.parsedType}),I}let n,a=new ve;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}isEqual(e){if(!(e instanceof zr)||this._def.coerce!==e._def.coerce)return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,a){return new zr(h(d({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(a)}]}))}_addCheck(e){return new zr(h(d({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l(on,"ZodBigInt");on.create=l(t=>{var e;return new on(d({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},Z(t)))},"create");var Ln=on,ln=class Zc extends H{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==k.boolean){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.boolean,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof Zc?this._def.coerce===e._def.coerce:!1}};l(ln,"ZodBoolean");ln.create=l(t=>new ln(d({typeName:"ZodBoolean",coerce:t?.coerce||!1},Z(t))),"create");var zn=ln,Ac=Symbol("zod_brand"),Dc=class Hc extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}isEqual(e){return e instanceof Hc?this._def.type.isEqual(e._def.type):!1}};l(Dc,"ZodBranded");var Wn=Dc,un=class Mc extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=h(d({},r),{common:h(d({},r.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:d({},n)});return pr(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Be(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Be(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof Mc?this._def.innerType.isEqual(e._def.innerType)&&M.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};l(un,"ZodCatch");un.create=l((t,e)=>new un(d({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},Z(e))),"create");var Vn=un,xs=l((t,e={},r)=>t?gr.create().superRefine((n,a)=>{var s,i;if(!t(n)){let o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(s=o.fatal)!=null?s:r)!=null?i:!0,p=typeof o=="string"?{message:o}:o;a.addIssue(h(d({code:"custom"},p),{fatal:c}))}}):gr.create(),"custom"),cn=class rs extends H{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.date,received:s.parsedType}),I}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_date}),I}let n=new ve,a;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):M.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rs(h(d({},this._def),{checks:[...this._def.checks,e]}))}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof rs))return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)&&this._def.coerce===e._def.coerce}};l(cn,"ZodDate");cn.create=l(t=>new cn(d({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},Z(t))),"create");var qn=cn,dn=class ns extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===k.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}dereference(e){return new ns(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof ns?this._def.innerType.isEqual(e._def.innerType)&&dt(this._def.defaultValue(),e._def.defaultValue()):!1}};l(dn,"ZodDefault");dn.create=l((t,e,r)=>new dn(d({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},Z(r))),"create");var mr=dn,Ke=l(t=>Array.from(new Set(t)),"unique"),De=l(t=>t instanceof Jn?De(t.schema):t instanceof Je?De(t.innerType()):t instanceof Yn?[t.value]:t instanceof bt?t.options:t instanceof Xn?M.objectValues(t.enum):t instanceof mr?De(t._def.innerType):t instanceof ra?[void 0]:t instanceof Qn?[null]:t instanceof je?[void 0,...De(t.unwrap())]:t instanceof ft?[null,...De(t.unwrap())]:t instanceof Wn||t instanceof _r?De(t.unwrap()):t instanceof Vn?De(t._def.innerType):[],"getDiscriminator"),jc=class Bt extends H{dereference(e){let r=this.options.map(a=>a.dereference(e)),n=Bt._getOptionsMap(this.discriminator,r);return new Bt(h(d({},this._def),{options:r,optionsMap:n}))}getReferences(){return Ke(this.options.flatMap(e=>e.getReferences()))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.object)return P(r,{code:_.invalid_type,expected:k.object,received:r.parsedType}),I;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(P(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),I)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let a=Bt._getOptionsMap(e,r);return new Bt(d({typeName:"ZodDiscriminatedUnion",discriminator:e,options:r,optionsMap:a},Z(n)))}static _getOptionsMap(e,r){let n=new Map;for(let a of r){let s=De(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,a)}}return n}isEqual(e){if(!(e instanceof Bt)||this._def.discriminator!==e._def.discriminator)return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le(this._def.options,{compare:r}),a=new le(e._def.options,{compare:r});return n.isEqual(a)}};l(jc,"ZodDiscriminatedUnion");var Ss=jc;function yr(t,e){return new bt(d({values:t,typeName:"ZodEnum"},Z(e)))}l(yr,"createZodEnum");var Os=class Wr extends H{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{expected:M.joinValues(n),received:r.parsedType,code:_.invalid_type}),I}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{received:r.data,code:_.invalid_enum_value,options:n}),I}return pe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Wr.create(e,d(d({},this._def),r))}exclude(e,r=this._def){return Wr.create(this.options.filter(n=>!e.includes(n)),d(d({},this._def),r))}isEqual(e){if(!(e instanceof Wr))return!1;let r=new le(this._def.values),n=new le(e._def.values);return r.isEqual(n)}};l(Os,"ZodEnum");Os.create=yr;var bt=Os,Nc=class Rt extends H{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let r=this._def.args.dereference(e),n=this._def.returns.dereference(e);return new Rt(h(d({},this._def),{args:r,returns:n}))}getReferences(){return Ke([...this._def.args.getReferences(),...this._def.returns.getReferences()])}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.function)return P(r,{code:_.invalid_type,expected:k.function,received:r.parsedType}),I;function n(o,c){return fr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,jt(),jo].filter(p=>!!p),issueData:{code:_.invalid_arguments,argumentsError:c}})}l(n,"makeArgsIssue");function a(o,c){return fr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,jt(),jo].filter(p=>!!p),issueData:{code:_.invalid_return_type,returnTypeError:c}})}l(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof vr){let o=this;return pe(async function(...c){let p=new Be([]),m=await o._def.args.parseAsync(c,s).catch(w=>{throw p.addIssue(n(c,w)),p}),T=await Reflect.apply(i,this,m);return await o._def.returns._def.type.parseAsync(T,s).catch(w=>{throw p.addIssue(a(T,w)),p})})}else{let o=this;return pe(function(...c){let p=o._def.args.safeParse(c,s);if(!p.success)throw new Be([n(c,p.error)]);let m=Reflect.apply(i,this,p.data),T=o._def.returns.safeParse(m,s);if(!T.success)throw new Be([a(m,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Rt(h(d({},this._def),{args:gt.create(e).rest(Dt.create())}))}returns(e){return new Rt(h(d({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Rt(d({args:e||gt.create([]).rest(Dt.create()),returns:r||Dt.create(),typeName:"ZodFunction"},Z(n)))}isEqual(e){return e instanceof Rt&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};l(Nc,"ZodFunction");var Cs=Nc;function fn(t,e){let r=He(t),n=He(e);if(t===e)return{valid:!0,data:t};if(r===k.object&&n===k.object){let a=M.objectKeys(e),s=M.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i=d(d({},t),e);for(let o of s){let c=fn(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===k.array&&n===k.array){if(t.length!==e.length)return{valid:!1};let a=[];for(let s=0;s<t.length;s++){let i=t[s],o=e[s],c=fn(i,o);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===k.date&&n===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}l(fn,"mergeValues");var pn=class as extends H{dereference(e){return new as(h(d({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Ke([...this._def.left.getReferences(),...this._def.right.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=l((s,i)=>{if(rn(s)||rn(i))return I;let o=fn(s.value,i.value);return o.valid?((nn(s)||nn(i))&&r.dirty(),{status:r.value,value:o.data}):(P(n,{code:_.invalid_intersection_types}),I)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}isEqual(e){if(!(e instanceof as))return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le([this._def.left,this._def.right],{compare:r}),a=new le([e._def.left,e._def.right],{compare:r});return n.isEqual(a)}};l(pn,"ZodIntersection");pn.create=l((t,e,r)=>new pn(d({left:t,right:e,typeName:"ZodIntersection"},Z(r))),"create");var Gn=pn,gn=class $c extends H{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}isEqual(e){return e instanceof $c?this._def.getter().isEqual(e._def.getter()):!1}};l(gn,"ZodLazy");gn.create=l((t,e)=>new gn(d({getter:t,typeName:"ZodLazy"},Z(e))),"create");var Jn=gn,hn=class Uc extends H{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return P(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),I}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof Uc?dt(this._def.value,e._def.value):!1}};l(hn,"ZodLiteral");hn.create=l((t,e)=>new hn(d({value:t,typeName:"ZodLiteral"},Z(e))),"create");var Yn=hn,mn=class ss extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new ss(h(d({},this._def),{keyType:r,valueType:n}))}getReferences(){return Ke([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.map)return P(n,{code:_.invalid_type,expected:k.map,received:n.parsedType}),I;let a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,c],p)=>({key:a._parse(new xe(n,o,n.path,[p,"key"])),value:s._parse(new xe(n,c,n.path,[p,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let p=await c.key,m=await c.value;if(p.status==="aborted"||m.status==="aborted")return I;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),o.set(p.value,m.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of i){let p=c.key,m=c.value;if(p.status==="aborted"||m.status==="aborted")return I;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),o.set(p.value,m.value)}return{status:r.value,value:o}}}isEqual(e){return!(!(e instanceof ss)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};l(mn,"ZodMap");mn.create=l((t,e,r)=>new mn(d({valueType:e,keyType:t,typeName:"ZodMap"},Z(r))),"create");var Is=mn,yn=class Kc extends H{_parse(e){if(this._getType(e)!==k.nan){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.nan,received:n.parsedType}),I}return{status:"valid",value:e.data}}isEqual(e){return e instanceof Kc}};l(yn,"ZodNaN");yn.create=l(t=>new yn(d({typeName:"ZodNaN"},Z(t))),"create");var Bs=yn,vn=class Fc extends H{_parse(e){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==k.string&&n.parsedType!==k.number){let a=M.objectValues(r);return P(n,{expected:M.joinValues(a),received:n.parsedType,code:_.invalid_type}),I}if(r.indexOf(e.data)===-1){let a=M.objectValues(r);return P(n,{received:n.data,code:_.invalid_enum_value,options:a}),I}return pe(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof Fc?dt(this._def.values,e._def.values):!1}};l(vn,"ZodNativeEnum");vn.create=l((t,e)=>new vn(d({values:t,typeName:"ZodNativeEnum"},Z(e))),"create");var Xn=vn,_n=class Lc extends H{_parse(e){let r=this._getOrReturnCtx(e);return P(r,{code:_.invalid_type,expected:k.never,received:r.parsedType}),I}isEqual(e){return e instanceof Lc}};l(_n,"ZodNever");_n.create=l(t=>new _n(d({typeName:"ZodNever"},Z(t))),"create");var qe=_n,Tn=class zc extends H{_parse(e){if(this._getType(e)!==k.null){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.null,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof zc}};l(Tn,"ZodNull");Tn.create=l(t=>new Tn(d({typeName:"ZodNull"},Z(t))),"create");var Qn=Tn,bn=class is extends H{dereference(e){return new is(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===k.null?pe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof is?this._def.innerType.isEqual(e._def.innerType):!1}};l(bn,"ZodNullable");bn.create=l((t,e)=>new bn(d({innerType:t,typeName:"ZodNullable"},Z(e))),"create");var ft=bn;function Wc(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(t.toFixed(a).replace(".","")),i=parseInt(e.toFixed(a).replace(".",""));return s%i/Math.pow(10,a)}l(Wc,"floatSafeRemainder");var wn=class Vr extends H{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)!==k.number){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.number,received:s.parsedType}),I}let n,a=new ve;for(let s of this._def.checks)s.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:_.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Wc(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:_.not_finite,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,a){return new Vr(h(d({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(a)}]}))}_addCheck(e){return new Vr(h(d({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof Vr))return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)}};l(wn,"ZodNumber");wn.create=l(t=>new wn(d({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},Z(t))),"create");var ea=wn;function ut(t){if(t instanceof pt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=je.create(ut(n))}return new pt(h(d({},t._def),{shape:l(()=>e,"shape")}))}else return t instanceof $t?new $t(h(d({},t._def),{type:ut(t.element)})):t instanceof je?je.create(ut(t.unwrap())):t instanceof ft?ft.create(ut(t.unwrap())):t instanceof gt?gt.create(t.items.map(e=>ut(e))):t}l(ut,"deepPartialify");var Ge=class Ee extends H{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=M.objectKeys(e);return this._cached={shape:e,keys:r}}dereference(e){let r=this._def.shape(),n={};for(let a in r)n[a]=r[a].dereference(e);return new Ee(h(d({},this._def),{shape:l(()=>n,"shape")}))}getReferences(){let e=this._def.shape(),r=[];for(let n in e)r.push(...e[n].getReferences());return Ke(r)}_parse(e){if(this._getType(e)!==k.object){let p=this._getOrReturnCtx(e);return P(p,{code:_.invalid_type,expected:k.object,received:p.parsedType}),I}let{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof qe&&this._def.unknownKeys==="strip"))for(let p in a.data)i.includes(p)||o.push(p);let c=[];for(let p of i){let m=s[p],T=a.data[p];c.push({key:{status:"valid",value:p},value:m._parse(new xe(a,T,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof qe){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of o)c.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(p==="strict")o.length>0&&(P(a,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of o){let T=a.data[m];c.push({key:{status:"valid",value:m},value:p._parse(new xe(a,T,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let m of c){let T=await m.key;p.push({key:T,value:await m.value,alwaysSet:m.alwaysSet})}return p}).then(p=>ve.mergeObjectSync(n,p)):ve.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new Ee(d(h(d({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:l((r,n)=>{var a,s,i,o;let c=(i=(s=(a=this._def).errorMap)==null?void 0:s.call(a,r,n).message)!=null?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=C.errToObj(e).message)!=null?o:c}:{message:c}},"errorMap")}:{}))}strip(){return new Ee(h(d({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Ee(h(d({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new Ee(h(d({},this._def),{shape:l(()=>d(d({},this._def.shape()),e),"shape")}))}merge(e){return new Ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:l(()=>d(d({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ee(h(d({},this._def),{catchall:e}))}pick(e){let r={};return M.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}omit(e){let r={};return M.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}deepPartial(){return ut(this)}partial(e){let r={};return M.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a?.optional()}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}required(e){let r={};return M.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof je;)s=s._def.innerType;r[n]=s}}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}keyof(){return yr(M.objectKeys(this.shape))}isEqual(e){if(!(e instanceof Ee)||!this._def.catchall.isEqual(e._def.catchall)||this._def.unknownKeys!==e._def.unknownKeys)return!1;let r=this._def.shape(),n=e._def.shape(),a=l((o,c)=>o[0]===c[0]&&o[1].isEqual(c[1]),"compare"),s=new le(Object.entries(r),{compare:a}),i=new le(Object.entries(n),{compare:a});return s.isEqual(i)}};l(Ge,"ZodObject");Ge.create=l((t,e)=>new Ge(d({shape:l(()=>t,"shape"),unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},Z(e))),"create");Ge.strictCreate=l((t,e)=>new Ge(d({shape:l(()=>t,"shape"),unknownKeys:"strict",catchall:qe.create(),typeName:"ZodObject"},Z(e))),"strictCreate");Ge.lazycreate=l((t,e)=>new Ge(d({shape:t,unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},Z(e))),"lazycreate");var pt=Ge,Pn=class os extends H{dereference(e){return new os(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===k.undefined?pe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof os?this._def.innerType.isEqual(e._def.innerType):!1}};l(Pn,"ZodOptional");Pn.create=l((t,e)=>new Pn(d({innerType:t,typeName:"ZodOptional"},Z(e))),"create");var je=Pn,Vc=class qr extends H{dereference(e){return new qr(h(d({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Ke([...this._def.in.getReferences(),...this._def.out.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return l(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?I:s.status==="dirty"?(r.dirty(),ct(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?I:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new qr({in:e,out:r,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof qr)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};l(Vc,"ZodPipeline");var ta=Vc,kn=class ls extends H{unwrap(){return this._def.type}dereference(e){return new ls(h(d({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.promise&&r.common.async===!1)return P(r,{code:_.invalid_type,expected:k.promise,received:r.parsedType}),I;let n=r.parsedType===k.promise?r.data:Promise.resolve(r.data);return pe(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}isEqual(e){return e instanceof ls?this._def.type.isEqual(e._def.type):!1}};l(kn,"ZodPromise");kn.create=l((t,e)=>new kn(d({type:t,typeName:"ZodPromise"},Z(e))),"create");var vr=kn,En=class us extends H{dereference(e){return new us(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){let r=this._def.innerType._parse(e);return Nt(r)&&(r.value=Object.freeze(r.value)),r}unwrap(){return this._def.innerType}isEqual(e){return e instanceof us?this._def.innerType.isEqual(e._def.innerType):!1}};l(En,"ZodReadonly");En.create=l((t,e)=>new En(d({innerType:t,typeName:"ZodReadonly"},Z(e))),"create");var _r=En,qc=class ar extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new ar(h(d({},this._def),{keyType:r,valueType:n}))}getReferences(){return Ke([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.object)return P(n,{code:_.invalid_type,expected:k.object,received:n.parsedType}),I;let a=[],s=this._def.keyType,i=this._def.valueType;for(let o in n.data)a.push({key:s._parse(new xe(n,o,n.path,o)),value:i._parse(new xe(n,n.data[o],n.path,o))});return n.common.async?ve.mergeObjectAsync(r,a):ve.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof H?new ar(d({keyType:e,valueType:r,typeName:"ZodRecord"},Z(n))):new ar(d({keyType:ge.create(),valueType:e,typeName:"ZodRecord"},Z(r)))}isEqual(e){return!(!(e instanceof ar)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};l(qc,"ZodRecord");var Rs=qc,xn=class Gc extends H{dereference(e){let r=e[this._def.uri];return r||this}getReferences(){return[this._def.uri]}_parse(e){let r=this._getOrReturnCtx(e);return P(r,{code:_.unresolved_reference}),I}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Gc?this._def.uri===e._def.uri:!1}};l(xn,"ZodRef");xn.create=l(t=>new xn({typeName:"ZodRef",uri:t}),"create");var Zs=xn,Sn=class sr extends H{dereference(e){return new sr(h(d({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.set)return P(n,{code:_.invalid_type,expected:k.set,received:n.parsedType}),I;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(P(n,{code:_.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(P(n,{code:_.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let p=new Set;for(let m of c){if(m.status==="aborted")return I;m.status==="dirty"&&r.dirty(),p.add(m.value)}return{status:r.value,value:p}}l(i,"finalizeSet");let o=[...n.data.values()].map((c,p)=>s._parse(new xe(n,c,n.path,p)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new sr(h(d({},this._def),{minSize:{value:e,message:C.toString(r)}}))}max(e,r){return new sr(h(d({},this._def),{maxSize:{value:e,message:C.toString(r)}}))}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}isEqual(e){var r,n,a,s;if(!(e instanceof sr))return!1;let i=(r=this._def.minSize)==null?void 0:r.value,o=(n=e._def.minSize)==null?void 0:n.value;if(i!==o)return!1;let c=(a=this._def.maxSize)==null?void 0:a.value,p=(s=e._def.maxSize)==null?void 0:s.value;return c!==p?!1:this._def.valueType.isEqual(e._def.valueType)}};l(Sn,"ZodSet");Sn.create=l((t,e)=>new Sn(d({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},Z(e))),"create");var As=Sn,Ds=/^c[^\s-]{8,}$/i,Hs=/^[a-z][a-z0-9]*$/,Ms=/^[0-9A-HJKMNP-TV-Z]{26}$/,js=/^[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,Ns=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Jc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Yc=l(t=>t===Jc,"isEmojiRegex"),Va,$s=/^(((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}))$/,Us=/^(([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})))$/,Ks=l(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function Xc(t,e){return!!((e==="v4"||!e)&&$s.test(t)||(e==="v6"||!e)&&Us.test(t))}l(Xc,"isValidIP");var On=class Zt extends H{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.string,received:s.parsedType}),I}let n=new ve,a;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?P(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&P(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Ns.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"email",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Va||(Va=new RegExp(Jc,"u")),Va.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"emoji",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")js.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"uuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Ds.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"cuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Hs.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"cuid2",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Ms.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"ulid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),P(a,{validation:"url",code:_.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"regex",code:_.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ks(s).test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Xc(e.data,s.version)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"ip",code:_.invalid_string,message:s.message}),n.dirty()):M.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),d({validation:r,code:_.invalid_string},C.errToObj(n)))}_addCheck(e){return new Zt(h(d({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(d({kind:"email"},C.errToObj(e)))}url(e){return this._addCheck(d({kind:"url"},C.errToObj(e)))}emoji(e){return this._addCheck(d({kind:"emoji"},C.errToObj(e)))}uuid(e){return this._addCheck(d({kind:"uuid"},C.errToObj(e)))}cuid(e){return this._addCheck(d({kind:"cuid"},C.errToObj(e)))}cuid2(e){return this._addCheck(d({kind:"cuid2"},C.errToObj(e)))}ulid(e){return this._addCheck(d({kind:"ulid"},C.errToObj(e)))}ip(e){return this._addCheck(d({kind:"ip"},C.errToObj(e)))}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(d({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!=null?r:!1},C.errToObj(e?.message)))}regex(e,r){return this._addCheck(d({kind:"regex",regex:e},C.errToObj(r)))}includes(e,r){return this._addCheck(d({kind:"includes",value:e,position:r?.position},C.errToObj(r?.message)))}startsWith(e,r){return this._addCheck(d({kind:"startsWith",value:e},C.errToObj(r)))}endsWith(e,r){return this._addCheck(d({kind:"endsWith",value:e},C.errToObj(r)))}min(e,r){return this._addCheck(d({kind:"min",value:e},C.errToObj(r)))}max(e,r){return this._addCheck(d({kind:"max",value:e},C.errToObj(r)))}length(e,r){return this._addCheck(d({kind:"length",value:e},C.errToObj(r)))}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new Zt(h(d({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[K]=h(d({},this._def[K]),{secret:!0}),this}toLowerCase(){return new Zt(h(d({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Zt(h(d({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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 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 minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}isEqual(e){if(!(e instanceof Zt))return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)}};l(On,"ZodString");On.create=l(t=>{var e;return new On(d({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},Z(t)))},"create");var ge=On,Cn=class Qc extends H{_parse(e){if(this._getType(e)!==k.symbol){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.symbol,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof Qc}};l(Cn,"ZodSymbol");Cn.create=l(t=>new Cn(d({typeName:"ZodSymbol"},Z(t))),"create");var Fs=Cn,Ut=class cs extends H{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new cs(h(d({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:l(i=>{P(n,i),i.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return I;let c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?I:c.status==="dirty"||r.value==="dirty"?ct(c.value):c});{if(r.value==="aborted")return I;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?I:o.status==="dirty"||r.value==="dirty"?ct(o.value):o}}if(a.type==="refinement"){let i=l(o=>{let c=a.refinement(o,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o},"executeRefinement");if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?I:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?I:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Nt(i))return i;let o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Nt(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):i);M.assertNever(a)}isEqual(e){return!(e instanceof cs)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:M.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):(M.assertNever(this._def.effect),!1)}};l(Ut,"ZodEffects");Ut.create=l((t,e,r)=>new Ut(d({schema:t,typeName:"ZodEffects",effect:e},Z(r))),"create");Ut.createWithPreprocess=l((t,e,r)=>new Ut(d({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},Z(r))),"createWithPreprocess");var Je=Ut,In=class Gr extends H{dereference(e){let r=this._def.items.map(a=>a.dereference(e)),n=this._def.rest?this._def.rest.dereference(e):null;return new Gr(h(d({},this._def),{items:r,rest:n}))}getReferences(){return Ke([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.array)return P(n,{code:_.invalid_type,expected:k.array,received:n.parsedType}),I;if(n.data.length<this._def.items.length)return P(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I;!this._def.rest&&n.data.length>this._def.items.length&&(P(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new xe(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>ve.mergeArray(r,i)):ve.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Gr(h(d({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof Gr)||!this._restEquals(e))return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le(this._def.items,{compare:r}),a=new le(e._def.items,{compare:r});return n.isEqual(a)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};l(In,"ZodTuple");In.create=l((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new In(d({items:t,typeName:"ZodTuple",rest:null},Z(e)))},"create");var gt=In,Bn=class ed extends H{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.undefined,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof ed}};l(Bn,"ZodUndefined");Bn.create=l(t=>new Bn(d({typeName:"ZodUndefined"},Z(t))),"create");var ra=Bn,Rn=class ds extends H{dereference(e){let r=this._def.options.map(n=>n.dereference(e));return new ds(h(d({},this._def),{options:r}))}getReferences(){return Ke(this._def.options.reduce((e,r)=>[...e,...r.getReferences()],[]))}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new Be(o.ctx.common.issues));return P(r,{code:_.invalid_union,unionErrors:i}),I}if(l(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let i=h(d({},r),{common:h(d({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s,i=[];for(let c of n){let p=h(d({},r),{common:h(d({},r.common),{issues:[]}),parent:null}),m=c._parseSync({data:r.data,path:r.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(c=>new Be(c));return P(r,{code:_.invalid_union,unionErrors:o}),I}}get options(){return this._def.options}isEqual(e){if(!(e instanceof ds))return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le([...this._def.options],{compare:r}),a=new le([...e._def.options],{compare:r});return n.isEqual(a)}};l(Rn,"ZodUnion");Rn.create=l((t,e)=>new Rn(d({options:t,typeName:"ZodUnion"},Z(e))),"create");var na=Rn,Zn=class td extends H{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof td}};l(Zn,"ZodUnknown");Zn.create=l(t=>new Zn(d({typeName:"ZodUnknown"},Z(t))),"create");var Dt=Zn,An=class rd extends H{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.void,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof rd}};l(An,"ZodVoid");An.create=l(t=>new An(d({typeName:"ZodVoid"},Z(t))),"create");var Ls=An,Wv=/^\d{4}-\d{2}-\d{2}(T|\s)?((\d{2}:\d{2}:\d{2}(\.\d{1,3})?)|(\d{2}:\d{2}))?(\s?([+-]\d{2}:\d{2}|Z))?$/,Kt=l((t,e,r=!0)=>{if(typeof t!="object")throw new Ga("Input must be an object");let n=l(i=>{let o=i;return e?.nullable&&(o=o.nullable()),e?.optional&&(o=o.optional()),e?.passtrough&&typeof o.passthrough=="function"&&(o=o.passthrough()),o},"applyOptions"),a=Object.entries(t).reduce((i,[o,c])=>{if(c===null)i[o]=n(E.null());else switch(typeof c){case"string":i[o]=Wv.test(c)?n(E.string().datetime()):n(E.string());break;case"number":i[o]=n(E.number());break;case"boolean":i[o]=n(E.boolean());break;case"object":Array.isArray(c)?c.length===0?i[o]=n(E.array(E.unknown())):typeof c[0]=="object"?i[o]=n(E.array(Kt(c[0],e,!1))):["string","number","boolean"].includes(typeof c[0])&&(i[o]=n(E.array(E[typeof c[0]]()))):i[o]=n(Kt(c,e,!1));break;default:throw new Ga(`Unsupported type for key ${o}`)}return i},{}),s=Object.keys(a).length>0;return e?.passtrough||!r&&!s?E.object(a).passthrough():E.object(a)},"objectToZui");function nd(){return{}}l(nd,"parseAnyDef");function zs(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage=h(d({},t.errorMessage),{[e]:r}))}l(zs,"addErrorMessage");function G(t,e,r,n,a){t[e]=r,zs(t,e,n,a)}l(G,"setResponseValueAndErrors");function ad(t,e){var r,n;let a={type:"array"};return((n=(r=t.type)==null?void 0:r._def)==null?void 0:n.typeName)!=="ZodAny"&&(a.items=V(t.type._def,h(d({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&G(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&G(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(G(a,"minItems",t.exactLength.value,t.exactLength.message,e),G(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}l(ad,"parseArrayDef");function sd(t,e){let r=d({type:"integer",format:"int64"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?G(r,"minimum",n.value,n.message,e):G(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),G(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?G(r,"maximum",n.value,n.message,e):G(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),G(r,"maximum",n.value,n.message,e));break;case"multipleOf":G(r,"multipleOf",n.value,n.message,e);break}return r}l(sd,"parseBigintDef");function id(t){return d({type:"boolean"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{})}l(id,"parseBooleanDef");function od(t,e){return V(t.type._def,e)}l(od,"parseBrandedDef");var Vv=l((t,e)=>V(t.innerType._def,e),"parseCatchDef");function ld(t,e){return e.dateStrategy=="integer"?qv(t,e):d({type:"string",format:"date-time"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{})}l(ld,"parseDateDef");var qv=l((t,e)=>{let r=d({type:"integer",format:"unix-time"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"&&G(r,"minimum",n.value,n.message,e);break;case"max":e.target==="jsonSchema7"&&G(r,"maximum",n.value,n.message,e);break}return r},"integerDateParser");function ud(t,e){return h(d({},V(t.innerType._def,e)),{default:t.defaultValue()})}l(ud,"parseDefaultDef");function cd(t,e){return e.effectStrategy==="input"?V(t.schema._def,e):{}}l(cd,"parseEffectsDef");function dd(t){return{type:"string",enum:t.values}}l(dd,"parseEnumDef");var Gv=l(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function fd(t,e){let r=[V(t.left._def,h(d({},e),{currentPath:[...e.currentPath,"allOf","0"]})),V(t.right._def,h(d({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return r.forEach(s=>{if(Gv(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let o=s,{additionalProperties:c}=o;i=Fo(o,["additionalProperties"])}else n=void 0;a.push(i)}}),a.length?d({allOf:a},n):void 0}l(fd,"parseIntersectionDef");function pd(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}l(pd,"parseLiteralDef");var nr={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((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}))$",ipv6:"^(([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})))$"};function Ws(t,e){let r=d({type:"string"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});function n(a){return e.patternStrategy==="escape"?Jv(a):a}if(l(n,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":G(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e);break;case"max":G(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":st(r,"email",a.message,e);break;case"format:idn-email":st(r,"idn-email",a.message,e);break;case"pattern:zod":Ae(r,nr.email,a.message,e);break}break;case"url":st(r,"uri",a.message,e);break;case"uuid":st(r,"uuid",a.message,e);break;case"regex":Ae(r,a.regex.source,a.message,e);break;case"cuid":Ae(r,nr.cuid,a.message,e);break;case"cuid2":Ae(r,nr.cuid2,a.message,e);break;case"startsWith":Ae(r,"^"+n(a.value),a.message,e);break;case"endsWith":Ae(r,n(a.value)+"$",a.message,e);break;case"datetime":st(r,"date-time",a.message,e);break;case"length":G(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e),G(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"includes":{Ae(r,n(a.value),a.message,e);break}case"ip":{a.version!=="v6"&&st(r,"ipv4",a.message,e),a.version!=="v4"&&st(r,"ipv6",a.message,e);break}case"emoji":Ae(r,nr.emoji,a.message,e);break;case"ulid":{Ae(r,nr.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}l(Ws,"parseStringDef");var Jv=l(t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),"escapeNonAlphaNumeric"),st=l((t,e,r,n)=>{var a;t.format||(a=t.anyOf)!=null&&a.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(d({format:t.format},t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(d({format:e},r&&n.errorMessages&&{errorMessage:{format:r}}))):G(t,"format",e,r,n)},"addFormat"),Ae=l((t,e,r,n)=>{var a;t.pattern||(a=t.allOf)!=null&&a.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(d({pattern:t.pattern},t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(d({pattern:e},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):G(t,"pattern",e,r,n)},"addPattern");function Vs(t,e){var r,n,a,s,i;if(e.target==="openApi3"&&((r=t.keyType)==null?void 0:r._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((c,p)=>{var m;return h(d({},c),{[p]:(m=V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"properties",p]})))!=null?m:{}})},{}),additionalProperties:!1};let o={type:"object",additionalProperties:(n=V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:{}};if(e.target==="openApi3")return o;if(((a=t.keyType)==null?void 0:a._def.typeName)==="ZodString"&&((s=t.keyType._def.checks)!=null&&s.length)){let c=Object.entries(Ws(t.keyType._def,e)).reduce((p,[m,T])=>m==="type"?p:h(d({},p),{[m]:T}),{});return h(d({},o),{propertyNames:c})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return h(d({},o),{propertyNames:{enum:t.keyType._def.values}});return o}l(Vs,"parseRecordDef");function gd(t,e){if(e.mapStrategy==="record")return Vs(t,e);let r=V(t.keyType._def,h(d({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},n=V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}l(gd,"parseMapDef");function hd(t){let e=t.values,n=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),a=Array.from(new Set(n.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:n.filter(s=>typeof s=="string"||typeof s=="number")}}l(hd,"parseNativeEnumDef");function md(){return{not:{}}}l(md,"parseNeverDef");function yd(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}l(yd,"parseNullDef");var Dn={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function vd(t,e){if(e.target==="openApi3")return No(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Dn&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((a,s)=>{let i=Dn[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((a,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(n.length===r.length){let a=n.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:r.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,a)=>[...n,...a._def.values.filter(s=>!n.includes(s))],[])};return No(t,e)}l(vd,"parseUnionDef");var No=l((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,s)=>V(a._def,h(d({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${s}`]}))).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0)),n=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(r.length)return e.unionStrategy==="anyOf"?d({anyOf:r},n):d({oneOf:r},n)},"asUnionOf");function _d(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Dn[t.innerType._def.typeName],nullable:!0}:{type:[Dn[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=V(t.innerType._def,h(d({},e),{currentPath:[...e.currentPath]}));return n&&h(d({},n),{nullable:!0})}let r=V(t.innerType._def,h(d({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return r&&{anyOf:[r,{type:"null"}]}}l(_d,"parseNullableDef");function Td(t,e){let r=d({type:"number"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",zs(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?G(r,"minimum",n.value,n.message,e):G(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),G(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?G(r,"maximum",n.value,n.message,e):G(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),G(r,"maximum",n.value,n.message,e));break;case"multipleOf":G(r,"multipleOf",n.value,n.message,e);break}return r}l(Td,"parseNumberDef");function bd(t,e){var r;let n=h(d({type:"object"},Object.entries(t.shape()).reduce((a,[s,i])=>{if(i===void 0||i._def===void 0)return a;let o=V(i._def,h(d({},e),{currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]}));return o===void 0?a:{properties:h(d({},a.properties),{[s]:o}),required:i.isOptional()?a.required:[...a.required,s]}},{properties:{},required:[]})),{additionalProperties:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":(r=V(t.catchall._def,h(d({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:!0});return n.required.length||delete n.required,n}l(bd,"parseObjectDef");var Yv=l((t,e)=>{var r;if(e.currentPath.toString()===((r=e.propertyPath)==null?void 0:r.toString()))return V(t.innerType._def,e);let n=V(t.innerType._def,h(d({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return n?{anyOf:[{not:{}},n]}:{}},"parseOptionalDef"),Xv=l((t,e)=>{if(e.pipeStrategy==="input")return V(t.in._def,e);if(e.pipeStrategy==="output")return V(t.out._def,e);let r=V(t.in._def,h(d({},e),{currentPath:[...e.currentPath,"allOf","0"]})),n=V(t.out._def,h(d({},e),{currentPath:[...e.currentPath,"allOf",r?"1":"0"]}));return{allOf:[r,n].filter(a=>a!==void 0)}},"parsePipelineDef");function wd(t,e){return V(t.type._def,e)}l(wd,"parsePromiseDef");function Pd(t,e){let n={type:"array",uniqueItems:!0,items:V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&G(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&G(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}l(Pd,"parseSetDef");function kd(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>V(r._def,h(d({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:V(t.rest._def,h(d({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>V(r._def,h(d({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[])}}l(kd,"parseTupleDef");function Ed(){return{not:{}}}l(Ed,"parseUndefinedDef");function xd(){return{}}l(xd,"parseUnknownDef");var Qv=l((t,e)=>V(t.innerType._def,e),"parseReadonlyDef");function Sd(t){return{$ref:t.uri}}l(Sd,"parseRefDef");function V(t,e,r=!1){let n=e.seen.get(t);if(n&&!r){let i=e_(n,e);if(i!==void 0)return i}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let s=r_(t,t.typeName,e);return s&&n_(t,e,s),a.jsonSchema=s,s}l(V,"parseDef");var e_=l((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:t_(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,n)=>e.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),t_=l((t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")},"getRelativePath"),r_=l((t,e,r)=>{switch(e){case"ZodString":return Ws(t,r);case"ZodNumber":return Td(t,r);case"ZodObject":return bd(t,r);case"ZodBigInt":return sd(t,r);case"ZodBoolean":return id(t);case"ZodDate":return ld(t,r);case"ZodUndefined":return Ed();case"ZodNull":return yd(r);case"ZodArray":return ad(t,r);case"ZodUnion":case"ZodDiscriminatedUnion":return vd(t,r);case"ZodIntersection":return fd(t,r);case"ZodTuple":return kd(t,r);case"ZodRecord":return Vs(t,r);case"ZodRef":return Sd(t);case"ZodLiteral":return pd(t,r);case"ZodEnum":return dd(t);case"ZodNativeEnum":return hd(t);case"ZodNullable":return _d(t,r);case"ZodOptional":return Yv(t,r);case"ZodMap":return gd(t,r);case"ZodSet":return Pd(t,r);case"ZodLazy":return V(t.getter()._def,r);case"ZodPromise":return wd(t,r);case"ZodNaN":case"ZodNever":return md();case"ZodEffects":return cd(t,r);case"ZodAny":return nd();case"ZodUnknown":return xd();case"ZodDefault":return ud(t,r);case"ZodBranded":return od(t,r);case"ZodReadonly":return Qv(t,r);case"ZodCatch":return Vv(t,r);case"ZodPipeline":return Xv(t,r);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(n=>{})(e)}},"selectParser"),n_=l((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),Object.assign(r,{[K]:d(d({},t[K]),r[K])}),r),"addMeta"),$o={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"string",mapStrategy:"entries",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",discriminator:!1,unionStrategy:"anyOf"},a_=l(t=>typeof t=="string"?h(d({},$o),{name:t}):d(d({},$o),t),"getDefaultOptions"),s_=l(t=>{let e=a_(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return h(d({},e),{currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,a])=>[a._def,{def:a._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))})},"getRefs"),i_=l((t,e)=>{var r;let n=s_(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[p,m])=>{var T;return h(d({},c),{[p]:(T=V(m._def,h(d({},n),{currentPath:[...n.basePath,n.definitionPath,p]}),!0))!=null?T:{}})},{}):void 0,s=typeof e=="string"?e:e?.name,i=(r=V(t._def,s===void 0?n:h(d({},n),{currentPath:[...n.basePath,n.definitionPath,s]}),!1))!=null?r:{},o=s===void 0?a?h(d({},i),{[n.definitionPath]:a}):i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:h(d({},a),{[s]:i})};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o},"zodToJsonSchema"),aa=l((t,e={target:"openApi3"})=>{let r=i_(t,e);return e.$schemaUrl===!1?delete r.$schema:typeof e.$schemaUrl=="string"&&(r.$schema=e.$schemaUrl),r},"zuiToJsonSchema"),o_=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],FT=bt.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Od=l(t=>ge.create().displayAs({id:"variable",params:d({type:t?.type||"any"},t?.params)}),"variable"),Cd=l(t=>ge.create().displayAs({id:"conversation",params:d({},t?.params)}),"conversation"),Id=l(t=>ge.create().displayAs({id:"user",params:d({},t?.params)}),"user"),Bd=l(t=>ge.create().displayAs({id:"message",params:d({},t?.params)}),"message"),Rd=l(t=>ge.create().displayAs({id:"agent",params:d({},t?.params)}),"agent"),Zd=l(t=>ge.create().displayAs({id:"event",params:d({},t?.params)}),"event"),Ad=l(t=>ge.create().displayAs({id:"table",params:d({},t?.params)}),"table"),Dd=l(t=>ge.create().displayAs({id:"tablerow",params:d({},t?.params)}),"tablerow"),Hd=l(t=>ge.create().displayAs({id:"intent",params:d({},t?.params)}),"intent"),Md=l(()=>bt.create(o_).displayAs({id:"dropdown",params:{}}),"aimodel"),jd=l(t=>ge.create().displayAs({id:"datasource",params:d({},t)}),"datasource"),Nd=l(t=>ge.create().displayAs({id:"knowledgebase",params:d({},t)}),"knowledgebase"),$d={object:pt.lazycreate},Ud=l((t,e={message:`Input not instance of ${t.name}`})=>xs(r=>r instanceof t,e),"instanceOfType"),qs=ge.create,Gs=ea.create,Kd=Bs.create,Fd=Ln.create,Js=zn.create,Ld=qn.create,zd=Fs.create,Wd=ra.create,Vd=Qn.create,qd=gr.create,Gd=Dt.create,Jd=qe.create,Yd=Ls.create,Xd=$t.create,Qd=pt.create,ef=pt.strictCreate,tf=na.create,rf=Ss.create,nf=Gn.create,af=gt.create,sf=Rs.create,of=Zs.create,lf=_r.create,uf=Is.create,cf=As.create,df=Cs.create,ff=Jn.create,pf=Yn.create,gf=bt.create,hf=Xn.create,mf=vr.create,fs=Je.create,yf=je.create,vf=ft.create,l_=mr.create,_f=Je.createWithPreprocess,Tf=ta.create,bf=l(()=>qs().optional(),"ostring"),wf=l(()=>Gs().optional(),"onumber"),Pf=l(()=>Js().optional(),"oboolean"),kf=H.fromJsonSchema,Ef=H.fromObject,xf={string:l(t=>ge.create(h(d({},t),{coerce:!0})),"string"),number:l(t=>ea.create(h(d({},t),{coerce:!0})),"number"),boolean:l(t=>zn.create(h(d({},t),{coerce:!0})),"boolean"),bigint:l(t=>Ln.create(h(d({},t),{coerce:!0})),"bigint"),date:l(t=>qn.create(h(d({},t),{coerce:!0})),"date")},Sf=I,v=E,Of=l((t,e)=>t.anyOf.length?t.anyOf.length===1?ce(t.anyOf[0],h(d({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((r,n)=>ce(r,h(d({},e),{path:[...e.path,"anyOf",n]}))).join(", ")}])`:"z.any()","parseAnyOf"),u_=l(t=>{var e;return(e=t[K])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),c_=l(t=>"z.any()","parseDefault"),d_=l((t,e)=>`z.union([${t.type.map(r=>ce(h(d({},t),{type:r}),e)).join(", ")}])`,"parseMultipleType"),f_=l((t,e)=>`z.any().refine((value) => !${ce(t.not,h(d({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),p_=l(t=>"z.null()","parseNull"),g_=l(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),h_=l((t,...e)=>Object.keys(t).reduce((r,n)=>(e.includes(n)||(r[n]=t[n]),r),{}),"omit");function fe(t,e,r){var n;let a=t[e],s="";if(a!==void 0){let i=r({value:a,json:JSON.stringify(a)});if(i){let o=i[0],c=i.length===3?i[1]:"",p=i.length===3?i[2]:i[1];s+=o,((n=t.errorMessage)==null?void 0:n[e])!==void 0&&(s+=c+JSON.stringify(t.errorMessage[e])),s+=p}}return s}l(fe,"withMessage");var ir=Symbol("Original index"),m_=l(t=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];if(typeof n=="boolean")e.push(n?{[ir]:r}:{[ir]:r,not:{}});else{if(ir in n)return t;e.push(h(d({},n),{[ir]:r}))}}return e},"ensureOriginalIndex");function hr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let r=t.allOf[0];return ce(r,h(d({},e),{path:[...e.path,"allOf",r[ir]]}))}else{let[r,n]=g_(m_(t.allOf));return`z.intersection(${hr({allOf:r},e)}, ${hr({allOf:n},e)})`}}l(hr,"parseAllOf");var y_=l((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((n,a)=>ce(n,h(d({},e),{path:[...e.path,"items",a]})))}])`;let r=t.items?`z.array(${ce(t.items,h(d({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return r+=fe(t,"minItems",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxItems",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseArray"),v_=l(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),__=l(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),T_=l((t,e)=>{let r=ce(t.if,h(d({},e),{path:[...e.path,"if"]})),n=ce(t.then,h(d({},e),{path:[...e.path,"then"]})),a=ce(t.else,h(d({},e),{path:[...e.path,"else"]}));return`z.union([${n}, ${a}]).superRefine((value,ctx) => {
30
+ ${T.join(" | ")}`;case v.ZodFirstPartyTypeKind.ZodIntersection:return`${z(o.left,s)} & ${z(o.right,s)}`;case v.ZodFirstPartyTypeKind.ZodTuple:return o.items.length===0?"":`[${o.items.map(N=>z(N,s)).join(", ")}]`;case v.ZodFirstPartyTypeKind.ZodRecord:let w=z(o.keyType,s),S=z(o.valueType,s);return`${R(o.description)} { [key: ${w}]: ${S} }`;case v.ZodFirstPartyTypeKind.ZodMap:return`Map<${z(o.keyType,s)}, ${z(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodSet:return`Set<${z(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodFunction:let W=z(new fo(o.args),s),q=z(new po(o.returns),s);return`${R(o.description)}
31
+ (${W}) => ${q}`;case v.ZodFirstPartyTypeKind.ZodLazy:return z(o.getter(),s);case v.ZodFirstPartyTypeKind.ZodLiteral:let re=tl(o.value);return`${R(o.description)}
32
+ ${re}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(Me).join(" | ");case v.ZodFirstPartyTypeKind.ZodEffects:return z(o.schema,s);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new yl(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${z(o.innerType,s)} | undefined`;case v.ZodFirstPartyTypeKind.ZodNullable:return`${z(o.innerType,s)} | null`;case v.ZodFirstPartyTypeKind.ZodDefault:return z(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodCatch:return z(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${z(o.type,s)}>`;case v.ZodFirstPartyTypeKind.ZodBranded:return z(o.type,s);case v.ZodFirstPartyTypeKind.ZodPipeline:return z(o.in,s);case v.ZodFirstPartyTypeKind.ZodSymbol:return`${R(o.description)} symbol`.trim();case v.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${z(o.innerType,s)}>`;case v.ZodFirstPartyTypeKind.ZodRef:return nl(o.uri);default:M.assertNever(o)}}l(z,"sUnwrapZod");var Qg=l((t,e)=>{if(t.props.type==="none")return z(t.props.schema,e);let r=R(t.props.schema.description),n=t.props.schema.describe(""),a=z(n,e);if(t.props.type==="variable")return co(`${r}declare const ${t.props.identifier}: ${a};`);let s=t.props.args.length>0?`<${t.props.args.map(nl).join(", ")}>`:"";return co(`${r}type ${t.props.identifier}${s} = ${a};`)},"unwrapDeclaration"),eh=l(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),th=l((t,e)=>{let r=eh(e),n=t.getReferences();if(r==="none"){if(n.length>0)throw new Ja;return new Fr({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new _l;if(r==="variable"){if(n.length>0)throw new Ja;return new Fr({type:"variable",identifier:a,schema:t})}return new Fr({type:"type",identifier:a,schema:t,args:n})},"getDeclarationProps"),rh=typeof global=="object"&&global&&global.Object===Object&&global,xl=rh,nh=typeof self=="object"&&self&&self.Object===Object&&self,ah=xl||nh||Function("return this")(),Ue=ah,sh=Ue.Symbol,Ve=sh,Sl=Object.prototype,ih=Sl.hasOwnProperty,oh=Sl.toString,rr=Ve?Ve.toStringTag:void 0;function Ol(t){var e=ih.call(t,rr),r=t[rr];try{t[rr]=void 0;var n=!0}catch{}var a=oh.call(t);return n&&(e?t[rr]=r:delete t[rr]),a}l(Ol,"getRawTag");var lh=Ol,uh=Object.prototype,ch=uh.toString;function Cl(t){return ch.call(t)}l(Cl,"objectToString");var dh=Cl,fh="[object Null]",ph="[object Undefined]",go=Ve?Ve.toStringTag:void 0;function Il(t){return t==null?t===void 0?ph:fh:go&&go in Object(t)?lh(t):dh(t)}l(Il,"baseGetTag");var Wt=Il;function Bl(t){return t!=null&&typeof t=="object"}l(Bl,"isObjectLike");var jt=Bl,gh="[object Symbol]";function Rl(t){return typeof t=="symbol"||jt(t)&&Wt(t)==gh}l(Rl,"isSymbol");var gs=Rl;function Zl(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}l(Zl,"arrayMap");var hh=Zl,mh=Array.isArray,$e=mh,yh=1/0,ho=Ve?Ve.prototype:void 0,mo=ho?ho.toString:void 0;function hs(t){if(typeof t=="string")return t;if($e(t))return hh(t,hs)+"";if(gs(t))return mo?mo.call(t):"";var e=t+"";return e=="0"&&1/t==-yh?"-0":e}l(hs,"baseToString");var vh=hs;function Al(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}l(Al,"isObject");var ms=Al;function Dl(t){return t}l(Dl,"identity");var _h=Dl,Th="[object AsyncFunction]",bh="[object Function]",wh="[object GeneratorFunction]",Ph="[object Proxy]";function Hl(t){if(!ms(t))return!1;var e=Wt(t);return e==bh||e==wh||e==Th||e==Ph}l(Hl,"isFunction");var Ml=Hl,kh=Ue["__core-js_shared__"],La=kh,yo=function(){var t=/[^.]+$/.exec(La&&La.keys&&La.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function jl(t){return!!yo&&yo in t}l(jl,"isMasked");var Eh=jl,xh=Function.prototype,Sh=xh.toString;function Nl(t){if(t!=null){try{return Sh.call(t)}catch{}try{return t+""}catch{}}return""}l(Nl,"toSource");var gt=Nl,Oh=/[\\^$.*+?()[\]{}|]/g,Ch=/^\[object .+?Constructor\]$/,Ih=Function.prototype,Bh=Object.prototype,Rh=Ih.toString,Zh=Bh.hasOwnProperty,Ah=RegExp("^"+Rh.call(Zh).replace(Oh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $l(t){if(!ms(t)||Eh(t))return!1;var e=Ml(t)?Ah:Ch;return e.test(gt(t))}l($l,"baseIsNative");var Dh=$l;function Ul(t,e){return t?.[e]}l(Ul,"getValue");var Hh=Ul;function Kl(t,e){var r=Hh(t,e);return Dh(r)?r:void 0}l(Kl,"getNative");var ht=Kl,Mh=ht(Ue,"WeakMap"),Ya=Mh,jh=function(){try{var t=ht(Object,"defineProperty");return t({},"",{}),t}catch{}}(),vo=jh,Nh=9007199254740991,$h=/^(?:0|[1-9]\d*)$/;function Fl(t,e){var r=typeof t;return e=e??Nh,!!e&&(r=="number"||r!="symbol"&&$h.test(t))&&t>-1&&t%1==0&&t<e}l(Fl,"isIndex");var Ll=Fl;function zl(t,e,r){e=="__proto__"&&vo?vo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}l(zl,"baseAssignValue");var Uh=zl;function Wl(t,e){return t===e||t!==t&&e!==e}l(Wl,"eq");var Vl=Wl,Kh=9007199254740991;function ql(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Kh}l(ql,"isLength");var ys=ql;function Gl(t){return t!=null&&ys(t.length)&&!Ml(t)}l(Gl,"isArrayLike");var Fh=Gl,Lh=Object.prototype;function Jl(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Lh;return t===r}l(Jl,"isPrototype");var zh=Jl;function Yl(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}l(Yl,"baseTimes");var Wh=Yl,Vh="[object Arguments]";function Xl(t){return jt(t)&&Wt(t)==Vh}l(Xl,"baseIsArguments");var _o=Xl,Ql=Object.prototype,qh=Ql.hasOwnProperty,Gh=Ql.propertyIsEnumerable,Jh=_o(function(){return arguments}())?_o:function(t){return jt(t)&&qh.call(t,"callee")&&!Gh.call(t,"callee")},eu=Jh;function tu(){return!1}l(tu,"stubFalse");var Yh=tu,ru=typeof exports=="object"&&exports&&!exports.nodeType&&exports,To=ru&&typeof module=="object"&&module&&!module.nodeType&&module,Xh=To&&To.exports===ru,bo=Xh?Ue.Buffer:void 0,Qh=bo?bo.isBuffer:void 0,em=Qh||Yh,Xa=em,tm="[object Arguments]",rm="[object Array]",nm="[object Boolean]",am="[object Date]",sm="[object Error]",im="[object Function]",om="[object Map]",lm="[object Number]",um="[object Object]",cm="[object RegExp]",dm="[object Set]",fm="[object String]",pm="[object WeakMap]",gm="[object ArrayBuffer]",hm="[object DataView]",mm="[object Float32Array]",ym="[object Float64Array]",vm="[object Int8Array]",_m="[object Int16Array]",Tm="[object Int32Array]",bm="[object Uint8Array]",wm="[object Uint8ClampedArray]",Pm="[object Uint16Array]",km="[object Uint32Array]",X={};X[mm]=X[ym]=X[vm]=X[_m]=X[Tm]=X[bm]=X[wm]=X[Pm]=X[km]=!0;X[tm]=X[rm]=X[gm]=X[nm]=X[hm]=X[am]=X[sm]=X[im]=X[om]=X[lm]=X[um]=X[cm]=X[dm]=X[fm]=X[pm]=!1;function nu(t){return jt(t)&&ys(t.length)&&!!X[Wt(t)]}l(nu,"baseIsTypedArray");var Em=nu;function au(t){return function(e){return t(e)}}l(au,"baseUnary");var xm=au,su=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lr=su&&typeof module=="object"&&module&&!module.nodeType&&module,Sm=lr&&lr.exports===su,za=Sm&&xl.process,Om=function(){try{var t=lr&&lr.require&&lr.require("util").types;return t||za&&za.binding&&za.binding("util")}catch{}}(),wo=Om,Po=wo&&wo.isTypedArray,Cm=Po?xm(Po):Em,iu=Cm,Im=Object.prototype,Bm=Im.hasOwnProperty;function ou(t,e){var r=$e(t),n=!r&&eu(t),a=!r&&!n&&Xa(t),s=!r&&!n&&!a&&iu(t),i=r||n||a||s,o=i?Wh(t.length,String):[],c=o.length;for(var p in t)(e||Bm.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Ll(p,c)))&&o.push(p);return o}l(ou,"arrayLikeKeys");var Rm=ou;function lu(t,e){return function(r){return t(e(r))}}l(lu,"overArg");var Zm=lu,Am=Zm(Object.keys,Object),Dm=Am,Hm=Object.prototype,Mm=Hm.hasOwnProperty;function uu(t){if(!zh(t))return Dm(t);var e=[];for(var r in Object(t))Mm.call(t,r)&&r!="constructor"&&e.push(r);return e}l(uu,"baseKeys");var jm=uu;function cu(t){return Fh(t)?Rm(t):jm(t)}l(cu,"keys");var vs=cu,Nm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$m=/^\w*$/;function du(t,e){if($e(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||gs(t)?!0:$m.test(t)||!Nm.test(t)||e!=null&&t in Object(e)}l(du,"isKey");var _s=du,Um=ht(Object,"create"),ur=Um;function fu(){this.__data__=ur?ur(null):{},this.size=0}l(fu,"hashClear");var Km=fu;function pu(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}l(pu,"hashDelete");var Fm=pu,Lm="__lodash_hash_undefined__",zm=Object.prototype,Wm=zm.hasOwnProperty;function gu(t){var e=this.__data__;if(ur){var r=e[t];return r===Lm?void 0:r}return Wm.call(e,t)?e[t]:void 0}l(gu,"hashGet");var Vm=gu,qm=Object.prototype,Gm=qm.hasOwnProperty;function hu(t){var e=this.__data__;return ur?e[t]!==void 0:Gm.call(e,t)}l(hu,"hashHas");var Jm=hu,Ym="__lodash_hash_undefined__";function mu(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ur&&e===void 0?Ym:e,this}l(mu,"hashSet");var Xm=mu;function mt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l(mt,"Hash");mt.prototype.clear=Km;mt.prototype.delete=Fm;mt.prototype.get=Vm;mt.prototype.has=Jm;mt.prototype.set=Xm;var ko=mt;function yu(){this.__data__=[],this.size=0}l(yu,"listCacheClear");var Qm=yu;function vu(t,e){for(var r=t.length;r--;)if(Vl(t[r][0],e))return r;return-1}l(vu,"assocIndexOf");var jn=vu,ey=Array.prototype,ty=ey.splice;function _u(t){var e=this.__data__,r=jn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():ty.call(e,r,1),--this.size,!0}l(_u,"listCacheDelete");var ry=_u;function Tu(t){var e=this.__data__,r=jn(e,t);return r<0?void 0:e[r][1]}l(Tu,"listCacheGet");var ny=Tu;function bu(t){return jn(this.__data__,t)>-1}l(bu,"listCacheHas");var ay=bu;function wu(t,e){var r=this.__data__,n=jn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}l(wu,"listCacheSet");var sy=wu;function yt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l(yt,"ListCache");yt.prototype.clear=Qm;yt.prototype.delete=ry;yt.prototype.get=ny;yt.prototype.has=ay;yt.prototype.set=sy;var Nn=yt,iy=ht(Ue,"Map"),cr=iy;function Pu(){this.size=0,this.__data__={hash:new ko,map:new(cr||Nn),string:new ko}}l(Pu,"mapCacheClear");var oy=Pu;function ku(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}l(ku,"isKeyable");var ly=ku;function Eu(t,e){var r=t.__data__;return ly(e)?r[typeof e=="string"?"string":"hash"]:r.map}l(Eu,"getMapData");var $n=Eu;function xu(t){var e=$n(this,t).delete(t);return this.size-=e?1:0,e}l(xu,"mapCacheDelete");var uy=xu;function Su(t){return $n(this,t).get(t)}l(Su,"mapCacheGet");var cy=Su;function Ou(t){return $n(this,t).has(t)}l(Ou,"mapCacheHas");var dy=Ou;function Cu(t,e){var r=$n(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}l(Cu,"mapCacheSet");var fy=Cu;function vt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}l(vt,"MapCache");vt.prototype.clear=oy;vt.prototype.delete=uy;vt.prototype.get=cy;vt.prototype.has=dy;vt.prototype.set=fy;var Un=vt,py="Expected a function";function Kn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(py);var r=l(function(){var n=arguments,a=e?e.apply(this,n):n[0],s=r.cache;if(s.has(a))return s.get(a);var i=t.apply(this,n);return r.cache=s.set(a,i)||s,i},"memoized");return r.cache=new(Kn.Cache||Un),r}l(Kn,"memoize");Kn.Cache=Un;var gy=Kn,hy=500;function Iu(t){var e=gy(t,function(n){return r.size===hy&&r.clear(),n}),r=e.cache;return e}l(Iu,"memoizeCapped");var my=Iu,yy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,vy=/\\(\\)?/g,_y=my(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(yy,function(r,n,a,s){e.push(a?s.replace(vy,"$1"):n||r)}),e}),Ty=_y;function Bu(t){return t==null?"":vh(t)}l(Bu,"toString");var by=Bu;function Ru(t,e){return $e(t)?t:_s(t,e)?[t]:Ty(by(t))}l(Ru,"castPath");var Zu=Ru,wy=1/0;function Au(t){if(typeof t=="string"||gs(t))return t;var e=t+"";return e=="0"&&1/t==-wy?"-0":e}l(Au,"toKey");var Fn=Au;function Du(t,e){e=Zu(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Fn(e[r++])];return r&&r==n?t:void 0}l(Du,"baseGet");var Hu=Du;function Mu(t,e,r){var n=t==null?void 0:Hu(t,e);return n===void 0?r:n}l(Mu,"get");var Py=Mu;function ju(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}l(ju,"arrayPush");var ky=ju;function Nu(){this.__data__=new Nn,this.size=0}l(Nu,"stackClear");var Ey=Nu;function $u(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}l($u,"stackDelete");var xy=$u;function Uu(t){return this.__data__.get(t)}l(Uu,"stackGet");var Sy=Uu;function Ku(t){return this.__data__.has(t)}l(Ku,"stackHas");var Oy=Ku,Cy=200;function Fu(t,e){var r=this.__data__;if(r instanceof Nn){var n=r.__data__;if(!cr||n.length<Cy-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Un(n)}return r.set(t,e),this.size=r.size,this}l(Fu,"stackSet");var Iy=Fu;function _t(t){var e=this.__data__=new Nn(t);this.size=e.size}l(_t,"Stack");_t.prototype.clear=Ey;_t.prototype.delete=xy;_t.prototype.get=Sy;_t.prototype.has=Oy;_t.prototype.set=Iy;var Lr=_t;function Lu(t,e){for(var r=-1,n=t==null?0:t.length,a=0,s=[];++r<n;){var i=t[r];e(i,r,t)&&(s[a++]=i)}return s}l(Lu,"arrayFilter");var By=Lu;function zu(){return[]}l(zu,"stubArray");var Ry=zu,Zy=Object.prototype,Ay=Zy.propertyIsEnumerable,Eo=Object.getOwnPropertySymbols,Dy=Eo?function(t){return t==null?[]:(t=Object(t),By(Eo(t),function(e){return Ay.call(t,e)}))}:Ry,Hy=Dy;function Wu(t,e,r){var n=e(t);return $e(t)?n:ky(n,r(t))}l(Wu,"baseGetAllKeys");var My=Wu;function Vu(t){return My(t,vs,Hy)}l(Vu,"getAllKeys");var xo=Vu,jy=ht(Ue,"DataView"),Qa=jy,Ny=ht(Ue,"Promise"),es=Ny,$y=ht(Ue,"Set"),ts=$y,So="[object Map]",Uy="[object Object]",Oo="[object Promise]",Co="[object Set]",Io="[object WeakMap]",Bo="[object DataView]",Ky=gt(Qa),Fy=gt(cr),Ly=gt(es),zy=gt(ts),Wy=gt(Ya),it=Wt;(Qa&&it(new Qa(new ArrayBuffer(1)))!=Bo||cr&&it(new cr)!=So||es&&it(es.resolve())!=Oo||ts&&it(new ts)!=Co||Ya&&it(new Ya)!=Io)&&(it=l(function(t){var e=Wt(t),r=e==Uy?t.constructor:void 0,n=r?gt(r):"";if(n)switch(n){case Ky:return Bo;case Fy:return So;case Ly:return Oo;case zy:return Co;case Wy:return Io}return e},"getTag"));var Ro=it,Vy=Ue.Uint8Array,Zo=Vy,qy="__lodash_hash_undefined__";function qu(t){return this.__data__.set(t,qy),this}l(qu,"setCacheAdd");var Gy=qu;function Gu(t){return this.__data__.has(t)}l(Gu,"setCacheHas");var Jy=Gu;function dr(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Un;++e<r;)this.add(t[e])}l(dr,"SetCache");dr.prototype.add=dr.prototype.push=Gy;dr.prototype.has=Jy;var Yy=dr;function Ju(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}l(Ju,"arraySome");var Xy=Ju;function Yu(t,e){return t.has(e)}l(Yu,"cacheHas");var Qy=Yu,ev=1,tv=2;function Xu(t,e,r,n,a,s){var i=r&ev,o=t.length,c=e.length;if(o!=c&&!(i&&c>o))return!1;var p=s.get(t),m=s.get(e);if(p&&m)return p==e&&m==t;var T=-1,O=!0,w=r&tv?new Yy:void 0;for(s.set(t,e),s.set(e,t);++T<o;){var S=t[T],W=e[T];if(n)var q=i?n(W,S,T,e,t,s):n(S,W,T,t,e,s);if(q!==void 0){if(q)continue;O=!1;break}if(w){if(!Xy(e,function(re,J){if(!Qy(w,J)&&(S===re||a(S,re,r,n,s)))return w.push(J)})){O=!1;break}}else if(!(S===W||a(S,W,r,n,s))){O=!1;break}}return s.delete(t),s.delete(e),O}l(Xu,"equalArrays");var Qu=Xu;function ec(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}l(ec,"mapToArray");var rv=ec;function tc(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}l(tc,"setToArray");var nv=tc,av=1,sv=2,iv="[object Boolean]",ov="[object Date]",lv="[object Error]",uv="[object Map]",cv="[object Number]",dv="[object RegExp]",fv="[object Set]",pv="[object String]",gv="[object Symbol]",hv="[object ArrayBuffer]",mv="[object DataView]",Ao=Ve?Ve.prototype:void 0,Wa=Ao?Ao.valueOf:void 0;function rc(t,e,r,n,a,s,i){switch(r){case mv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case hv:return!(t.byteLength!=e.byteLength||!s(new Zo(t),new Zo(e)));case iv:case ov:case cv:return Vl(+t,+e);case lv:return t.name==e.name&&t.message==e.message;case dv:case pv:return t==e+"";case uv:var o=rv;case fv:var c=n&av;if(o||(o=nv),t.size!=e.size&&!c)return!1;var p=i.get(t);if(p)return p==e;n|=sv,i.set(t,e);var m=Qu(o(t),o(e),n,a,s,i);return i.delete(t),m;case gv:if(Wa)return Wa.call(t)==Wa.call(e)}return!1}l(rc,"equalByTag");var yv=rc,vv=1,_v=Object.prototype,Tv=_v.hasOwnProperty;function nc(t,e,r,n,a,s){var i=r&vv,o=xo(t),c=o.length,p=xo(e),m=p.length;if(c!=m&&!i)return!1;for(var T=c;T--;){var O=o[T];if(!(i?O in e:Tv.call(e,O)))return!1}var w=s.get(t),S=s.get(e);if(w&&S)return w==e&&S==t;var W=!0;s.set(t,e),s.set(e,t);for(var q=i;++T<c;){O=o[T];var re=t[O],J=e[O];if(n)var N=i?n(J,re,O,e,t,s):n(re,J,O,t,e,s);if(!(N===void 0?re===J||a(re,J,r,n,s):N)){W=!1;break}q||(q=O=="constructor")}if(W&&!q){var F=t.constructor,ue=e.constructor;F!=ue&&"constructor"in t&&"constructor"in e&&!(typeof F=="function"&&F instanceof F&&typeof ue=="function"&&ue instanceof ue)&&(W=!1)}return s.delete(t),s.delete(e),W}l(nc,"equalObjects");var bv=nc,wv=1,Do="[object Arguments]",Ho="[object Array]",Kr="[object Object]",Pv=Object.prototype,Mo=Pv.hasOwnProperty;function ac(t,e,r,n,a,s){var i=$e(t),o=$e(e),c=i?Ho:Ro(t),p=o?Ho:Ro(e);c=c==Do?Kr:c,p=p==Do?Kr:p;var m=c==Kr,T=p==Kr,O=c==p;if(O&&Xa(t)){if(!Xa(e))return!1;i=!0,m=!1}if(O&&!m)return s||(s=new Lr),i||iu(t)?Qu(t,e,r,n,a,s):yv(t,e,c,r,n,a,s);if(!(r&wv)){var w=m&&Mo.call(t,"__wrapped__"),S=T&&Mo.call(e,"__wrapped__");if(w||S){var W=w?t.value():t,q=S?e.value():e;return s||(s=new Lr),a(W,q,r,n,s)}}return O?(s||(s=new Lr),bv(t,e,r,n,a,s)):!1}l(ac,"baseIsEqualDeep");var kv=ac;function Ts(t,e,r,n,a){return t===e?!0:t==null||e==null||!jt(t)&&!jt(e)?t!==t&&e!==e:kv(t,e,r,n,Ts,a)}l(Ts,"baseIsEqual");var bs=Ts,Ev=1,xv=2;function sc(t,e,r,n){var a=r.length,s=a,i=!n;if(t==null)return!s;for(t=Object(t);a--;){var o=r[a];if(i&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<s;){o=r[a];var c=o[0],p=t[c],m=o[1];if(i&&o[2]){if(p===void 0&&!(c in t))return!1}else{var T=new Lr;if(n)var O=n(p,m,c,t,e,T);if(!(O===void 0?bs(m,p,Ev|xv,n,T):O))return!1}}return!0}l(sc,"baseIsMatch");var Sv=sc;function ic(t){return t===t&&!ms(t)}l(ic,"isStrictComparable");var oc=ic;function lc(t){for(var e=vs(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,oc(a)]}return e}l(lc,"getMatchData");var Ov=lc;function uc(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}l(uc,"matchesStrictComparable");var cc=uc;function dc(t){var e=Ov(t);return e.length==1&&e[0][2]?cc(e[0][0],e[0][1]):function(r){return r===t||Sv(r,t,e)}}l(dc,"baseMatches");var Cv=dc;function fc(t,e){return t!=null&&e in Object(t)}l(fc,"baseHasIn");var Iv=fc;function pc(t,e,r){e=Zu(e,t);for(var n=-1,a=e.length,s=!1;++n<a;){var i=Fn(e[n]);if(!(s=t!=null&&r(t,i)))break;t=t[i]}return s||++n!=a?s:(a=t==null?0:t.length,!!a&&ys(a)&&Ll(i,a)&&($e(t)||eu(t)))}l(pc,"hasPath");var Bv=pc;function gc(t,e){return t!=null&&Bv(t,e,Iv)}l(gc,"hasIn");var Rv=gc,Zv=1,Av=2;function hc(t,e){return _s(t)&&oc(e)?cc(Fn(t),e):function(r){var n=Py(r,t);return n===void 0&&n===e?Rv(r,t):bs(e,n,Zv|Av)}}l(hc,"baseMatchesProperty");var Dv=hc;function mc(t){return function(e){return e?.[t]}}l(mc,"baseProperty");var Hv=mc;function yc(t){return function(e){return Hu(e,t)}}l(yc,"basePropertyDeep");var Mv=yc;function vc(t){return _s(t)?Hv(Fn(t)):Mv(t)}l(vc,"property");var jv=vc;function _c(t){return typeof t=="function"?t:t==null?_h:typeof t=="object"?$e(t)?Dv(t[0],t[1]):Cv(t):jv(t)}l(_c,"baseIteratee");var Nv=_c;function Tc(t){return function(e,r,n){for(var a=-1,s=Object(e),i=n(e),o=i.length;o--;){var c=i[t?o:++a];if(r(s[c],c,s)===!1)break}return e}}l(Tc,"createBaseFor");var $v=Tc,Uv=$v(),Kv=Uv;function bc(t,e){return t&&Kv(t,e,vs)}l(bc,"baseForOwn");var Fv=bc;function wc(t,e){return bs(t,e)}l(wc,"isEqual");var ct=wc;function Pc(t,e){var r={};return e=Nv(e,3),Fv(t,function(n,a,s){Uh(r,a,e(n,a,s))}),r}l(Pc,"mapValues");var Lv=Pc;function ws(t){return se(t)}l(ws,"toTypescriptSchema");function se(t){let r=t._def;switch(r.typeName){case v.ZodFirstPartyTypeKind.ZodString:return`${R(r.description)}z.string()`.trim();case v.ZodFirstPartyTypeKind.ZodNumber:return`${R(r.description)}z.number()`.trim();case v.ZodFirstPartyTypeKind.ZodNaN:return`${R(r.description)}z.nan()`.trim();case v.ZodFirstPartyTypeKind.ZodBigInt:return`${R(r.description)}z.bigint()`.trim();case v.ZodFirstPartyTypeKind.ZodBoolean:return`${R(t._def.description)}z.boolean()`.trim();case v.ZodFirstPartyTypeKind.ZodDate:return`${R(r.description)}z.date()`.trim();case v.ZodFirstPartyTypeKind.ZodUndefined:return`${R(r.description)}z.undefined()`.trim();case v.ZodFirstPartyTypeKind.ZodNull:return`${R(r.description)}z.null()`.trim();case v.ZodFirstPartyTypeKind.ZodAny:return`${R(r.description)}z.any()`.trim();case v.ZodFirstPartyTypeKind.ZodUnknown:return`${R(r.description)}z.unknown()`.trim();case v.ZodFirstPartyTypeKind.ZodNever:return`${R(r.description)}z.never()`.trim();case v.ZodFirstPartyTypeKind.ZodVoid:return`${R(r.description)}z.void()`.trim();case v.ZodFirstPartyTypeKind.ZodArray:return`z.array(${se(r.type)})`;case v.ZodFirstPartyTypeKind.ZodObject:let n=Lv(r.shape(),ue=>ue instanceof v.Schema?se(ue):"z.any()");return[`${R(r.description)}z.object({`,...Object.entries(n).map(([ue,Le])=>` ${ue}: ${Le},`),"})"].join(`
33
+ `).trim();case v.ZodFirstPartyTypeKind.ZodUnion:let a=r.options.map(se);return`${R(r.description)}z.union([${a.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let s=r.options.map(se),i=Me(r.discriminator);return`${R(r.description)}z.discriminatedUnion(${i}, [${s.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodIntersection:let o=se(r.left),c=se(r.right);return`${R(r.description)}z.intersection(${o}, ${c})`.trim();case v.ZodFirstPartyTypeKind.ZodTuple:let p=r.items.map(se);return`${R(r.description)}z.tuple([${p.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodRecord:let m=se(r.keyType),T=se(r.valueType);return`${R(r.description)}z.record(${m}, ${T})`.trim();case v.ZodFirstPartyTypeKind.ZodMap:let O=se(r.keyType),w=se(r.valueType);return`${R(r.description)}z.map(${O}, ${w})`.trim();case v.ZodFirstPartyTypeKind.ZodSet:return`${R(r.description)}z.set(${se(r.valueType)})`.trim();case v.ZodFirstPartyTypeKind.ZodFunction:let S=r.args.items.map(se),W=S.length?`.args(${S.join(", ")})`:"",q=se(r.returns);return`${R(r.description)}z.function()${W}.returns(${q})`.trim();case v.ZodFirstPartyTypeKind.ZodLazy:return`${R(r.description)}z.lazy(() => ${se(r.getter())})`.trim();case v.ZodFirstPartyTypeKind.ZodLiteral:let re=Me(r.value);return`${R(r.description)}z.literal(${re})`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:let J=r.values.map(Me);return`${R(r.description)}z.enum([${J.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodEffects:throw new st(v.ZodFirstPartyTypeKind.ZodEffects);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new st(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${R(r.description)}z.optional(${se(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodNullable:return`${R(r.description)}z.nullable(${se(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodDefault:let N=rl(r.defaultValue());return`${R(r.description)}${se(r.innerType)}.default(${N})`.trim();case v.ZodFirstPartyTypeKind.ZodCatch:throw new st(v.ZodFirstPartyTypeKind.ZodCatch);case v.ZodFirstPartyTypeKind.ZodPromise:return`${R(r.description)}z.promise(${se(r.type)})`.trim();case v.ZodFirstPartyTypeKind.ZodBranded:throw new st(v.ZodFirstPartyTypeKind.ZodBranded);case v.ZodFirstPartyTypeKind.ZodPipeline:throw new st(v.ZodFirstPartyTypeKind.ZodPipeline);case v.ZodFirstPartyTypeKind.ZodSymbol:throw new st(v.ZodFirstPartyTypeKind.ZodSymbol);case v.ZodFirstPartyTypeKind.ZodReadonly:return`${R(r.description)}z.readonly(${se(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodRef:let F=Me(r.uri);return`${R(r.description)}z.ref(${F})`.trim();default:M.assertNever(r)}}l(se,"sUnwrapZod");var kc=class{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}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}};l(kc,"ParseInputLazyPath");var xe=kc,jo=l((t,e)=>{if($t(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;let r=new Be(t.common.issues);return this._error=r,this._error}}},"handleResult"),Ec=class{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}dereference(e){return this}getReferences(){return[]}_getType(e){return He(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ve,ctx:{common:e.parent.common,data:e.data,parsedType:He(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(pr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let a={common:{issues:[],async:(n=r?.async)!=null?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},s=this._parseSync({data:e,path:a.path,parent:a});return jo(a,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:He(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(pr(a)?a:Promise.resolve(a));return jo(n,s)}refine(e,r){let n=l(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let i=e(a),o=l(()=>s.addIssue(d({code:_.custom},n(a))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new Je({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return je.create(this,this._def)}nullable(){return dt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ut.create(this,this._def)}promise(){return vr.create(this,this._def)}or(e){return na.create([this,e],this._def)}and(e){return Gn.create(this,e,this._def)}transform(e){return new Je(h(d({},Z(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let r=typeof e=="function"?e:()=>e;return new mr(h(d({},Z(this._def)),{innerType:this,defaultValue:r,typeName:"ZodDefault"}))}brand(){return new Wn(d({typeName:"ZodBranded",type:this},Z(this._def)))}catch(e){let r=typeof e=="function"?e:()=>e;return new Vn(h(d({},Z(this._def)),{innerType:this,catchValue:r,typeName:"ZodCatch"}))}describe(e){let r=this.constructor;return new r(h(d({},this._def),{description:e}))}pipe(e){return ta.create(this,e)}readonly(){return _r.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){for(let[r,n]of Object.entries(e))this._def[K]=h(d({},this._def[K]),{[r]:n});return this}getMetadata(){return d({},this._def[K])}setMetadata(e){this._def[K]=d({},e)}get ui(){let e=this._getMetadataRoot();return d({},e._def[K])}_setZuiMeta(e,r){let n=this._getMetadataRoot();n._def[K]=h(d({},n._def[K]),{[e]:r})}_getMetadataRoot(){let e=this._def;switch(e.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":return e.innerType;case"ZodEffects":return e.schema;default:return this}}displayAs(e){var r,n,a;return(a=(r=this._def)[n=K])!=null||(r[n]={}),this._def[K].displayAs=[e.id,e.params],this}title(e){return this._setZuiMeta("title",e),this}hidden(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("hidden",r),this}disabled(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("disabled",r),this}placeholder(e){return this._setZuiMeta("placeholder",e),this}toJsonSchema(e){return aa(this,e)}toTypescript(e){return Qr(this,e)}toTypescriptSchema(){return ws(this)}async toTypescriptAsync(e){let r=Qr(this,h(d({},e),{formatter:void 0}));return e?.formatter&&(r=await e.formatter(r)),r}static fromObject(e,r){return Ft(e,r)}static fromJsonSchema(e){return Tr(e)}};l(Ec,"ZodType");var H=Ec,Ps=(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.ZodRef="ZodRef",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",t))(Ps||{}),M;(t=>{t.assertEqual=l(a=>a,"assertEqual");function e(a){}t.assertIs=e,l(e,"assertIs");function r(a){throw new Error("assertNever called")}t.assertNever=r,l(r,"assertNever"),t.arrayToEnum=l(a=>{let s={};for(let i of a)s[i]=i;return s},"arrayToEnum"),t.getValidEnumValues=l(a=>{let s=(0,t.objectKeys)(a).filter(o=>typeof a[a[o]]!="number"),i={};for(let o of s)i[o]=a[o];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=l(a=>(0,t.objectKeys)(a).map(function(s){return a[s]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},t.find=l((a,s)=>{for(let i of a)if(s(i))return i},"find"),t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,l(n,"joinValues"),t.jsonStringifyReplacer=l((a,s)=>typeof s=="bigint"?s.toString():s,"jsonStringifyReplacer"),t.compareFunctions=l((a,s)=>a.toString()===s.toString(),"compareFunctions")})(M||(M={}));var en;(t=>{t.mergeShapes=l((e,r)=>d(d({},e),r),"mergeShapes")})(en||(en={}));var k=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),He=l(t=>{switch(typeof t){case"undefined":return k.undefined;case"string":return k.string;case"number":return isNaN(t)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(t)?k.array:t===null?k.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?k.promise:typeof Map<"u"&&t instanceof Map?k.map:typeof Set<"u"&&t instanceof Set?k.set:typeof Date<"u"&&t instanceof Date?k.date:k.object;default:return k.unknown}},"getParsedType");function Z(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a,[K]:t?.[K]}:{errorMap:l((i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:r??o.defaultError},"customMap"),description:a,[K]:t?.[K]}}l(Z,"processCreateParams");var ks=l((t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===k.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:M.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;case _.unresolved_reference:r="Unresolved reference";break;default:r=e.defaultError,M.assertNever(t)}return{message:r}},"errorMap"),No=ks,_=M.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","unresolved_reference"]),xc=l(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),tn=class Sc extends Error{constructor(e){super(),this.issues=[],this.addIssue=l(n=>{this.issues=[...this.issues,n]},"addIssue"),this.addIssues=l((n=[])=>{this.issues=[...this.issues,...n]},"addIssues");let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},a=l(s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){let p=i.path[c];c===i.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(r(i))):o[p]=o[p]||{_errors:[]},o=o[p],c++}}},"processError");return a(this),n}static assert(e){if(!(e instanceof Sc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};l(tn,"ZodError");tn.create=l(t=>new tn(t),"create");var Be=tn,Oc=ks;function Es(t){Oc=t}l(Es,"setErrorMap");function Nt(){return Oc}l(Nt,"getErrorMap");var fr=l(t=>{var e;let{data:r,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o=h(d({},s),{path:i}),c="",p=a.filter(m=>!!m).slice().reverse();for(let m of p)c=m(o,{data:r,defaultError:c}).message;return h(d({},s),{path:i,message:(e=s.message)!=null?e:c})},"makeIssue"),Cc=[];function P(t,e){let r=fr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Nt(),ks].filter(n=>!!n)});t.common.issues.push(r)}l(P,"addIssueToContext");var Ic=class Bc{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let a of r){if(a.status==="aborted")return I;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let a of r)n.push({key:await a.key,value:await a.value});return Bc.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let a of r){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return I;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}};l(Ic,"ParseStatus");var ve=Ic,I=Object.freeze({status:"aborted"}),ut=l(t=>({status:"dirty",value:t}),"DIRTY"),pe=l(t=>({status:"valid",value:t}),"OK"),rn=l(t=>t.status==="aborted","isAborted"),nn=l(t=>t.status==="dirty","isDirty"),$t=l(t=>t.status==="valid","isValid"),pr=l(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),C;(t=>{t.errToObj=l(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=l(e=>typeof e=="string"?e:e?.message,"toString")})(C||(C={}));var an=class Rc extends H{constructor(){super(...arguments),this._any=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof Rc}};l(an,"ZodAny");an.create=l(t=>new an(d({typeName:"ZodAny"},Z(t))),"create");var gr=an,sn=class Bt extends H{dereference(e){return new Bt(h(d({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var r,n,a,s,i,o;return e instanceof Bt?ct((r=this._def.exactLength)==null?void 0:r.value,(n=e._def.exactLength)==null?void 0:n.value)&&ct((a=this._def.maxLength)==null?void 0:a.value,(s=e._def.maxLength)==null?void 0:s.value)&&ct((i=this._def.minLength)==null?void 0:i.value,(o=e._def.minLength)==null?void 0:o.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==k.array)return P(r,{code:_.invalid_type,expected:k.array,received:r.parsedType}),I;if(a.exactLength!==null){let i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(P(r,{code:i?_.too_big:_.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(P(r,{code:_.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(P(r,{code:_.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new xe(r,i,r.path,o)))).then(i=>ve.mergeArray(n,i));let s=[...r.data].map((i,o)=>a.type._parseSync(new xe(r,i,r.path,o)));return ve.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Bt(h(d({},this._def),{minLength:{value:e,message:C.toString(r)}}))}max(e,r){return new Bt(h(d({},this._def),{maxLength:{value:e,message:C.toString(r)}}))}length(e,r){return new Bt(h(d({},this._def),{exactLength:{value:e,message:C.toString(r)}}))}nonempty(e){return this.min(1,e)}};l(sn,"ZodArray");sn.create=l((t,e)=>new sn(d({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},Z(e))),"create");var Ut=sn,zv={compare:ct},Zc=class{constructor(e=[],r={}){this._options=d(d({},zv),r),this._items=[];for(let n of e)this.add(n)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(r=>this._options.compare(r,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(r=>e.has(r))}};l(Zc,"CustomSet");var le=Zc,on=class zr extends H{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)!==k.bigint){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.bigint,received:s.parsedType}),I}let n,a=new ve;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}isEqual(e){if(!(e instanceof zr)||this._def.coerce!==e._def.coerce)return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,a){return new zr(h(d({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(a)}]}))}_addCheck(e){return new zr(h(d({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};l(on,"ZodBigInt");on.create=l(t=>{var e;return new on(d({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},Z(t)))},"create");var Ln=on,ln=class Ac extends H{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==k.boolean){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.boolean,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof Ac?this._def.coerce===e._def.coerce:!1}};l(ln,"ZodBoolean");ln.create=l(t=>new ln(d({typeName:"ZodBoolean",coerce:t?.coerce||!1},Z(t))),"create");var zn=ln,Dc=Symbol("zod_brand"),Hc=class Mc extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}isEqual(e){return e instanceof Mc?this._def.type.isEqual(e._def.type):!1}};l(Hc,"ZodBranded");var Wn=Hc,un=class jc extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=h(d({},r),{common:h(d({},r.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:d({},n)});return pr(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Be(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Be(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof jc?this._def.innerType.isEqual(e._def.innerType)&&M.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};l(un,"ZodCatch");un.create=l((t,e)=>new un(d({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},Z(e))),"create");var Vn=un,xs=l((t,e={},r)=>t?gr.create().superRefine((n,a)=>{var s,i;if(!t(n)){let o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(s=o.fatal)!=null?s:r)!=null?i:!0,p=typeof o=="string"?{message:o}:o;a.addIssue(h(d({code:"custom"},p),{fatal:c}))}}):gr.create(),"custom"),cn=class rs extends H{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==k.date){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.date,received:s.parsedType}),I}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_date}),I}let n=new ve,a;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):M.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new rs(h(d({},this._def),{checks:[...this._def.checks,e]}))}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof rs))return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)&&this._def.coerce===e._def.coerce}};l(cn,"ZodDate");cn.create=l(t=>new cn(d({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},Z(t))),"create");var qn=cn,dn=class ns extends H{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===k.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}dereference(e){return new ns(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof ns?this._def.innerType.isEqual(e._def.innerType)&&ct(this._def.defaultValue(),e._def.defaultValue()):!1}};l(dn,"ZodDefault");dn.create=l((t,e,r)=>new dn(d({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},Z(r))),"create");var mr=dn,Ke=l(t=>Array.from(new Set(t)),"unique"),De=l(t=>t instanceof Jn?De(t.schema):t instanceof Je?De(t.innerType()):t instanceof Yn?[t.value]:t instanceof Tt?t.options:t instanceof Xn?M.objectValues(t.enum):t instanceof mr?De(t._def.innerType):t instanceof ra?[void 0]:t instanceof Qn?[null]:t instanceof je?[void 0,...De(t.unwrap())]:t instanceof dt?[null,...De(t.unwrap())]:t instanceof Wn||t instanceof _r?De(t.unwrap()):t instanceof Vn?De(t._def.innerType):[],"getDiscriminator"),Nc=class Rt extends H{dereference(e){let r=this.options.map(a=>a.dereference(e)),n=Rt._getOptionsMap(this.discriminator,r);return new Rt(h(d({},this._def),{options:r,optionsMap:n}))}getReferences(){return Ke(this.options.flatMap(e=>e.getReferences()))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.object)return P(r,{code:_.invalid_type,expected:k.object,received:r.parsedType}),I;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(P(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),I)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let a=Rt._getOptionsMap(e,r);return new Rt(d({typeName:"ZodDiscriminatedUnion",discriminator:e,options:r,optionsMap:a},Z(n)))}static _getOptionsMap(e,r){let n=new Map;for(let a of r){let s=De(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,a)}}return n}isEqual(e){if(!(e instanceof Rt)||this._def.discriminator!==e._def.discriminator)return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le(this._def.options,{compare:r}),a=new le(e._def.options,{compare:r});return n.isEqual(a)}};l(Nc,"ZodDiscriminatedUnion");var Ss=Nc;function yr(t,e){return new Tt(d({values:t,typeName:"ZodEnum"},Z(e)))}l(yr,"createZodEnum");var Os=class Wr extends H{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{expected:M.joinValues(n),received:r.parsedType,code:_.invalid_type}),I}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return P(r,{received:r.data,code:_.invalid_enum_value,options:n}),I}return pe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Wr.create(e,d(d({},this._def),r))}exclude(e,r=this._def){return Wr.create(this.options.filter(n=>!e.includes(n)),d(d({},this._def),r))}isEqual(e){if(!(e instanceof Wr))return!1;let r=new le(this._def.values),n=new le(e._def.values);return r.isEqual(n)}};l(Os,"ZodEnum");Os.create=yr;var Tt=Os,$c=class Zt extends H{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let r=this._def.args.dereference(e),n=this._def.returns.dereference(e);return new Zt(h(d({},this._def),{args:r,returns:n}))}getReferences(){return Ke([...this._def.args.getReferences(),...this._def.returns.getReferences()])}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.function)return P(r,{code:_.invalid_type,expected:k.function,received:r.parsedType}),I;function n(o,c){return fr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Nt(),No].filter(p=>!!p),issueData:{code:_.invalid_arguments,argumentsError:c}})}l(n,"makeArgsIssue");function a(o,c){return fr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Nt(),No].filter(p=>!!p),issueData:{code:_.invalid_return_type,returnTypeError:c}})}l(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof vr){let o=this;return pe(async function(...c){let p=new Be([]),m=await o._def.args.parseAsync(c,s).catch(w=>{throw p.addIssue(n(c,w)),p}),T=await Reflect.apply(i,this,m);return await o._def.returns._def.type.parseAsync(T,s).catch(w=>{throw p.addIssue(a(T,w)),p})})}else{let o=this;return pe(function(...c){let p=o._def.args.safeParse(c,s);if(!p.success)throw new Be([n(c,p.error)]);let m=Reflect.apply(i,this,p.data),T=o._def.returns.safeParse(m,s);if(!T.success)throw new Be([a(m,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Zt(h(d({},this._def),{args:pt.create(e).rest(Ht.create())}))}returns(e){return new Zt(h(d({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Zt(d({args:e||pt.create([]).rest(Ht.create()),returns:r||Ht.create(),typeName:"ZodFunction"},Z(n)))}isEqual(e){return e instanceof Zt&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};l($c,"ZodFunction");var Cs=$c;function fn(t,e){let r=He(t),n=He(e);if(t===e)return{valid:!0,data:t};if(r===k.object&&n===k.object){let a=M.objectKeys(e),s=M.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i=d(d({},t),e);for(let o of s){let c=fn(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===k.array&&n===k.array){if(t.length!==e.length)return{valid:!1};let a=[];for(let s=0;s<t.length;s++){let i=t[s],o=e[s],c=fn(i,o);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===k.date&&n===k.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}l(fn,"mergeValues");var pn=class as extends H{dereference(e){return new as(h(d({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Ke([...this._def.left.getReferences(),...this._def.right.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=l((s,i)=>{if(rn(s)||rn(i))return I;let o=fn(s.value,i.value);return o.valid?((nn(s)||nn(i))&&r.dirty(),{status:r.value,value:o.data}):(P(n,{code:_.invalid_intersection_types}),I)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}isEqual(e){if(!(e instanceof as))return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le([this._def.left,this._def.right],{compare:r}),a=new le([e._def.left,e._def.right],{compare:r});return n.isEqual(a)}};l(pn,"ZodIntersection");pn.create=l((t,e,r)=>new pn(d({left:t,right:e,typeName:"ZodIntersection"},Z(r))),"create");var Gn=pn,gn=class Uc extends H{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}isEqual(e){return e instanceof Uc?this._def.getter().isEqual(e._def.getter()):!1}};l(gn,"ZodLazy");gn.create=l((t,e)=>new gn(d({getter:t,typeName:"ZodLazy"},Z(e))),"create");var Jn=gn,hn=class Kc extends H{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return P(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),I}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof Kc?ct(this._def.value,e._def.value):!1}};l(hn,"ZodLiteral");hn.create=l((t,e)=>new hn(d({value:t,typeName:"ZodLiteral"},Z(e))),"create");var Yn=hn,mn=class ss extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new ss(h(d({},this._def),{keyType:r,valueType:n}))}getReferences(){return Ke([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.map)return P(n,{code:_.invalid_type,expected:k.map,received:n.parsedType}),I;let a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,c],p)=>({key:a._parse(new xe(n,o,n.path,[p,"key"])),value:s._parse(new xe(n,c,n.path,[p,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let p=await c.key,m=await c.value;if(p.status==="aborted"||m.status==="aborted")return I;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),o.set(p.value,m.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of i){let p=c.key,m=c.value;if(p.status==="aborted"||m.status==="aborted")return I;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),o.set(p.value,m.value)}return{status:r.value,value:o}}}isEqual(e){return!(!(e instanceof ss)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};l(mn,"ZodMap");mn.create=l((t,e,r)=>new mn(d({valueType:e,keyType:t,typeName:"ZodMap"},Z(r))),"create");var Is=mn,yn=class Fc extends H{_parse(e){if(this._getType(e)!==k.nan){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.nan,received:n.parsedType}),I}return{status:"valid",value:e.data}}isEqual(e){return e instanceof Fc}};l(yn,"ZodNaN");yn.create=l(t=>new yn(d({typeName:"ZodNaN"},Z(t))),"create");var Bs=yn,vn=class Lc extends H{_parse(e){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==k.string&&n.parsedType!==k.number){let a=M.objectValues(r);return P(n,{expected:M.joinValues(a),received:n.parsedType,code:_.invalid_type}),I}if(r.indexOf(e.data)===-1){let a=M.objectValues(r);return P(n,{received:n.data,code:_.invalid_enum_value,options:a}),I}return pe(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof Lc?ct(this._def.values,e._def.values):!1}};l(vn,"ZodNativeEnum");vn.create=l((t,e)=>new vn(d({values:t,typeName:"ZodNativeEnum"},Z(e))),"create");var Xn=vn,_n=class zc extends H{_parse(e){let r=this._getOrReturnCtx(e);return P(r,{code:_.invalid_type,expected:k.never,received:r.parsedType}),I}isEqual(e){return e instanceof zc}};l(_n,"ZodNever");_n.create=l(t=>new _n(d({typeName:"ZodNever"},Z(t))),"create");var qe=_n,Tn=class Wc extends H{_parse(e){if(this._getType(e)!==k.null){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.null,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof Wc}};l(Tn,"ZodNull");Tn.create=l(t=>new Tn(d({typeName:"ZodNull"},Z(t))),"create");var Qn=Tn,bn=class is extends H{dereference(e){return new is(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===k.null?pe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof is?this._def.innerType.isEqual(e._def.innerType):!1}};l(bn,"ZodNullable");bn.create=l((t,e)=>new bn(d({innerType:t,typeName:"ZodNullable"},Z(e))),"create");var dt=bn;function Vc(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(t.toFixed(a).replace(".","")),i=parseInt(e.toFixed(a).replace(".",""));return s%i/Math.pow(10,a)}l(Vc,"floatSafeRemainder");var wn=class Vr extends H{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)!==k.number){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.number,received:s.parsedType}),I}let n,a=new ve;for(let s of this._def.checks)s.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:_.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Vc(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),P(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),P(n,{code:_.not_finite,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,a){return new Vr(h(d({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(a)}]}))}_addCheck(e){return new Vr(h(d({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof Vr))return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)}};l(wn,"ZodNumber");wn.create=l(t=>new wn(d({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},Z(t))),"create");var ea=wn;function lt(t){if(t instanceof ft){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=je.create(lt(n))}return new ft(h(d({},t._def),{shape:l(()=>e,"shape")}))}else return t instanceof Ut?new Ut(h(d({},t._def),{type:lt(t.element)})):t instanceof je?je.create(lt(t.unwrap())):t instanceof dt?dt.create(lt(t.unwrap())):t instanceof pt?pt.create(t.items.map(e=>lt(e))):t}l(lt,"deepPartialify");var Ge=class Ee extends H{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=M.objectKeys(e);return this._cached={shape:e,keys:r}}dereference(e){let r=this._def.shape(),n={};for(let a in r)n[a]=r[a].dereference(e);return new Ee(h(d({},this._def),{shape:l(()=>n,"shape")}))}getReferences(){let e=this._def.shape(),r=[];for(let n in e)r.push(...e[n].getReferences());return Ke(r)}_parse(e){if(this._getType(e)!==k.object){let p=this._getOrReturnCtx(e);return P(p,{code:_.invalid_type,expected:k.object,received:p.parsedType}),I}let{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof qe&&this._def.unknownKeys==="strip"))for(let p in a.data)i.includes(p)||o.push(p);let c=[];for(let p of i){let m=s[p],T=a.data[p];c.push({key:{status:"valid",value:p},value:m._parse(new xe(a,T,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof qe){let p=this._def.unknownKeys;if(p==="passthrough")for(let m of o)c.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(p==="strict")o.length>0&&(P(a,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let m of o){let T=a.data[m];c.push({key:{status:"valid",value:m},value:p._parse(new xe(a,T,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let m of c){let T=await m.key;p.push({key:T,value:await m.value,alwaysSet:m.alwaysSet})}return p}).then(p=>ve.mergeObjectSync(n,p)):ve.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new Ee(d(h(d({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:l((r,n)=>{var a,s,i,o;let c=(i=(s=(a=this._def).errorMap)==null?void 0:s.call(a,r,n).message)!=null?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=C.errToObj(e).message)!=null?o:c}:{message:c}},"errorMap")}:{}))}strip(){return new Ee(h(d({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Ee(h(d({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new Ee(h(d({},this._def),{shape:l(()=>d(d({},this._def.shape()),e),"shape")}))}merge(e){return new Ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:l(()=>d(d({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ee(h(d({},this._def),{catchall:e}))}pick(e){let r={};return M.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}omit(e){let r={};return M.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}deepPartial(){return lt(this)}partial(e){let r={};return M.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a?.optional()}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}required(e){let r={};return M.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof je;)s=s._def.innerType;r[n]=s}}),new Ee(h(d({},this._def),{shape:l(()=>r,"shape")}))}keyof(){return yr(M.objectKeys(this.shape))}isEqual(e){if(!(e instanceof Ee)||!this._def.catchall.isEqual(e._def.catchall)||this._def.unknownKeys!==e._def.unknownKeys)return!1;let r=this._def.shape(),n=e._def.shape(),a=l((o,c)=>o[0]===c[0]&&o[1].isEqual(c[1]),"compare"),s=new le(Object.entries(r),{compare:a}),i=new le(Object.entries(n),{compare:a});return s.isEqual(i)}};l(Ge,"ZodObject");Ge.create=l((t,e)=>new Ge(d({shape:l(()=>t,"shape"),unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},Z(e))),"create");Ge.strictCreate=l((t,e)=>new Ge(d({shape:l(()=>t,"shape"),unknownKeys:"strict",catchall:qe.create(),typeName:"ZodObject"},Z(e))),"strictCreate");Ge.lazycreate=l((t,e)=>new Ge(d({shape:t,unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},Z(e))),"lazycreate");var ft=Ge,Pn=class os extends H{dereference(e){return new os(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===k.undefined?pe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof os?this._def.innerType.isEqual(e._def.innerType):!1}};l(Pn,"ZodOptional");Pn.create=l((t,e)=>new Pn(d({innerType:t,typeName:"ZodOptional"},Z(e))),"create");var je=Pn,qc=class qr extends H{dereference(e){return new qr(h(d({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Ke([...this._def.in.getReferences(),...this._def.out.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return l(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?I:s.status==="dirty"?(r.dirty(),ut(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?I:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new qr({in:e,out:r,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof qr)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};l(qc,"ZodPipeline");var ta=qc,kn=class ls extends H{unwrap(){return this._def.type}dereference(e){return new ls(h(d({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==k.promise&&r.common.async===!1)return P(r,{code:_.invalid_type,expected:k.promise,received:r.parsedType}),I;let n=r.parsedType===k.promise?r.data:Promise.resolve(r.data);return pe(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}isEqual(e){return e instanceof ls?this._def.type.isEqual(e._def.type):!1}};l(kn,"ZodPromise");kn.create=l((t,e)=>new kn(d({type:t,typeName:"ZodPromise"},Z(e))),"create");var vr=kn,En=class us extends H{dereference(e){return new us(h(d({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){let r=this._def.innerType._parse(e);return $t(r)&&(r.value=Object.freeze(r.value)),r}unwrap(){return this._def.innerType}isEqual(e){return e instanceof us?this._def.innerType.isEqual(e._def.innerType):!1}};l(En,"ZodReadonly");En.create=l((t,e)=>new En(d({innerType:t,typeName:"ZodReadonly"},Z(e))),"create");var _r=En,Gc=class ar extends H{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new ar(h(d({},this._def),{keyType:r,valueType:n}))}getReferences(){return Ke([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.object)return P(n,{code:_.invalid_type,expected:k.object,received:n.parsedType}),I;let a=[],s=this._def.keyType,i=this._def.valueType;for(let o in n.data)a.push({key:s._parse(new xe(n,o,n.path,o)),value:i._parse(new xe(n,n.data[o],n.path,o))});return n.common.async?ve.mergeObjectAsync(r,a):ve.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof H?new ar(d({keyType:e,valueType:r,typeName:"ZodRecord"},Z(n))):new ar(d({keyType:ge.create(),valueType:e,typeName:"ZodRecord"},Z(r)))}isEqual(e){return!(!(e instanceof ar)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};l(Gc,"ZodRecord");var Rs=Gc,xn=class Jc extends H{dereference(e){let r=e[this._def.uri];return r||this}getReferences(){return[this._def.uri]}_parse(e){let r=this._getOrReturnCtx(e);return P(r,{code:_.unresolved_reference}),I}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Jc?this._def.uri===e._def.uri:!1}};l(xn,"ZodRef");xn.create=l(t=>new xn({typeName:"ZodRef",uri:t}),"create");var Zs=xn,Sn=class sr extends H{dereference(e){return new sr(h(d({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.set)return P(n,{code:_.invalid_type,expected:k.set,received:n.parsedType}),I;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(P(n,{code:_.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(P(n,{code:_.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let p=new Set;for(let m of c){if(m.status==="aborted")return I;m.status==="dirty"&&r.dirty(),p.add(m.value)}return{status:r.value,value:p}}l(i,"finalizeSet");let o=[...n.data.values()].map((c,p)=>s._parse(new xe(n,c,n.path,p)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new sr(h(d({},this._def),{minSize:{value:e,message:C.toString(r)}}))}max(e,r){return new sr(h(d({},this._def),{maxSize:{value:e,message:C.toString(r)}}))}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}isEqual(e){var r,n,a,s;if(!(e instanceof sr))return!1;let i=(r=this._def.minSize)==null?void 0:r.value,o=(n=e._def.minSize)==null?void 0:n.value;if(i!==o)return!1;let c=(a=this._def.maxSize)==null?void 0:a.value,p=(s=e._def.maxSize)==null?void 0:s.value;return c!==p?!1:this._def.valueType.isEqual(e._def.valueType)}};l(Sn,"ZodSet");Sn.create=l((t,e)=>new Sn(d({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},Z(e))),"create");var As=Sn,Ds=/^c[^\s-]{8,}$/i,Hs=/^[a-z][a-z0-9]*$/,Ms=/^[0-9A-HJKMNP-TV-Z]{26}$/,js=/^[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,Ns=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Xc=l(t=>t===Yc,"isEmojiRegex"),Va,$s=/^(((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}))$/,Us=/^(([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})))$/,Ks=l(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function Qc(t,e){return!!((e==="v4"||!e)&&$s.test(t)||(e==="v6"||!e)&&Us.test(t))}l(Qc,"isValidIP");var On=class At extends H{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==k.string){let s=this._getOrReturnCtx(e);return P(s,{code:_.invalid_type,expected:k.string,received:s.parsedType}),I}let n=new ve,a;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),P(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?P(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&P(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Ns.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"email",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Va||(Va=new RegExp(Yc,"u")),Va.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"emoji",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")js.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"uuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Ds.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"cuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Hs.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"cuid2",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Ms.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"ulid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),P(a,{validation:"url",code:_.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"regex",code:_.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ks(s).test(e.data)||(a=this._getOrReturnCtx(e,a),P(a,{code:_.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Qc(e.data,s.version)||(a=this._getOrReturnCtx(e,a),P(a,{validation:"ip",code:_.invalid_string,message:s.message}),n.dirty()):M.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),d({validation:r,code:_.invalid_string},C.errToObj(n)))}_addCheck(e){return new At(h(d({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(d({kind:"email"},C.errToObj(e)))}url(e){return this._addCheck(d({kind:"url"},C.errToObj(e)))}emoji(e){return this._addCheck(d({kind:"emoji"},C.errToObj(e)))}uuid(e){return this._addCheck(d({kind:"uuid"},C.errToObj(e)))}cuid(e){return this._addCheck(d({kind:"cuid"},C.errToObj(e)))}cuid2(e){return this._addCheck(d({kind:"cuid2"},C.errToObj(e)))}ulid(e){return this._addCheck(d({kind:"ulid"},C.errToObj(e)))}ip(e){return this._addCheck(d({kind:"ip"},C.errToObj(e)))}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(d({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!=null?r:!1},C.errToObj(e?.message)))}regex(e,r){return this._addCheck(d({kind:"regex",regex:e},C.errToObj(r)))}includes(e,r){return this._addCheck(d({kind:"includes",value:e,position:r?.position},C.errToObj(r?.message)))}startsWith(e,r){return this._addCheck(d({kind:"startsWith",value:e},C.errToObj(r)))}endsWith(e,r){return this._addCheck(d({kind:"endsWith",value:e},C.errToObj(r)))}min(e,r){return this._addCheck(d({kind:"min",value:e},C.errToObj(r)))}max(e,r){return this._addCheck(d({kind:"max",value:e},C.errToObj(r)))}length(e,r){return this._addCheck(d({kind:"length",value:e},C.errToObj(r)))}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new At(h(d({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[K]=h(d({},this._def[K]),{secret:!0}),this}toLowerCase(){return new At(h(d({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new At(h(d({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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 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 minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}isEqual(e){if(!(e instanceof At))return!1;let r=new le(this._def.checks),n=new le(e._def.checks);return r.isEqual(n)}};l(On,"ZodString");On.create=l(t=>{var e;return new On(d({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},Z(t)))},"create");var ge=On,Cn=class ed extends H{_parse(e){if(this._getType(e)!==k.symbol){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.symbol,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof ed}};l(Cn,"ZodSymbol");Cn.create=l(t=>new Cn(d({typeName:"ZodSymbol"},Z(t))),"create");var Fs=Cn,Kt=class cs extends H{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new cs(h(d({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:l(i=>{P(n,i),i.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return I;let c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?I:c.status==="dirty"||r.value==="dirty"?ut(c.value):c});{if(r.value==="aborted")return I;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?I:o.status==="dirty"||r.value==="dirty"?ut(o.value):o}}if(a.type==="refinement"){let i=l(o=>{let c=a.refinement(o,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o},"executeRefinement");if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?I:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?I:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!$t(i))return i;let o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>$t(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):i);M.assertNever(a)}isEqual(e){return!(e instanceof cs)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:M.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):(M.assertNever(this._def.effect),!1)}};l(Kt,"ZodEffects");Kt.create=l((t,e,r)=>new Kt(d({schema:t,typeName:"ZodEffects",effect:e},Z(r))),"create");Kt.createWithPreprocess=l((t,e,r)=>new Kt(d({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},Z(r))),"createWithPreprocess");var Je=Kt,In=class Gr extends H{dereference(e){let r=this._def.items.map(a=>a.dereference(e)),n=this._def.rest?this._def.rest.dereference(e):null;return new Gr(h(d({},this._def),{items:r,rest:n}))}getReferences(){return Ke([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==k.array)return P(n,{code:_.invalid_type,expected:k.array,received:n.parsedType}),I;if(n.data.length<this._def.items.length)return P(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I;!this._def.rest&&n.data.length>this._def.items.length&&(P(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new xe(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>ve.mergeArray(r,i)):ve.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Gr(h(d({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof Gr)||!this._restEquals(e))return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le(this._def.items,{compare:r}),a=new le(e._def.items,{compare:r});return n.isEqual(a)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};l(In,"ZodTuple");In.create=l((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new In(d({items:t,typeName:"ZodTuple",rest:null},Z(e)))},"create");var pt=In,Bn=class td extends H{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.undefined,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof td}};l(Bn,"ZodUndefined");Bn.create=l(t=>new Bn(d({typeName:"ZodUndefined"},Z(t))),"create");var ra=Bn,Rn=class ds extends H{dereference(e){let r=this._def.options.map(n=>n.dereference(e));return new ds(h(d({},this._def),{options:r}))}getReferences(){return Ke(this._def.options.reduce((e,r)=>[...e,...r.getReferences()],[]))}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new Be(o.ctx.common.issues));return P(r,{code:_.invalid_union,unionErrors:i}),I}if(l(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let i=h(d({},r),{common:h(d({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s,i=[];for(let c of n){let p=h(d({},r),{common:h(d({},r.common),{issues:[]}),parent:null}),m=c._parseSync({data:r.data,path:r.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(c=>new Be(c));return P(r,{code:_.invalid_union,unionErrors:o}),I}}get options(){return this._def.options}isEqual(e){if(!(e instanceof ds))return!1;let r=l((s,i)=>s.isEqual(i),"compare"),n=new le([...this._def.options],{compare:r}),a=new le([...e._def.options],{compare:r});return n.isEqual(a)}};l(Rn,"ZodUnion");Rn.create=l((t,e)=>new Rn(d({options:t,typeName:"ZodUnion"},Z(e))),"create");var na=Rn,Zn=class rd extends H{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof rd}};l(Zn,"ZodUnknown");Zn.create=l(t=>new Zn(d({typeName:"ZodUnknown"},Z(t))),"create");var Ht=Zn,An=class nd extends H{_parse(e){if(this._getType(e)!==k.undefined){let n=this._getOrReturnCtx(e);return P(n,{code:_.invalid_type,expected:k.void,received:n.parsedType}),I}return pe(e.data)}isEqual(e){return e instanceof nd}};l(An,"ZodVoid");An.create=l(t=>new An(d({typeName:"ZodVoid"},Z(t))),"create");var Ls=An,Wv=/^\d{4}-\d{2}-\d{2}(T|\s)?((\d{2}:\d{2}:\d{2}(\.\d{1,3})?)|(\d{2}:\d{2}))?(\s?([+-]\d{2}:\d{2}|Z))?$/,Ft=l((t,e,r=!0)=>{if(typeof t!="object")throw new Ga("Input must be an object");let n=l(i=>{let o=i;return e?.nullable&&(o=o.nullable()),e?.optional&&(o=o.optional()),e?.passtrough&&typeof o.passthrough=="function"&&(o=o.passthrough()),o},"applyOptions"),a=Object.entries(t).reduce((i,[o,c])=>{if(c===null)i[o]=n(E.null());else switch(typeof c){case"string":i[o]=Wv.test(c)?n(E.string().datetime()):n(E.string());break;case"number":i[o]=n(E.number());break;case"boolean":i[o]=n(E.boolean());break;case"object":Array.isArray(c)?c.length===0?i[o]=n(E.array(E.unknown())):typeof c[0]=="object"?i[o]=n(E.array(Ft(c[0],e,!1))):["string","number","boolean"].includes(typeof c[0])&&(i[o]=n(E.array(E[typeof c[0]]()))):i[o]=n(Ft(c,e,!1));break;default:throw new Ga(`Unsupported type for key ${o}`)}return i},{}),s=Object.keys(a).length>0;return e?.passtrough||!r&&!s?E.object(a).passthrough():E.object(a)},"objectToZui");function ad(){return{}}l(ad,"parseAnyDef");function zs(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage=h(d({},t.errorMessage),{[e]:r}))}l(zs,"addErrorMessage");function G(t,e,r,n,a){t[e]=r,zs(t,e,n,a)}l(G,"setResponseValueAndErrors");function sd(t,e){var r,n;let a={type:"array"};return((n=(r=t.type)==null?void 0:r._def)==null?void 0:n.typeName)!=="ZodAny"&&(a.items=V(t.type._def,h(d({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&G(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&G(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(G(a,"minItems",t.exactLength.value,t.exactLength.message,e),G(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}l(sd,"parseArrayDef");function id(t,e){let r=d({type:"integer",format:"int64"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?G(r,"minimum",n.value,n.message,e):G(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),G(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?G(r,"maximum",n.value,n.message,e):G(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),G(r,"maximum",n.value,n.message,e));break;case"multipleOf":G(r,"multipleOf",n.value,n.message,e);break}return r}l(id,"parseBigintDef");function od(t){return d({type:"boolean"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{})}l(od,"parseBooleanDef");function ld(t,e){return V(t.type._def,e)}l(ld,"parseBrandedDef");var Vv=l((t,e)=>V(t.innerType._def,e),"parseCatchDef");function ud(t,e){return e.dateStrategy=="integer"?qv(t,e):d({type:"string",format:"date-time"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{})}l(ud,"parseDateDef");var qv=l((t,e)=>{let r=d({type:"integer",format:"unix-time"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"&&G(r,"minimum",n.value,n.message,e);break;case"max":e.target==="jsonSchema7"&&G(r,"maximum",n.value,n.message,e);break}return r},"integerDateParser");function cd(t,e){return h(d({},V(t.innerType._def,e)),{default:t.defaultValue()})}l(cd,"parseDefaultDef");function dd(t,e){return e.effectStrategy==="input"?V(t.schema._def,e):{}}l(dd,"parseEffectsDef");function fd(t){return{type:"string",enum:t.values}}l(fd,"parseEnumDef");var Gv=l(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function pd(t,e){let r=[V(t.left._def,h(d({},e),{currentPath:[...e.currentPath,"allOf","0"]})),V(t.right._def,h(d({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return r.forEach(s=>{if(Gv(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let o=s,{additionalProperties:c}=o;i=Lo(o,["additionalProperties"])}else n=void 0;a.push(i)}}),a.length?d({allOf:a},n):void 0}l(pd,"parseIntersectionDef");function gd(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}l(gd,"parseLiteralDef");var nr={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((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}))$",ipv6:"^(([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})))$"};function Ws(t,e){let r=d({type:"string"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});function n(a){return e.patternStrategy==="escape"?Jv(a):a}if(l(n,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":G(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e);break;case"max":G(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":at(r,"email",a.message,e);break;case"format:idn-email":at(r,"idn-email",a.message,e);break;case"pattern:zod":Ae(r,nr.email,a.message,e);break}break;case"url":at(r,"uri",a.message,e);break;case"uuid":at(r,"uuid",a.message,e);break;case"regex":Ae(r,a.regex.source,a.message,e);break;case"cuid":Ae(r,nr.cuid,a.message,e);break;case"cuid2":Ae(r,nr.cuid2,a.message,e);break;case"startsWith":Ae(r,"^"+n(a.value),a.message,e);break;case"endsWith":Ae(r,n(a.value)+"$",a.message,e);break;case"datetime":at(r,"date-time",a.message,e);break;case"length":G(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e),G(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"includes":{Ae(r,n(a.value),a.message,e);break}case"ip":{a.version!=="v6"&&at(r,"ipv4",a.message,e),a.version!=="v4"&&at(r,"ipv6",a.message,e);break}case"emoji":Ae(r,nr.emoji,a.message,e);break;case"ulid":{Ae(r,nr.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}l(Ws,"parseStringDef");var Jv=l(t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),"escapeNonAlphaNumeric"),at=l((t,e,r,n)=>{var a;t.format||(a=t.anyOf)!=null&&a.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(d({format:t.format},t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(d({format:e},r&&n.errorMessages&&{errorMessage:{format:r}}))):G(t,"format",e,r,n)},"addFormat"),Ae=l((t,e,r,n)=>{var a;t.pattern||(a=t.allOf)!=null&&a.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(d({pattern:t.pattern},t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(d({pattern:e},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):G(t,"pattern",e,r,n)},"addPattern");function Vs(t,e){var r,n,a,s,i;if(e.target==="openApi3"&&((r=t.keyType)==null?void 0:r._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((c,p)=>{var m;return h(d({},c),{[p]:(m=V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"properties",p]})))!=null?m:{}})},{}),additionalProperties:!1};let o={type:"object",additionalProperties:(n=V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:{}};if(e.target==="openApi3")return o;if(((a=t.keyType)==null?void 0:a._def.typeName)==="ZodString"&&((s=t.keyType._def.checks)!=null&&s.length)){let c=Object.entries(Ws(t.keyType._def,e)).reduce((p,[m,T])=>m==="type"?p:h(d({},p),{[m]:T}),{});return h(d({},o),{propertyNames:c})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return h(d({},o),{propertyNames:{enum:t.keyType._def.values}});return o}l(Vs,"parseRecordDef");function hd(t,e){if(e.mapStrategy==="record")return Vs(t,e);let r=V(t.keyType._def,h(d({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},n=V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}l(hd,"parseMapDef");function md(t){let e=t.values,n=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),a=Array.from(new Set(n.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:n.filter(s=>typeof s=="string"||typeof s=="number")}}l(md,"parseNativeEnumDef");function yd(){return{not:{}}}l(yd,"parseNeverDef");function vd(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}l(vd,"parseNullDef");var Dn={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function _d(t,e){if(e.target==="openApi3")return $o(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Dn&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((a,s)=>{let i=Dn[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((a,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(n.length===r.length){let a=n.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:r.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,a)=>[...n,...a._def.values.filter(s=>!n.includes(s))],[])};return $o(t,e)}l(_d,"parseUnionDef");var $o=l((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,s)=>V(a._def,h(d({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${s}`]}))).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0)),n=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(r.length)return e.unionStrategy==="anyOf"?d({anyOf:r},n):d({oneOf:r},n)},"asUnionOf");function Td(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Dn[t.innerType._def.typeName],nullable:!0}:{type:[Dn[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=V(t.innerType._def,h(d({},e),{currentPath:[...e.currentPath]}));return n&&h(d({},n),{nullable:!0})}let r=V(t.innerType._def,h(d({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return r&&{anyOf:[r,{type:"null"}]}}l(Td,"parseNullableDef");function bd(t,e){let r=d({type:"number"},t.coerce?{[K]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",zs(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?G(r,"minimum",n.value,n.message,e):G(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),G(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?G(r,"maximum",n.value,n.message,e):G(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),G(r,"maximum",n.value,n.message,e));break;case"multipleOf":G(r,"multipleOf",n.value,n.message,e);break}return r}l(bd,"parseNumberDef");function wd(t,e){var r;let n=h(d({type:"object"},Object.entries(t.shape()).reduce((a,[s,i])=>{if(i===void 0||i._def===void 0)return a;let o=V(i._def,h(d({},e),{currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]}));return o===void 0?a:{properties:h(d({},a.properties),{[s]:o}),required:i.isOptional()?a.required:[...a.required,s]}},{properties:{},required:[]})),{additionalProperties:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":(r=V(t.catchall._def,h(d({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:!0});return n.required.length||delete n.required,n}l(wd,"parseObjectDef");var Yv=l((t,e)=>{var r;if(e.currentPath.toString()===((r=e.propertyPath)==null?void 0:r.toString()))return V(t.innerType._def,e);let n=V(t.innerType._def,h(d({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return n?{anyOf:[{not:{}},n]}:{}},"parseOptionalDef"),Xv=l((t,e)=>{if(e.pipeStrategy==="input")return V(t.in._def,e);if(e.pipeStrategy==="output")return V(t.out._def,e);let r=V(t.in._def,h(d({},e),{currentPath:[...e.currentPath,"allOf","0"]})),n=V(t.out._def,h(d({},e),{currentPath:[...e.currentPath,"allOf",r?"1":"0"]}));return{allOf:[r,n].filter(a=>a!==void 0)}},"parsePipelineDef");function Pd(t,e){return V(t.type._def,e)}l(Pd,"parsePromiseDef");function kd(t,e){let n={type:"array",uniqueItems:!0,items:V(t.valueType._def,h(d({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&G(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&G(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}l(kd,"parseSetDef");function Ed(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>V(r._def,h(d({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:V(t.rest._def,h(d({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>V(r._def,h(d({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[])}}l(Ed,"parseTupleDef");function xd(){return{not:{}}}l(xd,"parseUndefinedDef");function Sd(){return{}}l(Sd,"parseUnknownDef");var Qv=l((t,e)=>V(t.innerType._def,e),"parseReadonlyDef");function Od(t){return{$ref:t.uri}}l(Od,"parseRefDef");function V(t,e,r=!1){let n=e.seen.get(t);if(n&&!r){let i=e_(n,e);if(i!==void 0)return i}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let s=r_(t,t.typeName,e);return s&&n_(t,e,s),a.jsonSchema=s,s}l(V,"parseDef");var e_=l((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:t_(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,n)=>e.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),t_=l((t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")},"getRelativePath"),r_=l((t,e,r)=>{switch(e){case"ZodString":return Ws(t,r);case"ZodNumber":return bd(t,r);case"ZodObject":return wd(t,r);case"ZodBigInt":return id(t,r);case"ZodBoolean":return od(t);case"ZodDate":return ud(t,r);case"ZodUndefined":return xd();case"ZodNull":return vd(r);case"ZodArray":return sd(t,r);case"ZodUnion":case"ZodDiscriminatedUnion":return _d(t,r);case"ZodIntersection":return pd(t,r);case"ZodTuple":return Ed(t,r);case"ZodRecord":return Vs(t,r);case"ZodRef":return Od(t);case"ZodLiteral":return gd(t,r);case"ZodEnum":return fd(t);case"ZodNativeEnum":return md(t);case"ZodNullable":return Td(t,r);case"ZodOptional":return Yv(t,r);case"ZodMap":return hd(t,r);case"ZodSet":return kd(t,r);case"ZodLazy":return V(t.getter()._def,r);case"ZodPromise":return Pd(t,r);case"ZodNaN":case"ZodNever":return yd();case"ZodEffects":return dd(t,r);case"ZodAny":return ad();case"ZodUnknown":return Sd();case"ZodDefault":return cd(t,r);case"ZodBranded":return ld(t,r);case"ZodReadonly":return Qv(t,r);case"ZodCatch":return Vv(t,r);case"ZodPipeline":return Xv(t,r);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(n=>{})(e)}},"selectParser"),n_=l((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),Object.assign(r,{[K]:d(d({},t[K]),r[K])}),r),"addMeta"),Uo={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"string",mapStrategy:"entries",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",discriminator:!1,unionStrategy:"anyOf"},a_=l(t=>typeof t=="string"?h(d({},Uo),{name:t}):d(d({},Uo),t),"getDefaultOptions"),s_=l(t=>{let e=a_(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return h(d({},e),{currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,a])=>[a._def,{def:a._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))})},"getRefs"),i_=l((t,e)=>{var r;let n=s_(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[p,m])=>{var T;return h(d({},c),{[p]:(T=V(m._def,h(d({},n),{currentPath:[...n.basePath,n.definitionPath,p]}),!0))!=null?T:{}})},{}):void 0,s=typeof e=="string"?e:e?.name,i=(r=V(t._def,s===void 0?n:h(d({},n),{currentPath:[...n.basePath,n.definitionPath,s]}),!1))!=null?r:{},o=s===void 0?a?h(d({},i),{[n.definitionPath]:a}):i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:h(d({},a),{[s]:i})};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o},"zodToJsonSchema"),aa=l((t,e={target:"openApi3"})=>{let r=i_(t,e);return e.$schemaUrl===!1?delete r.$schema:typeof e.$schemaUrl=="string"&&(r.$schema=e.$schemaUrl),r},"zuiToJsonSchema"),o_=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],FT=Tt.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Cd=l(t=>ge.create().displayAs({id:"variable",params:d({type:t?.type||"any"},t?.params)}),"variable"),Id=l(t=>ge.create().displayAs({id:"conversation",params:d({},t?.params)}),"conversation"),Bd=l(t=>ge.create().displayAs({id:"user",params:d({},t?.params)}),"user"),Rd=l(t=>ge.create().displayAs({id:"message",params:d({},t?.params)}),"message"),Zd=l(t=>ge.create().displayAs({id:"agent",params:d({},t?.params)}),"agent"),Ad=l(t=>ge.create().displayAs({id:"event",params:d({},t?.params)}),"event"),Dd=l(t=>ge.create().displayAs({id:"table",params:d({},t?.params)}),"table"),Hd=l(t=>ge.create().displayAs({id:"tablerow",params:d({},t?.params)}),"tablerow"),Md=l(t=>ge.create().displayAs({id:"intent",params:d({},t?.params)}),"intent"),jd=l(()=>Tt.create(o_).displayAs({id:"dropdown",params:{}}),"aimodel"),Nd=l(t=>ge.create().displayAs({id:"datasource",params:d({},t)}),"datasource"),$d=l(t=>ge.create().displayAs({id:"knowledgebase",params:d({},t)}),"knowledgebase"),Ud={object:ft.lazycreate},Kd=l((t,e={message:`Input not instance of ${t.name}`})=>xs(r=>r instanceof t,e),"instanceOfType"),qs=ge.create,Gs=ea.create,Fd=Bs.create,Ld=Ln.create,Js=zn.create,zd=qn.create,Wd=Fs.create,Vd=ra.create,qd=Qn.create,Gd=gr.create,Jd=Ht.create,Yd=qe.create,Xd=Ls.create,Qd=Ut.create,ef=ft.create,tf=ft.strictCreate,rf=na.create,nf=Ss.create,af=Gn.create,sf=pt.create,of=Rs.create,lf=Zs.create,uf=_r.create,cf=Is.create,df=As.create,ff=Cs.create,pf=Jn.create,gf=Yn.create,hf=Tt.create,mf=Xn.create,yf=vr.create,fs=Je.create,vf=je.create,_f=dt.create,l_=mr.create,Tf=Je.createWithPreprocess,bf=ta.create,wf=l(()=>qs().optional(),"ostring"),Pf=l(()=>Gs().optional(),"onumber"),kf=l(()=>Js().optional(),"oboolean"),Ef=H.fromJsonSchema,xf=H.fromObject,Sf={string:l(t=>ge.create(h(d({},t),{coerce:!0})),"string"),number:l(t=>ea.create(h(d({},t),{coerce:!0})),"number"),boolean:l(t=>zn.create(h(d({},t),{coerce:!0})),"boolean"),bigint:l(t=>Ln.create(h(d({},t),{coerce:!0})),"bigint"),date:l(t=>qn.create(h(d({},t),{coerce:!0})),"date")},Of=I,v=E,Cf=l((t,e)=>t.anyOf.length?t.anyOf.length===1?ce(t.anyOf[0],h(d({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((r,n)=>ce(r,h(d({},e),{path:[...e.path,"anyOf",n]}))).join(", ")}])`:"z.any()","parseAnyOf"),u_=l(t=>{var e;return(e=t[K])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),c_=l(t=>"z.any()","parseDefault"),d_=l((t,e)=>`z.union([${t.type.map(r=>ce(h(d({},t),{type:r}),e)).join(", ")}])`,"parseMultipleType"),f_=l((t,e)=>`z.any().refine((value) => !${ce(t.not,h(d({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),p_=l(t=>"z.null()","parseNull"),g_=l(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),h_=l((t,...e)=>Object.keys(t).reduce((r,n)=>(e.includes(n)||(r[n]=t[n]),r),{}),"omit");function fe(t,e,r){var n;let a=t[e],s="";if(a!==void 0){let i=r({value:a,json:JSON.stringify(a)});if(i){let o=i[0],c=i.length===3?i[1]:"",p=i.length===3?i[2]:i[1];s+=o,((n=t.errorMessage)==null?void 0:n[e])!==void 0&&(s+=c+JSON.stringify(t.errorMessage[e])),s+=p}}return s}l(fe,"withMessage");var ir=Symbol("Original index"),m_=l(t=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];if(typeof n=="boolean")e.push(n?{[ir]:r}:{[ir]:r,not:{}});else{if(ir in n)return t;e.push(h(d({},n),{[ir]:r}))}}return e},"ensureOriginalIndex");function hr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let r=t.allOf[0];return ce(r,h(d({},e),{path:[...e.path,"allOf",r[ir]]}))}else{let[r,n]=g_(m_(t.allOf));return`z.intersection(${hr({allOf:r},e)}, ${hr({allOf:n},e)})`}}l(hr,"parseAllOf");var y_=l((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((n,a)=>ce(n,h(d({},e),{path:[...e.path,"items",a]})))}])`;let r=t.items?`z.array(${ce(t.items,h(d({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return r+=fe(t,"minItems",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxItems",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseArray"),v_=l(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),__=l(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),T_=l((t,e)=>{let r=ce(t.if,h(d({},e),{path:[...e.path,"if"]})),n=ce(t.then,h(d({},e),{path:[...e.path,"then"]})),a=ce(t.else,h(d({},e),{path:[...e.path,"else"]}));return`z.union([${n}, ${a}]).superRefine((value,ctx) => {
34
34
  const result = ${r}.safeParse(value).success
35
35
  ? ${n}.safeParse(value)
36
36
  : ${a}.safeParse(value);
@@ -54,7 +54,7 @@ ${re}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(Me).join(
54
54
  message: "Invalid input: Should pass single schema",
55
55
  });
56
56
  }
57
- })`:"z.any()","parseOneOf");function Cf(t,e){let r;t.properties&&(Object.keys(t.properties).length?(r="z.object({ ",r+=Object.keys(t.properties).map(i=>{let o=t.properties[i],c=`${JSON.stringify(i)}: ${ce(o,h(d({},e),{path:[...e.path,"properties",i]}))}`,p=typeof o=="object"&&o.default!==void 0||typeof t.default=="object"&&t.default!==null&&i in t.default,m=Array.isArray(t.required)?t.required.includes(i):typeof o=="object"&&o.required===!0;return!p&&!m?`${c}.optional()`:c}).join(", "),r+=" })"):r="z.object({})");let n=t.additionalProperties!==void 0?ce(t.additionalProperties,h(d({},e),{path:[...e.path,"additionalProperties"]})):void 0,a;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([o,c])=>[o,ce(c,h(d({},e),{path:[...e.path,"patternProperties",o]}))],{}));a="",r?n?a+=`.catchall(z.union([${[...Object.values(i),n].join(", ")}]))`:Object.keys(i).length>1?a+=`.catchall(z.union([${Object.values(i).join(", ")}]))`:a+=`.catchall(${Object.values(i)})`:n?a+=`z.record(z.union([${[...Object.values(i),n].join(", ")}]))`:Object.keys(i).length>1?a+=`z.record(z.union([${Object.values(i).join(", ")}]))`:a+=`z.record(${Object.values(i)})`,a+=`.superRefine((value, ctx) => {
57
+ })`:"z.any()","parseOneOf");function If(t,e){let r;t.properties&&(Object.keys(t.properties).length?(r="z.object({ ",r+=Object.keys(t.properties).map(i=>{let o=t.properties[i],c=`${JSON.stringify(i)}: ${ce(o,h(d({},e),{path:[...e.path,"properties",i]}))}`,p=typeof o=="object"&&o.default!==void 0||typeof t.default=="object"&&t.default!==null&&i in t.default,m=Array.isArray(t.required)?t.required.includes(i):typeof o=="object"&&o.required===!0;return!p&&!m?`${c}.optional()`:c}).join(", "),r+=" })"):r="z.object({})");let n=t.additionalProperties!==void 0?ce(t.additionalProperties,h(d({},e),{path:[...e.path,"additionalProperties"]})):void 0,a;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([o,c])=>[o,ce(c,h(d({},e),{path:[...e.path,"patternProperties",o]}))],{}));a="",r?n?a+=`.catchall(z.union([${[...Object.values(i),n].join(", ")}]))`:Object.keys(i).length>1?a+=`.catchall(z.union([${Object.values(i).join(", ")}]))`:a+=`.catchall(${Object.values(i)})`:n?a+=`z.record(z.union([${[...Object.values(i),n].join(", ")}]))`:Object.keys(i).length>1?a+=`z.record(z.union([${Object.values(i).join(", ")}]))`:a+=`z.record(${Object.values(i)})`,a+=`.superRefine((value, ctx) => {
58
58
  `,a+=`for (const key in value) {
59
59
  `,n&&(t.properties?a+=`let evaluated = [${Object.keys(t.properties).map(o=>JSON.stringify(o)).join(", ")}].includes(key)
60
60
  `:a+=`let evaluated = false
@@ -86,7 +86,7 @@ ${re}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(Me).join(
86
86
  `,a+=`}
87
87
  `,a+=`}
88
88
  `),a+=`}
89
- `,a+="})"}let s=r?a?r+a:n?n==="z.never()"?r+".strict()":r+`.catchall(${n})`:r:a||(n?`z.record(${n})`:"z.record(z.any())");return ie.an.anyOf(t)&&(s+=`.and(${Of(h(d({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?h(d({},i),{type:"object"}):i)}),e)})`),ie.a.oneOf(t)&&(s+=`.and(${Ys(h(d({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?h(d({},i),{type:"object"}):i)}),e)})`),ie.an.allOf(t)&&(s+=`.and(${hr(h(d({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?h(d({},i),{type:"object"}):i)}),e)})`),s}l(Cf,"parseObject");var w_=l(t=>{var e;let r="z.string()";if((e=t[K])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";r="z.coerce.string()"}return r+=fe(t,"format",({value:n})=>{switch(n){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),r+=fe(t,"pattern",({json:n})=>[`.regex(new RegExp(${n})`,", ",")"]),r+=fe(t,"minLength",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxLength",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseString"),P_=l((t,e)=>`${ce(h_(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),k_=l(t=>`z.ref('${t.$ref}')`,"parseRef"),E_=l((t,e)=>{var r,n;if(t.oneOf.length<=1||!((r=t.discriminator)!=null&&r.propertyName))return Ys(t,e);let a=t.oneOf.map((s,i)=>ce(s,h(d({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(n=t.discriminator)==null?void 0:n.propertyName}", [${a.join(", ")}])`},"parseDiscriminator"),ce=l((t,e={seen:new Map,path:[]},r)=>{if(typeof t!="object")return t?"z.any()":"z.never()";if(e.parserOverride){let s=e.parserOverride(t,e);if(typeof s=="string")return s}let n=e.seen.get(t);if(n){if(n.r!==void 0)return n.r;if(e.depth===void 0||n.n>=e.depth)return"z.any()";n.n+=1}else n={r:void 0,n:0},e.seen.set(t,n);let a=O_(t,e);return r||(a=x_(t,a),e.withoutDefaults||(a=S_(t,a))),n.r=a,a},"parseSchema"),x_=l((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),S_=l((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),O_=l((t,e)=>ie.a.nullable(t)?P_(t,e):ie.an.object(t)?Cf(t,e):ie.an.array(t)?y_(t,e):ie.an.anyOf(t)?Of(t,e):ie.an.allOf(t)?hr(t,e):ie.a.discriminator(t)?E_(t,e):ie.a.oneOf(t)?Ys(t,e):ie.a.not(t)?f_(t,e):ie.an.enum(t)?__(t):ie.a.const(t)?v_(t):ie.a.multipleType(t)?d_(t,e):ie.a.primitive(t,"string")?w_(t):ie.a.primitive(t,"number")||ie.a.primitive(t,"integer")?b_(t):ie.a.primitive(t,"boolean")?u_(t):ie.a.primitive(t,"null")?p_(t):ie.a.conditional(t)?T_(t,e):ie.a.ref(t)?k_(t):c_(t),"selectParser"),ie={an:{object:l(t=>t.type==="object","object"),array:l(t=>t.type==="array","array"),anyOf:l(t=>t.anyOf!==void 0,"anyOf"),allOf:l(t=>t.allOf!==void 0,"allOf"),enum:l(t=>t.enum!==void 0,"enum")},a:{nullable:l(t=>t.nullable===!0,"nullable"),multipleType:l(t=>Array.isArray(t.type),"multipleType"),not:l(t=>t.not!==void 0,"not"),const:l(t=>t.const!==void 0,"const"),primitive:l((t,e)=>t.type===e,"primitive"),conditional:l(t=>Boolean("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:l(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:l(t=>t.oneOf!==void 0,"oneOf"),ref:l(t=>t.$ref!==void 0,"ref")}},C_=l(t=>{let e;try{e=new Function("z",`return ${t}`)(v)}catch(r){return{sucess:!1,error:`Failed to evaluate schema: ${(r instanceof Error?r:new Error(String(r))).message}`}}return e instanceof v.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),I_=l(t=>ce(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),B_=l(t=>{let e=I_(t);e=e.replaceAll("errors: z.ZodError[]","errors");let r=C_(e);if(!r.sucess)throw new il(r.error);return r.value},"jsonSchemaToZod"),or=l((t,e)=>{var r,n;if(e[K]&&t._def&&(t._def[K]=e[K]),((r=t._def)==null?void 0:r.typeName)==="ZodObject"&&e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([a,s])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[a]&&or(i[a],s)}),((n=t._def)==null?void 0:n.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&or(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let a=e.items;if(typeof a=="object"&&!Array.isArray(a)){let s=t._def.type;s&&or(s,a)}else Array.isArray(a)&&a.forEach((s,i)=>{let o=t._def;o.typeName===E.ZodFirstPartyTypeKind.ZodTuple&&or(o.items[i],s)})}},"applyZuiPropsRecursively"),Tr=l(t=>{let e=B_(t);return or(e,t),e},"jsonSchemaToZui"),If=class extends Ft.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Uncaught error:",e,r)}render(){return this.state.hasError&&this.props.fallback?Ft.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};l(If,"ErrorBoundary");var Ht=If;function Bf(t,e){return r=>Ft.default.createElement(Ht,{fallback:e,fieldSchema:r.fieldSchema,path:r.path},Ft.default.createElement(t,d({},r)))}l(Bf,"withErrorBoundary");var Jr=l(t=>{var e=t,{components:r,fieldSchema:n,path:a,required:s,fallback:i}=e,o=Fo(e,["components","fieldSchema","path","required","fallback"]),c,p;let{formData:m,disabled:T,hidden:O,handlePropertyChange:w,addArrayItem:S,removeArrayItem:W,formErrors:q,formValid:re}=Wo(n,a),J=(0,be.useMemo)(()=>lt(m,a),[m,a]),N=(0,be.useMemo)(()=>Fg(r,n),[n,r]),{discriminator:F,discriminatedSchema:ue,discriminatorValue:Le}=$g(n,a);if(!N||O===!0)return null;let{Component:rt,type:Ce}=N,we={type:Ce,componentID:N.id,scope:a.join("."),context:{path:a,readonly:!1,formData:m,formErrors:q,formValid:re,updateForm:w,updateFormData:l(Pe=>w([],Pe),"updateFormData")},onChange:l(Pe=>w(a,Pe),"onChange"),disabled:T,errors:q?.filter(Pe=>Pe.path===a)||[],label:((c=n[K])==null?void 0:c.title)||qa(((p=a[a.length-1])==null?void 0:p.toString())||""),params:N.params,schema:n,zuiProps:n[K]};if(n.type==="array"&&Ce==="array"){let Pe=rt,Te=we.schema,ke=Array.isArray(J)||typeof J=="object"?J:[],j=d(h(d({},we),{type:Ce,schema:Te,data:ke,addItem:l(Ie=>S(a,Ie),"addItem"),removeItem:l(Ie=>W(a,Ie),"removeItem")}),o);return Array.isArray(n.items)?null:be.default.createElement(Pe,h(d({key:we.scope},j),{isArrayChild:j.isArrayChild}),Array.isArray(j.data)?j.data.map((Ie,Oe)=>{let ze=[...a,Oe.toString()];return be.default.createElement(Ht,{key:ze.join("."),fallback:i,fieldSchema:n.items,path:ze},be.default.createElement(Jr,{key:ze.join("."),components:r,fieldSchema:n.items,path:ze,required:s,isArrayChild:!0,index:Oe,removeSelf:()=>W(a,Oe),fallback:i}))}):[])}if(n.type==="object"&&Ce==="object"&&n.properties){let Pe=rt,Te=d(h(d({},we),{type:Ce,schema:we.schema,data:J||{}}),o);return be.default.createElement(Pe,h(d({key:we.scope},Te),{isArrayChild:Te.isArrayChild}),Object.entries(n.properties).map(([ke,j])=>{var Ie;let Oe=[...a,ke];return be.default.createElement(Ht,{key:Oe.join("."),fallback:i,fieldSchema:j,path:Oe},be.default.createElement(Jr,{key:Oe.join("."),components:r,fieldSchema:j,path:Oe,required:((Ie=n.required)==null?void 0:Ie.includes(ke))||!1,isArrayChild:!1,fallback:i}))}))}if(Ce==="discriminatedUnion"){let Pe=rt,Te=d(h(d({},we),{type:Ce,schema:we.schema,data:J||{},discriminatorKey:F?.key||null,discriminatorLabel:qa(F?.key||"Unknown"),discriminatorOptions:F?.values||null,discriminatorValue:Le,setDiscriminator:l(ke=>{if(!F?.key){console.warn("No discriminator key found, cannot set discriminator");return}w(a,{[F.key]:ke})},"setDiscriminator")}),o);return be.default.createElement(Pe,h(d({key:we.scope},Te),{isArrayChild:Te.isArrayChild}),ue&&be.default.createElement(Ht,{key:a.join("."),fallback:i,fieldSchema:ue,path:a},be.default.createElement(Jr,{components:r,fieldSchema:ue,path:a,required:s,isArrayChild:!1,fallback:i})))}let va=rt,_a=d(h(d({},we),{type:Ce,schema:we.schema,config:{},required:s,data:J,description:n.description}),o);return be.default.createElement(va,d({},_a))},"FormElementRenderer"),R_=l(({schema:t,components:e,onChange:r,value:n,disableValidation:a,fallback:s,dataTransform:i,onValidation:o})=>{let[c,p]=(0,Ne.useState)(n);return(0,Ne.useEffect)(()=>{r(c)},[c]),(0,Ne.useEffect)(()=>{let m=At(t);p(T=>Xr(m,T))},[JSON.stringify(t),p]),Ne.default.createElement(Ng,{formData:c,setFormData:p,formSchema:t,disableValidation:a||!1,dataTransform:i,onValidation:o},Ne.default.createElement(Ht,{fallback:s,fieldSchema:t,path:[]},Ne.default.createElement(Jr,{components:e,fieldSchema:t,path:[],fallback:s,required:!0,isArrayChild:!1})))},"ZuiForm"),Z_={string:{},number:{slider:{id:"slider",params:v.object({})}},boolean:{switch:{id:"switch",params:v.object({})}},array:{},object:{},discriminatedUnion:{}},A_={errors:nl,jsonSchemaToZui:Tr,zuiToJsonSchema:aa,objectToZui:Kt,toTypescript:Qr,toTypescriptSchema:ws};var Wt=(t,e)=>{let r=t._def,n=e._def;if(r.typeName===E.ZodFirstPartyTypeKind.ZodObject&&n.typeName===E.ZodFirstPartyTypeKind.ZodObject){let a=r.shape(),s=n.shape();return E.object({...a,...s})}if(r.typeName===E.ZodFirstPartyTypeKind.ZodRecord&&n.typeName===E.ZodFirstPartyTypeKind.ZodRecord)return E.record(E.intersection(r.valueType,n.valueType));throw new Error("Cannot merge object schemas with record schemas")},Rf=E;var _e=E.string().min(1),Af=E.object({text:_e}),Df=E.object({markdown:_e}),Hf=E.object({imageUrl:_e}),Mf=E.object({audioUrl:_e}),jf=E.object({videoUrl:_e}),Nf=E.object({fileUrl:_e,title:_e.optional()}),$f=E.object({latitude:E.number(),longitude:E.number(),address:E.string().optional(),title:E.string().optional()}),Uf=E.object({title:_e,subtitle:_e.optional(),imageUrl:_e.optional(),actions:E.array(E.object({action:E.enum(["postback","url","say"]),label:_e,value:_e}))}),Zf=E.object({text:_e,options:E.array(E.object({label:_e,value:_e}))}),D_=E.object({items:E.array(Uf)}),H_=E.union([E.object({type:E.literal("text"),payload:Af}),E.object({type:E.literal("markdown"),payload:Df}),E.object({type:E.literal("image"),payload:Hf}),E.object({type:E.literal("audio"),payload:Mf}),E.object({type:E.literal("video"),payload:jf}),E.object({type:E.literal("file"),payload:Nf}),E.object({type:E.literal("location"),payload:$f})]),M_=E.object({items:E.array(H_)}),j_={schema:Df},N_={text:{schema:Af},image:{schema:Hf},audio:{schema:Mf},video:{schema:jf},file:{schema:Nf},location:{schema:$f},carousel:{schema:D_},card:{schema:Uf},dropdown:{schema:Zf},choice:{schema:Zf},bloc:{schema:M_}};var br="x-bot-id",Qs="x-bot-user-id",ei="x-integration-id",ti="x-webhook-id",ri="x-bp-configuration-type",wr="x-bp-configuration",Pr="x-bp-operation",ni="x-bp-type",$_={HIDDEN_IN_STUDIO:{bpActionHiddenInStudio:"true"},AWAIT_RETURN:{bpActionAwaitReturn:"true"}};var Kf=require("browser-or-node");var Vt=console;function Se(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function kr(t,e=8072,r=L_){if(!Kf.isNode)throw new Error("This function can only be called in Node.js");let a=require("http").createServer(async(s,i)=>{try{let o=await U_(s);if(o.path==="/health"){i.writeHead(200).end("ok");return}let c=await t(o);i.writeHead(c?.status??200,c?.headers??{}).end(c?.body??"{}")}catch(o){Vt.error("Error while handling request",{error:o?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:o?.message??"Internal error occured"}))}});return a.listen(e,()=>r(e)),a}async function U_(t){let e=await F_(t),r={};for(let a=0;a<t.rawHeaders.length;a+=2){let s=t.rawHeaders[a].toLowerCase(),i=t.rawHeaders[a+1];r[s]=i}let n=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:n.pathname,query:K_(n.search,"?"),headers:r,method:t.method?.toUpperCase()??"GET"}}function K_(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function F_(t){return new Promise((e,r)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let n="";t.on("data",a=>n+=a.toString()),t.on("error",a=>r(a)),t.on("end",()=>e(n))})}function L_(t){Vt.info(`Listening on port ${t}`)}var ya=require("@botpress/client");var te={};er(te,{mapKeys:()=>V_,mapValues:()=>W_,mergeRecords:()=>G_,pairs:()=>sa,stripUndefinedProps:()=>q_,values:()=>z_});var sa=t=>Object.entries(t),z_=t=>Object.values(t),W_=(t,e)=>Object.fromEntries(sa(t).map(([r,n])=>[r,e(n,r)])),V_=(t,e)=>Object.fromEntries(sa(t).map(([r,n])=>[e(r),n])),q_=t=>Object.fromEntries(sa(t).filter(([,e])=>e!==void 0)),G_=(t,e,r)=>{let n=[...Object.keys(t),...Object.keys(e)],a=[...new Set(n)],s={};for(let i of a){let o=t[i],c=e[i];o&&c?s[i]=r(o,c):o?s[i]=o:c&&(s[i]=c)}return s};var A={};er(A,{safePush:()=>J_,unique:()=>Y_});var J_=(t,...e)=>t?[...t,...e]:[...e],Y_=t=>Array.from(new Set(t));var Fe={};er(Fe,{setName:()=>X_});var X_=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Ff=t=>{let{name:e,version:r}=t,n={actions:{},events:{},channels:{}},a={name:e,version:r,entities:te.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},s=te.mapValues(t.entities,i=>i.schema);for(let[i,o]of Object.entries(t.definition.actions??{})){let c=o.input.schema.dereference(s),p=o.output.schema.dereference(s),m=t.actions?.[i]?.name??i;n.actions[m]={...o,...t.actions?.[i]??{},input:{schema:c},output:{schema:p}},a.actions[i]={name:m}}for(let[i,o]of Object.entries(t.definition.events??{})){let c=o.schema.dereference(s),p=t.events?.[i]?.name??i;n.events[p]={...o,...t.events?.[i]??{},schema:c},a.events[i]={name:p}}for(let[i,o]of Object.entries(t.definition.channels??{})){let c={};for(let[m,T]of Object.entries(o.messages)){let O=T.schema.dereference(s);c[m]={...T,schema:O}}let p=t.channels?.[i]?.name??i;n.channels[p]={...o,...t.channels?.[i]??{},message:{...o.message??{},tags:{...o.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...o.conversation??{},tags:{...o.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:c},a.channels[i]={name:p}}return{resolved:n,statement:a}};var ia=Symbol("schemaName"),Lf=t=>t?te.mapValues(t,(r,n)=>({...r,[ia]:n})):{},zf=t=>ia in t&&t[ia]!==void 0,Wf=t=>t[ia];var oa=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.configurations=e.configurations,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities,this.interfaces=e.interfaces,this.__advanced=e.__advanced}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;extend(e,r){let{entities:n,actions:a,events:s,channels:i}=this._callBuilder(e,r),o=this;o.interfaces??={};let c=Object.values(n).map(O=>O.name),p=c.length===0?e.name:`${e.name}<${c.join(",")}>`,{resolved:m,statement:T}=Ff({...e,entities:n,actions:te.stripUndefinedProps(a),events:te.stripUndefinedProps(s),channels:te.stripUndefinedProps(i)});return o.actions=te.mergeRecords(o.actions??{},m.actions,this._mergeActions),o.channels=te.mergeRecords(o.channels??{},m.channels,this._mergeChannels),o.events=te.mergeRecords(o.events??{},m.events,this._mergeEvents),o.interfaces[p]={id:e.id,...T},this}_callBuilder(e,r){let a={entities:Lf(this.entities)},s=r(a),i=te.pairs(s.entities).find(([c,p])=>!zf(p));if(i)throw new Error(`Cannot extend interface "${e.name}" with entity "${i[0]}"; the provided schema is not part of the integration's entities.`);return{entities:te.mapValues(s.entities,c=>({name:Wf(c),schema:c.schema})),actions:s.actions??{},events:s.events??{},channels:s.channels??{}}}_mergeActions=(e,r)=>({...e,...r,input:{schema:Wt(e.input.schema,r.input.schema)},output:{schema:Wt(e.output.schema,r.output.schema)}});_mergeEvents=(e,r)=>({...e,...r,schema:Wt(e.schema,r.schema)});_mergeChannels=(e,r)=>{let n=te.mergeRecords(e.messages,r.messages,this._mergeMessage),a;(e.conversation||r.conversation)&&(a={tags:{...e.conversation?.tags,...r.conversation?.tags}});let s;return(e.message||r.message)&&(s={tags:{...e.message?.tags,...r.message?.tags}}),{...e,...r,messages:n,conversation:a,message:s}};_mergeMessage=(e,r)=>({schema:Wt(e.schema,r.schema)})};var Pt=require("@botpress/client");var Vf=require("@botpress/client"),la={retries:3,retryCondition:t=>Vf.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:t=>t*1e3};var qt=class{constructor(e){this._client=e}createConversation=e=>this._client.createConversation(e);getConversation=e=>this._client.getConversation(e);listConversations=e=>this._client.listConversations(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);updateConversation=e=>this._client.updateConversation(e);deleteConversation=e=>this._client.deleteConversation(e);listParticipants=e=>this._client.listParticipants(e);addParticipant=e=>this._client.addParticipant(e);getParticipant=e=>this._client.getParticipant(e);removeParticipant=e=>this._client.removeParticipant(e);createEvent=e=>this._client.createEvent(e);getEvent=e=>this._client.getEvent(e);listEvents=e=>this._client.listEvents(e);createMessage=e=>this._client.createMessage(e);getOrCreateMessage=e=>this._client.getOrCreateMessage(e);getMessage=e=>this._client.getMessage(e);updateMessage=e=>this._client.updateMessage(e);listMessages=e=>this._client.listMessages(e);deleteMessage=e=>this._client.deleteMessage(e);createUser=e=>this._client.createUser(e);getUser=e=>this._client.getUser(e);listUsers=e=>this._client.listUsers(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);updateUser=e=>this._client.updateUser(e);deleteUser=e=>this._client.deleteUser(e);getState=e=>this._client.getState(e);setState=e=>this._client.setState(e);getOrSetState=e=>this._client.getOrSetState(e);patchState=e=>this._client.patchState(e);configureIntegration=e=>this._client.configureIntegration(e);uploadFile=e=>this._client.uploadFile(e);upsertFile=e=>this._client.upsertFile(e);deleteFile=e=>this._client.deleteFile(e);listFiles=e=>this._client.listFiles(e);getFile=e=>this._client.getFile(e);updateFileMetadata=e=>this._client.updateFileMetadata(e)};var ua=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};var ca="#";var Q_=E.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Gf=t=>{let e=t[br],r=t[Qs],n=t[ei],a=t[ti],s=t[ri],i=t[wr],o=Q_.parse(t[Pr]);if(!e)throw new Error("Missing bot headers");if(!r)throw new Error("Missing bot user headers");if(!n)throw new Error("Missing integration headers");if(!a)throw new Error("Missing webhook headers");if(!i)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:e,botUserId:r,integrationId:n,webhookId:a,operation:o,configurationType:s??null,configuration:i?JSON.parse(Buffer.from(i,"base64").toString("utf-8")):{}}};var Jf=at(require("util")),Gt=class{defaultOptions;constructor(e){this.defaultOptions=e}info(...e){this._log("info",e)}debug(...e){this._log("debug",e)}warn(...e){this._log("warn",e)}error(...e){this._log("error",e)}_log(e,r){this._getConsoleMethod(e)(this._serializeMessage(r))}_serializeMessage(e){let r=Jf.default.format(...e);return process.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(r):r}getJsonMessage(e){return JSON.stringify({msg:e,options:this.defaultOptions})}_getConsoleMethod(e){switch(e){case"debug":return console.debug;case"warn":return console.warn;case"error":return console.error;default:return console.info}}};var Ye=class extends Gt{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new Ye({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withVisibleToBotOwners(e){return this.with({visibleToBotOwners:e})}forBot(){return this.withVisibleToBotOwners(!0)}getJsonMessage(e){return JSON.stringify({msg:e,visible_to_bot_owner:this.defaultOptions.visibleToBotOwners,options:this.defaultOptions})}};var eT=t=>["traceparent","tracestate","sentry-trace"].reduce((e,r)=>(t[r]&&(e[r]=t[r]),e),{}),Yf=t=>async e=>{let r=Gf(e.headers),[,n]=(e.headers.traceparent||"").split("-"),a=new Pt.Client({botId:r.botId,integrationId:r.integrationId,retry:la,headers:eT(e.headers)}),s=new qt(a),i=new Ye({traceId:n}),o={ctx:r,req:e,client:s,logger:i,instance:t};try{let c;switch(r.operation){case"webhook_received":c=await rT(o);break;case"register":c=await nT(o);break;case"unregister":c=await aT(o);break;case"message_created":c=await oT(o);break;case"action_triggered":c=await lT(o);break;case"ping":c=await tT(o);break;case"create_user":c=await sT(o);break;case"create_conversation":c=await iT(o);break;default:throw new Error(`Unknown operation ${r.operation}`)}return c?{...c,status:c.status??200}:{status:200}}catch(c){if((0,Pt.isApiError)(c)){let m=c.type==="Runtime"?c:new Pt.RuntimeError(c.message,c);return i.forBot().error(m.message),{status:m.code,body:JSON.stringify(m.toJSON())}}console.error(c);let p=new Pt.RuntimeError("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return i.forBot().error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}},tT=async t=>{},rT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{let{req:s}=Se(r);return a.webhook({client:t,ctx:e,req:s,logger:n})},nT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.register)return;let{webhookUrl:s}=Se(r);await a.register({client:t,ctx:e,webhookUrl:s,logger:n})},aT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.unregister)return;let{webhookUrl:s}=Se(r);await a.unregister({ctx:e,webhookUrl:s,client:t,logger:n})},sT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createUser)return;let{tags:s}=Se(r);return await a.createUser({ctx:e,client:t,tags:s,logger:n})},iT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createConversation)return;let{channel:s,tags:i}=Se(r);return await a.createConversation({ctx:e,client:t,channel:s,tags:i,logger:n})},oT=async({ctx:t,req:e,client:r,logger:n,instance:a})=>{let{conversation:s,user:i,type:o,payload:c,message:p}=Se(e),m=a.channels[s.channel];if(!m)throw new Error(`Channel ${s.channel} not found`);let T=m.messages[o];if(!T)throw new Error(`Message of type ${o} not found in channel ${s.channel}`);await T({ctx:t,conversation:s,message:p,user:i,type:o,client:r,payload:c,ack:async({tags:w})=>{await r.updateMessage({id:p.id,tags:w})},logger:n})},lT=async({req:t,ctx:e,client:r,logger:n,instance:a})=>{let{input:s,type:i}=Se(t);if(!i)throw new Error("Missing action type");let o=a.actions[i];if(!o)throw new Error(`Action ${i} not found`);let c=new ua,m={output:await o({ctx:e,input:s,client:r,type:i,logger:n,metadata:c}),meta:c.toJSON()};return{body:JSON.stringify(m)}};var da=class{constructor(e){this.props=e;this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}actions;channels;register;unregister;createUser;createConversation;webhook;handler=Yf(this);start=e=>kr(this.handler,e)};var fa=class{constructor(e){this.props=e;this.integrations=e.integrations,this.plugins=e.plugins,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables,this.workflows=e.workflows}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;addIntegration(e,r){let n=this;return n.integrations||(n.integrations={}),n.integrations[e.name]={enabled:r.enabled,...e,configurationType:r.configurationType,configuration:r.configuration},this}addPlugin(e,r){let n=this;n.plugins||(n.plugins={});let a=r.alias??e.name;return n.plugins[a]={...e,alias:r.alias,configuration:r.configuration,interfaces:r.interfaces},n.user=this._mergeUser(n.user,e.definition.user),n.conversation=this._mergeConversation(n.conversation,e.definition.conversation),n.message=this._mergeMessage(n.message,e.definition.message),n.recurringEvents=this._mergeRecurringEvents(n.recurringEvents,e.definition.recurringEvents),n.tables=this._mergeTables(n.tables,e.definition.tables),n.workflows=this._mergeWorkflows(n.workflows,e.definition.workflows),n.states=this._mergeStates(n.states,this._prefixKeys(e.definition.states,r.alias)),n.events=this._mergeEvents(n.events,this._prefixKeys(e.definition.events,r.alias)),n.actions=this._mergeActions(n.actions,this._prefixKeys(e.definition.actions,r.alias)),this}_mergeUser=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeConversation=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeMessage=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeStates=(e,r)=>({...e,...r});_mergeEvents=(e,r)=>({...e,...r});_mergeRecurringEvents=(e,r)=>({...e,...r});_mergeActions=(e,r)=>({...e,...r});_mergeTables=(e,r)=>({...e,...r});_mergeWorkflows=(e,r)=>({...e,...r});_prefixKeys=(e,r)=>!e||!r?e:te.mapKeys(e,n=>`${r}${ca}${n}`)};var ep=at(require("@botpress/client"));var Xe=class extends Gt{constructor(e){super({...e})}with(e){return new Xe({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}withEventId(e){return this.with({eventId:e})}withMessageId(e){return this.with({messageId:e})}};var Re=class{constructor(e,r={before:{},after:{}}){this._client=e;this._hooks=r}getConversation=e=>this._run("getConversation",e);listConversations=e=>this._run("listConversations",e);updateConversation=e=>this._run("updateConversation",e);deleteConversation=e=>this._run("deleteConversation",e);listParticipants=e=>this._run("listParticipants",e);addParticipant=e=>this._run("addParticipant",e);getParticipant=e=>this._run("getParticipant",e);removeParticipant=e=>this._run("removeParticipant",e);createEvent=e=>this._run("createEvent",e);getEvent=e=>this._run("getEvent",e);listEvents=e=>this._run("listEvents",e);createMessage=e=>this._run("createMessage",e);getOrCreateMessage=e=>this._run("getOrCreateMessage",e);getMessage=e=>this._run("getMessage",e);updateMessage=e=>this._run("updateMessage",e);listMessages=e=>this._run("listMessages",e);deleteMessage=e=>this._run("deleteMessage",e);getUser=e=>this._run("getUser",e);listUsers=e=>this._run("listUsers",e);updateUser=e=>this._run("updateUser",e);deleteUser=e=>this._run("deleteUser",e);getState=e=>this._run("getState",e);setState=e=>this._run("setState",e);getOrSetState=e=>this._run("getOrSetState",e);patchState=e=>this._run("patchState",e);callAction=e=>this._run("callAction",e);uploadFile=e=>this._run("uploadFile",e);upsertFile=e=>this._run("upsertFile",e);deleteFile=e=>this._run("deleteFile",e);listFiles=e=>this._run("listFiles",e);getFile=e=>this._run("getFile",e);updateFileMetadata=e=>this._run("updateFileMetadata",e);searchFiles=e=>this._run("searchFiles",e);trackAnalytics=e=>this._run("trackAnalytics",e);getTableRow=e=>this._run("getTableRow",e);createTableRows=e=>this._run("createTableRows",e);findTableRows=e=>this._run("findTableRows",e);deleteTableRows=e=>this._run("deleteTableRows",e);updateTableRows=e=>this._run("updateTableRows",e);upsertTableRows=e=>this._run("upsertTableRows",e);createWorkflow=e=>this._run("createWorkflow",e);getWorkflow=e=>this._run("getWorkflow",e);updateWorkflow=e=>this._run("updateWorkflow",e);deleteWorkflow=e=>this._run("deleteWorkflow",e);listWorkflows=e=>this._run("listWorkflows",e);createConversation=e=>this._client.createConversation(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);createUser=e=>this._client.createUser(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);_run=async(e,r)=>{let n=this._hooks.before[e];n&&(r=await n(r));let a=await this._client[e](r),s=this._hooks.after[e];return s&&(a=await s(a,r)),a}};var Jt=t=>new Proxy({},{get:(e,r)=>({listInstances:{all:n=>Qe({workflowName:r,client:t,input:n}),running:n=>Qe({workflowName:r,client:t,input:n,statuses:["in_progress"]}),scheduled:n=>Qe({workflowName:r,client:t,input:n,statuses:["pending","listening"]}),allFinished:n=>Qe({workflowName:r,client:t,input:n,statuses:["completed","cancelled","failed","timedout"]}),cancelled:n=>Qe({workflowName:r,client:t,input:n,statuses:["cancelled"]}),failed:n=>Qe({workflowName:r,client:t,input:n,statuses:["failed"]}),succeeded:n=>Qe({workflowName:r,client:t,input:n,statuses:["completed"]}),timedOut:n=>Qe({workflowName:r,client:t,input:n,statuses:["timedout"]})},startNewInstance:async n=>{let{workflow:a}=await t.createWorkflow({name:r,status:"pending",...n});return{workflow:et({client:t,workflow:a})}}})}),Qe=async t=>{let e=await t.client.listWorkflows({name:t.workflowName,statuses:t.statuses,...t.input});return{...e,workflows:e.workflows.map(r=>et({client:t.client,workflow:r}))}},et=t=>({...t.workflow,async update(e){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,...e});return{workflow:et({client:t.client,workflow:r})}},async setFailed({failureReason:e}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"failed",failureReason:e});return{workflow:et({client:t.client,workflow:r})}},async setCompleted({output:e}={}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"completed",output:e});return{workflow:et({client:t.client,workflow:r})}},async cancel(){let{workflow:e}=await t.client.updateWorkflow({id:t.workflow.id,status:"cancelled"});return{workflow:et({client:t.client,workflow:e})}}});var uT=E.enum(["event_received","register","unregister","ping","action_triggered"]),Xf=t=>{let e=t[br],r=t[wr],n=t[ni],a=uT.parse(t[Pr]);if(!e)throw new Error("Missing bot headers");if(!n)throw new Error("Missing type headers");if(!r)throw new Error("Missing configuration headers");if(!a)throw new Error("Missing operation headers");return{botId:e,operation:a,type:n,configuration:r?JSON.parse(Buffer.from(r,"base64").toString("utf-8")):{}}};var he={status:200};var ai=t=>{switch(t){case"workflow_continued":return"continued";case"workflow_started":return"started";case"workflow_timedout":return"timed_out";default:throw new Error(`Unsupported workflow update type: ${t}`)}};var cT=["child_workflow_deleted","child_workflow_finished","workflow_timedout","workflow_started","workflow_continued"],Qf=async(t,e)=>{if(t.ctx.type!=="workflow_update"||!cT.includes(e.payload.type))throw new Error("Unexpected event type");let r={...t,logger:dT(t,e)};if(!e.payload.workflow.name)return r.logger.warn("Received workflow update event without a workflow name. Assuming this workflow was not defined by the bot.",e.payload.workflow),he;switch(e.payload.type){case"child_workflow_deleted":case"child_workflow_finished":r.logger.info(`Received child workflow event "${e.payload.type}", but child workflows are not yet supported`);break;case"workflow_timedout":case"workflow_started":case"workflow_continued":return await fT(r,e);default:e.payload.type}return he},dT=(t,e)=>t.logger.with({eventId:e.id,workflowId:e.payload.workflow.id,conversationId:e.payload.conversation?.id,userId:e.payload.user?.id}),fT=async(t,e)=>{let r=ai(e.payload.type),n=t.self.workflowHandlers[r]?.[e.payload.workflow.name];return!n||n.length===0?(t.logger.warn(`No ${r} handler found for workflow "${e.payload.workflow.name}"`),he):(await pT(t,e),await gT(t,e),he)},pT=async(t,e)=>{e.payload.workflow.status==="pending"&&await t.client.updateWorkflow({id:e.payload.workflow.id,status:"in_progress",eventId:e.id})},gT=async(t,e)=>{let r=ai(e.payload.type),n=t.self.workflowHandlers[r]?.[e.payload.workflow.name];for(let a of n)await a({...t,conversation:e.payload.conversation,user:e.payload.user,workflow:et({...t,workflow:e.payload.workflow}),workflows:Jt(t.client)})};var tp=t=>async e=>{let r=Xf(e.headers),n=new Xe,a=new ep.Client({botId:r.botId,retry:la}),s=new Re(a,{before:{createMessage:async o=>{let c=t.hookHandlers.before_outgoing_message[o.type]??[];for(let p of c){let m=new Re(a);o=(await p({client:m,ctx:r,logger:n.with({conversationId:o.conversationId,userId:o.userId}),data:o,...tt({client:m})}))?.data??o}return o},callAction:async o=>{let c=t.hookHandlers.before_outgoing_call_action[o.type]??[];for(let p of c){let m=new Re(a);o=(await p({client:m,ctx:r,logger:n,data:o,...tt({client:m})}))?.data??o}return o}},after:{createMessage:async o=>{let c=t.hookHandlers.after_outgoing_message[o.message.type]??[];for(let p of c){let m=new Re(a);o=(await p({client:m,ctx:r,logger:n.with({messageId:o.message.id,conversationId:o.message.conversationId,userId:o.message.userId}),data:o,...tt({client:m})}))?.data??o}return o},callAction:async(o,c)=>{let{type:p}=c,m=t.hookHandlers.after_outgoing_call_action[p]??[];for(let T of m){let O=new Re(a);o=(await T({client:O,ctx:r,logger:n,data:{type:p,...o},...tt({client:O})}))?.data??o}return o}}}),i={req:e,ctx:r,logger:n,client:s,self:t};switch(r.operation){case"action_triggered":return await _T(i);case"event_received":return await vT(i);case"register":return await mT(i);case"unregister":return await yT(i);case"ping":return await hT(i);default:throw new Error(`Unknown operation ${r.operation}`)}},hT=async({ctx:t})=>(Vt.info(`Received ${t.operation} operation for bot ${t.botId} of type ${t.type}`),he),mT=async t=>he,yT=async t=>he,vT=async t=>{let{ctx:e,logger:r,req:n,client:a,self:s}=t,i={client:a,ctx:e,logger:r,...tt({client:a})};Vt.debug(`Received event ${e.type}`);let o=Se(n);if(i.logger=i.logger.with({eventId:o.event.id,messageId:o.event.messageId,conversationId:o.event.conversationId,userId:o.event.userId}),e.type==="workflow_update")return await Qf(t,o.event);if(e.type==="message_created"){let w=o.event,S=w.payload.message;i.logger=i.logger.with({messageId:S.id,conversationId:S.conversationId,userId:S.userId});let W=s.hookHandlers.before_incoming_message[S.type]??[];for(let N of W){let F=await N({...i,data:S});if(S=F?.data??S,F?.stop)return he}let q={...i,user:w.payload.user,conversation:w.payload.conversation,message:S,event:w},re=s.messageHandlers[S.type]??[];for(let N of re)await N(q);let J=s.hookHandlers.after_incoming_message[S.type]??[];for(let N of J){let F=await N({...i,data:S});if(S=F?.data??S,F?.stop)return he}return he}if(e.type==="state_expired"){let S=o.event.payload.state,W={...i,state:S},q=s.stateExpiredHandlers["*"]??[];for(let re of q)await re(W);return he}let c=o.event,p=s.hookHandlers.before_incoming_event[c.type]??[];for(let w of p){let S=await w({...i,data:c});if(c=S?.data??c,S?.stop)return he}let m={...i,event:c},T=s.eventHandlers[c.type]??[];for(let w of T)await w(m);let O=s.hookHandlers.after_incoming_event[c.type]??[];for(let w of O){let S=await w({...i,data:c});if(c=S?.data??c,S?.stop)return he}return he},_T=async({ctx:t,logger:e,req:r,client:n,self:a})=>{let{input:s,type:i}=Se(r);if(!i)throw new Error("Missing action type");let o=a.hookHandlers.before_incoming_call_action[i]??[];for(let O of o){let w=await O({ctx:t,logger:e,client:n,data:{type:i,input:s},...tt({client:n})});s=w?.data?.input??s,i=w?.data?.type??i}let c=a.actionHandlers[i];if(!c)throw new Error(`Action ${i} not found`);let p=await c({ctx:t,logger:e,input:s,client:n,type:i,...tt({client:n})}),m=a.hookHandlers.after_incoming_call_action[i]??[];for(let O of m){let w=await O({ctx:t,logger:e,client:n,data:{type:i,output:p},...tt({client:n})});i=w?.data?.type??i,p=w?.data?.output??p}return{status:200,body:JSON.stringify({output:p})}},tt=t=>({workflows:Jt(t.client)});var pa=class{constructor(e){this.props=e;this._actionHandlers=e.actions,this._plugins=e.plugins}_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_plugins={};_registerOrder=0;get actionHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._actionHandlers[r];if(n)return n;for(let a of Object.values(this._plugins))if(n=a.actionHandlers[r],n)return n}})}get messageHandlers(){return new Proxy({},{get:(e,r)=>{let n=Object.values(this._plugins).flatMap(o=>o.messageHandlers[r]??[]),a=this._messageHandlers[r]??[],s=this._messageHandlers["*"]??[],i=[...a,...s].sort((o,c)=>o.order-c.order).map(({handler:o})=>o);return A.unique([...n,...i])}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{let n=Object.values(this._plugins).flatMap(o=>o.eventHandlers[r]??[]),a=this._eventHandlers[r]??[],s=this._eventHandlers["*"]??[],i=[...a,...s].sort((o,c)=>o.order-c.order).map(({handler:o})=>o);return A.unique([...n,...i])}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{let n=Object.values(this._plugins).flatMap(o=>o.stateExpiredHandlers[r]??[]),a=this._stateExpiredHandlers[r]??[],s=this._stateExpiredHandlers["*"]??[],i=[...a,...s].sort((o,c)=>o.order-c.order).map(({handler:o})=>o);return A.unique([...n,...i])}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>{if(this._hookHandlers[r])return new Proxy({},{get:(a,s)=>{let i=Object.values(this._plugins).flatMap(T=>T.hookHandlers[r]?.[s]??[]),o=this._hookHandlers[r]??{},c=o[s]??[],p=o["*"]??[],m=[...c,...p].sort((T,O)=>T.order-O.order).map(({handler:T})=>T);return A.unique([...i,...m])}})}})}get workflowHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._workflowHandlers[r];if(n)return new Proxy({},{get:(a,s)=>{let i=n[s]?.sort((c,p)=>c.order-p.order).map(({handler:c})=>c)??[],o=Object.values(this._plugins).flatMap(c=>c.workflowHandlers[r]?.[s]??[]);return A.unique([...i,...o])}})}})}on={message:(e,r)=>{this._messageHandlers[e]=A.safePush(this._messageHandlers[e],{handler:r,order:this._registerOrder++})},event:(e,r)=>{this._eventHandlers[e]=A.safePush(this._eventHandlers[e],{handler:r,order:this._registerOrder++})},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=A.safePush(this._stateExpiredHandlers[e],{handler:r,order:this._registerOrder++})},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=A.safePush(this._hookHandlers.before_incoming_event[e],{handler:r,order:this._registerOrder++})},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=A.safePush(this._hookHandlers.before_incoming_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=A.safePush(this._hookHandlers.before_outgoing_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=A.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},beforeIncomingCallAction:(e,r)=>{this._hookHandlers.before_incoming_call_action[e]=A.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=A.safePush(this._hookHandlers.after_incoming_event[e],{handler:r,order:this._registerOrder++})},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=A.safePush(this._hookHandlers.after_incoming_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=A.safePush(this._hookHandlers.after_outgoing_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=A.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingCallAction:(e,r)=>{this._hookHandlers.after_incoming_call_action[e]=A.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:r,order:this._registerOrder++})},workflowStart:(e,r)=>{this._workflowHandlers.started[e]=A.safePush(this._workflowHandlers.started[e],{handler:r,order:this._registerOrder++})},workflowContinue:(e,r)=>{this._workflowHandlers.continued[e]=A.safePush(this._workflowHandlers.continued[e],{handler:r,order:this._registerOrder++})},workflowTimeout:(e,r)=>{this._workflowHandlers.timed_out[e]=A.safePush(this._workflowHandlers.timed_out[e],{handler:r,order:this._registerOrder++})}};handler=tp(this);start=e=>kr(this.handler,e)};var ga=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.title=e.title,this.description=e.description,this.readme=e.readme,this.entities=e.entities??{};let r=this._getEntityReference(this.entities),n=e.events===void 0?{}:te.mapValues(e.events,i=>({...i,schema:i.schema(r)})),a=e.actions===void 0?{}:te.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(r)},output:{...i.output,schema:i.output.schema(r)}})),s=e.channels===void 0?{}:te.mapValues(e.channels,i=>({...i,messages:te.mapValues(i.messages,o=>({...o,schema:o.schema(r)}))}));this.events=n,this.actions=a,this.channels=s}name;version;title;description;icon;readme;entities;events;actions;channels;_getEntityReference=e=>{let r={};for(let[n,a]of Object.entries(e)){let s=a.schema._def["x-zui"]?.title,i=a.schema._def.description,o=Rf.ref(n);s&&o.title(s),i&&o.describe(i),r[n]=o}return r}};var ha=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.description=e.description,this.integrations=e.integrations,this.interfaces=e.interfaces,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables,this.workflows=e.workflows}name;version;title;description;icon;readme;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows};var si=":";var rp=t=>{let[e,r]=t.split(si);return!e||!r?null:{namespace:e,eventName:r}},np=t=>`${t.namespace}${si}${t.actionName}`,ap=t=>`${t.namespace}${si}${t.eventName}`,sp=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.actions[t.actionName]?.name??t.actionName;return{namespace:n,actionName:a}},ip=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.events[t.eventName]?.name??t.eventName;return{namespace:n,eventName:a}};var op=(t,e)=>new Proxy({},{get:(r,n)=>new Proxy({},{get:(a,s)=>i=>TT({client:t,interfaces:e.interfaces,integrationOrInterfaceName:n,methodName:s,input:i})})}),TT=async({client:t,interfaces:e,integrationOrInterfaceName:r,methodName:n,input:a})=>{let s=sp({namespace:r,actionName:n},e),i=np(s);return(await t.callAction({type:i,input:a})).output};var ii=class{constructor(e,r,n){this._client=e;this._stateType=r;this._stateName=n}async get(e){return await this._client.getState({type:this._stateType,name:this._stateName,id:e}).then(r=>r.state.payload)}async set(e,r){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:r})}async getOrSet(e,r){return await this._client.getOrSetState({type:this._stateType,name:this._stateName,id:e,payload:r}).then(n=>n.state.payload)}async delete(e){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:null})}async patch(e,r){await this._client.patchState({type:this._stateType,name:this._stateName,id:e,payload:r})}},lp=(t,e)=>new Proxy({},{get:(r,n)=>new Proxy({},{get:(a,s)=>{let i=e.alias!==void 0?`${e.alias}${ca}${s}`:s;return new ii(t,n,i)}})});var ma=class{constructor(e){this.props=e;this._actionHandlers=e.actions}_runtimeProps;_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_registerOrder=0;initialize(e){return this._runtimeProps=e,this}get _runtime(){if(!this._runtimeProps)throw new Error("Plugin not correctly initialized. This is likely because you access your plugin config outside of an handler.");return this._runtimeProps}_getTools(e){let{configuration:r,interfaces:n,alias:a}=this._runtime,s=op(e,this._runtime),i=lp(e,this._runtime),o=Jt(e);return{configuration:r,interfaces:n,actions:s,states:i,alias:a,workflows:o}}get actionHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._actionHandlers[r];if(n)return Fe.setName(a=>n({...a,...this._getTools(a.client)}),n.name)}})}get messageHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._messageHandlers[r]??[],a=this._messageHandlers["*"]??[];return A.unique([...n,...a]).sort((i,o)=>i.order-o.order).map(({handler:i})=>Fe.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._eventHandlers[r]??[],a=Object.entries(this._eventHandlers).filter(([o])=>this._eventResolvesTo(o,r)).flatMap(([,o])=>o??[]),s=this._eventHandlers["*"]??[];return A.unique([...n,...a,...s]).sort((o,c)=>o.order-c.order).map(({handler:o})=>Fe.setName(c=>o({...c,...this._getTools(c.client)}),o.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._stateExpiredHandlers[r]??[],a=this._stateExpiredHandlers["*"]??[];return A.unique([...n,...a]).sort((i,o)=>i.order-o.order).map(({handler:i})=>Fe.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._hookHandlers[r];if(n)return new Proxy({},{get:(a,s)=>{s=this._stripAliasPrefix(s);let i=n[s]??[],o=Object.entries(n).filter(([m])=>this._eventResolvesTo(m,s)).flatMap(([,m])=>m??[]),c=n["*"]??[];return A.unique([...i,...o,...c]).sort((m,T)=>m.order-T.order).map(({handler:m})=>Fe.setName(T=>m({...T,...this._getTools(T.client)}),m.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._workflowHandlers[r];if(n)return new Proxy({},{get:(a,s)=>(n[s]?.sort((o,c)=>o.order-c.order)??[]).map(({handler:o})=>Fe.setName(c=>o({...c,...this._getTools(c.client)}),o.name))})}})}on={message:(e,r)=>{this._messageHandlers[e]=A.safePush(this._messageHandlers[e],{handler:r,order:this._registerOrder++})},event:(e,r)=>{this._eventHandlers[e]=A.safePush(this._eventHandlers[e],{handler:r,order:this._registerOrder++})},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=A.safePush(this._stateExpiredHandlers[e],{handler:r,order:this._registerOrder++})},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=A.safePush(this._hookHandlers.before_incoming_event[e],{handler:r,order:this._registerOrder++})},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=A.safePush(this._hookHandlers.before_incoming_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=A.safePush(this._hookHandlers.before_outgoing_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=A.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},beforeIncomingCallAction:(e,r)=>{this._hookHandlers.before_incoming_call_action[e]=A.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=A.safePush(this._hookHandlers.after_incoming_event[e],{handler:r,order:this._registerOrder++})},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=A.safePush(this._hookHandlers.after_incoming_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=A.safePush(this._hookHandlers.after_outgoing_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=A.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingCallAction:(e,r)=>{this._hookHandlers.after_incoming_call_action[e]=A.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:r,order:this._registerOrder++})},workflowStart:(e,r)=>{this._workflowHandlers.started[e]=A.safePush(this._workflowHandlers.started[e],{handler:r,order:this._registerOrder++})},workflowContinue:(e,r)=>{this._workflowHandlers.continued[e]=A.safePush(this._workflowHandlers.continued[e],{handler:r,order:this._registerOrder++})},workflowTimeout:(e,r)=>{this._workflowHandlers.timed_out[e]=A.safePush(this._workflowHandlers.timed_out[e],{handler:r,order:this._registerOrder++})}};_eventResolvesTo=(e,r)=>{let n=rp(e);if(!n)return!1;let a=ip(n,this._runtime.interfaces);return ap(a)===r};_stripAliasPrefix=e=>{let{alias:r}=this._runtime;if(!r)return e;let n=`${r}:`;return e.startsWith(n)?e.slice(n.length):e}};0&&(module.exports={BRAND,Bot,BotDefinition,BotLogger,BotSpecificClient,DIRTY,EMPTY_PATH,ErrorBoundary,INVALID,Integration,IntegrationDefinition,IntegrationLogger,IntegrationSpecificClient,InterfaceDefinition,NEVER,OK,ParseInputLazyPath,ParseStatus,Plugin,PluginDefinition,RuntimeError,Schema,WELL_KNOWN_ATTRIBUTES,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,ZodFirstPartyTypeKind,ZodFunction,ZodIntersection,ZodIssueCode,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodRef,ZodSchema,ZodSet,ZodString,ZodSymbol,ZodTransformer,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,ZuiForm,addIssueToContext,agent,aimodel,any,array,bigint,boolean,botIdHeader,botUserIdHeader,coerce,configurationHeader,configurationTypeHeader,conversation,createZodEnum,cuid2Regex,cuidRegex,custom,datasource,date,datetimeRegex,defaultComponentDefinitions,discriminatedUnion,effect,emailRegex,enum:null,errorUtil,event,fromJsonSchema,fromObject,function:null,getErrorMap,getParsedType,instanceof:null,integrationIdHeader,intent,intersection,ipv4Regex,ipv6Regex,isAborted,isApiError,isAsync,isDirty,isEmojiRegex,isValid,jsonSchemaToZui,knowledgebase,late,lazy,literal,makeIssue,map,mergeObjectSchemas,message,messages,nan,nativeEnum,never,null:null,nullable,number,object,objectToZui,objectUtil,oboolean,onumber,operationHeader,optional,ostring,parseBody,pipeline,preprocess,processCreateParams,promise,quotelessJson,readonly,record,ref,serve,set,setErrorMap,strictObject,string,symbol,table,tablerow,transformer,transforms,tuple,typeHeader,ulidRegex,undefined,union,unknown,user,util,uuidRegex,variable,void:null,webhookIdHeader,withErrorBoundary,z,zuiToJsonSchema});
89
+ `,a+="})"}let s=r?a?r+a:n?n==="z.never()"?r+".strict()":r+`.catchall(${n})`:r:a||(n?`z.record(${n})`:"z.record(z.any())");return ie.an.anyOf(t)&&(s+=`.and(${Cf(h(d({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?h(d({},i),{type:"object"}):i)}),e)})`),ie.a.oneOf(t)&&(s+=`.and(${Ys(h(d({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?h(d({},i),{type:"object"}):i)}),e)})`),ie.an.allOf(t)&&(s+=`.and(${hr(h(d({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?h(d({},i),{type:"object"}):i)}),e)})`),s}l(If,"parseObject");var w_=l(t=>{var e;let r="z.string()";if((e=t[K])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";r="z.coerce.string()"}return r+=fe(t,"format",({value:n})=>{switch(n){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),r+=fe(t,"pattern",({json:n})=>[`.regex(new RegExp(${n})`,", ",")"]),r+=fe(t,"minLength",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxLength",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseString"),P_=l((t,e)=>`${ce(h_(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),k_=l(t=>`z.ref('${t.$ref}')`,"parseRef"),E_=l((t,e)=>{var r,n;if(t.oneOf.length<=1||!((r=t.discriminator)!=null&&r.propertyName))return Ys(t,e);let a=t.oneOf.map((s,i)=>ce(s,h(d({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(n=t.discriminator)==null?void 0:n.propertyName}", [${a.join(", ")}])`},"parseDiscriminator"),ce=l((t,e={seen:new Map,path:[]},r)=>{if(typeof t!="object")return t?"z.any()":"z.never()";if(e.parserOverride){let s=e.parserOverride(t,e);if(typeof s=="string")return s}let n=e.seen.get(t);if(n){if(n.r!==void 0)return n.r;if(e.depth===void 0||n.n>=e.depth)return"z.any()";n.n+=1}else n={r:void 0,n:0},e.seen.set(t,n);let a=O_(t,e);return r||(a=x_(t,a),e.withoutDefaults||(a=S_(t,a))),n.r=a,a},"parseSchema"),x_=l((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),S_=l((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),O_=l((t,e)=>ie.a.nullable(t)?P_(t,e):ie.an.object(t)?If(t,e):ie.an.array(t)?y_(t,e):ie.an.anyOf(t)?Cf(t,e):ie.an.allOf(t)?hr(t,e):ie.a.discriminator(t)?E_(t,e):ie.a.oneOf(t)?Ys(t,e):ie.a.not(t)?f_(t,e):ie.an.enum(t)?__(t):ie.a.const(t)?v_(t):ie.a.multipleType(t)?d_(t,e):ie.a.primitive(t,"string")?w_(t):ie.a.primitive(t,"number")||ie.a.primitive(t,"integer")?b_(t):ie.a.primitive(t,"boolean")?u_(t):ie.a.primitive(t,"null")?p_(t):ie.a.conditional(t)?T_(t,e):ie.a.ref(t)?k_(t):c_(t),"selectParser"),ie={an:{object:l(t=>t.type==="object","object"),array:l(t=>t.type==="array","array"),anyOf:l(t=>t.anyOf!==void 0,"anyOf"),allOf:l(t=>t.allOf!==void 0,"allOf"),enum:l(t=>t.enum!==void 0,"enum")},a:{nullable:l(t=>t.nullable===!0,"nullable"),multipleType:l(t=>Array.isArray(t.type),"multipleType"),not:l(t=>t.not!==void 0,"not"),const:l(t=>t.const!==void 0,"const"),primitive:l((t,e)=>t.type===e,"primitive"),conditional:l(t=>Boolean("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:l(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:l(t=>t.oneOf!==void 0,"oneOf"),ref:l(t=>t.$ref!==void 0,"ref")}},C_=l(t=>{let e;try{e=new Function("z",`return ${t}`)(v)}catch(r){return{sucess:!1,error:`Failed to evaluate schema: ${(r instanceof Error?r:new Error(String(r))).message}`}}return e instanceof v.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),I_=l(t=>ce(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),B_=l(t=>{let e=I_(t);e=e.replaceAll("errors: z.ZodError[]","errors");let r=C_(e);if(!r.sucess)throw new ol(r.error);return r.value},"jsonSchemaToZod"),or=l((t,e)=>{var r,n;if(e[K]&&t._def&&(t._def[K]=e[K]),((r=t._def)==null?void 0:r.typeName)==="ZodObject"&&e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([a,s])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[a]&&or(i[a],s)}),((n=t._def)==null?void 0:n.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&or(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let a=e.items;if(typeof a=="object"&&!Array.isArray(a)){let s=t._def.type;s&&or(s,a)}else Array.isArray(a)&&a.forEach((s,i)=>{let o=t._def;o.typeName===E.ZodFirstPartyTypeKind.ZodTuple&&or(o.items[i],s)})}},"applyZuiPropsRecursively"),Tr=l(t=>{let e=B_(t);return or(e,t),e},"jsonSchemaToZui"),Bf=class extends Lt.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Uncaught error:",e,r)}render(){return this.state.hasError&&this.props.fallback?Lt.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};l(Bf,"ErrorBoundary");var Mt=Bf;function Rf(t,e){return r=>Lt.default.createElement(Mt,{fallback:e,fieldSchema:r.fieldSchema,path:r.path},Lt.default.createElement(t,d({},r)))}l(Rf,"withErrorBoundary");var Jr=l(t=>{var e=t,{components:r,fieldSchema:n,path:a,required:s,fallback:i}=e,o=Lo(e,["components","fieldSchema","path","required","fallback"]),c,p;let{formData:m,disabled:T,hidden:O,handlePropertyChange:w,addArrayItem:S,removeArrayItem:W,formErrors:q,formValid:re}=Vo(n,a),J=(0,be.useMemo)(()=>ot(m,a),[m,a]),N=(0,be.useMemo)(()=>Fg(r,n),[n,r]),{discriminator:F,discriminatedSchema:ue,discriminatorValue:Le}=$g(n,a);if(!N||O===!0)return null;let{Component:rt,type:Ce}=N,we={type:Ce,componentID:N.id,scope:a.join("."),context:{path:a,readonly:!1,formData:m,formErrors:q,formValid:re,updateForm:w,updateFormData:l(Pe=>w([],Pe),"updateFormData")},onChange:l(Pe=>w(a,Pe),"onChange"),disabled:T,errors:q?.filter(Pe=>Pe.path===a)||[],label:((c=n[K])==null?void 0:c.title)||qa(((p=a[a.length-1])==null?void 0:p.toString())||""),params:N.params,schema:n,zuiProps:n[K]};if(n.type==="array"&&Ce==="array"){let Pe=rt,Te=we.schema,ke=Array.isArray(J)||typeof J=="object"?J:[],j=d(h(d({},we),{type:Ce,schema:Te,data:ke,addItem:l(Ie=>S(a,Ie),"addItem"),removeItem:l(Ie=>W(a,Ie),"removeItem")}),o);return Array.isArray(n.items)?null:be.default.createElement(Pe,h(d({key:we.scope},j),{isArrayChild:j.isArrayChild}),Array.isArray(j.data)?j.data.map((Ie,Oe)=>{let ze=[...a,Oe.toString()];return be.default.createElement(Mt,{key:ze.join("."),fallback:i,fieldSchema:n.items,path:ze},be.default.createElement(Jr,{key:ze.join("."),components:r,fieldSchema:n.items,path:ze,required:s,isArrayChild:!0,index:Oe,removeSelf:()=>W(a,Oe),fallback:i}))}):[])}if(n.type==="object"&&Ce==="object"&&n.properties){let Pe=rt,Te=d(h(d({},we),{type:Ce,schema:we.schema,data:J||{}}),o);return be.default.createElement(Pe,h(d({key:we.scope},Te),{isArrayChild:Te.isArrayChild}),Object.entries(n.properties).map(([ke,j])=>{var Ie;let Oe=[...a,ke];return be.default.createElement(Mt,{key:Oe.join("."),fallback:i,fieldSchema:j,path:Oe},be.default.createElement(Jr,{key:Oe.join("."),components:r,fieldSchema:j,path:Oe,required:((Ie=n.required)==null?void 0:Ie.includes(ke))||!1,isArrayChild:!1,fallback:i}))}))}if(Ce==="discriminatedUnion"){let Pe=rt,Te=d(h(d({},we),{type:Ce,schema:we.schema,data:J||{},discriminatorKey:F?.key||null,discriminatorLabel:qa(F?.key||"Unknown"),discriminatorOptions:F?.values||null,discriminatorValue:Le,setDiscriminator:l(ke=>{if(!F?.key){console.warn("No discriminator key found, cannot set discriminator");return}w(a,{[F.key]:ke})},"setDiscriminator")}),o);return be.default.createElement(Pe,h(d({key:we.scope},Te),{isArrayChild:Te.isArrayChild}),ue&&be.default.createElement(Mt,{key:a.join("."),fallback:i,fieldSchema:ue,path:a},be.default.createElement(Jr,{components:r,fieldSchema:ue,path:a,required:s,isArrayChild:!1,fallback:i})))}let va=rt,_a=d(h(d({},we),{type:Ce,schema:we.schema,config:{},required:s,data:J,description:n.description}),o);return be.default.createElement(va,d({},_a))},"FormElementRenderer"),R_=l(({schema:t,components:e,onChange:r,value:n,disableValidation:a,fallback:s,dataTransform:i,onValidation:o})=>{let[c,p]=(0,Ne.useState)(n);return(0,Ne.useEffect)(()=>{r(c)},[c]),(0,Ne.useEffect)(()=>{let m=Dt(t);p(T=>Xr(m,T))},[JSON.stringify(t),p]),Ne.default.createElement(Ng,{formData:c,setFormData:p,formSchema:t,disableValidation:a||!1,dataTransform:i,onValidation:o},Ne.default.createElement(Mt,{fallback:s,fieldSchema:t,path:[]},Ne.default.createElement(Jr,{components:e,fieldSchema:t,path:[],fallback:s,required:!0,isArrayChild:!1})))},"ZuiForm"),Z_={string:{},number:{slider:{id:"slider",params:v.object({})}},boolean:{switch:{id:"switch",params:v.object({})}},array:{},object:{},discriminatedUnion:{}},A_={errors:al,jsonSchemaToZui:Tr,zuiToJsonSchema:aa,objectToZui:Ft,toTypescript:Qr,toTypescriptSchema:ws};var Vt=(t,e)=>{let r=t._def,n=e._def;if(r.typeName===E.ZodFirstPartyTypeKind.ZodObject&&n.typeName===E.ZodFirstPartyTypeKind.ZodObject){let a=r.shape(),s=n.shape();return E.object({...a,...s})}if(r.typeName===E.ZodFirstPartyTypeKind.ZodRecord&&n.typeName===E.ZodFirstPartyTypeKind.ZodRecord)return E.record(E.intersection(r.valueType,n.valueType));throw new Error("Cannot merge object schemas with record schemas")},Zf=E;var _e=E.string().min(1),Df=E.object({text:_e}),Hf=E.object({markdown:_e}),Mf=E.object({imageUrl:_e}),jf=E.object({audioUrl:_e}),Nf=E.object({videoUrl:_e}),$f=E.object({fileUrl:_e,title:_e.optional()}),Uf=E.object({latitude:E.number(),longitude:E.number(),address:E.string().optional(),title:E.string().optional()}),Kf=E.object({title:_e,subtitle:_e.optional(),imageUrl:_e.optional(),actions:E.array(E.object({action:E.enum(["postback","url","say"]),label:_e,value:_e}))}),Af=E.object({text:_e,options:E.array(E.object({label:_e,value:_e}))}),D_=E.object({items:E.array(Kf)}),H_=E.union([E.object({type:E.literal("text"),payload:Df}),E.object({type:E.literal("markdown"),payload:Hf}),E.object({type:E.literal("image"),payload:Mf}),E.object({type:E.literal("audio"),payload:jf}),E.object({type:E.literal("video"),payload:Nf}),E.object({type:E.literal("file"),payload:$f}),E.object({type:E.literal("location"),payload:Uf})]),M_=E.object({items:E.array(H_)}),j_={schema:Hf},N_={text:{schema:Df},image:{schema:Mf},audio:{schema:jf},video:{schema:Nf},file:{schema:$f},location:{schema:Uf},carousel:{schema:D_},card:{schema:Kf},dropdown:{schema:Af},choice:{schema:Af},bloc:{schema:M_}};var br="x-bot-id",Qs="x-bot-user-id",ei="x-integration-id",ti="x-webhook-id",ri="x-bp-configuration-type",wr="x-bp-configuration",Pr="x-bp-operation",ni="x-bp-type",$_={HIDDEN_IN_STUDIO:{bpActionHiddenInStudio:"true"},AWAIT_RETURN:{bpActionAwaitReturn:"true"}};var Ff=require("browser-or-node");var ai=console;function Se(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function kr(t,e=8072,r=L_){if(!Ff.isNode)throw new Error("This function can only be called in Node.js");let a=require("http").createServer(async(s,i)=>{try{let o=await U_(s);if(o.path==="/health"){i.writeHead(200).end("ok");return}let c=await t(o);i.writeHead(c?.status??200,c?.headers??{}).end(c?.body??"{}")}catch(o){ai.error("Error while handling request",{error:o?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:o?.message??"Internal error occured"}))}});return a.listen(e,()=>r(e)),a}async function U_(t){let e=await F_(t),r={};for(let a=0;a<t.rawHeaders.length;a+=2){let s=t.rawHeaders[a].toLowerCase(),i=t.rawHeaders[a+1];r[s]=i}let n=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:n.pathname,query:K_(n.search,"?"),headers:r,method:t.method?.toUpperCase()??"GET"}}function K_(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function F_(t){return new Promise((e,r)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let n="";t.on("data",a=>n+=a.toString()),t.on("error",a=>r(a)),t.on("end",()=>e(n))})}function L_(t){ai.info(`Listening on port ${t}`)}var ya=require("@botpress/client");var te={};er(te,{mapKeys:()=>V_,mapValues:()=>W_,mergeRecords:()=>G_,pairs:()=>sa,stripUndefinedProps:()=>q_,values:()=>z_});var sa=t=>Object.entries(t),z_=t=>Object.values(t),W_=(t,e)=>Object.fromEntries(sa(t).map(([r,n])=>[r,e(n,r)])),V_=(t,e)=>Object.fromEntries(sa(t).map(([r,n])=>[e(r),n])),q_=t=>Object.fromEntries(sa(t).filter(([,e])=>e!==void 0)),G_=(t,e,r)=>{let n=[...Object.keys(t),...Object.keys(e)],a=[...new Set(n)],s={};for(let i of a){let o=t[i],c=e[i];o&&c?s[i]=r(o,c):o?s[i]=o:c&&(s[i]=c)}return s};var A={};er(A,{safePush:()=>J_,unique:()=>Y_});var J_=(t,...e)=>t?[...t,...e]:[...e],Y_=t=>Array.from(new Set(t));var Fe={};er(Fe,{setName:()=>X_});var X_=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Lf=t=>{let{name:e,version:r}=t,n={actions:{},events:{},channels:{}},a={name:e,version:r,entities:te.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},s=te.mapValues(t.entities,i=>i.schema);for(let[i,o]of Object.entries(t.definition.actions??{})){let c=o.input.schema.dereference(s),p=o.output.schema.dereference(s),m=t.actions?.[i]?.name??i;n.actions[m]={...o,...t.actions?.[i]??{},input:{schema:c},output:{schema:p}},a.actions[i]={name:m}}for(let[i,o]of Object.entries(t.definition.events??{})){let c=o.schema.dereference(s),p=t.events?.[i]?.name??i;n.events[p]={...o,...t.events?.[i]??{},schema:c},a.events[i]={name:p}}for(let[i,o]of Object.entries(t.definition.channels??{})){let c={};for(let[m,T]of Object.entries(o.messages)){let O=T.schema.dereference(s);c[m]={...T,schema:O}}let p=t.channels?.[i]?.name??i;n.channels[p]={...o,...t.channels?.[i]??{},message:{...o.message??{},tags:{...o.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...o.conversation??{},tags:{...o.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:c},a.channels[i]={name:p}}return{resolved:n,statement:a}};var ia=Symbol("schemaName"),zf=t=>t?te.mapValues(t,(r,n)=>({...r,[ia]:n})):{},Wf=t=>ia in t&&t[ia]!==void 0,Vf=t=>t[ia];var oa=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.configurations=e.configurations,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities,this.interfaces=e.interfaces,this.__advanced=e.__advanced}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;extend(e,r){let{entities:n,actions:a,events:s,channels:i}=this._callBuilder(e,r),o=this;o.interfaces??={};let c=Object.values(n).map(O=>O.name),p=c.length===0?e.name:`${e.name}<${c.join(",")}>`,{resolved:m,statement:T}=Lf({...e,entities:n,actions:te.stripUndefinedProps(a),events:te.stripUndefinedProps(s),channels:te.stripUndefinedProps(i)});return o.actions=te.mergeRecords(o.actions??{},m.actions,this._mergeActions),o.channels=te.mergeRecords(o.channels??{},m.channels,this._mergeChannels),o.events=te.mergeRecords(o.events??{},m.events,this._mergeEvents),o.interfaces[p]={id:e.id,...T},this}_callBuilder(e,r){let a={entities:zf(this.entities)},s=r(a),i=te.pairs(s.entities).find(([c,p])=>!Wf(p));if(i)throw new Error(`Cannot extend interface "${e.name}" with entity "${i[0]}"; the provided schema is not part of the integration's entities.`);return{entities:te.mapValues(s.entities,c=>({name:Vf(c),schema:c.schema})),actions:s.actions??{},events:s.events??{},channels:s.channels??{}}}_mergeActions=(e,r)=>({...e,...r,input:{schema:Vt(e.input.schema,r.input.schema)},output:{schema:Vt(e.output.schema,r.output.schema)}});_mergeEvents=(e,r)=>({...e,...r,schema:Vt(e.schema,r.schema)});_mergeChannels=(e,r)=>{let n=te.mergeRecords(e.messages,r.messages,this._mergeMessage),a;(e.conversation||r.conversation)&&(a={tags:{...e.conversation?.tags,...r.conversation?.tags}});let s;return(e.message||r.message)&&(s={tags:{...e.message?.tags,...r.message?.tags}}),{...e,...r,messages:n,conversation:a,message:s}};_mergeMessage=(e,r)=>({schema:Vt(e.schema,r.schema)})};var wt=require("@botpress/client");var qf=require("@botpress/client"),la={retries:3,retryCondition:t=>qf.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:t=>t*1e3};var qt=class{constructor(e){this._client=e}createConversation=e=>this._client.createConversation(e);getConversation=e=>this._client.getConversation(e);listConversations=e=>this._client.listConversations(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);updateConversation=e=>this._client.updateConversation(e);deleteConversation=e=>this._client.deleteConversation(e);listParticipants=e=>this._client.listParticipants(e);addParticipant=e=>this._client.addParticipant(e);getParticipant=e=>this._client.getParticipant(e);removeParticipant=e=>this._client.removeParticipant(e);createEvent=e=>this._client.createEvent(e);getEvent=e=>this._client.getEvent(e);listEvents=e=>this._client.listEvents(e);createMessage=e=>this._client.createMessage(e);getOrCreateMessage=e=>this._client.getOrCreateMessage(e);getMessage=e=>this._client.getMessage(e);updateMessage=e=>this._client.updateMessage(e);listMessages=e=>this._client.listMessages(e);deleteMessage=e=>this._client.deleteMessage(e);createUser=e=>this._client.createUser(e);getUser=e=>this._client.getUser(e);listUsers=e=>this._client.listUsers(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);updateUser=e=>this._client.updateUser(e);deleteUser=e=>this._client.deleteUser(e);getState=e=>this._client.getState(e);setState=e=>this._client.setState(e);getOrSetState=e=>this._client.getOrSetState(e);patchState=e=>this._client.patchState(e);configureIntegration=e=>this._client.configureIntegration(e);uploadFile=e=>this._client.uploadFile(e);upsertFile=e=>this._client.upsertFile(e);deleteFile=e=>this._client.deleteFile(e);listFiles=e=>this._client.listFiles(e);getFile=e=>this._client.getFile(e);updateFileMetadata=e=>this._client.updateFileMetadata(e)};var ua=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};var ca="#";var Q_=E.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Jf=t=>{let e=t[br],r=t[Qs],n=t[ei],a=t[ti],s=t[ri],i=t[wr],o=Q_.parse(t[Pr]);if(!e)throw new Error("Missing bot headers");if(!r)throw new Error("Missing bot user headers");if(!n)throw new Error("Missing integration headers");if(!a)throw new Error("Missing webhook headers");if(!i)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:e,botUserId:r,integrationId:n,webhookId:a,operation:o,configurationType:s??null,configuration:i?JSON.parse(Buffer.from(i,"base64").toString("utf-8")):{}}};var Yf=St(require("util")),Gt=class{defaultOptions;constructor(e){this.defaultOptions=e}info(...e){this._log("info",e)}debug(...e){this._log("debug",e)}warn(...e){this._log("warn",e)}error(...e){this._log("error",e)}_log(e,r){this._getConsoleMethod(e)(this._serializeMessage(r))}_serializeMessage(e){let r=Yf.default.format(...e);return process.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(r):r}getJsonMessage(e){return JSON.stringify({msg:e,options:this.defaultOptions})}_getConsoleMethod(e){switch(e){case"debug":return console.debug;case"warn":return console.warn;case"error":return console.error;default:return console.info}}};var Ye=class extends Gt{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new Ye({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withVisibleToBotOwners(e){return this.with({visibleToBotOwners:e})}forBot(){return this.withVisibleToBotOwners(!0)}getJsonMessage(e){return JSON.stringify({msg:e,visible_to_bot_owner:this.defaultOptions.visibleToBotOwners,options:this.defaultOptions})}};var eT=t=>["traceparent","tracestate","sentry-trace"].reduce((e,r)=>(t[r]&&(e[r]=t[r]),e),{}),Xf=t=>async e=>{let r=Jf(e.headers),[,n]=(e.headers.traceparent||"").split("-"),a=new wt.Client({botId:r.botId,integrationId:r.integrationId,retry:la,headers:eT(e.headers)}),s=new qt(a),i=new Ye({traceId:n}),o={ctx:r,req:e,client:s,logger:i,instance:t};try{let c;switch(r.operation){case"webhook_received":c=await rT(o);break;case"register":c=await nT(o);break;case"unregister":c=await aT(o);break;case"message_created":c=await oT(o);break;case"action_triggered":c=await lT(o);break;case"ping":c=await tT(o);break;case"create_user":c=await sT(o);break;case"create_conversation":c=await iT(o);break;default:throw new Error(`Unknown operation ${r.operation}`)}return c?{...c,status:c.status??200}:{status:200}}catch(c){if((0,wt.isApiError)(c)){let m=c.type==="Runtime"?c:new wt.RuntimeError(c.message,c);return i.forBot().error(m.message),{status:m.code,body:JSON.stringify(m.toJSON())}}console.error(c);let p=new wt.RuntimeError("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return i.forBot().error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}},tT=async t=>{},rT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{let{req:s}=Se(r);return a.webhook({client:t,ctx:e,req:s,logger:n})},nT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.register)return;let{webhookUrl:s}=Se(r);await a.register({client:t,ctx:e,webhookUrl:s,logger:n})},aT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.unregister)return;let{webhookUrl:s}=Se(r);await a.unregister({ctx:e,webhookUrl:s,client:t,logger:n})},sT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createUser)return;let{tags:s}=Se(r);return await a.createUser({ctx:e,client:t,tags:s,logger:n})},iT=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createConversation)return;let{channel:s,tags:i}=Se(r);return await a.createConversation({ctx:e,client:t,channel:s,tags:i,logger:n})},oT=async({ctx:t,req:e,client:r,logger:n,instance:a})=>{let{conversation:s,user:i,type:o,payload:c,message:p}=Se(e),m=a.channels[s.channel];if(!m)throw new Error(`Channel ${s.channel} not found`);let T=m.messages[o];if(!T)throw new Error(`Message of type ${o} not found in channel ${s.channel}`);await T({ctx:t,conversation:s,message:p,user:i,type:o,client:r,payload:c,ack:async({tags:w})=>{await r.updateMessage({id:p.id,tags:w})},logger:n})},lT=async({req:t,ctx:e,client:r,logger:n,instance:a})=>{let{input:s,type:i}=Se(t);if(!i)throw new Error("Missing action type");let o=a.actions[i];if(!o)throw new Error(`Action ${i} not found`);let c=new ua,m={output:await o({ctx:e,input:s,client:r,type:i,logger:n,metadata:c}),meta:c.toJSON()};return{body:JSON.stringify(m)}};var da=class{constructor(e){this.props=e;this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}actions;channels;register;unregister;createUser;createConversation;webhook;handler=Xf(this);start=e=>kr(this.handler,e)};var fa=class{constructor(e){this.props=e;this.integrations=e.integrations,this.plugins=e.plugins,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables,this.workflows=e.workflows}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;addIntegration(e,r){let n=this;return n.integrations||(n.integrations={}),n.integrations[e.name]={enabled:r.enabled,...e,configurationType:r.configurationType,configuration:r.configuration},this}addPlugin(e,r){let n=this;n.plugins||(n.plugins={});let a=r.alias??e.name;return n.plugins[a]={...e,alias:r.alias,configuration:r.configuration,interfaces:r.interfaces},n.user=this._mergeUser(n.user,e.definition.user),n.conversation=this._mergeConversation(n.conversation,e.definition.conversation),n.message=this._mergeMessage(n.message,e.definition.message),n.recurringEvents=this._mergeRecurringEvents(n.recurringEvents,e.definition.recurringEvents),n.tables=this._mergeTables(n.tables,e.definition.tables),n.workflows=this._mergeWorkflows(n.workflows,e.definition.workflows),n.states=this._mergeStates(n.states,this._prefixKeys(e.definition.states,r.alias)),n.events=this._mergeEvents(n.events,this._prefixKeys(e.definition.events,r.alias)),n.actions=this._mergeActions(n.actions,this._prefixKeys(e.definition.actions,r.alias)),this}_mergeUser=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeConversation=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeMessage=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeStates=(e,r)=>({...e,...r});_mergeEvents=(e,r)=>({...e,...r});_mergeRecurringEvents=(e,r)=>({...e,...r});_mergeActions=(e,r)=>({...e,...r});_mergeTables=(e,r)=>({...e,...r});_mergeWorkflows=(e,r)=>({...e,...r});_prefixKeys=(e,r)=>!e||!r?e:te.mapKeys(e,n=>`${r}${ca}${n}`)};var Pt=require("@botpress/client");var Xe=class extends Gt{constructor(e){super({...e})}with(e){return new Xe({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}withEventId(e){return this.with({eventId:e})}withMessageId(e){return this.with({messageId:e})}};var Re=class{constructor(e,r={before:{},after:{}}){this._client=e;this._hooks=r}getConversation=e=>this._run("getConversation",e);listConversations=e=>this._run("listConversations",e);updateConversation=e=>this._run("updateConversation",e);deleteConversation=e=>this._run("deleteConversation",e);listParticipants=e=>this._run("listParticipants",e);addParticipant=e=>this._run("addParticipant",e);getParticipant=e=>this._run("getParticipant",e);removeParticipant=e=>this._run("removeParticipant",e);createEvent=e=>this._run("createEvent",e);getEvent=e=>this._run("getEvent",e);listEvents=e=>this._run("listEvents",e);createMessage=e=>this._run("createMessage",e);getOrCreateMessage=e=>this._run("getOrCreateMessage",e);getMessage=e=>this._run("getMessage",e);updateMessage=e=>this._run("updateMessage",e);listMessages=e=>this._run("listMessages",e);deleteMessage=e=>this._run("deleteMessage",e);getUser=e=>this._run("getUser",e);listUsers=e=>this._run("listUsers",e);updateUser=e=>this._run("updateUser",e);deleteUser=e=>this._run("deleteUser",e);getState=e=>this._run("getState",e);setState=e=>this._run("setState",e);getOrSetState=e=>this._run("getOrSetState",e);patchState=e=>this._run("patchState",e);callAction=e=>this._run("callAction",e);uploadFile=e=>this._run("uploadFile",e);upsertFile=e=>this._run("upsertFile",e);deleteFile=e=>this._run("deleteFile",e);listFiles=e=>this._run("listFiles",e);getFile=e=>this._run("getFile",e);updateFileMetadata=e=>this._run("updateFileMetadata",e);searchFiles=e=>this._run("searchFiles",e);trackAnalytics=e=>this._run("trackAnalytics",e);getTableRow=e=>this._run("getTableRow",e);createTableRows=e=>this._run("createTableRows",e);findTableRows=e=>this._run("findTableRows",e);deleteTableRows=e=>this._run("deleteTableRows",e);updateTableRows=e=>this._run("updateTableRows",e);upsertTableRows=e=>this._run("upsertTableRows",e);createWorkflow=e=>this._run("createWorkflow",e);getWorkflow=e=>this._run("getWorkflow",e);updateWorkflow=e=>this._run("updateWorkflow",e);deleteWorkflow=e=>this._run("deleteWorkflow",e);listWorkflows=e=>this._run("listWorkflows",e);createConversation=e=>this._client.createConversation(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);createUser=e=>this._client.createUser(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);_run=async(e,r)=>{let n=this._hooks.before[e];n&&(r=await n(r));let a=await this._client[e](r),s=this._hooks.after[e];return s&&(a=await s(a,r)),a}};var Jt=t=>new Proxy({},{get:(e,r)=>({listInstances:{all:n=>Qe({workflowName:r,client:t,input:n}),running:n=>Qe({workflowName:r,client:t,input:n,statuses:["in_progress"]}),scheduled:n=>Qe({workflowName:r,client:t,input:n,statuses:["pending","listening"]}),allFinished:n=>Qe({workflowName:r,client:t,input:n,statuses:["completed","cancelled","failed","timedout"]}),cancelled:n=>Qe({workflowName:r,client:t,input:n,statuses:["cancelled"]}),failed:n=>Qe({workflowName:r,client:t,input:n,statuses:["failed"]}),succeeded:n=>Qe({workflowName:r,client:t,input:n,statuses:["completed"]}),timedOut:n=>Qe({workflowName:r,client:t,input:n,statuses:["timedout"]})},startNewInstance:async n=>{let{workflow:a}=await t.createWorkflow({name:r,status:"pending",...n});return{workflow:et({client:t,workflow:a})}}})}),Qe=async t=>{let e=await t.client.listWorkflows({name:t.workflowName,statuses:t.statuses,...t.input});return{...e,workflows:e.workflows.map(r=>et({client:t.client,workflow:r}))}},et=t=>({...t.workflow,async update(e){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,...e});return{workflow:et({client:t.client,workflow:r})}},async setFailed({failureReason:e}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"failed",failureReason:e});return{workflow:et({client:t.client,workflow:r})}},async setCompleted({output:e}={}){let{workflow:r}=await t.client.updateWorkflow({id:t.workflow.id,status:"completed",output:e});return{workflow:et({client:t.client,workflow:r})}},async cancel(){let{workflow:e}=await t.client.updateWorkflow({id:t.workflow.id,status:"cancelled"});return{workflow:et({client:t.client,workflow:e})}}});var uT=E.enum(["event_received","register","unregister","ping","action_triggered"]),Qf=t=>{let e=t[br],r=t[wr],n=t[ni],a=uT.parse(t[Pr]);if(!e)throw new Error("Missing bot headers");if(!n)throw new Error("Missing type headers");if(!r)throw new Error("Missing configuration headers");if(!a)throw new Error("Missing operation headers");return{botId:e,operation:a,type:n,configuration:r?JSON.parse(Buffer.from(r,"base64").toString("utf-8")):{}}};var he={status:200};var si=t=>{switch(t){case"workflow_continued":return"continued";case"workflow_started":return"started";case"workflow_timedout":return"timed_out";default:throw new Error(`Unsupported workflow update type: ${t}`)}};var cT=["child_workflow_deleted","child_workflow_finished","workflow_timedout","workflow_started","workflow_continued"],ep=async(t,e)=>{if(t.ctx.type!=="workflow_update"||!cT.includes(e.payload.type))throw new Error("Unexpected event type");let r={...t,logger:dT(t,e)};if(!e.payload.workflow.name)return r.logger.warn("Received workflow update event without a workflow name. Assuming this workflow was not defined by the bot.",e.payload.workflow),he;switch(e.payload.type){case"child_workflow_deleted":case"child_workflow_finished":r.logger.info(`Received child workflow event "${e.payload.type}", but child workflows are not yet supported`);break;case"workflow_timedout":case"workflow_started":case"workflow_continued":return await fT(r,e);default:e.payload.type}return he},dT=(t,e)=>t.logger.with({eventId:e.id,workflowId:e.payload.workflow.id,conversationId:e.payload.conversation?.id,userId:e.payload.user?.id}),fT=async(t,e)=>{let r=si(e.payload.type),n=t.self.workflowHandlers[r]?.[e.payload.workflow.name];return!n||n.length===0?(t.logger.warn(`No ${r} handler found for workflow "${e.payload.workflow.name}"`),he):(await pT(t,e),await gT(t,e),he)},pT=async(t,e)=>{e.payload.workflow.status==="pending"&&await t.client.updateWorkflow({id:e.payload.workflow.id,status:"in_progress",eventId:e.id})},gT=async(t,e)=>{let r=si(e.payload.type),n=t.self.workflowHandlers[r]?.[e.payload.workflow.name];for(let a of n)await a({...t,conversation:e.payload.conversation,user:e.payload.user,workflow:et({...t,workflow:e.payload.workflow}),workflows:Jt(t.client)})};var tp=t=>async e=>{let r=Qf(e.headers),n=new Xe,a=new Pt.Client({botId:r.botId,retry:la}),s=new Re(a,{before:{createMessage:async o=>{let c=t.hookHandlers.before_outgoing_message[o.type]??[];for(let p of c){let m=new Re(a);o=(await p({client:m,ctx:r,logger:n.with({conversationId:o.conversationId,userId:o.userId}),data:o,...tt({client:m})}))?.data??o}return o},callAction:async o=>{let c=t.hookHandlers.before_outgoing_call_action[o.type]??[];for(let p of c){let m=new Re(a);o=(await p({client:m,ctx:r,logger:n,data:o,...tt({client:m})}))?.data??o}return o}},after:{createMessage:async o=>{let c=t.hookHandlers.after_outgoing_message[o.message.type]??[];for(let p of c){let m=new Re(a);o=(await p({client:m,ctx:r,logger:n.with({messageId:o.message.id,conversationId:o.message.conversationId,userId:o.message.userId}),data:o,...tt({client:m})}))?.data??o}return o},callAction:async(o,c)=>{let{type:p}=c,m=t.hookHandlers.after_outgoing_call_action[p]??[];for(let T of m){let O=new Re(a);o=(await T({client:O,ctx:r,logger:n,data:{type:p,...o},...tt({client:O})}))?.data??o}return o}}}),i={req:e,ctx:r,logger:n,client:s,self:t};try{switch(r.operation){case"action_triggered":return await _T(i);case"event_received":return await vT(i);case"register":return await mT(i);case"unregister":return await yT(i);case"ping":return await hT(i);default:throw new Error(`Unknown operation ${r.operation}`)}}catch(o){if((0,Pt.isApiError)(o)){let p=o.type==="Runtime"?o:new Pt.RuntimeError(o.message,o);return n.error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}let c=new Pt.RuntimeError("An unexpected error occurred in the bot.");return n.error(c.message),{status:c.code,body:JSON.stringify(c.toJSON())}}},hT=async t=>he,mT=async t=>he,yT=async t=>he,vT=async t=>{let{ctx:e,logger:r,req:n,client:a,self:s}=t,i={client:a,ctx:e,logger:r,...tt({client:a})},o=Se(n);if(i.logger=i.logger.with({eventId:o.event.id,messageId:o.event.messageId,conversationId:o.event.conversationId,userId:o.event.userId}),e.type==="workflow_update")return await ep(t,o.event);if(e.type==="message_created"){let w=o.event,S=w.payload.message;i.logger=i.logger.with({messageId:S.id,conversationId:S.conversationId,userId:S.userId});let W=s.hookHandlers.before_incoming_message[S.type]??[];for(let N of W){let F=await N({...i,data:S});if(S=F?.data??S,F?.stop)return he}let q={...i,user:w.payload.user,conversation:w.payload.conversation,message:S,event:w},re=s.messageHandlers[S.type]??[];for(let N of re)await N(q);let J=s.hookHandlers.after_incoming_message[S.type]??[];for(let N of J){let F=await N({...i,data:S});if(S=F?.data??S,F?.stop)return he}return he}if(e.type==="state_expired"){let S=o.event.payload.state,W={...i,state:S},q=s.stateExpiredHandlers["*"]??[];for(let re of q)await re(W);return he}let c=o.event,p=s.hookHandlers.before_incoming_event[c.type]??[];for(let w of p){let S=await w({...i,data:c});if(c=S?.data??c,S?.stop)return he}let m={...i,event:c},T=s.eventHandlers[c.type]??[];for(let w of T)await w(m);let O=s.hookHandlers.after_incoming_event[c.type]??[];for(let w of O){let S=await w({...i,data:c});if(c=S?.data??c,S?.stop)return he}return he},_T=async({ctx:t,logger:e,req:r,client:n,self:a})=>{let{input:s,type:i}=Se(r);if(!i)throw new Error("Missing action type");let o=a.hookHandlers.before_incoming_call_action[i]??[];for(let O of o){let w=await O({ctx:t,logger:e,client:n,data:{type:i,input:s},...tt({client:n})});s=w?.data?.input??s,i=w?.data?.type??i}let c=a.actionHandlers[i];if(!c)throw new Error(`Action ${i} not found`);let p=await c({ctx:t,logger:e,input:s,client:n,type:i,...tt({client:n})}),m=a.hookHandlers.after_incoming_call_action[i]??[];for(let O of m){let w=await O({ctx:t,logger:e,client:n,data:{type:i,output:p},...tt({client:n})});i=w?.data?.type??i,p=w?.data?.output??p}return{status:200,body:JSON.stringify({output:p})}},tt=t=>({workflows:Jt(t.client)});var pa=class{constructor(e){this.props=e;this._actionHandlers=e.actions,this._plugins=e.plugins}_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_plugins={};_registerOrder=0;get actionHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._actionHandlers[r];if(n)return n;for(let a of Object.values(this._plugins))if(n=a.actionHandlers[r],n)return n}})}get messageHandlers(){return new Proxy({},{get:(e,r)=>{let n=Object.values(this._plugins).flatMap(o=>o.messageHandlers[r]??[]),a=this._messageHandlers[r]??[],s=this._messageHandlers["*"]??[],i=[...a,...s].sort((o,c)=>o.order-c.order).map(({handler:o})=>o);return A.unique([...n,...i])}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{let n=Object.values(this._plugins).flatMap(o=>o.eventHandlers[r]??[]),a=this._eventHandlers[r]??[],s=this._eventHandlers["*"]??[],i=[...a,...s].sort((o,c)=>o.order-c.order).map(({handler:o})=>o);return A.unique([...n,...i])}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{let n=Object.values(this._plugins).flatMap(o=>o.stateExpiredHandlers[r]??[]),a=this._stateExpiredHandlers[r]??[],s=this._stateExpiredHandlers["*"]??[],i=[...a,...s].sort((o,c)=>o.order-c.order).map(({handler:o})=>o);return A.unique([...n,...i])}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>{if(this._hookHandlers[r])return new Proxy({},{get:(a,s)=>{let i=Object.values(this._plugins).flatMap(T=>T.hookHandlers[r]?.[s]??[]),o=this._hookHandlers[r]??{},c=o[s]??[],p=o["*"]??[],m=[...c,...p].sort((T,O)=>T.order-O.order).map(({handler:T})=>T);return A.unique([...i,...m])}})}})}get workflowHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._workflowHandlers[r];if(n)return new Proxy({},{get:(a,s)=>{let i=n[s]?.sort((c,p)=>c.order-p.order).map(({handler:c})=>c)??[],o=Object.values(this._plugins).flatMap(c=>c.workflowHandlers[r]?.[s]??[]);return A.unique([...i,...o])}})}})}on={message:(e,r)=>{this._messageHandlers[e]=A.safePush(this._messageHandlers[e],{handler:r,order:this._registerOrder++})},event:(e,r)=>{this._eventHandlers[e]=A.safePush(this._eventHandlers[e],{handler:r,order:this._registerOrder++})},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=A.safePush(this._stateExpiredHandlers[e],{handler:r,order:this._registerOrder++})},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=A.safePush(this._hookHandlers.before_incoming_event[e],{handler:r,order:this._registerOrder++})},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=A.safePush(this._hookHandlers.before_incoming_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=A.safePush(this._hookHandlers.before_outgoing_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=A.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},beforeIncomingCallAction:(e,r)=>{this._hookHandlers.before_incoming_call_action[e]=A.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=A.safePush(this._hookHandlers.after_incoming_event[e],{handler:r,order:this._registerOrder++})},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=A.safePush(this._hookHandlers.after_incoming_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=A.safePush(this._hookHandlers.after_outgoing_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=A.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingCallAction:(e,r)=>{this._hookHandlers.after_incoming_call_action[e]=A.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:r,order:this._registerOrder++})},workflowStart:(e,r)=>{this._workflowHandlers.started[e]=A.safePush(this._workflowHandlers.started[e],{handler:r,order:this._registerOrder++})},workflowContinue:(e,r)=>{this._workflowHandlers.continued[e]=A.safePush(this._workflowHandlers.continued[e],{handler:r,order:this._registerOrder++})},workflowTimeout:(e,r)=>{this._workflowHandlers.timed_out[e]=A.safePush(this._workflowHandlers.timed_out[e],{handler:r,order:this._registerOrder++})}};handler=tp(this);start=e=>kr(this.handler,e)};var ga=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.title=e.title,this.description=e.description,this.readme=e.readme,this.entities=e.entities??{};let r=this._getEntityReference(this.entities),n=e.events===void 0?{}:te.mapValues(e.events,i=>({...i,schema:i.schema(r)})),a=e.actions===void 0?{}:te.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(r)},output:{...i.output,schema:i.output.schema(r)}})),s=e.channels===void 0?{}:te.mapValues(e.channels,i=>({...i,messages:te.mapValues(i.messages,o=>({...o,schema:o.schema(r)}))}));this.events=n,this.actions=a,this.channels=s}name;version;title;description;icon;readme;entities;events;actions;channels;_getEntityReference=e=>{let r={};for(let[n,a]of Object.entries(e)){let s=a.schema._def["x-zui"]?.title,i=a.schema._def.description,o=Zf.ref(n);s&&o.title(s),i&&o.describe(i),r[n]=o}return r}};var ha=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.description=e.description,this.integrations=e.integrations,this.interfaces=e.interfaces,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables,this.workflows=e.workflows}name;version;title;description;icon;readme;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows};var ii=":";var rp=t=>{let[e,r]=t.split(ii);return!e||!r?null:{namespace:e,eventName:r}},np=t=>`${t.namespace}${ii}${t.actionName}`,ap=t=>`${t.namespace}${ii}${t.eventName}`,sp=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.actions[t.actionName]?.name??t.actionName;return{namespace:n,actionName:a}},ip=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.events[t.eventName]?.name??t.eventName;return{namespace:n,eventName:a}};var op=(t,e)=>new Proxy({},{get:(r,n)=>new Proxy({},{get:(a,s)=>i=>TT({client:t,interfaces:e.interfaces,integrationOrInterfaceName:n,methodName:s,input:i})})}),TT=async({client:t,interfaces:e,integrationOrInterfaceName:r,methodName:n,input:a})=>{let s=sp({namespace:r,actionName:n},e),i=np(s);return(await t.callAction({type:i,input:a})).output};var oi=class{constructor(e,r,n){this._client=e;this._stateType=r;this._stateName=n}async get(e){return await this._client.getState({type:this._stateType,name:this._stateName,id:e}).then(r=>r.state.payload)}async set(e,r){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:r})}async getOrSet(e,r){return await this._client.getOrSetState({type:this._stateType,name:this._stateName,id:e,payload:r}).then(n=>n.state.payload)}async delete(e){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:null})}async patch(e,r){await this._client.patchState({type:this._stateType,name:this._stateName,id:e,payload:r})}},lp=(t,e)=>new Proxy({},{get:(r,n)=>new Proxy({},{get:(a,s)=>{let i=e.alias!==void 0?`${e.alias}${ca}${s}`:s;return new oi(t,n,i)}})});var ma=class{constructor(e){this.props=e;this._actionHandlers=e.actions}_runtimeProps;_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},before_incoming_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{},after_incoming_call_action:{}};_workflowHandlers={started:{},continued:{},timed_out:{}};_registerOrder=0;initialize(e){return this._runtimeProps=e,this}get _runtime(){if(!this._runtimeProps)throw new Error("Plugin not correctly initialized. This is likely because you access your plugin config outside of an handler.");return this._runtimeProps}_getTools(e){let{configuration:r,interfaces:n,alias:a}=this._runtime,s=op(e,this._runtime),i=lp(e,this._runtime),o=Jt(e);return{configuration:r,interfaces:n,actions:s,states:i,alias:a,workflows:o}}get actionHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._actionHandlers[r];if(n)return Fe.setName(a=>n({...a,...this._getTools(a.client)}),n.name)}})}get messageHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._messageHandlers[r]??[],a=this._messageHandlers["*"]??[];return A.unique([...n,...a]).sort((i,o)=>i.order-o.order).map(({handler:i})=>Fe.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._eventHandlers[r]??[],a=Object.entries(this._eventHandlers).filter(([o])=>this._eventResolvesTo(o,r)).flatMap(([,o])=>o??[]),s=this._eventHandlers["*"]??[];return A.unique([...n,...a,...s]).sort((o,c)=>o.order-c.order).map(({handler:o})=>Fe.setName(c=>o({...c,...this._getTools(c.client)}),o.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{r=this._stripAliasPrefix(r);let n=this._stateExpiredHandlers[r]??[],a=this._stateExpiredHandlers["*"]??[];return A.unique([...n,...a]).sort((i,o)=>i.order-o.order).map(({handler:i})=>Fe.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._hookHandlers[r];if(n)return new Proxy({},{get:(a,s)=>{s=this._stripAliasPrefix(s);let i=n[s]??[],o=Object.entries(n).filter(([m])=>this._eventResolvesTo(m,s)).flatMap(([,m])=>m??[]),c=n["*"]??[];return A.unique([...i,...o,...c]).sort((m,T)=>m.order-T.order).map(({handler:m})=>Fe.setName(T=>m({...T,...this._getTools(T.client)}),m.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._workflowHandlers[r];if(n)return new Proxy({},{get:(a,s)=>(n[s]?.sort((o,c)=>o.order-c.order)??[]).map(({handler:o})=>Fe.setName(c=>o({...c,...this._getTools(c.client)}),o.name))})}})}on={message:(e,r)=>{this._messageHandlers[e]=A.safePush(this._messageHandlers[e],{handler:r,order:this._registerOrder++})},event:(e,r)=>{this._eventHandlers[e]=A.safePush(this._eventHandlers[e],{handler:r,order:this._registerOrder++})},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=A.safePush(this._stateExpiredHandlers[e],{handler:r,order:this._registerOrder++})},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=A.safePush(this._hookHandlers.before_incoming_event[e],{handler:r,order:this._registerOrder++})},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=A.safePush(this._hookHandlers.before_incoming_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=A.safePush(this._hookHandlers.before_outgoing_message[e],{handler:r,order:this._registerOrder++})},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=A.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},beforeIncomingCallAction:(e,r)=>{this._hookHandlers.before_incoming_call_action[e]=A.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=A.safePush(this._hookHandlers.after_incoming_event[e],{handler:r,order:this._registerOrder++})},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=A.safePush(this._hookHandlers.after_incoming_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=A.safePush(this._hookHandlers.after_outgoing_message[e],{handler:r,order:this._registerOrder++})},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=A.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:r,order:this._registerOrder++})},afterIncomingCallAction:(e,r)=>{this._hookHandlers.after_incoming_call_action[e]=A.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:r,order:this._registerOrder++})},workflowStart:(e,r)=>{this._workflowHandlers.started[e]=A.safePush(this._workflowHandlers.started[e],{handler:r,order:this._registerOrder++})},workflowContinue:(e,r)=>{this._workflowHandlers.continued[e]=A.safePush(this._workflowHandlers.continued[e],{handler:r,order:this._registerOrder++})},workflowTimeout:(e,r)=>{this._workflowHandlers.timed_out[e]=A.safePush(this._workflowHandlers.timed_out[e],{handler:r,order:this._registerOrder++})}};_eventResolvesTo=(e,r)=>{let n=rp(e);if(!n)return!1;let a=ip(n,this._runtime.interfaces);return ap(a)===r};_stripAliasPrefix=e=>{let{alias:r}=this._runtime;if(!r)return e;let n=`${r}:`;return e.startsWith(n)?e.slice(n.length):e}};0&&(module.exports={BRAND,Bot,BotDefinition,BotLogger,BotSpecificClient,DIRTY,EMPTY_PATH,ErrorBoundary,INVALID,Integration,IntegrationDefinition,IntegrationLogger,IntegrationSpecificClient,InterfaceDefinition,NEVER,OK,ParseInputLazyPath,ParseStatus,Plugin,PluginDefinition,RuntimeError,Schema,WELL_KNOWN_ATTRIBUTES,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,ZodFirstPartyTypeKind,ZodFunction,ZodIntersection,ZodIssueCode,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodRef,ZodSchema,ZodSet,ZodString,ZodSymbol,ZodTransformer,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,ZuiForm,addIssueToContext,agent,aimodel,any,array,bigint,boolean,botIdHeader,botUserIdHeader,coerce,configurationHeader,configurationTypeHeader,conversation,createZodEnum,cuid2Regex,cuidRegex,custom,datasource,date,datetimeRegex,defaultComponentDefinitions,discriminatedUnion,effect,emailRegex,enum:null,errorUtil,event,fromJsonSchema,fromObject,function:null,getErrorMap,getParsedType,instanceof:null,integrationIdHeader,intent,intersection,ipv4Regex,ipv6Regex,isAborted,isApiError,isAsync,isDirty,isEmojiRegex,isValid,jsonSchemaToZui,knowledgebase,late,lazy,literal,makeIssue,map,mergeObjectSchemas,message,messages,nan,nativeEnum,never,null:null,nullable,number,object,objectToZui,objectUtil,oboolean,onumber,operationHeader,optional,ostring,parseBody,pipeline,preprocess,processCreateParams,promise,quotelessJson,readonly,record,ref,serve,set,setErrorMap,strictObject,string,symbol,table,tablerow,transformer,transforms,tuple,typeHeader,ulidRegex,undefined,union,unknown,user,util,uuidRegex,variable,void:null,webhookIdHeader,withErrorBoundary,z,zuiToJsonSchema});
90
90
  /*! Bundled license information:
91
91
 
92
92
  react/cjs/react.production.min.js: