@botpress/sdk 4.8.1 → 4.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,34 +1,34 @@
1
- var Dv=Object.create;var Qr=Object.defineProperty;var Nv=Object.getOwnPropertyDescriptor;var Hv=Object.getOwnPropertyNames;var Uv=Object.getPrototypeOf,jv=Object.prototype.hasOwnProperty;var it=(t,e)=>()=>(t&&(e=t(t=0)),e);var zl=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),jn=(t,e)=>{for(var n in e)Qr(t,n,{get:e[n],enumerable:!0})},Gl=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Hv(e))!jv.call(t,o)&&o!==n&&Qr(t,o,{get:()=>e[o],enumerable:!(r=Nv(e,o))||r.enumerable});return t};var Tr=(t,e,n)=>(n=t!=null?Dv(Uv(t)):{},Gl(e||!t||!t.__esModule?Qr(n,"default",{value:t,enumerable:!0}):n,t)),$v=t=>Gl(Qr({},"__esModule",{value:!0}),t);var C=it(()=>{});var J={};jn(J,{_debugEnd:()=>Hu,_debugProcess:()=>Nu,_events:()=>Qu,_eventsCount:()=>ec,_exiting:()=>hu,_fatalExceptions:()=>Ru,_getActiveHandles:()=>bu,_getActiveRequests:()=>_u,_kill:()=>xu,_linkedBinding:()=>yu,_maxListeners:()=>Xu,_preload_modules:()=>Vu,_rawDebug:()=>pu,_startProfilerIdleNotifier:()=>Uu,_stopProfilerIdleNotifier:()=>ju,_tickCallback:()=>Du,abort:()=>Fu,addListener:()=>tc,allowedNodeEnvironmentFlags:()=>Iu,arch:()=>Ql,argv:()=>nu,argv0:()=>Gu,assert:()=>Au,binding:()=>su,browser:()=>du,chdir:()=>cu,config:()=>vu,cpuUsage:()=>ni,cwd:()=>uu,debugPort:()=>zu,default:()=>cc,dlopen:()=>Tu,domain:()=>mu,emit:()=>ac,emitWarning:()=>au,env:()=>tu,execArgv:()=>ru,execPath:()=>qu,exit:()=>Su,features:()=>Cu,hasUncaughtExceptionCaptureCallback:()=>Mu,hrtime:()=>ti,kill:()=>Eu,listeners:()=>uc,memoryUsage:()=>Pu,moduleLoadList:()=>gu,nextTick:()=>Jl,off:()=>rc,on:()=>Nt,once:()=>nc,openStdin:()=>ku,pid:()=>Ku,platform:()=>eu,ppid:()=>Wu,prependListener:()=>sc,prependOnceListener:()=>lc,reallyExit:()=>wu,release:()=>fu,removeAllListeners:()=>oc,removeListener:()=>ic,resourceUsage:()=>Bu,setSourceMapsEnabled:()=>Ju,setUncaughtExceptionCaptureCallback:()=>Ou,stderr:()=>Zu,stdin:()=>Lu,stdout:()=>$u,title:()=>Xl,umask:()=>lu,uptime:()=>Yu,version:()=>iu,versions:()=>ou});function Jo(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function Zv(){!$n||!dn||($n=!1,dn.length?Dt=dn.concat(Dt):ei=-1,Dt.length&&Vl())}function Vl(){if(!$n){var t=setTimeout(Zv,0);$n=!0;for(var e=Dt.length;e;){for(dn=Dt,Dt=[];++ei<e;)dn&&dn[ei].run();ei=-1,e=Dt.length}dn=null,$n=!1,clearTimeout(t)}}function Jl(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Dt.push(new Yl(t,e)),Dt.length===1&&!$n&&setTimeout(Vl,0)}function Yl(t,e){this.fun=t,this.array=e}function ot(){}function yu(t){Jo("_linkedBinding")}function Tu(t){Jo("dlopen")}function _u(){return[]}function bu(){return[]}function Au(t,e){if(!t)throw new Error(e||"assertion error")}function Mu(){return!1}function Yu(){return en.now()/1e3}function ti(t){var e=Math.floor((Date.now()-en.now())*.001),n=en.now()*.001,r=Math.floor(n)+e,o=Math.floor(n%1*1e9);return t&&(r=r-t[0],o=o-t[1],o<0&&(r--,o+=Vo)),[r,o]}function Nt(){return cc}function uc(t){return[]}var Dt,$n,dn,ei,Xl,Ql,eu,tu,nu,ru,iu,ou,au,su,lu,uu,cu,fu,du,pu,gu,mu,hu,vu,wu,xu,ni,Bu,Pu,Eu,Su,ku,Iu,Cu,Ru,Ou,Du,Nu,Hu,Uu,ju,$u,Zu,Lu,Fu,Ku,Wu,qu,zu,Gu,Vu,Ju,en,Go,Vo,Xu,Qu,ec,tc,nc,rc,ic,oc,ac,sc,lc,cc,fc=it(()=>{C();O();R();Dt=[],$n=!1,ei=-1;Yl.prototype.run=function(){this.fun.apply(null,this.array)};Xl="browser",Ql="x64",eu="browser",tu={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},nu=["/usr/bin/node"],ru=[],iu="v16.8.0",ou={},au=function(t,e){console.warn((e?e+": ":"")+t)},su=function(t){Jo("binding")},lu=function(t){return 0},uu=function(){return"/"},cu=function(t){},fu={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};du=!0,pu=ot,gu=[];mu={},hu=!1,vu={};wu=ot,xu=ot,ni=function(){return{}},Bu=ni,Pu=ni,Eu=ot,Su=ot,ku=ot,Iu={};Cu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Ru=ot,Ou=ot;Du=ot,Nu=ot,Hu=ot,Uu=ot,ju=ot,$u=void 0,Zu=void 0,Lu=void 0,Fu=ot,Ku=2,Wu=1,qu="/bin/usr/node",zu=9229,Gu="node",Vu=[],Ju=ot,en={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};en.now===void 0&&(Go=Date.now(),en.timing&&en.timing.navigationStart&&(Go=en.timing.navigationStart),en.now=()=>Date.now()-Go);Vo=1e9;ti.bigint=function(t){var e=ti(t);return typeof BigInt>"u"?e[0]*Vo+e[1]:BigInt(e[0]*Vo)+BigInt(e[1])};Xu=10,Qu={},ec=0;tc=Nt,nc=Nt,rc=Nt,ic=Nt,oc=Nt,ac=ot,sc=Nt,lc=Nt;cc={version:iu,versions:ou,arch:Ql,platform:eu,browser:du,release:fu,_rawDebug:pu,moduleLoadList:gu,binding:su,_linkedBinding:yu,_events:Qu,_eventsCount:ec,_maxListeners:Xu,on:Nt,addListener:tc,once:nc,off:rc,removeListener:ic,removeAllListeners:oc,emit:ac,prependListener:sc,prependOnceListener:lc,listeners:uc,domain:mu,_exiting:hu,config:vu,dlopen:Tu,uptime:Yu,_getActiveRequests:_u,_getActiveHandles:bu,reallyExit:wu,_kill:xu,cpuUsage:ni,resourceUsage:Bu,memoryUsage:Pu,kill:Eu,exit:Su,openStdin:ku,allowedNodeEnvironmentFlags:Iu,assert:Au,features:Cu,_fatalExceptions:Ru,setUncaughtExceptionCaptureCallback:Ou,hasUncaughtExceptionCaptureCallback:Mu,emitWarning:au,nextTick:Jl,_tickCallback:Du,_debugProcess:Nu,_debugEnd:Hu,_startProfilerIdleNotifier:Uu,_stopProfilerIdleNotifier:ju,stdout:$u,stdin:Lu,stderr:Zu,abort:Fu,umask:lu,chdir:cu,cwd:uu,env:tu,title:Xl,argv:nu,execArgv:ru,pid:Ku,ppid:Wu,execPath:qu,debugPort:zu,hrtime:ti,argv0:Gu,_preload_modules:Vu,setSourceMapsEnabled:Ju}});var R=it(()=>{fc()});function Lv(){if(dc)return _r;dc=!0,_r.byteLength=a,_r.toByteArray=c,_r.fromByteArray=g;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=r.length;o<s;++o)t[o]=r[o],e[r.charCodeAt(o)]=o;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function i(m){var v=m.length;if(v%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var B=m.indexOf("=");B===-1&&(B=v);var P=B===v?0:4-B%4;return[B,P]}function a(m){var v=i(m),B=v[0],P=v[1];return(B+P)*3/4-P}function l(m,v,B){return(v+B)*3/4-B}function c(m){var v,B=i(m),P=B[0],T=B[1],S=new n(l(m,P,T)),E=0,M=T>0?P-4:P,$;for($=0;$<M;$+=4)v=e[m.charCodeAt($)]<<18|e[m.charCodeAt($+1)]<<12|e[m.charCodeAt($+2)]<<6|e[m.charCodeAt($+3)],S[E++]=v>>16&255,S[E++]=v>>8&255,S[E++]=v&255;return T===2&&(v=e[m.charCodeAt($)]<<2|e[m.charCodeAt($+1)]>>4,S[E++]=v&255),T===1&&(v=e[m.charCodeAt($)]<<10|e[m.charCodeAt($+1)]<<4|e[m.charCodeAt($+2)]>>2,S[E++]=v>>8&255,S[E++]=v&255),S}function d(m){return t[m>>18&63]+t[m>>12&63]+t[m>>6&63]+t[m&63]}function y(m,v,B){for(var P,T=[],S=v;S<B;S+=3)P=(m[S]<<16&16711680)+(m[S+1]<<8&65280)+(m[S+2]&255),T.push(d(P));return T.join("")}function g(m){for(var v,B=m.length,P=B%3,T=[],S=16383,E=0,M=B-P;E<M;E+=S)T.push(y(m,E,E+S>M?M:E+S));return P===1?(v=m[B-1],T.push(t[v>>2]+t[v<<4&63]+"==")):P===2&&(v=(m[B-2]<<8)+m[B-1],T.push(t[v>>10]+t[v>>4&63]+t[v<<2&63]+"=")),T.join("")}return _r}function Fv(){if(pc)return ri;pc=!0;return ri.read=function(t,e,n,r,o){var s,i,a=o*8-r-1,l=(1<<a)-1,c=l>>1,d=-7,y=n?o-1:0,g=n?-1:1,m=t[e+y];for(y+=g,s=m&(1<<-d)-1,m>>=-d,d+=a;d>0;s=s*256+t[e+y],y+=g,d-=8);for(i=s&(1<<-d)-1,s>>=-d,d+=r;d>0;i=i*256+t[e+y],y+=g,d-=8);if(s===0)s=1-c;else{if(s===l)return i?NaN:(m?-1:1)*(1/0);i=i+Math.pow(2,r),s=s-c}return(m?-1:1)*i*Math.pow(2,s-r)},ri.write=function(t,e,n,r,o,s){var i,a,l,c=s*8-o-1,d=(1<<c)-1,y=d>>1,g=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:s-1,v=r?1:-1,B=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,i=d):(i=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(i++,l/=2),i+y>=d?(a=0,i=d):i+y>=1?(a=(e*l-1)*Math.pow(2,o),i=i+y):(a=e*Math.pow(2,y-1)*Math.pow(2,o),i=0));o>=8;t[n+m]=a&255,m+=v,a/=256,o-=8);for(i=i<<o|a,c+=o;c>0;t[n+m]=i&255,m+=v,i/=256,c-=8);t[n+m-v]|=B*128},ri}function At(){if(gc)return pn;gc=!0;let t=Lv(),e=Fv(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;pn.Buffer=i,pn.SlowBuffer=T,pn.INSPECT_MAX_BYTES=50;let r=2147483647;pn.kMaxLength=r,i.TYPED_ARRAY_SUPPORT=o(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{let h=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(h,u),h.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function s(h){if(h>r)throw new RangeError('The value "'+h+'" is invalid for option "size"');let u=new Uint8Array(h);return Object.setPrototypeOf(u,i.prototype),u}function i(h,u,f){if(typeof h=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(h)}return a(h,u,f)}i.poolSize=8192;function a(h,u,f){if(typeof h=="string")return y(h,u);if(ArrayBuffer.isView(h))return m(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h);if(vt(h,ArrayBuffer)||h&&vt(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(vt(h,SharedArrayBuffer)||h&&vt(h.buffer,SharedArrayBuffer)))return v(h,u,f);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let _=h.valueOf&&h.valueOf();if(_!=null&&_!==h)return i.from(_,u,f);let I=B(h);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return i.from(h[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h)}i.from=function(h,u,f){return a(h,u,f)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function c(h,u,f){return l(h),h<=0?s(h):u!==void 0?typeof f=="string"?s(h).fill(u,f):s(h).fill(u):s(h)}i.alloc=function(h,u,f){return c(h,u,f)};function d(h){return l(h),s(h<0?0:P(h)|0)}i.allocUnsafe=function(h){return d(h)},i.allocUnsafeSlow=function(h){return d(h)};function y(h,u){if((typeof u!="string"||u==="")&&(u="utf8"),!i.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let f=S(h,u)|0,_=s(f),I=_.write(h,u);return I!==f&&(_=_.slice(0,I)),_}function g(h){let u=h.length<0?0:P(h.length)|0,f=s(u);for(let _=0;_<u;_+=1)f[_]=h[_]&255;return f}function m(h){if(vt(h,Uint8Array)){let u=new Uint8Array(h);return v(u.buffer,u.byteOffset,u.byteLength)}return g(h)}function v(h,u,f){if(u<0||h.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let _;return u===void 0&&f===void 0?_=new Uint8Array(h):f===void 0?_=new Uint8Array(h,u):_=new Uint8Array(h,u,f),Object.setPrototypeOf(_,i.prototype),_}function B(h){if(i.isBuffer(h)){let u=P(h.length)|0,f=s(u);return f.length===0||h.copy(f,0,0,u),f}if(h.length!==void 0)return typeof h.length!="number"||hr(h.length)?s(0):g(h);if(h.type==="Buffer"&&Array.isArray(h.data))return g(h.data)}function P(h){if(h>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return h|0}function T(h){return+h!=h&&(h=0),i.alloc(+h)}i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,f){if(vt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),vt(f,Uint8Array)&&(f=i.from(f,f.offset,f.byteLength)),!i.isBuffer(u)||!i.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===f)return 0;let _=u.length,I=f.length;for(let N=0,K=Math.min(_,I);N<K;++N)if(u[N]!==f[N]){_=u[N],I=f[N];break}return _<I?-1:I<_?1:0},i.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(u,f){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return i.alloc(0);let _;if(f===void 0)for(f=0,_=0;_<u.length;++_)f+=u[_].length;let I=i.allocUnsafe(f),N=0;for(_=0;_<u.length;++_){let K=u[_];if(vt(K,Uint8Array))N+K.length>I.length?(i.isBuffer(K)||(K=i.from(K)),K.copy(I,N)):Uint8Array.prototype.set.call(I,K,N);else if(i.isBuffer(K))K.copy(I,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=K.length}return I};function S(h,u){if(i.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||vt(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof h);let f=h.length,_=arguments.length>2&&arguments[2]===!0;if(!_&&f===0)return 0;let I=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return He(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return Pt(h).length;default:if(I)return _?-1:He(h).length;u=(""+u).toLowerCase(),I=!0}}i.byteLength=S;function E(h,u,f){let _=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(h||(h="utf8");;)switch(h){case"hex":return he(this,u,f);case"utf8":case"utf-8":return $e(this,u,f);case"ascii":return Ve(this,u,f);case"latin1":case"binary":return Ae(this,u,f);case"base64":return Ie(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,u,f);default:if(_)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),_=!0}}i.prototype._isBuffer=!0;function M(h,u,f){let _=h[u];h[u]=h[f],h[f]=_}i.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<u;f+=2)M(this,f,f+1);return this},i.prototype.swap32=function(){let u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<u;f+=4)M(this,f,f+3),M(this,f+1,f+2);return this},i.prototype.swap64=function(){let u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<u;f+=8)M(this,f,f+7),M(this,f+1,f+6),M(this,f+2,f+5),M(this,f+3,f+4);return this},i.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?$e(this,0,u):E.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(u){if(!i.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:i.compare(this,u)===0},i.prototype.inspect=function(){let u="",f=pn.INSPECT_MAX_BYTES;return u=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(u+=" ... "),"<Buffer "+u+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(u,f,_,I,N){if(vt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),!i.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(f===void 0&&(f=0),_===void 0&&(_=u?u.length:0),I===void 0&&(I=0),N===void 0&&(N=this.length),f<0||_>u.length||I<0||N>this.length)throw new RangeError("out of range index");if(I>=N&&f>=_)return 0;if(I>=N)return-1;if(f>=_)return 1;if(f>>>=0,_>>>=0,I>>>=0,N>>>=0,this===u)return 0;let K=N-I,Be=_-f,Je=Math.min(K,Be),Fe=this.slice(I,N),Ye=u.slice(f,_);for(let Ze=0;Ze<Je;++Ze)if(Fe[Ze]!==Ye[Ze]){K=Fe[Ze],Be=Ye[Ze];break}return K<Be?-1:Be<K?1:0};function $(h,u,f,_,I){if(h.length===0)return-1;if(typeof f=="string"?(_=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,hr(f)&&(f=I?0:h.length-1),f<0&&(f=h.length+f),f>=h.length){if(I)return-1;f=h.length-1}else if(f<0)if(I)f=0;else return-1;if(typeof u=="string"&&(u=i.from(u,_)),i.isBuffer(u))return u.length===0?-1:oe(h,u,f,_,I);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(h,u,f):Uint8Array.prototype.lastIndexOf.call(h,u,f):oe(h,[u],f,_,I);throw new TypeError("val must be string, number or Buffer")}function oe(h,u,f,_,I){let N=1,K=h.length,Be=u.length;if(_!==void 0&&(_=String(_).toLowerCase(),_==="ucs2"||_==="ucs-2"||_==="utf16le"||_==="utf-16le")){if(h.length<2||u.length<2)return-1;N=2,K/=2,Be/=2,f/=2}function Je(Ye,Ze){return N===1?Ye[Ze]:Ye.readUInt16BE(Ze*N)}let Fe;if(I){let Ye=-1;for(Fe=f;Fe<K;Fe++)if(Je(h,Fe)===Je(u,Ye===-1?0:Fe-Ye)){if(Ye===-1&&(Ye=Fe),Fe-Ye+1===Be)return Ye*N}else Ye!==-1&&(Fe-=Fe-Ye),Ye=-1}else for(f+Be>K&&(f=K-Be),Fe=f;Fe>=0;Fe--){let Ye=!0;for(let Ze=0;Ze<Be;Ze++)if(Je(h,Fe+Ze)!==Je(u,Ze)){Ye=!1;break}if(Ye)return Fe}return-1}i.prototype.includes=function(u,f,_){return this.indexOf(u,f,_)!==-1},i.prototype.indexOf=function(u,f,_){return $(this,u,f,_,!0)},i.prototype.lastIndexOf=function(u,f,_){return $(this,u,f,_,!1)};function X(h,u,f,_){f=Number(f)||0;let I=h.length-f;_?(_=Number(_),_>I&&(_=I)):_=I;let N=u.length;_>N/2&&(_=N/2);let K;for(K=0;K<_;++K){let Be=parseInt(u.substr(K*2,2),16);if(hr(Be))return K;h[f+K]=Be}return K}function ue(h,u,f,_){return It(He(u,h.length-f),h,f,_)}function ee(h,u,f,_){return It(_e(u),h,f,_)}function ie(h,u,f,_){return It(Pt(u),h,f,_)}function Oe(h,u,f,_){return It(U(u,h.length-f),h,f,_)}i.prototype.write=function(u,f,_,I){if(f===void 0)I="utf8",_=this.length,f=0;else if(_===void 0&&typeof f=="string")I=f,_=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(_)?(_=_>>>0,I===void 0&&(I="utf8")):(I=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let N=this.length-f;if((_===void 0||_>N)&&(_=N),u.length>0&&(_<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let K=!1;for(;;)switch(I){case"hex":return X(this,u,f,_);case"utf8":case"utf-8":return ue(this,u,f,_);case"ascii":case"latin1":case"binary":return ee(this,u,f,_);case"base64":return ie(this,u,f,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,u,f,_);default:if(K)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),K=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ie(h,u,f){return u===0&&f===h.length?t.fromByteArray(h):t.fromByteArray(h.slice(u,f))}function $e(h,u,f){f=Math.min(h.length,f);let _=[],I=u;for(;I<f;){let N=h[I],K=null,Be=N>239?4:N>223?3:N>191?2:1;if(I+Be<=f){let Je,Fe,Ye,Ze;switch(Be){case 1:N<128&&(K=N);break;case 2:Je=h[I+1],(Je&192)===128&&(Ze=(N&31)<<6|Je&63,Ze>127&&(K=Ze));break;case 3:Je=h[I+1],Fe=h[I+2],(Je&192)===128&&(Fe&192)===128&&(Ze=(N&15)<<12|(Je&63)<<6|Fe&63,Ze>2047&&(Ze<55296||Ze>57343)&&(K=Ze));break;case 4:Je=h[I+1],Fe=h[I+2],Ye=h[I+3],(Je&192)===128&&(Fe&192)===128&&(Ye&192)===128&&(Ze=(N&15)<<18|(Je&63)<<12|(Fe&63)<<6|Ye&63,Ze>65535&&Ze<1114112&&(K=Ze))}}K===null?(K=65533,Be=1):K>65535&&(K-=65536,_.push(K>>>10&1023|55296),K=56320|K&1023),_.push(K),I+=Be}return Me(_)}let Ne=4096;function Me(h){let u=h.length;if(u<=Ne)return String.fromCharCode.apply(String,h);let f="",_=0;for(;_<u;)f+=String.fromCharCode.apply(String,h.slice(_,_+=Ne));return f}function Ve(h,u,f){let _="";f=Math.min(h.length,f);for(let I=u;I<f;++I)_+=String.fromCharCode(h[I]&127);return _}function Ae(h,u,f){let _="";f=Math.min(h.length,f);for(let I=u;I<f;++I)_+=String.fromCharCode(h[I]);return _}function he(h,u,f){let _=h.length;(!u||u<0)&&(u=0),(!f||f<0||f>_)&&(f=_);let I="";for(let N=u;N<f;++N)I+=Xr[h[N]];return I}function Se(h,u,f){let _=h.slice(u,f),I="";for(let N=0;N<_.length-1;N+=2)I+=String.fromCharCode(_[N]+_[N+1]*256);return I}i.prototype.slice=function(u,f){let _=this.length;u=~~u,f=f===void 0?_:~~f,u<0?(u+=_,u<0&&(u=0)):u>_&&(u=_),f<0?(f+=_,f<0&&(f=0)):f>_&&(f=_),f<u&&(f=u);let I=this.subarray(u,f);return Object.setPrototypeOf(I,i.prototype),I};function ce(h,u,f){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+u>f)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(u,f,_){u=u>>>0,f=f>>>0,_||ce(u,f,this.length);let I=this[u],N=1,K=0;for(;++K<f&&(N*=256);)I+=this[u+K]*N;return I},i.prototype.readUintBE=i.prototype.readUIntBE=function(u,f,_){u=u>>>0,f=f>>>0,_||ce(u,f,this.length);let I=this[u+--f],N=1;for(;f>0&&(N*=256);)I+=this[u+--f]*N;return I},i.prototype.readUint8=i.prototype.readUInt8=function(u,f){return u=u>>>0,f||ce(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,f){return u=u>>>0,f||ce(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,f){return u=u>>>0,f||ce(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,f){return u=u>>>0,f||ce(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(u,f){return u=u>>>0,f||ce(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=wt(function(u){u=u>>>0,b(u,"offset");let f=this[u],_=this[u+7];(f===void 0||_===void 0)&&w(u,this.length-8);let I=f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,N=this[++u]+this[++u]*2**8+this[++u]*2**16+_*2**24;return BigInt(I)+(BigInt(N)<<BigInt(32))}),i.prototype.readBigUInt64BE=wt(function(u){u=u>>>0,b(u,"offset");let f=this[u],_=this[u+7];(f===void 0||_===void 0)&&w(u,this.length-8);let I=f*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],N=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+_;return(BigInt(I)<<BigInt(32))+BigInt(N)}),i.prototype.readIntLE=function(u,f,_){u=u>>>0,f=f>>>0,_||ce(u,f,this.length);let I=this[u],N=1,K=0;for(;++K<f&&(N*=256);)I+=this[u+K]*N;return N*=128,I>=N&&(I-=Math.pow(2,8*f)),I},i.prototype.readIntBE=function(u,f,_){u=u>>>0,f=f>>>0,_||ce(u,f,this.length);let I=f,N=1,K=this[u+--I];for(;I>0&&(N*=256);)K+=this[u+--I]*N;return N*=128,K>=N&&(K-=Math.pow(2,8*f)),K},i.prototype.readInt8=function(u,f){return u=u>>>0,f||ce(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},i.prototype.readInt16LE=function(u,f){u=u>>>0,f||ce(u,2,this.length);let _=this[u]|this[u+1]<<8;return _&32768?_|4294901760:_},i.prototype.readInt16BE=function(u,f){u=u>>>0,f||ce(u,2,this.length);let _=this[u+1]|this[u]<<8;return _&32768?_|4294901760:_},i.prototype.readInt32LE=function(u,f){return u=u>>>0,f||ce(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},i.prototype.readInt32BE=function(u,f){return u=u>>>0,f||ce(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=wt(function(u){u=u>>>0,b(u,"offset");let f=this[u],_=this[u+7];(f===void 0||_===void 0)&&w(u,this.length-8);let I=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(_<<24);return(BigInt(I)<<BigInt(32))+BigInt(f+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),i.prototype.readBigInt64BE=wt(function(u){u=u>>>0,b(u,"offset");let f=this[u],_=this[u+7];(f===void 0||_===void 0)&&w(u,this.length-8);let I=(f<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(I)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+_)}),i.prototype.readFloatLE=function(u,f){return u=u>>>0,f||ce(u,4,this.length),e.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,f){return u=u>>>0,f||ce(u,4,this.length),e.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,f){return u=u>>>0,f||ce(u,8,this.length),e.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,f){return u=u>>>0,f||ce(u,8,this.length),e.read(this,u,!1,52,8)};function ve(h,u,f,_,I,N){if(!i.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>I||u<N)throw new RangeError('"value" argument is out of bounds');if(f+_>h.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,f,_,I){if(u=+u,f=f>>>0,_=_>>>0,!I){let Be=Math.pow(2,8*_)-1;ve(this,u,f,_,Be,0)}let N=1,K=0;for(this[f]=u&255;++K<_&&(N*=256);)this[f+K]=u/N&255;return f+_},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,f,_,I){if(u=+u,f=f>>>0,_=_>>>0,!I){let Be=Math.pow(2,8*_)-1;ve(this,u,f,_,Be,0)}let N=_-1,K=1;for(this[f+N]=u&255;--N>=0&&(K*=256);)this[f+N]=u/K&255;return f+_},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,1,255,0),this[f]=u&255,f+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,2,65535,0),this[f]=u&255,this[f+1]=u>>>8,f+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,2,65535,0),this[f]=u>>>8,this[f+1]=u&255,f+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,4,4294967295,0),this[f+3]=u>>>24,this[f+2]=u>>>16,this[f+1]=u>>>8,this[f]=u&255,f+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,4,4294967295,0),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4};function D(h,u,f,_,I){ae(u,_,I,h,f,7);let N=Number(u&BigInt(4294967295));h[f++]=N,N=N>>8,h[f++]=N,N=N>>8,h[f++]=N,N=N>>8,h[f++]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return h[f++]=K,K=K>>8,h[f++]=K,K=K>>8,h[f++]=K,K=K>>8,h[f++]=K,f}function Z(h,u,f,_,I){ae(u,_,I,h,f,7);let N=Number(u&BigInt(4294967295));h[f+7]=N,N=N>>8,h[f+6]=N,N=N>>8,h[f+5]=N,N=N>>8,h[f+4]=N;let K=Number(u>>BigInt(32)&BigInt(4294967295));return h[f+3]=K,K=K>>8,h[f+2]=K,K=K>>8,h[f+1]=K,K=K>>8,h[f]=K,f+8}i.prototype.writeBigUInt64LE=wt(function(u,f=0){return D(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=wt(function(u,f=0){return Z(this,u,f,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,f,_,I){if(u=+u,f=f>>>0,!I){let Je=Math.pow(2,8*_-1);ve(this,u,f,_,Je-1,-Je)}let N=0,K=1,Be=0;for(this[f]=u&255;++N<_&&(K*=256);)u<0&&Be===0&&this[f+N-1]!==0&&(Be=1),this[f+N]=(u/K>>0)-Be&255;return f+_},i.prototype.writeIntBE=function(u,f,_,I){if(u=+u,f=f>>>0,!I){let Je=Math.pow(2,8*_-1);ve(this,u,f,_,Je-1,-Je)}let N=_-1,K=1,Be=0;for(this[f+N]=u&255;--N>=0&&(K*=256);)u<0&&Be===0&&this[f+N+1]!==0&&(Be=1),this[f+N]=(u/K>>0)-Be&255;return f+_},i.prototype.writeInt8=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,1,127,-128),u<0&&(u=255+u+1),this[f]=u&255,f+1},i.prototype.writeInt16LE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,2,32767,-32768),this[f]=u&255,this[f+1]=u>>>8,f+2},i.prototype.writeInt16BE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,2,32767,-32768),this[f]=u>>>8,this[f+1]=u&255,f+2},i.prototype.writeInt32LE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,4,2147483647,-2147483648),this[f]=u&255,this[f+1]=u>>>8,this[f+2]=u>>>16,this[f+3]=u>>>24,f+4},i.prototype.writeInt32BE=function(u,f,_){return u=+u,f=f>>>0,_||ve(this,u,f,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[f]=u>>>24,this[f+1]=u>>>16,this[f+2]=u>>>8,this[f+3]=u&255,f+4},i.prototype.writeBigInt64LE=wt(function(u,f=0){return D(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=wt(function(u,f=0){return Z(this,u,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(h,u,f,_,I,N){if(f+_>h.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function fe(h,u,f,_,I){return u=+u,f=f>>>0,I||F(h,u,f,4),e.write(h,u,f,_,23,4),f+4}i.prototype.writeFloatLE=function(u,f,_){return fe(this,u,f,!0,_)},i.prototype.writeFloatBE=function(u,f,_){return fe(this,u,f,!1,_)};function Te(h,u,f,_,I){return u=+u,f=f>>>0,I||F(h,u,f,8),e.write(h,u,f,_,52,8),f+8}i.prototype.writeDoubleLE=function(u,f,_){return Te(this,u,f,!0,_)},i.prototype.writeDoubleBE=function(u,f,_){return Te(this,u,f,!1,_)},i.prototype.copy=function(u,f,_,I){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(_||(_=0),!I&&I!==0&&(I=this.length),f>=u.length&&(f=u.length),f||(f=0),I>0&&I<_&&(I=_),I===_||u.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),u.length-f<I-_&&(I=u.length-f+_);let N=I-_;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,_,I):Uint8Array.prototype.set.call(u,this.subarray(_,I),f),N},i.prototype.fill=function(u,f,_,I){if(typeof u=="string"){if(typeof f=="string"?(I=f,f=0,_=this.length):typeof _=="string"&&(I=_,_=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!i.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(u.length===1){let K=u.charCodeAt(0);(I==="utf8"&&K<128||I==="latin1")&&(u=K)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(f<0||this.length<f||this.length<_)throw new RangeError("Out of range index");if(_<=f)return this;f=f>>>0,_=_===void 0?this.length:_>>>0,u||(u=0);let N;if(typeof u=="number")for(N=f;N<_;++N)this[N]=u;else{let K=i.isBuffer(u)?u:i.from(u,I),Be=K.length;if(Be===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(N=0;N<_-f;++N)this[N+f]=K[N%Be]}return this};let A={};function k(h,u,f){A[h]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${h}]`,this.stack,delete this.name}get code(){return h}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${h}]: ${this.message}`}}}k("ERR_BUFFER_OUT_OF_BOUNDS",function(h){return h?`${h} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),k("ERR_INVALID_ARG_TYPE",function(h,u){return`The "${h}" argument must be of type number. Received type ${typeof u}`},TypeError),k("ERR_OUT_OF_RANGE",function(h,u,f){let _=`The value of "${h}" is out of range.`,I=f;return Number.isInteger(f)&&Math.abs(f)>2**32?I=j(String(f)):typeof f=="bigint"&&(I=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(I=j(I)),I+="n"),_+=` It must be ${u}. Received ${I}`,_},RangeError);function j(h){let u="",f=h.length,_=h[0]==="-"?1:0;for(;f>=_+4;f-=3)u=`_${h.slice(f-3,f)}${u}`;return`${h.slice(0,f)}${u}`}function Y(h,u,f){b(u,"offset"),(h[u]===void 0||h[u+f]===void 0)&&w(u,h.length-(f+1))}function ae(h,u,f,_,I,N){if(h>f||h<u){let K=typeof u=="bigint"?"n":"",Be;throw u===0||u===BigInt(0)?Be=`>= 0${K} and < 2${K} ** ${(N+1)*8}${K}`:Be=`>= -(2${K} ** ${(N+1)*8-1}${K}) and < 2 ** ${(N+1)*8-1}${K}`,new A.ERR_OUT_OF_RANGE("value",Be,h)}Y(_,I,N)}function b(h,u){if(typeof h!="number")throw new A.ERR_INVALID_ARG_TYPE(u,"number",h)}function w(h,u,f){throw Math.floor(h)!==h?(b(h,f),new A.ERR_OUT_OF_RANGE("offset","an integer",h)):u<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${u}`,h)}let W=/[^+/0-9A-Za-z-_]/g;function Q(h){if(h=h.split("=")[0],h=h.trim().replace(W,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function He(h,u){u=u||1/0;let f,_=h.length,I=null,N=[];for(let K=0;K<_;++K){if(f=h.charCodeAt(K),f>55295&&f<57344){if(!I){if(f>56319){(u-=3)>-1&&N.push(239,191,189);continue}else if(K+1===_){(u-=3)>-1&&N.push(239,191,189);continue}I=f;continue}if(f<56320){(u-=3)>-1&&N.push(239,191,189),I=f;continue}f=(I-55296<<10|f-56320)+65536}else I&&(u-=3)>-1&&N.push(239,191,189);if(I=null,f<128){if((u-=1)<0)break;N.push(f)}else if(f<2048){if((u-=2)<0)break;N.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;N.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;N.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return N}function _e(h){let u=[];for(let f=0;f<h.length;++f)u.push(h.charCodeAt(f)&255);return u}function U(h,u){let f,_,I,N=[];for(let K=0;K<h.length&&!((u-=2)<0);++K)f=h.charCodeAt(K),_=f>>8,I=f%256,N.push(I),N.push(_);return N}function Pt(h){return t.toByteArray(Q(h))}function It(h,u,f,_){let I;for(I=0;I<_&&!(I+f>=u.length||I>=h.length);++I)u[I+f]=h[I];return I}function vt(h,u){return h instanceof u||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===u.name}function hr(h){return h!==h}let Xr=function(){let h="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){let _=f*16;for(let I=0;I<16;++I)u[_+I]=h[f]+h[I]}return u}();function wt(h){return typeof BigInt>"u"?vr:h}function vr(){throw new Error("BigInt not supported")}return pn}var _r,dc,ri,pc,pn,gc,ii=it(()=>{C();O();R();_r={},dc=!1;ri={},pc=!1;pn={},gc=!1});var gn,z,DI,NI,yc=it(()=>{C();O();R();ii();gn=At();gn.Buffer;gn.SlowBuffer;gn.INSPECT_MAX_BYTES;gn.kMaxLength;z=gn.Buffer,DI=gn.INSPECT_MAX_BYTES,NI=gn.kMaxLength});var O=it(()=>{yc()});var Sc=zl(Pe=>{"use strict";C();O();R();var br=Symbol.for("react.element"),Kv=Symbol.for("react.portal"),Wv=Symbol.for("react.fragment"),qv=Symbol.for("react.strict_mode"),zv=Symbol.for("react.profiler"),Gv=Symbol.for("react.provider"),Vv=Symbol.for("react.context"),Jv=Symbol.for("react.forward_ref"),Yv=Symbol.for("react.suspense"),Xv=Symbol.for("react.memo"),Qv=Symbol.for("react.lazy"),mc=Symbol.iterator;function eT(t){return t===null||typeof t!="object"?null:(t=mc&&t[mc]||t["@@iterator"],typeof t=="function"?t:null)}var Tc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_c=Object.assign,bc={};function Zn(t,e,n){this.props=t,this.context=e,this.refs=bc,this.updater=n||Tc}Zn.prototype.isReactComponent={};Zn.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")};Zn.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function wc(){}wc.prototype=Zn.prototype;function Xo(t,e,n){this.props=t,this.context=e,this.refs=bc,this.updater=n||Tc}var Qo=Xo.prototype=new wc;Qo.constructor=Xo;_c(Qo,Zn.prototype);Qo.isPureReactComponent=!0;var hc=Array.isArray,xc=Object.prototype.hasOwnProperty,ea={current:null},Bc={key:!0,ref:!0,__self:!0,__source:!0};function Pc(t,e,n){var r,o={},s=null,i=null;if(e!=null)for(r in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(s=""+e.key),e)xc.call(e,r)&&!Bc.hasOwnProperty(r)&&(o[r]=e[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:br,type:t,key:s,ref:i,props:o,_owner:ea.current}}function tT(t,e){return{$$typeof:br,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function ta(t){return typeof t=="object"&&t!==null&&t.$$typeof===br}function nT(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var vc=/\/+/g;function Yo(t,e){return typeof t=="object"&&t!==null&&t.key!=null?nT(""+t.key):e.toString(36)}function ai(t,e,n,r,o){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 br:case Kv:i=!0}}if(i)return i=t,o=o(i),t=r===""?"."+Yo(i,0):r,hc(o)?(n="",t!=null&&(n=t.replace(vc,"$&/")+"/"),ai(o,e,n,"",function(c){return c})):o!=null&&(ta(o)&&(o=tT(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(vc,"$&/")+"/")+t)),e.push(o)),1;if(i=0,r=r===""?".":r+":",hc(t))for(var a=0;a<t.length;a++){s=t[a];var l=r+Yo(s,a);i+=ai(s,e,n,l,o)}else if(l=eT(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=r+Yo(s,a++),i+=ai(s,e,n,l,o);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 oi(t,e,n){if(t==null)return t;var r=[],o=0;return ai(t,r,"","",function(s){return e.call(n,s,o++)}),r}function rT(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ut={current:null},si={transition:null},iT={ReactCurrentDispatcher:ut,ReactCurrentBatchConfig:si,ReactCurrentOwner:ea};function Ec(){throw Error("act(...) is not supported in production builds of React.")}Pe.Children={map:oi,forEach:function(t,e,n){oi(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return oi(t,function(){e++}),e},toArray:function(t){return oi(t,function(e){return e})||[]},only:function(t){if(!ta(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Pe.Component=Zn;Pe.Fragment=Wv;Pe.Profiler=zv;Pe.PureComponent=Xo;Pe.StrictMode=qv;Pe.Suspense=Yv;Pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iT;Pe.act=Ec;Pe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=_c({},t.props),o=t.key,s=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,i=ea.current),e.key!==void 0&&(o=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)xc.call(e,l)&&!Bc.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:br,type:t.type,key:o,ref:s,props:r,_owner:i}};Pe.createContext=function(t){return t={$$typeof:Vv,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Gv,_context:t},t.Consumer=t};Pe.createElement=Pc;Pe.createFactory=function(t){var e=Pc.bind(null,t);return e.type=t,e};Pe.createRef=function(){return{current:null}};Pe.forwardRef=function(t){return{$$typeof:Jv,render:t}};Pe.isValidElement=ta;Pe.lazy=function(t){return{$$typeof:Qv,_payload:{_status:-1,_result:t},_init:rT}};Pe.memo=function(t,e){return{$$typeof:Xv,type:t,compare:e===void 0?null:e}};Pe.startTransition=function(t){var e=si.transition;si.transition={};try{t()}finally{si.transition=e}};Pe.unstable_act=Ec;Pe.useCallback=function(t,e){return ut.current.useCallback(t,e)};Pe.useContext=function(t){return ut.current.useContext(t)};Pe.useDebugValue=function(){};Pe.useDeferredValue=function(t){return ut.current.useDeferredValue(t)};Pe.useEffect=function(t,e){return ut.current.useEffect(t,e)};Pe.useId=function(){return ut.current.useId()};Pe.useImperativeHandle=function(t,e,n){return ut.current.useImperativeHandle(t,e,n)};Pe.useInsertionEffect=function(t,e){return ut.current.useInsertionEffect(t,e)};Pe.useLayoutEffect=function(t,e){return ut.current.useLayoutEffect(t,e)};Pe.useMemo=function(t,e){return ut.current.useMemo(t,e)};Pe.useReducer=function(t,e,n){return ut.current.useReducer(t,e,n)};Pe.useRef=function(t){return ut.current.useRef(t)};Pe.useState=function(t){return ut.current.useState(t)};Pe.useSyncExternalStore=function(t,e,n){return ut.current.useSyncExternalStore(t,e,n)};Pe.useTransition=function(){return ut.current.useTransition()};Pe.version="18.3.1"});var Ln=zl((zI,kc)=>{"use strict";C();O();R();kc.exports=Sc()});function Ct(){return Ny||(Ny=!0,typeof Object.create=="function"?To=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:To=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),To}var To,Ny,os=it(()=>{C();O();R();To={},Ny=!1});function Ue(){Ue.init.call(this)}function _o(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function qy(t){return t._maxListeners===void 0?Ue.defaultMaxListeners:t._maxListeners}function $y(t,e,n,r){var o,s,i,a;if(_o(n),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),i=s[e]),i===void 0)i=s[e]=n,++t._eventsCount;else if(typeof i=="function"?i=s[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(o=qy(t))>0&&i.length>o&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=i.length,a=l,console&&console.warn&&console.warn(a)}return t}function uP(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Zy(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},o=uP.bind(r);return o.listener=n,r.wrapFn=o,o}function Ly(t,e,n){var r=t._events;if(r===void 0)return[];var o=r[e];return o===void 0?[]:typeof o=="function"?n?[o.listener||o]:[o]:n?function(s){for(var i=new Array(s.length),a=0;a<i.length;++a)i[a]=s[a].listener||s[a];return i}(o):zy(o,o.length)}function Fy(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function zy(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}var Ky,Wy,or,Hy,Uy,jy,yt,as=it(()=>{C();O();R();or=typeof Reflect=="object"?Reflect:null,Hy=or&&typeof or.apply=="function"?or.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Wy=or&&typeof or.ownKeys=="function"?or.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Uy=Number.isNaN||function(t){return t!=t};Ky=Ue,Ue.EventEmitter=Ue,Ue.prototype._events=void 0,Ue.prototype._eventsCount=0,Ue.prototype._maxListeners=void 0;jy=10;Object.defineProperty(Ue,"defaultMaxListeners",{enumerable:!0,get:function(){return jy},set:function(t){if(typeof t!="number"||t<0||Uy(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");jy=t}}),Ue.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ue.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Uy(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Ue.prototype.getMaxListeners=function(){return qy(this)},Ue.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var a=o[t];if(a===void 0)return!1;if(typeof a=="function")Hy(a,this,e);else{var l=a.length,c=zy(a,l);for(n=0;n<l;++n)Hy(c[n],this,e)}return!0},Ue.prototype.addListener=function(t,e){return $y(this,t,e,!1)},Ue.prototype.on=Ue.prototype.addListener,Ue.prototype.prependListener=function(t,e){return $y(this,t,e,!0)},Ue.prototype.once=function(t,e){return _o(e),this.on(t,Zy(this,t,e)),this},Ue.prototype.prependOnceListener=function(t,e){return _o(e),this.prependListener(t,Zy(this,t,e)),this},Ue.prototype.removeListener=function(t,e){var n,r,o,s,i;if(_o(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){i=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():function(a,l){for(;l+1<a.length;l++)a[l]=a[l+1];a.pop()}(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,i||e)}return this},Ue.prototype.off=Ue.prototype.removeListener,Ue.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o,s=Object.keys(n);for(r=0;r<s.length;++r)(o=s[r])!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},Ue.prototype.listeners=function(t){return Ly(this,t,!0)},Ue.prototype.rawListeners=function(t){return Ly(this,t,!1)},Ue.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Fy.call(t,e)},Ue.prototype.listenerCount=Fy,Ue.prototype.eventNames=function(){return this._eventsCount>0?Wy(this._events):[]};yt=Ky;yt.EventEmitter;yt.defaultMaxListeners;yt.init;yt.listenerCount;yt.EventEmitter;yt.defaultMaxListeners;yt.init;yt.listenerCount});var Gy=it(()=>{C();O();R();as();yt.once=function(t,e){return new Promise((n,r)=>{function o(...i){s!==void 0&&t.removeListener("error",s),n(i)}let s;e!=="error"&&(s=i=>{t.removeListener(name,o),r(i)},t.once("error",s)),t.once(e,o)})};yt.on=function(t,e){let n=[],r=[],o=null,s=!1,i={async next(){let c=n.shift();if(c)return createIterResult(c,!1);if(o){let d=Promise.reject(o);return o=null,d}return s?createIterResult(void 0,!0):new Promise((d,y)=>r.push({resolve:d,reject:y}))},async return(){t.removeListener(e,a),t.removeListener("error",l),s=!0;for(let c of r)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){o=c,t.removeListener(e,a),t.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return t.on(e,a),t.on("error",l),i;function a(...c){let d=r.shift();d?d.resolve(createIterResult(c,!1)):n.push(c)}function l(c){s=!0;let d=r.shift();d?d.reject(c):o=c,i.return()}}});function fs(){throw new Error("setTimeout has not been defined")}function ds(){throw new Error("clearTimeout has not been defined")}function lm(t){if(qt===setTimeout)return setTimeout(t,0);if((qt===fs||!qt)&&setTimeout)return qt=setTimeout,setTimeout(t,0);try{return qt(t,0)}catch{try{return qt.call(null,t,0)}catch{return qt.call(this||sr,t,0)}}}function cP(){ar&&An&&(ar=!1,An.length?Gt=An.concat(Gt):Eo=-1,Gt.length&&um())}function um(){if(!ar){var t=lm(cP);ar=!0;for(var e=Gt.length;e;){for(An=Gt,Gt=[];++Eo<e;)An&&An[Eo].run();Eo=-1,e=Gt.length}An=null,ar=!1,function(n){if(zt===clearTimeout)return clearTimeout(n);if((zt===ds||!zt)&&clearTimeout)return zt=clearTimeout,clearTimeout(n);try{zt(n)}catch{try{return zt.call(null,n)}catch{return zt.call(this||sr,n)}}}(t)}}function Vy(t,e){(this||sr).fun=t,(this||sr).array=e}function Wt(){}function Rn(t){return t.call.bind(t)}function Fr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function Yy(t){return mt&&_t?xt(t)!==void 0:ym(t)||mm(t)||hm(t)||vm(t)||Tm(t)||_m(t)||bm(t)||wm(t)||xm(t)||Bm(t)||Pm(t)}function ym(t){return mt&&_t?xt(t)==="Uint8Array":Ge(t)==="[object Uint8Array]"||_P(t)&&t.buffer!==void 0}function mm(t){return mt&&_t?xt(t)==="Uint8ClampedArray":Ge(t)==="[object Uint8ClampedArray]"}function hm(t){return mt&&_t?xt(t)==="Uint16Array":Ge(t)==="[object Uint16Array]"}function vm(t){return mt&&_t?xt(t)==="Uint32Array":Ge(t)==="[object Uint32Array]"}function Tm(t){return mt&&_t?xt(t)==="Int8Array":Ge(t)==="[object Int8Array]"}function _m(t){return mt&&_t?xt(t)==="Int16Array":Ge(t)==="[object Int16Array]"}function bm(t){return mt&&_t?xt(t)==="Int32Array":Ge(t)==="[object Int32Array]"}function wm(t){return mt&&_t?xt(t)==="Float32Array":Ge(t)==="[object Float32Array]"}function xm(t){return mt&&_t?xt(t)==="Float64Array":Ge(t)==="[object Float64Array]"}function Bm(t){return mt&&_t?xt(t)==="BigInt64Array":Ge(t)==="[object BigInt64Array]"}function Pm(t){return mt&&_t?xt(t)==="BigUint64Array":Ge(t)==="[object BigUint64Array]"}function bo(t){return Ge(t)==="[object Map]"}function wo(t){return Ge(t)==="[object Set]"}function xo(t){return Ge(t)==="[object WeakMap]"}function ss(t){return Ge(t)==="[object WeakSet]"}function ko(t){return Ge(t)==="[object ArrayBuffer]"}function Xy(t){return typeof ArrayBuffer<"u"&&(ko.working?ko(t):t instanceof ArrayBuffer)}function Io(t){return Ge(t)==="[object DataView]"}function Qy(t){return typeof DataView<"u"&&(Io.working?Io(t):t instanceof DataView)}function Ao(t){return Ge(t)==="[object SharedArrayBuffer]"}function em(t){return typeof SharedArrayBuffer<"u"&&(Ao.working?Ao(t):t instanceof SharedArrayBuffer)}function tm(t){return Fr(t,PP)}function nm(t){return Fr(t,EP)}function rm(t){return Fr(t,SP)}function im(t){return gm&&Fr(t,kP)}function om(t){return gs&&Fr(t,IP)}function an(t,e){var n={seen:[],stylize:RP};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),ys(e)?n.showHidden=e:e&&L._extend(n,e),Cn(n.showHidden)&&(n.showHidden=!1),Cn(n.depth)&&(n.depth=2),Cn(n.colors)&&(n.colors=!1),Cn(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=CP),Co(n,t,n.depth)}function CP(t,e){var n=an.styles[e];return n?"\x1B["+an.colors[n][0]+"m"+t+"\x1B["+an.colors[n][1]+"m":t}function RP(t,e){return t}function Co(t,e,n){if(t.customInspect&&e&&So(e.inspect)&&e.inspect!==L.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Ro(r)||(r=Co(t,r,n)),r}var o=function(g,m){if(Cn(m))return g.stylize("undefined","undefined");if(Ro(m)){var v="'"+JSON.stringify(m).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(v,"string")}if(km(m))return g.stylize(""+m,"number");if(ys(m))return g.stylize(""+m,"boolean");if(Do(m))return g.stylize("null","null")}(t,e);if(o)return o;var s=Object.keys(e),i=function(g){var m={};return g.forEach(function(v,B){m[v]=!0}),m}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),Lr(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return ls(e);if(s.length===0){if(So(e)){var a=e.name?": "+e.name:"";return t.stylize("[Function"+a+"]","special")}if(Zr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Oo(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Lr(e))return ls(e)}var l,c="",d=!1,y=["{","}"];return Sm(e)&&(d=!0,y=["[","]"]),So(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),Zr(e)&&(c=" "+RegExp.prototype.toString.call(e)),Oo(e)&&(c=" "+Date.prototype.toUTCString.call(e)),Lr(e)&&(c=" "+ls(e)),s.length!==0||d&&e.length!=0?n<0?Zr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=d?function(g,m,v,B,P){for(var T=[],S=0,E=m.length;S<E;++S)Im(m,String(S))?T.push(us(g,m,v,B,String(S),!0)):T.push("");return P.forEach(function(M){M.match(/^\d+$/)||T.push(us(g,m,v,B,M,!0))}),T}(t,e,n,i,s):s.map(function(g){return us(t,e,n,i,g,d)}),t.seen.pop(),function(g,m,v){var B=0;return g.reduce(function(P,T){return B++,T.indexOf(`
2
- `)>=0&&B++,P+T.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?v[0]+(m===""?"":m+`
1
+ var Ya=Object.defineProperty;var Mv=Object.getOwnPropertyDescriptor;var Nv=Object.getOwnPropertyNames;var Dv=Object.prototype.hasOwnProperty;var ot=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ln=(t,e)=>{for(var n in e)Ya(t,n,{get:e[n],enumerable:!0})},Hv=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Nv(e))!Dv.call(t,a)&&a!==n&&Ya(t,a,{get:()=>e[a],enumerable:!(r=Mv(e,a))||r.enumerable});return t};var Uv=t=>Hv(Ya({},"__esModule",{value:!0}),t);var O=ot(()=>{});var X={};Ln(X,{_debugEnd:()=>Ru,_debugProcess:()=>Ou,_events:()=>Vu,_eventsCount:()=>Ju,_exiting:()=>pu,_fatalExceptions:()=>ku,_getActiveHandles:()=>hu,_getActiveRequests:()=>mu,_kill:()=>Tu,_linkedBinding:()=>fu,_maxListeners:()=>Gu,_preload_modules:()=>Wu,_rawDebug:()=>uu,_startProfilerIdleNotifier:()=>Mu,_stopProfilerIdleNotifier:()=>Nu,_tickCallback:()=>Cu,abort:()=>$u,addListener:()=>Xu,allowedNodeEnvironmentFlags:()=>Bu,arch:()=>Vl,argv:()=>Yl,argv0:()=>Fu,assert:()=>Eu,binding:()=>ru,browser:()=>lu,chdir:()=>ou,config:()=>gu,cpuUsage:()=>ui,cwd:()=>au,debugPort:()=>Lu,default:()=>oc,dlopen:()=>yu,domain:()=>du,emit:()=>nc,emitWarning:()=>nu,env:()=>Xl,execArgv:()=>Ql,execPath:()=>Ku,exit:()=>xu,features:()=>Su,hasUncaughtExceptionCaptureCallback:()=>Au,hrtime:()=>li,kill:()=>wu,listeners:()=>ac,memoryUsage:()=>bu,moduleLoadList:()=>cu,nextTick:()=>zl,off:()=>Qu,on:()=>$t,once:()=>Yu,openStdin:()=>Pu,pid:()=>Zu,platform:()=>Jl,ppid:()=>ju,prependListener:()=>rc,prependOnceListener:()=>ic,reallyExit:()=>vu,release:()=>su,removeAllListeners:()=>tc,removeListener:()=>ec,resourceUsage:()=>_u,setSourceMapsEnabled:()=>zu,setUncaughtExceptionCaptureCallback:()=>Iu,stderr:()=>Hu,stdin:()=>Uu,stdout:()=>Du,title:()=>Gl,umask:()=>iu,uptime:()=>qu,version:()=>eu,versions:()=>tu});function to(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function $v(){!Fn||!gn||(Fn=!1,gn.length?Ut=gn.concat(Ut):si=-1,Ut.length&&Wl())}function Wl(){if(!Fn){var t=setTimeout($v,0);Fn=!0;for(var e=Ut.length;e;){for(gn=Ut,Ut=[];++si<e;)gn&&gn[si].run();si=-1,e=Ut.length}gn=null,Fn=!1,clearTimeout(t)}}function zl(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Ut.push(new ql(t,e)),Ut.length===1&&!Fn&&setTimeout(Wl,0)}function ql(t,e){this.fun=t,this.array=e}function lt(){}function fu(t){to("_linkedBinding")}function yu(t){to("dlopen")}function mu(){return[]}function hu(){return[]}function Eu(t,e){if(!t)throw new Error(e||"assertion error")}function Au(){return!1}function qu(){return tn.now()/1e3}function li(t){var e=Math.floor((Date.now()-tn.now())*.001),n=tn.now()*.001,r=Math.floor(n)+e,a=Math.floor(n%1*1e9);return t&&(r=r-t[0],a=a-t[1],a<0&&(r--,a+=eo)),[r,a]}function $t(){return oc}function ac(t){return[]}var Ut,Fn,gn,si,Gl,Vl,Jl,Xl,Yl,Ql,eu,tu,nu,ru,iu,au,ou,su,lu,uu,cu,du,pu,gu,vu,Tu,ui,_u,bu,wu,xu,Pu,Bu,Su,ku,Iu,Cu,Ou,Ru,Mu,Nu,Du,Hu,Uu,$u,Zu,ju,Ku,Lu,Fu,Wu,zu,tn,Qa,eo,Gu,Vu,Ju,Xu,Yu,Qu,ec,tc,nc,rc,ic,oc,sc=ot(()=>{O();M();R();Ut=[],Fn=!1,si=-1;ql.prototype.run=function(){this.fun.apply(null,this.array)};Gl="browser",Vl="x64",Jl="browser",Xl={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Yl=["/usr/bin/node"],Ql=[],eu="v16.8.0",tu={},nu=function(t,e){console.warn((e?e+": ":"")+t)},ru=function(t){to("binding")},iu=function(t){return 0},au=function(){return"/"},ou=function(t){},su={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};lu=!0,uu=lt,cu=[];du={},pu=!1,gu={};vu=lt,Tu=lt,ui=function(){return{}},_u=ui,bu=ui,wu=lt,xu=lt,Pu=lt,Bu={};Su={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ku=lt,Iu=lt;Cu=lt,Ou=lt,Ru=lt,Mu=lt,Nu=lt,Du=void 0,Hu=void 0,Uu=void 0,$u=lt,Zu=2,ju=1,Ku="/bin/usr/node",Lu=9229,Fu="node",Wu=[],zu=lt,tn={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};tn.now===void 0&&(Qa=Date.now(),tn.timing&&tn.timing.navigationStart&&(Qa=tn.timing.navigationStart),tn.now=()=>Date.now()-Qa);eo=1e9;li.bigint=function(t){var e=li(t);return typeof BigInt>"u"?e[0]*eo+e[1]:BigInt(e[0]*eo)+BigInt(e[1])};Gu=10,Vu={},Ju=0;Xu=$t,Yu=$t,Qu=$t,ec=$t,tc=$t,nc=lt,rc=$t,ic=$t;oc={version:eu,versions:tu,arch:Vl,platform:Jl,browser:lu,release:su,_rawDebug:uu,moduleLoadList:cu,binding:ru,_linkedBinding:fu,_events:Vu,_eventsCount:Ju,_maxListeners:Gu,on:$t,addListener:Xu,once:Yu,off:Qu,removeListener:ec,removeAllListeners:tc,emit:nc,prependListener:rc,prependOnceListener:ic,listeners:ac,domain:du,_exiting:pu,config:gu,dlopen:yu,uptime:qu,_getActiveRequests:mu,_getActiveHandles:hu,reallyExit:vu,_kill:Tu,cpuUsage:ui,resourceUsage:_u,memoryUsage:bu,kill:wu,exit:xu,openStdin:Pu,allowedNodeEnvironmentFlags:Bu,assert:Eu,features:Su,_fatalExceptions:ku,setUncaughtExceptionCaptureCallback:Iu,hasUncaughtExceptionCaptureCallback:Au,emitWarning:nu,nextTick:zl,_tickCallback:Cu,_debugProcess:Ou,_debugEnd:Ru,_startProfilerIdleNotifier:Mu,_stopProfilerIdleNotifier:Nu,stdout:Du,stdin:Uu,stderr:Hu,abort:$u,umask:iu,chdir:ou,cwd:au,env:Xl,title:Gl,argv:Yl,execArgv:Ql,pid:Zu,ppid:ju,execPath:Ku,debugPort:Lu,hrtime:li,argv0:Fu,_preload_modules:Wu,setSourceMapsEnabled:zu}});var R=ot(()=>{sc()});function Zv(){if(lc)return Tr;lc=!0,Tr.byteLength=o,Tr.toByteArray=f,Tr.fromByteArray=g;for(var t=[],e=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=r.length;a<s;++a)t[a]=r[a],e[r.charCodeAt(a)]=a;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63;function i(h){var w=h.length;if(w%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=h.indexOf("=");P===-1&&(P=w);var B=P===w?0:4-P%4;return[P,B]}function o(h){var w=i(h),P=w[0],B=w[1];return(P+B)*3/4-B}function l(h,w,P){return(w+P)*3/4-P}function f(h){var w,P=i(h),B=P[0],v=P[1],S=new n(l(h,B,v)),E=0,H=v>0?B-4:B,K;for(K=0;K<H;K+=4)w=e[h.charCodeAt(K)]<<18|e[h.charCodeAt(K+1)]<<12|e[h.charCodeAt(K+2)]<<6|e[h.charCodeAt(K+3)],S[E++]=w>>16&255,S[E++]=w>>8&255,S[E++]=w&255;return v===2&&(w=e[h.charCodeAt(K)]<<2|e[h.charCodeAt(K+1)]>>4,S[E++]=w&255),v===1&&(w=e[h.charCodeAt(K)]<<10|e[h.charCodeAt(K+1)]<<4|e[h.charCodeAt(K+2)]>>2,S[E++]=w>>8&255,S[E++]=w&255),S}function p(h){return t[h>>18&63]+t[h>>12&63]+t[h>>6&63]+t[h&63]}function y(h,w,P){for(var B,v=[],S=w;S<P;S+=3)B=(h[S]<<16&16711680)+(h[S+1]<<8&65280)+(h[S+2]&255),v.push(p(B));return v.join("")}function g(h){for(var w,P=h.length,B=P%3,v=[],S=16383,E=0,H=P-B;E<H;E+=S)v.push(y(h,E,E+S>H?H:E+S));return B===1?(w=h[P-1],v.push(t[w>>2]+t[w<<4&63]+"==")):B===2&&(w=(h[P-2]<<8)+h[P-1],v.push(t[w>>10]+t[w>>4&63]+t[w<<2&63]+"=")),v.join("")}return Tr}function jv(){if(uc)return ci;uc=!0;return ci.read=function(t,e,n,r,a){var s,i,o=a*8-r-1,l=(1<<o)-1,f=l>>1,p=-7,y=n?a-1:0,g=n?-1:1,h=t[e+y];for(y+=g,s=h&(1<<-p)-1,h>>=-p,p+=o;p>0;s=s*256+t[e+y],y+=g,p-=8);for(i=s&(1<<-p)-1,s>>=-p,p+=r;p>0;i=i*256+t[e+y],y+=g,p-=8);if(s===0)s=1-f;else{if(s===l)return i?NaN:(h?-1:1)*(1/0);i=i+Math.pow(2,r),s=s-f}return(h?-1:1)*i*Math.pow(2,s-r)},ci.write=function(t,e,n,r,a,s){var i,o,l,f=s*8-a-1,p=(1<<f)-1,y=p>>1,g=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:s-1,w=r?1:-1,P=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,i=p):(i=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-i))<1&&(i--,l*=2),i+y>=1?e+=g/l:e+=g*Math.pow(2,1-y),e*l>=2&&(i++,l/=2),i+y>=p?(o=0,i=p):i+y>=1?(o=(e*l-1)*Math.pow(2,a),i=i+y):(o=e*Math.pow(2,y-1)*Math.pow(2,a),i=0));a>=8;t[n+h]=o&255,h+=w,o/=256,a-=8);for(i=i<<a|o,f+=a;f>0;t[n+h]=i&255,h+=w,i/=256,f-=8);t[n+h-w]|=P*128},ci}function Rt(){if(cc)return yn;cc=!0;let t=Zv(),e=jv(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;yn.Buffer=i,yn.SlowBuffer=v,yn.INSPECT_MAX_BYTES=50;let r=2147483647;yn.kMaxLength=r,i.TYPED_ARRAY_SUPPORT=a(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let m=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(m,u),m.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function s(m){if(m>r)throw new RangeError('The value "'+m+'" is invalid for option "size"');let u=new Uint8Array(m);return Object.setPrototypeOf(u,i.prototype),u}function i(m,u,c){if(typeof m=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return p(m)}return o(m,u,c)}i.poolSize=8192;function o(m,u,c){if(typeof m=="string")return y(m,u);if(ArrayBuffer.isView(m))return h(m);if(m==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m);if(wt(m,ArrayBuffer)||m&&wt(m.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(wt(m,SharedArrayBuffer)||m&&wt(m.buffer,SharedArrayBuffer)))return w(m,u,c);if(typeof m=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=m.valueOf&&m.valueOf();if(T!=null&&T!==m)return i.from(T,u,c);let I=P(m);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof m[Symbol.toPrimitive]=="function")return i.from(m[Symbol.toPrimitive]("string"),u,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof m)}i.from=function(m,u,c){return o(m,u,c)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function l(m){if(typeof m!="number")throw new TypeError('"size" argument must be of type number');if(m<0)throw new RangeError('The value "'+m+'" is invalid for option "size"')}function f(m,u,c){return l(m),m<=0?s(m):u!==void 0?typeof c=="string"?s(m).fill(u,c):s(m).fill(u):s(m)}i.alloc=function(m,u,c){return f(m,u,c)};function p(m){return l(m),s(m<0?0:B(m)|0)}i.allocUnsafe=function(m){return p(m)},i.allocUnsafeSlow=function(m){return p(m)};function y(m,u){if((typeof u!="string"||u==="")&&(u="utf8"),!i.isEncoding(u))throw new TypeError("Unknown encoding: "+u);let c=S(m,u)|0,T=s(c),I=T.write(m,u);return I!==c&&(T=T.slice(0,I)),T}function g(m){let u=m.length<0?0:B(m.length)|0,c=s(u);for(let T=0;T<u;T+=1)c[T]=m[T]&255;return c}function h(m){if(wt(m,Uint8Array)){let u=new Uint8Array(m);return w(u.buffer,u.byteOffset,u.byteLength)}return g(m)}function w(m,u,c){if(u<0||m.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(m.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');let T;return u===void 0&&c===void 0?T=new Uint8Array(m):c===void 0?T=new Uint8Array(m,u):T=new Uint8Array(m,u,c),Object.setPrototypeOf(T,i.prototype),T}function P(m){if(i.isBuffer(m)){let u=B(m.length)|0,c=s(u);return c.length===0||m.copy(c,0,0,u),c}if(m.length!==void 0)return typeof m.length!="number"||hr(m.length)?s(0):g(m);if(m.type==="Buffer"&&Array.isArray(m.data))return g(m.data)}function B(m){if(m>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return m|0}function v(m){return+m!=m&&(m=0),i.alloc(+m)}i.isBuffer=function(u){return u!=null&&u._isBuffer===!0&&u!==i.prototype},i.compare=function(u,c){if(wt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),wt(c,Uint8Array)&&(c=i.from(c,c.offset,c.byteLength)),!i.isBuffer(u)||!i.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(u===c)return 0;let T=u.length,I=c.length;for(let U=0,W=Math.min(T,I);U<W;++U)if(u[U]!==c[U]){T=u[U],I=c[U];break}return T<I?-1:I<T?1:0},i.isEncoding=function(u){switch(String(u).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(u,c){if(!Array.isArray(u))throw new TypeError('"list" argument must be an Array of Buffers');if(u.length===0)return i.alloc(0);let T;if(c===void 0)for(c=0,T=0;T<u.length;++T)c+=u[T].length;let I=i.allocUnsafe(c),U=0;for(T=0;T<u.length;++T){let W=u[T];if(wt(W,Uint8Array))U+W.length>I.length?(i.isBuffer(W)||(W=i.from(W)),W.copy(I,U)):Uint8Array.prototype.set.call(I,W,U);else if(i.isBuffer(W))W.copy(I,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=W.length}return I};function S(m,u){if(i.isBuffer(m))return m.length;if(ArrayBuffer.isView(m)||wt(m,ArrayBuffer))return m.byteLength;if(typeof m!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof m);let c=m.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&c===0)return 0;let I=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Me(m).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return kt(m).length;default:if(I)return T?-1:Me(m).length;u=(""+u).toLowerCase(),I=!0}}i.byteLength=S;function E(m,u,c){let T=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,u>>>=0,c<=u))return"";for(m||(m="utf8");;)switch(m){case"hex":return Pe(this,u,c);case"utf8":case"utf-8":return tt(this,u,c);case"ascii":return mt(this,u,c);case"latin1":case"binary":return Ue(this,u,c);case"base64":return ze(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,u,c);default:if(T)throw new TypeError("Unknown encoding: "+m);m=(m+"").toLowerCase(),T=!0}}i.prototype._isBuffer=!0;function H(m,u,c){let T=m[u];m[u]=m[c],m[c]=T}i.prototype.swap16=function(){let u=this.length;if(u%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let c=0;c<u;c+=2)H(this,c,c+1);return this},i.prototype.swap32=function(){let u=this.length;if(u%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let c=0;c<u;c+=4)H(this,c,c+3),H(this,c+1,c+2);return this},i.prototype.swap64=function(){let u=this.length;if(u%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let c=0;c<u;c+=8)H(this,c,c+7),H(this,c+1,c+6),H(this,c+2,c+5),H(this,c+3,c+4);return this},i.prototype.toString=function(){let u=this.length;return u===0?"":arguments.length===0?tt(this,0,u):E.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(u){if(!i.isBuffer(u))throw new TypeError("Argument must be a Buffer");return this===u?!0:i.compare(this,u)===0},i.prototype.inspect=function(){let u="",c=yn.INSPECT_MAX_BYTES;return u=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(u+=" ... "),"<Buffer "+u+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(u,c,T,I,U){if(wt(u,Uint8Array)&&(u=i.from(u,u.offset,u.byteLength)),!i.isBuffer(u))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof u);if(c===void 0&&(c=0),T===void 0&&(T=u?u.length:0),I===void 0&&(I=0),U===void 0&&(U=this.length),c<0||T>u.length||I<0||U>this.length)throw new RangeError("out of range index");if(I>=U&&c>=T)return 0;if(I>=U)return-1;if(c>=T)return 1;if(c>>>=0,T>>>=0,I>>>=0,U>>>=0,this===u)return 0;let W=U-I,Be=T-c,qe=Math.min(W,Be),Ze=this.slice(I,U),Ge=u.slice(c,T);for(let He=0;He<qe;++He)if(Ze[He]!==Ge[He]){W=Ze[He],Be=Ge[He];break}return W<Be?-1:Be<W?1:0};function K(m,u,c,T,I){if(m.length===0)return-1;if(typeof c=="string"?(T=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,hr(c)&&(c=I?0:m.length-1),c<0&&(c=m.length+c),c>=m.length){if(I)return-1;c=m.length-1}else if(c<0)if(I)c=0;else return-1;if(typeof u=="string"&&(u=i.from(u,T)),i.isBuffer(u))return u.length===0?-1:ae(m,u,c,T,I);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(m,u,c):Uint8Array.prototype.lastIndexOf.call(m,u,c):ae(m,[u],c,T,I);throw new TypeError("val must be string, number or Buffer")}function ae(m,u,c,T,I){let U=1,W=m.length,Be=u.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(m.length<2||u.length<2)return-1;U=2,W/=2,Be/=2,c/=2}function qe(Ge,He){return U===1?Ge[He]:Ge.readUInt16BE(He*U)}let Ze;if(I){let Ge=-1;for(Ze=c;Ze<W;Ze++)if(qe(m,Ze)===qe(u,Ge===-1?0:Ze-Ge)){if(Ge===-1&&(Ge=Ze),Ze-Ge+1===Be)return Ge*U}else Ge!==-1&&(Ze-=Ze-Ge),Ge=-1}else for(c+Be>W&&(c=W-Be),Ze=c;Ze>=0;Ze--){let Ge=!0;for(let He=0;He<Be;He++)if(qe(m,Ze+He)!==qe(u,He)){Ge=!1;break}if(Ge)return Ze}return-1}i.prototype.includes=function(u,c,T){return this.indexOf(u,c,T)!==-1},i.prototype.indexOf=function(u,c,T){return K(this,u,c,T,!0)},i.prototype.lastIndexOf=function(u,c,T){return K(this,u,c,T,!1)};function Q(m,u,c,T){c=Number(c)||0;let I=m.length-c;T?(T=Number(T),T>I&&(T=I)):T=I;let U=u.length;T>U/2&&(T=U/2);let W;for(W=0;W<T;++W){let Be=parseInt(u.substr(W*2,2),16);if(hr(Be))return W;m[c+W]=Be}return W}function ge(m,u,c,T){return Ot(Me(u,m.length-c),m,c,T)}function oe(m,u,c,T){return Ot(_e(u),m,c,T)}function re(m,u,c,T){return Ot(kt(u),m,c,T)}function Oe(m,u,c,T){return Ot($(u,m.length-c),m,c,T)}i.prototype.write=function(u,c,T,I){if(c===void 0)I="utf8",T=this.length,c=0;else if(T===void 0&&typeof c=="string")I=c,T=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(T)?(T=T>>>0,I===void 0&&(I="utf8")):(I=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let U=this.length-c;if((T===void 0||T>U)&&(T=U),u.length>0&&(T<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let W=!1;for(;;)switch(I){case"hex":return Q(this,u,c,T);case"utf8":case"utf-8":return ge(this,u,c,T);case"ascii":case"latin1":case"binary":return oe(this,u,c,T);case"base64":return re(this,u,c,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Oe(this,u,c,T);default:if(W)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),W=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ze(m,u,c){return u===0&&c===m.length?t.fromByteArray(m):t.fromByteArray(m.slice(u,c))}function tt(m,u,c){c=Math.min(m.length,c);let T=[],I=u;for(;I<c;){let U=m[I],W=null,Be=U>239?4:U>223?3:U>191?2:1;if(I+Be<=c){let qe,Ze,Ge,He;switch(Be){case 1:U<128&&(W=U);break;case 2:qe=m[I+1],(qe&192)===128&&(He=(U&31)<<6|qe&63,He>127&&(W=He));break;case 3:qe=m[I+1],Ze=m[I+2],(qe&192)===128&&(Ze&192)===128&&(He=(U&15)<<12|(qe&63)<<6|Ze&63,He>2047&&(He<55296||He>57343)&&(W=He));break;case 4:qe=m[I+1],Ze=m[I+2],Ge=m[I+3],(qe&192)===128&&(Ze&192)===128&&(Ge&192)===128&&(He=(U&15)<<18|(qe&63)<<12|(Ze&63)<<6|Ge&63,He>65535&&He<1114112&&(W=He))}}W===null?(W=65533,Be=1):W>65535&&(W-=65536,T.push(W>>>10&1023|55296),W=56320|W&1023),T.push(W),I+=Be}return Je(T)}let Ve=4096;function Je(m){let u=m.length;if(u<=Ve)return String.fromCharCode.apply(String,m);let c="",T=0;for(;T<u;)c+=String.fromCharCode.apply(String,m.slice(T,T+=Ve));return c}function mt(m,u,c){let T="";c=Math.min(m.length,c);for(let I=u;I<c;++I)T+=String.fromCharCode(m[I]&127);return T}function Ue(m,u,c){let T="";c=Math.min(m.length,c);for(let I=u;I<c;++I)T+=String.fromCharCode(m[I]);return T}function Pe(m,u,c){let T=m.length;(!u||u<0)&&(u=0),(!c||c<0||c>T)&&(c=T);let I="";for(let U=u;U<c;++U)I+=oi[m[U]];return I}function Se(m,u,c){let T=m.slice(u,c),I="";for(let U=0;U<T.length-1;U+=2)I+=String.fromCharCode(T[U]+T[U+1]*256);return I}i.prototype.slice=function(u,c){let T=this.length;u=~~u,c=c===void 0?T:~~c,u<0?(u+=T,u<0&&(u=0)):u>T&&(u=T),c<0?(c+=T,c<0&&(c=0)):c>T&&(c=T),c<u&&(c=u);let I=this.subarray(u,c);return Object.setPrototypeOf(I,i.prototype),I};function fe(m,u,c){if(m%1!==0||m<0)throw new RangeError("offset is not uint");if(m+u>c)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u],U=1,W=0;for(;++W<c&&(U*=256);)I+=this[u+W]*U;return I},i.prototype.readUintBE=i.prototype.readUIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u+--c],U=1;for(;c>0&&(U*=256);)I+=this[u+--c]*U;return I},i.prototype.readUint8=i.prototype.readUInt8=function(u,c){return u=u>>>0,c||fe(u,1,this.length),this[u]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(u,c){return u=u>>>0,c||fe(u,2,this.length),this[u]|this[u+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(u,c){return u=u>>>0,c||fe(u,2,this.length),this[u]<<8|this[u+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),(this[u]|this[u+1]<<8|this[u+2]<<16)+this[u+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]*16777216+(this[u+1]<<16|this[u+2]<<8|this[u+3])},i.prototype.readBigUInt64LE=Bt(function(u){u=u>>>0,_(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24,U=this[++u]+this[++u]*2**8+this[++u]*2**16+T*2**24;return BigInt(I)+(BigInt(U)<<BigInt(32))}),i.prototype.readBigUInt64BE=Bt(function(u){u=u>>>0,_(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=c*2**24+this[++u]*2**16+this[++u]*2**8+this[++u],U=this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+T;return(BigInt(I)<<BigInt(32))+BigInt(U)}),i.prototype.readIntLE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=this[u],U=1,W=0;for(;++W<c&&(U*=256);)I+=this[u+W]*U;return U*=128,I>=U&&(I-=Math.pow(2,8*c)),I},i.prototype.readIntBE=function(u,c,T){u=u>>>0,c=c>>>0,T||fe(u,c,this.length);let I=c,U=1,W=this[u+--I];for(;I>0&&(U*=256);)W+=this[u+--I]*U;return U*=128,W>=U&&(W-=Math.pow(2,8*c)),W},i.prototype.readInt8=function(u,c){return u=u>>>0,c||fe(u,1,this.length),this[u]&128?(255-this[u]+1)*-1:this[u]},i.prototype.readInt16LE=function(u,c){u=u>>>0,c||fe(u,2,this.length);let T=this[u]|this[u+1]<<8;return T&32768?T|4294901760:T},i.prototype.readInt16BE=function(u,c){u=u>>>0,c||fe(u,2,this.length);let T=this[u+1]|this[u]<<8;return T&32768?T|4294901760:T},i.prototype.readInt32LE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]|this[u+1]<<8|this[u+2]<<16|this[u+3]<<24},i.prototype.readInt32BE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),this[u]<<24|this[u+1]<<16|this[u+2]<<8|this[u+3]},i.prototype.readBigInt64LE=Bt(function(u){u=u>>>0,_(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=this[u+4]+this[u+5]*2**8+this[u+6]*2**16+(T<<24);return(BigInt(I)<<BigInt(32))+BigInt(c+this[++u]*2**8+this[++u]*2**16+this[++u]*2**24)}),i.prototype.readBigInt64BE=Bt(function(u){u=u>>>0,_(u,"offset");let c=this[u],T=this[u+7];(c===void 0||T===void 0)&&x(u,this.length-8);let I=(c<<24)+this[++u]*2**16+this[++u]*2**8+this[++u];return(BigInt(I)<<BigInt(32))+BigInt(this[++u]*2**24+this[++u]*2**16+this[++u]*2**8+T)}),i.prototype.readFloatLE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),e.read(this,u,!0,23,4)},i.prototype.readFloatBE=function(u,c){return u=u>>>0,c||fe(u,4,this.length),e.read(this,u,!1,23,4)},i.prototype.readDoubleLE=function(u,c){return u=u>>>0,c||fe(u,8,this.length),e.read(this,u,!0,52,8)},i.prototype.readDoubleBE=function(u,c){return u=u>>>0,c||fe(u,8,this.length),e.read(this,u,!1,52,8)};function ve(m,u,c,T,I,U){if(!i.isBuffer(m))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>I||u<U)throw new RangeError('"value" argument is out of bounds');if(c+T>m.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(u,c,T,I){if(u=+u,c=c>>>0,T=T>>>0,!I){let Be=Math.pow(2,8*T)-1;ve(this,u,c,T,Be,0)}let U=1,W=0;for(this[c]=u&255;++W<T&&(U*=256);)this[c+W]=u/U&255;return c+T},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(u,c,T,I){if(u=+u,c=c>>>0,T=T>>>0,!I){let Be=Math.pow(2,8*T)-1;ve(this,u,c,T,Be,0)}let U=T-1,W=1;for(this[c+U]=u&255;--U>=0&&(W*=256);)this[c+U]=u/W&255;return c+T},i.prototype.writeUint8=i.prototype.writeUInt8=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,1,255,0),this[c]=u&255,c+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,65535,0),this[c]=u&255,this[c+1]=u>>>8,c+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,65535,0),this[c]=u>>>8,this[c+1]=u&255,c+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,4294967295,0),this[c+3]=u>>>24,this[c+2]=u>>>16,this[c+1]=u>>>8,this[c]=u&255,c+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,4294967295,0),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4};function D(m,u,c,T,I){ie(u,T,I,m,c,7);let U=Number(u&BigInt(4294967295));m[c++]=U,U=U>>8,m[c++]=U,U=U>>8,m[c++]=U,U=U>>8,m[c++]=U;let W=Number(u>>BigInt(32)&BigInt(4294967295));return m[c++]=W,W=W>>8,m[c++]=W,W=W>>8,m[c++]=W,W=W>>8,m[c++]=W,c}function j(m,u,c,T,I){ie(u,T,I,m,c,7);let U=Number(u&BigInt(4294967295));m[c+7]=U,U=U>>8,m[c+6]=U,U=U>>8,m[c+5]=U,U=U>>8,m[c+4]=U;let W=Number(u>>BigInt(32)&BigInt(4294967295));return m[c+3]=W,W=W>>8,m[c+2]=W,W=W>>8,m[c+1]=W,W=W>>8,m[c]=W,c+8}i.prototype.writeBigUInt64LE=Bt(function(u,c=0){return D(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=Bt(function(u,c=0){return j(this,u,c,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(u,c,T,I){if(u=+u,c=c>>>0,!I){let qe=Math.pow(2,8*T-1);ve(this,u,c,T,qe-1,-qe)}let U=0,W=1,Be=0;for(this[c]=u&255;++U<T&&(W*=256);)u<0&&Be===0&&this[c+U-1]!==0&&(Be=1),this[c+U]=(u/W>>0)-Be&255;return c+T},i.prototype.writeIntBE=function(u,c,T,I){if(u=+u,c=c>>>0,!I){let qe=Math.pow(2,8*T-1);ve(this,u,c,T,qe-1,-qe)}let U=T-1,W=1,Be=0;for(this[c+U]=u&255;--U>=0&&(W*=256);)u<0&&Be===0&&this[c+U+1]!==0&&(Be=1),this[c+U]=(u/W>>0)-Be&255;return c+T},i.prototype.writeInt8=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,1,127,-128),u<0&&(u=255+u+1),this[c]=u&255,c+1},i.prototype.writeInt16LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,32767,-32768),this[c]=u&255,this[c+1]=u>>>8,c+2},i.prototype.writeInt16BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,2,32767,-32768),this[c]=u>>>8,this[c+1]=u&255,c+2},i.prototype.writeInt32LE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,2147483647,-2147483648),this[c]=u&255,this[c+1]=u>>>8,this[c+2]=u>>>16,this[c+3]=u>>>24,c+4},i.prototype.writeInt32BE=function(u,c,T){return u=+u,c=c>>>0,T||ve(this,u,c,4,2147483647,-2147483648),u<0&&(u=4294967295+u+1),this[c]=u>>>24,this[c+1]=u>>>16,this[c+2]=u>>>8,this[c+3]=u&255,c+4},i.prototype.writeBigInt64LE=Bt(function(u,c=0){return D(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=Bt(function(u,c=0){return j(this,u,c,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(m,u,c,T,I,U){if(c+T>m.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function de(m,u,c,T,I){return u=+u,c=c>>>0,I||F(m,u,c,4),e.write(m,u,c,T,23,4),c+4}i.prototype.writeFloatLE=function(u,c,T){return de(this,u,c,!0,T)},i.prototype.writeFloatBE=function(u,c,T){return de(this,u,c,!1,T)};function Te(m,u,c,T,I){return u=+u,c=c>>>0,I||F(m,u,c,8),e.write(m,u,c,T,52,8),c+8}i.prototype.writeDoubleLE=function(u,c,T){return Te(this,u,c,!0,T)},i.prototype.writeDoubleBE=function(u,c,T){return Te(this,u,c,!1,T)},i.prototype.copy=function(u,c,T,I){if(!i.isBuffer(u))throw new TypeError("argument should be a Buffer");if(T||(T=0),!I&&I!==0&&(I=this.length),c>=u.length&&(c=u.length),c||(c=0),I>0&&I<T&&(I=T),I===T||u.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),u.length-c<I-T&&(I=u.length-c+T);let U=I-T;return this===u&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,T,I):Uint8Array.prototype.set.call(u,this.subarray(T,I),c),U},i.prototype.fill=function(u,c,T,I){if(typeof u=="string"){if(typeof c=="string"?(I=c,c=0,T=this.length):typeof T=="string"&&(I=T,T=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!i.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(u.length===1){let W=u.charCodeAt(0);(I==="utf8"&&W<128||I==="latin1")&&(u=W)}}else typeof u=="number"?u=u&255:typeof u=="boolean"&&(u=Number(u));if(c<0||this.length<c||this.length<T)throw new RangeError("Out of range index");if(T<=c)return this;c=c>>>0,T=T===void 0?this.length:T>>>0,u||(u=0);let U;if(typeof u=="number")for(U=c;U<T;++U)this[U]=u;else{let W=i.isBuffer(u)?u:i.from(u,I),Be=W.length;if(Be===0)throw new TypeError('The value "'+u+'" is invalid for argument "value"');for(U=0;U<T-c;++U)this[U+c]=W[U%Be]}return this};let A={};function k(m,u,c){A[m]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${m}]`,this.stack,delete this.name}get code(){return m}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${m}]: ${this.message}`}}}k("ERR_BUFFER_OUT_OF_BOUNDS",function(m){return m?`${m} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),k("ERR_INVALID_ARG_TYPE",function(m,u){return`The "${m}" argument must be of type number. Received type ${typeof u}`},TypeError),k("ERR_OUT_OF_RANGE",function(m,u,c){let T=`The value of "${m}" is out of range.`,I=c;return Number.isInteger(c)&&Math.abs(c)>2**32?I=Z(String(c)):typeof c=="bigint"&&(I=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(I=Z(I)),I+="n"),T+=` It must be ${u}. Received ${I}`,T},RangeError);function Z(m){let u="",c=m.length,T=m[0]==="-"?1:0;for(;c>=T+4;c-=3)u=`_${m.slice(c-3,c)}${u}`;return`${m.slice(0,c)}${u}`}function J(m,u,c){_(u,"offset"),(m[u]===void 0||m[u+c]===void 0)&&x(u,m.length-(c+1))}function ie(m,u,c,T,I,U){if(m>c||m<u){let W=typeof u=="bigint"?"n":"",Be;throw u===0||u===BigInt(0)?Be=`>= 0${W} and < 2${W} ** ${(U+1)*8}${W}`:Be=`>= -(2${W} ** ${(U+1)*8-1}${W}) and < 2 ** ${(U+1)*8-1}${W}`,new A.ERR_OUT_OF_RANGE("value",Be,m)}J(T,I,U)}function _(m,u){if(typeof m!="number")throw new A.ERR_INVALID_ARG_TYPE(u,"number",m)}function x(m,u,c){throw Math.floor(m)!==m?(_(m,c),new A.ERR_OUT_OF_RANGE("offset","an integer",m)):u<0?new A.ERR_BUFFER_OUT_OF_BOUNDS:new A.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${u}`,m)}let z=/[^+/0-9A-Za-z-_]/g;function Y(m){if(m=m.split("=")[0],m=m.trim().replace(z,""),m.length<2)return"";for(;m.length%4!==0;)m=m+"=";return m}function Me(m,u){u=u||1/0;let c,T=m.length,I=null,U=[];for(let W=0;W<T;++W){if(c=m.charCodeAt(W),c>55295&&c<57344){if(!I){if(c>56319){(u-=3)>-1&&U.push(239,191,189);continue}else if(W+1===T){(u-=3)>-1&&U.push(239,191,189);continue}I=c;continue}if(c<56320){(u-=3)>-1&&U.push(239,191,189),I=c;continue}c=(I-55296<<10|c-56320)+65536}else I&&(u-=3)>-1&&U.push(239,191,189);if(I=null,c<128){if((u-=1)<0)break;U.push(c)}else if(c<2048){if((u-=2)<0)break;U.push(c>>6|192,c&63|128)}else if(c<65536){if((u-=3)<0)break;U.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((u-=4)<0)break;U.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return U}function _e(m){let u=[];for(let c=0;c<m.length;++c)u.push(m.charCodeAt(c)&255);return u}function $(m,u){let c,T,I,U=[];for(let W=0;W<m.length&&!((u-=2)<0);++W)c=m.charCodeAt(W),T=c>>8,I=c%256,U.push(I),U.push(T);return U}function kt(m){return t.toByteArray(Y(m))}function Ot(m,u,c,T){let I;for(I=0;I<T&&!(I+c>=u.length||I>=m.length);++I)u[I+c]=m[I];return I}function wt(m,u){return m instanceof u||m!=null&&m.constructor!=null&&m.constructor.name!=null&&m.constructor.name===u.name}function hr(m){return m!==m}let oi=function(){let m="0123456789abcdef",u=new Array(256);for(let c=0;c<16;++c){let T=c*16;for(let I=0;I<16;++I)u[T+I]=m[c]+m[I]}return u}();function Bt(m){return typeof BigInt>"u"?vr:m}function vr(){throw new Error("BigInt not supported")}return yn}var Tr,lc,ci,uc,yn,cc,fi=ot(()=>{O();M();R();Tr={},lc=!1;ci={},uc=!1;yn={},cc=!1});var mn,G,aA,oA,fc=ot(()=>{O();M();R();fi();mn=Rt();mn.Buffer;mn.SlowBuffer;mn.INSPECT_MAX_BYTES;mn.kMaxLength;G=mn.Buffer,aA=mn.INSPECT_MAX_BYTES,oA=mn.kMaxLength});var M=ot(()=>{fc()});function Mt(){return Ny||(Ny=!0,typeof Object.create=="function"?xa=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:xa=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}),xa}var xa,Ny,rs=ot(()=>{O();M();R();xa={},Ny=!1});function Ne(){Ne.init.call(this)}function Pa(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function Wy(t){return t._maxListeners===void 0?Ne.defaultMaxListeners:t._maxListeners}function $y(t,e,n,r){var a,s,i,o;if(Pa(n),(s=t._events)===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,n.listener?n.listener:n),s=t._events),i=s[e]),i===void 0)i=s[e]=n,++t._eventsCount;else if(typeof i=="function"?i=s[e]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(a=Wy(t))>0&&i.length>a&&!i.warned){i.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=i.length,o=l,console&&console.warn&&console.warn(o)}return t}function RB(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Zy(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},a=RB.bind(r);return a.listener=n,r.wrapFn=a,a}function jy(t,e,n){var r=t._events;if(r===void 0)return[];var a=r[e];return a===void 0?[]:typeof a=="function"?n?[a.listener||a]:[a]:n?function(s){for(var i=new Array(s.length),o=0;o<i.length;++o)i[o]=s[o].listener||s[o];return i}(a):zy(a,a.length)}function Ky(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}function zy(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}var Ly,Fy,ar,Dy,Hy,Uy,Tt,is=ot(()=>{O();M();R();ar=typeof Reflect=="object"?Reflect:null,Dy=ar&&typeof ar.apply=="function"?ar.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};Fy=ar&&typeof ar.ownKeys=="function"?ar.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};Hy=Number.isNaN||function(t){return t!=t};Ly=Ne,Ne.EventEmitter=Ne,Ne.prototype._events=void 0,Ne.prototype._eventsCount=0,Ne.prototype._maxListeners=void 0;Uy=10;Object.defineProperty(Ne,"defaultMaxListeners",{enumerable:!0,get:function(){return Uy},set:function(t){if(typeof t!="number"||t<0||Hy(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Uy=t}}),Ne.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ne.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||Hy(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Ne.prototype.getMaxListeners=function(){return Wy(this)},Ne.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",a=this._events;if(a!==void 0)r=r&&a.error===void 0;else if(!r)return!1;if(r){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var o=a[t];if(o===void 0)return!1;if(typeof o=="function")Dy(o,this,e);else{var l=o.length,f=zy(o,l);for(n=0;n<l;++n)Dy(f[n],this,e)}return!0},Ne.prototype.addListener=function(t,e){return $y(this,t,e,!1)},Ne.prototype.on=Ne.prototype.addListener,Ne.prototype.prependListener=function(t,e){return $y(this,t,e,!0)},Ne.prototype.once=function(t,e){return Pa(e),this.on(t,Zy(this,t,e)),this},Ne.prototype.prependOnceListener=function(t,e){return Pa(e),this.prependListener(t,Zy(this,t,e)),this},Ne.prototype.removeListener=function(t,e){var n,r,a,s,i;if(Pa(e),(r=this._events)===void 0)return this;if((n=r[t])===void 0)return this;if(n===e||n.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(a=-1,s=n.length-1;s>=0;s--)if(n[s]===e||n[s].listener===e){i=n[s].listener,a=s;break}if(a<0)return this;a===0?n.shift():function(o,l){for(;l+1<o.length;l++)o[l]=o[l+1];o.pop()}(n,a),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,i||e)}return this},Ne.prototype.off=Ne.prototype.removeListener,Ne.prototype.removeAllListeners=function(t){var e,n,r;if((n=this._events)===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var a,s=Object.keys(n);for(r=0;r<s.length;++r)(a=s[r])!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=n[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},Ne.prototype.listeners=function(t){return jy(this,t,!0)},Ne.prototype.rawListeners=function(t){return jy(this,t,!1)},Ne.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Ky.call(t,e)},Ne.prototype.listenerCount=Ky,Ne.prototype.eventNames=function(){return this._eventsCount>0?Fy(this._events):[]};Tt=Ly;Tt.EventEmitter;Tt.defaultMaxListeners;Tt.init;Tt.listenerCount;Tt.EventEmitter;Tt.defaultMaxListeners;Tt.init;Tt.listenerCount});var qy=ot(()=>{O();M();R();is();Tt.once=function(t,e){return new Promise((n,r)=>{function a(...i){s!==void 0&&t.removeListener("error",s),n(i)}let s;e!=="error"&&(s=i=>{t.removeListener(name,a),r(i)},t.once("error",s)),t.once(e,a)})};Tt.on=function(t,e){let n=[],r=[],a=null,s=!1,i={async next(){let f=n.shift();if(f)return createIterResult(f,!1);if(a){let p=Promise.reject(a);return a=null,p}return s?createIterResult(void 0,!0):new Promise((p,y)=>r.push({resolve:p,reject:y}))},async return(){t.removeListener(e,o),t.removeListener("error",l),s=!0;for(let f of r)f.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(f){a=f,t.removeListener(e,o),t.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return t.on(e,o),t.on("error",l),i;function o(...f){let p=r.shift();p?p.resolve(createIterResult(f,!1)):n.push(f)}function l(f){s=!0;let p=r.shift();p?p.reject(f):a=f,i.return()}}});function us(){throw new Error("setTimeout has not been defined")}function cs(){throw new Error("clearTimeout has not been defined")}function sm(t){if(qt===setTimeout)return setTimeout(t,0);if((qt===us||!qt)&&setTimeout)return qt=setTimeout,setTimeout(t,0);try{return qt(t,0)}catch{try{return qt.call(null,t,0)}catch{return qt.call(this||sr,t,0)}}}function MB(){or&&Mn&&(or=!1,Mn.length?Vt=Mn.concat(Vt):Aa=-1,Vt.length&&lm())}function lm(){if(!or){var t=sm(MB);or=!0;for(var e=Vt.length;e;){for(Mn=Vt,Vt=[];++Aa<e;)Mn&&Mn[Aa].run();Aa=-1,e=Vt.length}Mn=null,or=!1,function(n){if(Gt===clearTimeout)return clearTimeout(n);if((Gt===cs||!Gt)&&clearTimeout)return Gt=clearTimeout,clearTimeout(n);try{Gt(n)}catch{try{return Gt.call(null,n)}catch{return Gt.call(this||sr,n)}}}(t)}}function Gy(t,e){(this||sr).fun=t,(this||sr).array=e}function zt(){}function Dn(t){return t.call.bind(t)}function Xr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function Jy(t){return _t&&xt?Et(t)!==void 0:gm(t)||ym(t)||mm(t)||hm(t)||vm(t)||Tm(t)||_m(t)||bm(t)||wm(t)||xm(t)||Pm(t)}function gm(t){return _t&&xt?Et(t)==="Uint8Array":We(t)==="[object Uint8Array]"||FB(t)&&t.buffer!==void 0}function ym(t){return _t&&xt?Et(t)==="Uint8ClampedArray":We(t)==="[object Uint8ClampedArray]"}function mm(t){return _t&&xt?Et(t)==="Uint16Array":We(t)==="[object Uint16Array]"}function hm(t){return _t&&xt?Et(t)==="Uint32Array":We(t)==="[object Uint32Array]"}function vm(t){return _t&&xt?Et(t)==="Int8Array":We(t)==="[object Int8Array]"}function Tm(t){return _t&&xt?Et(t)==="Int16Array":We(t)==="[object Int16Array]"}function _m(t){return _t&&xt?Et(t)==="Int32Array":We(t)==="[object Int32Array]"}function bm(t){return _t&&xt?Et(t)==="Float32Array":We(t)==="[object Float32Array]"}function wm(t){return _t&&xt?Et(t)==="Float64Array":We(t)==="[object Float64Array]"}function xm(t){return _t&&xt?Et(t)==="BigInt64Array":We(t)==="[object BigInt64Array]"}function Pm(t){return _t&&xt?Et(t)==="BigUint64Array":We(t)==="[object BigUint64Array]"}function Ba(t){return We(t)==="[object Map]"}function Ea(t){return We(t)==="[object Set]"}function Sa(t){return We(t)==="[object WeakMap]"}function as(t){return We(t)==="[object WeakSet]"}function Oa(t){return We(t)==="[object ArrayBuffer]"}function Xy(t){return typeof ArrayBuffer<"u"&&(Oa.working?Oa(t):t instanceof ArrayBuffer)}function Ra(t){return We(t)==="[object DataView]"}function Yy(t){return typeof DataView<"u"&&(Ra.working?Ra(t):t instanceof DataView)}function Ma(t){return We(t)==="[object SharedArrayBuffer]"}function Qy(t){return typeof SharedArrayBuffer<"u"&&(Ma.working?Ma(t):t instanceof SharedArrayBuffer)}function em(t){return Xr(t,VB)}function tm(t){return Xr(t,JB)}function nm(t){return Xr(t,XB)}function rm(t){return pm&&Xr(t,YB)}function im(t){return ds&&Xr(t,QB)}function ln(t,e){var n={seen:[],stylize:nE};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),ps(e)?n.showHidden=e:e&&L._extend(n,e),Nn(n.showHidden)&&(n.showHidden=!1),Nn(n.depth)&&(n.depth=2),Nn(n.colors)&&(n.colors=!1),Nn(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=tE),Na(n,t,n.depth)}function tE(t,e){var n=ln.styles[e];return n?"\x1B["+ln.colors[n][0]+"m"+t+"\x1B["+ln.colors[n][1]+"m":t}function nE(t,e){return t}function Na(t,e,n){if(t.customInspect&&e&&Ca(e.inspect)&&e.inspect!==L.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return Da(r)||(r=Na(t,r,n)),r}var a=function(g,h){if(Nn(h))return g.stylize("undefined","undefined");if(Da(h)){var w="'"+JSON.stringify(h).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return g.stylize(w,"string")}if(Sm(h))return g.stylize(""+h,"number");if(ps(h))return g.stylize(""+h,"boolean");if($a(h))return g.stylize("null","null")}(t,e);if(a)return a;var s=Object.keys(e),i=function(g){var h={};return g.forEach(function(w,P){h[w]=!0}),h}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),Jr(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return os(e);if(s.length===0){if(Ca(e)){var o=e.name?": "+e.name:"";return t.stylize("[Function"+o+"]","special")}if(Vr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ha(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Jr(e))return os(e)}var l,f="",p=!1,y=["{","}"];return Em(e)&&(p=!0,y=["[","]"]),Ca(e)&&(f=" [Function"+(e.name?": "+e.name:"")+"]"),Vr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Ha(e)&&(f=" "+Date.prototype.toUTCString.call(e)),Jr(e)&&(f=" "+os(e)),s.length!==0||p&&e.length!=0?n<0?Vr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=p?function(g,h,w,P,B){for(var v=[],S=0,E=h.length;S<E;++S)km(h,String(S))?v.push(ss(g,h,w,P,String(S),!0)):v.push("");return B.forEach(function(H){H.match(/^\d+$/)||v.push(ss(g,h,w,P,H,!0))}),v}(t,e,n,i,s):s.map(function(g){return ss(t,e,n,i,g,p)}),t.seen.pop(),function(g,h,w){var P=0;return g.reduce(function(B,v){return P++,v.indexOf(`
2
+ `)>=0&&P++,B+v.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?w[0]+(h===""?"":h+`
3
3
  `)+" "+g.join(`,
4
- `)+" "+v[1]:v[0]+m+" "+g.join(", ")+" "+v[1]}(l,c,y)):y[0]+c+y[1]}function ls(t){return"["+Error.prototype.toString.call(t)+"]"}function us(t,e,n,r,o,s){var i,a,l;if((l=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?a=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(a=t.stylize("[Setter]","special")),Im(r,o)||(i="["+o+"]"),a||(t.seen.indexOf(l.value)<0?(a=Do(n)?Co(t,l.value,null):Co(t,l.value,n-1)).indexOf(`
5
- `)>-1&&(a=s?a.split(`
6
- `).map(function(c){return" "+c}).join(`
4
+ `)+" "+w[1]:w[0]+h+" "+g.join(", ")+" "+w[1]}(l,f,y)):y[0]+f+y[1]}function os(t){return"["+Error.prototype.toString.call(t)+"]"}function ss(t,e,n,r,a,s){var i,o,l;if((l=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]}).get?o=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(o=t.stylize("[Setter]","special")),km(r,a)||(i="["+a+"]"),o||(t.seen.indexOf(l.value)<0?(o=$a(n)?Na(t,l.value,null):Na(t,l.value,n-1)).indexOf(`
5
+ `)>-1&&(o=s?o.split(`
6
+ `).map(function(f){return" "+f}).join(`
7
7
  `).substr(2):`
8
- `+a.split(`
9
- `).map(function(c){return" "+c}).join(`
10
- `)):a=t.stylize("[Circular]","special")),Cn(i)){if(s&&o.match(/^\d+$/))return a;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+a}function Sm(t){return Array.isArray(t)}function ys(t){return typeof t=="boolean"}function Do(t){return t===null}function km(t){return typeof t=="number"}function Ro(t){return typeof t=="string"}function Cn(t){return t===void 0}function Zr(t){return lr(t)&&ms(t)==="[object RegExp]"}function lr(t){return typeof t=="object"&&t!==null}function Oo(t){return lr(t)&&ms(t)==="[object Date]"}function Lr(t){return lr(t)&&(ms(t)==="[object Error]"||t instanceof Error)}function So(t){return typeof t=="function"}function ms(t){return Object.prototype.toString.call(t)}function cs(t){return t<10?"0"+t.toString(10):t.toString(10)}function MP(){var t=new Date,e=[cs(t.getHours()),cs(t.getMinutes()),cs(t.getSeconds())].join(":");return[t.getDate(),OP[t.getMonth()],e].join(" ")}function Im(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function DP(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}var sm,qt,zt,sr,et,An,Gt,ar,Eo,Ke,fP,ps,Mo,cm,dP,pP,gP,yP,mP,fm,dm,Jy,hP,vP,TP,pm,Ee,_P,bP,wP,gm,gs,_t,mt,xP,Ge,PP,EP,SP,$r,L,Rt,am,AP,Bo,Em,Po,OP,In,tC,No=it(()=>{C();O();R();sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,et=sm={};(function(){try{qt=typeof setTimeout=="function"?setTimeout:fs}catch{qt=fs}try{zt=typeof clearTimeout=="function"?clearTimeout:ds}catch{zt=ds}})();Gt=[],ar=!1,Eo=-1;et.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Gt.push(new Vy(t,e)),Gt.length!==1||ar||lm(um)},Vy.prototype.run=function(){(this||sr).fun.apply(null,(this||sr).array)},et.title="browser",et.browser=!0,et.env={},et.argv=[],et.version="",et.versions={},et.on=Wt,et.addListener=Wt,et.once=Wt,et.off=Wt,et.removeListener=Wt,et.removeAllListeners=Wt,et.emit=Wt,et.prependListener=Wt,et.prependOnceListener=Wt,et.listeners=function(t){return[]},et.binding=function(t){throw new Error("process.binding is not supported")},et.cwd=function(){return"/"},et.chdir=function(t){throw new Error("process.chdir is not supported")},et.umask=function(){return 0};Ke=sm;Ke.addListener;Ke.argv;Ke.binding;Ke.browser;Ke.chdir;Ke.cwd;Ke.emit;Ke.env;Ke.listeners;Ke.nextTick;Ke.off;Ke.on;Ke.once;Ke.prependListener;Ke.prependOnceListener;Ke.removeAllListeners;Ke.removeListener;Ke.title;Ke.umask;Ke.version;Ke.versions;fP=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",ps=Object.prototype.toString,Mo=function(t){return!(fP&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&ps.call(t)==="[object Arguments]"},cm=function(t){return!!Mo(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&ps.call(t)!=="[object Array]"&&ps.call(t.callee)==="[object Function]"},dP=function(){return Mo(arguments)}();Mo.isLegacyArguments=cm;pP=dP?Mo:cm,gP=Object.prototype.toString,yP=Function.prototype.toString,mP=/^\s*(?:function)?\*/,fm=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",dm=Object.getPrototypeOf,Jy=function(){if(!fm)return!1;try{return Function("return function*() {}")()}catch{}}(),hP=Jy?dm(Jy):{},vP=function(t){return typeof t=="function"&&(!!mP.test(yP.call(t))||(fm?dm(t)===hP:gP.call(t)==="[object GeneratorFunction]"))},TP=typeof Object.create=="function"?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},pm=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Ee={},_P=pm,bP=pP,wP=vP;gm=typeof BigInt<"u",gs=typeof Symbol<"u",_t=gs&&Symbol.toStringTag!==void 0,mt=typeof Uint8Array<"u",xP=typeof ArrayBuffer<"u";if(mt&&_t)var BP=Object.getPrototypeOf(Uint8Array.prototype),xt=Rn(Object.getOwnPropertyDescriptor(BP,Symbol.toStringTag).get);Ge=Rn(Object.prototype.toString),PP=Rn(Number.prototype.valueOf),EP=Rn(String.prototype.valueOf),SP=Rn(Boolean.prototype.valueOf);if(gm)var kP=Rn(BigInt.prototype.valueOf);if(gs)var IP=Rn(Symbol.prototype.valueOf);Ee.isArgumentsObject=bP,Ee.isGeneratorFunction=wP,Ee.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},Ee.isArrayBufferView=function(t){return xP&&ArrayBuffer.isView?ArrayBuffer.isView(t):Yy(t)||Qy(t)},Ee.isTypedArray=Yy,Ee.isUint8Array=ym,Ee.isUint8ClampedArray=mm,Ee.isUint16Array=hm,Ee.isUint32Array=vm,Ee.isInt8Array=Tm,Ee.isInt16Array=_m,Ee.isInt32Array=bm,Ee.isFloat32Array=wm,Ee.isFloat64Array=xm,Ee.isBigInt64Array=Bm,Ee.isBigUint64Array=Pm,bo.working=typeof Map<"u"&&bo(new Map),Ee.isMap=function(t){return typeof Map<"u"&&(bo.working?bo(t):t instanceof Map)},wo.working=typeof Set<"u"&&wo(new Set),Ee.isSet=function(t){return typeof Set<"u"&&(wo.working?wo(t):t instanceof Set)},xo.working=typeof WeakMap<"u"&&xo(new WeakMap),Ee.isWeakMap=function(t){return typeof WeakMap<"u"&&(xo.working?xo(t):t instanceof WeakMap)},ss.working=typeof WeakSet<"u"&&ss(new WeakSet),Ee.isWeakSet=function(t){return ss(t)},ko.working=typeof ArrayBuffer<"u"&&ko(new ArrayBuffer),Ee.isArrayBuffer=Xy,Io.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Io(new DataView(new ArrayBuffer(1),0,1)),Ee.isDataView=Qy,Ao.working=typeof SharedArrayBuffer<"u"&&Ao(new SharedArrayBuffer),Ee.isSharedArrayBuffer=em,Ee.isAsyncFunction=function(t){return Ge(t)==="[object AsyncFunction]"},Ee.isMapIterator=function(t){return Ge(t)==="[object Map Iterator]"},Ee.isSetIterator=function(t){return Ge(t)==="[object Set Iterator]"},Ee.isGeneratorObject=function(t){return Ge(t)==="[object Generator]"},Ee.isWebAssemblyCompiledModule=function(t){return Ge(t)==="[object WebAssembly.Module]"},Ee.isNumberObject=tm,Ee.isStringObject=nm,Ee.isBooleanObject=rm,Ee.isBigIntObject=im,Ee.isSymbolObject=om,Ee.isBoxedPrimitive=function(t){return tm(t)||nm(t)||rm(t)||im(t)||om(t)},Ee.isAnyArrayBuffer=function(t){return mt&&(Xy(t)||em(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(Ee,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})});$r=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,L={},Rt=Ke,am=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},AP=/%[sdj%]/g;L.format=function(t){if(!Ro(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(an(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,o=r.length,s=String(t).replace(AP,function(a){if(a==="%%")return"%";if(n>=o)return a;switch(a){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return a}}),i=r[n];n<o;i=r[++n])Do(i)||!lr(i)?s+=" "+i:s+=" "+an(i);return s},L.deprecate=function(t,e){if(Rt!==void 0&&Rt.noDeprecation===!0)return t;if(Rt===void 0)return function(){return L.deprecate(t,e).apply(this||$r,arguments)};var n=!1;return function(){if(!n){if(Rt.throwDeprecation)throw new Error(e);Rt.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this||$r,arguments)}};Bo={},Em=/^$/;Rt.env.NODE_DEBUG&&(Po=Rt.env.NODE_DEBUG,Po=Po.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Em=new RegExp("^"+Po+"$","i"));L.debuglog=function(t){if(t=t.toUpperCase(),!Bo[t])if(Em.test(t)){var e=Rt.pid;Bo[t]=function(){var n=L.format.apply(L,arguments);console.error("%s %d: %s",t,e,n)}}else Bo[t]=function(){};return Bo[t]},L.inspect=an,an.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},an.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},L.types=Ee,L.isArray=Sm,L.isBoolean=ys,L.isNull=Do,L.isNullOrUndefined=function(t){return t==null},L.isNumber=km,L.isString=Ro,L.isSymbol=function(t){return typeof t=="symbol"},L.isUndefined=Cn,L.isRegExp=Zr,L.types.isRegExp=Zr,L.isObject=lr,L.isDate=Oo,L.types.isDate=Oo,L.isError=Lr,L.types.isNativeError=Lr,L.isFunction=So,L.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},L.isBuffer=pm;OP=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];L.log=function(){console.log("%s - %s",MP(),L.format.apply(L,arguments))},L.inherits=TP,L._extend=function(t,e){if(!e||!lr(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};In=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;L.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(In&&t[In]){var e;if(typeof(e=t[In])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,In,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var n,r,o=new Promise(function(a,l){n=a,r=l}),s=[],i=0;i<arguments.length;i++)s.push(arguments[i]);s.push(function(a,l){a?r(a):n(l)});try{t.apply(this||$r,s)}catch(a){r(a)}return o}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),In&&Object.defineProperty(e,In,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,am(t))},L.promisify.custom=In,L.callbackify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if(typeof o!="function")throw new TypeError("The last argument must be of type Function");var s=this||$r,i=function(){return o.apply(s,arguments)};t.apply(this||$r,n).then(function(a){Rt.nextTick(i.bind(null,null,a))},function(a){Rt.nextTick(DP.bind(null,a,i))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,am(t)),e};L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;L.promisify;L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;tC=L.promisify;L.types});var sC,Am=it(()=>{C();O();R();No();L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;sC=L.promisify;L.types;L.TextEncoder=globalThis.TextEncoder;L.TextDecoder=globalThis.TextDecoder});function _s(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function NP(){!ur||!On||(ur=!1,On.length?Vt=On.concat(Vt):Ho=-1,Vt.length&&Cm())}function Cm(){if(!ur){var t=setTimeout(NP,0);ur=!0;for(var e=Vt.length;e;){for(On=Vt,Vt=[];++Ho<e;)On&&On[Ho].run();Ho=-1,e=Vt.length}On=null,ur=!1,clearTimeout(t)}}function HP(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Vt.push(new Rm(t,e)),Vt.length===1&&!ur&&setTimeout(Cm,0)}function Rm(t,e){this.fun=t,this.array=e}function st(){}function eE(t){_s("_linkedBinding")}function iE(t){_s("dlopen")}function oE(){return[]}function aE(){return[]}function yE(t,e){if(!t)throw new Error(e||"assertion error")}function TE(){return!1}function NE(){return sn.now()/1e3}function Ts(t){var e=Math.floor((Date.now()-sn.now())*.001),n=sn.now()*.001,r=Math.floor(n)+e,o=Math.floor(n%1*1e9);return t&&(r=r-t[0],o=o-t[1],o<0&&(r--,o+=vs)),[r,o]}function ln(){return St}function GE(t){return[]}var Vt,ur,On,Ho,UP,jP,$P,ZP,LP,FP,KP,WP,qP,zP,GP,VP,JP,YP,XP,QP,tE,nE,rE,sE,lE,bs,uE,cE,fE,dE,pE,gE,mE,hE,vE,_E,bE,wE,xE,BE,PE,EE,SE,kE,IE,AE,CE,RE,OE,ME,DE,sn,hs,vs,HE,UE,jE,$E,ZE,LE,FE,KE,WE,qE,zE,St,ws=it(()=>{C();O();R();Vt=[],ur=!1,Ho=-1;Rm.prototype.run=function(){this.fun.apply(null,this.array)};UP="browser",jP="x64",$P="browser",ZP={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},LP=["/usr/bin/node"],FP=[],KP="v16.8.0",WP={},qP=function(t,e){console.warn((e?e+": ":"")+t)},zP=function(t){_s("binding")},GP=function(t){return 0},VP=function(){return"/"},JP=function(t){},YP={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};XP=st,QP=[];tE={},nE=!1,rE={};sE=st,lE=st,bs=function(){return{}},uE=bs,cE=bs,fE=st,dE=st,pE=st,gE={};mE={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},hE=st,vE=st;_E=st,bE=st,wE=st,xE=st,BE=st,PE=void 0,EE=void 0,SE=void 0,kE=st,IE=2,AE=1,CE="/bin/usr/node",RE=9229,OE="node",ME=[],DE=st,sn={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};sn.now===void 0&&(hs=Date.now(),sn.timing&&sn.timing.navigationStart&&(hs=sn.timing.navigationStart),sn.now=()=>Date.now()-hs);vs=1e9;Ts.bigint=function(t){var e=Ts(t);return typeof BigInt>"u"?e[0]*vs+e[1]:BigInt(e[0]*vs)+BigInt(e[1])};HE=10,UE={},jE=0;$E=ln,ZE=ln,LE=ln,FE=ln,KE=ln,WE=st,qE=ln,zE=ln;St={version:KP,versions:WP,arch:jP,platform:$P,release:YP,_rawDebug:XP,moduleLoadList:QP,binding:zP,_linkedBinding:eE,_events:UE,_eventsCount:jE,_maxListeners:HE,on:ln,addListener:$E,once:ZE,off:LE,removeListener:FE,removeAllListeners:KE,emit:WE,prependListener:qE,prependOnceListener:zE,listeners:GE,domain:tE,_exiting:nE,config:rE,dlopen:iE,uptime:NE,_getActiveRequests:oE,_getActiveHandles:aE,reallyExit:sE,_kill:lE,cpuUsage:bs,resourceUsage:uE,memoryUsage:cE,kill:fE,exit:dE,openStdin:pE,allowedNodeEnvironmentFlags:gE,assert:yE,features:mE,_fatalExceptions:hE,setUncaughtExceptionCaptureCallback:vE,hasUncaughtExceptionCaptureCallback:TE,emitWarning:qP,nextTick:HP,_tickCallback:_E,_debugProcess:bE,_debugEnd:wE,_startProfilerIdleNotifier:xE,_stopProfilerIdleNotifier:BE,stdout:PE,stdin:SE,stderr:EE,abort:kE,umask:GP,chdir:JP,cwd:VP,env:ZP,title:UP,argv:LP,execArgv:FP,pid:IE,ppid:AE,execPath:CE,debugPort:RE,hrtime:Ts,argv0:OE,_preload_modules:ME,setSourceMapsEnabled:DE}});function Mm(){if(Om)return xs;Om=!0,xs=t;function t(n,r){if(e("noDeprecation"))return n;var o=!1;function s(){if(!o){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),o=!0}return n.apply(this||Bs,arguments)}return s}function e(n){try{if(!Bs.localStorage)return!1}catch{return!1}var r=Bs.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return xs}var xs,Om,Bs,Dm=it(()=>{C();O();R();xs={},Om=!1,Bs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global});function VE(){if(Nm)return Kr;Nm=!0;var t=At(),e=t.Buffer;function n(o,s){for(var i in o)s[i]=o[i]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Kr=t:(n(t,Kr),Kr.Buffer=r);function r(o,s,i){return e(o,s,i)}return r.prototype=Object.create(e.prototype),n(e,r),r.from=function(o,s,i){if(typeof o=="number")throw new TypeError("Argument must not be a number");return e(o,s,i)},r.alloc=function(o,s,i){if(typeof o!="number")throw new TypeError("Argument must be a number");var a=e(o);return s!==void 0?typeof i=="string"?a.fill(s,i):a.fill(s):a.fill(0),a},r.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return e(o)},r.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)},Kr}function JE(){if(Hm)return Ps;Hm=!0;var t=VE().Buffer,e=t.isEncoding||function(T){switch(T=""+T,T&&T.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(T){if(!T)return"utf8";for(var S;;)switch(T){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return T;default:if(S)return;T=(""+T).toLowerCase(),S=!0}}function r(T){var S=n(T);if(typeof S!="string"&&(t.isEncoding===e||!e(T)))throw new Error("Unknown encoding: "+T);return S||T}Ps.StringDecoder=o;function o(T){this.encoding=r(T);var S;switch(this.encoding){case"utf16le":this.text=y,this.end=g,S=4;break;case"utf8":this.fillLast=l,S=4;break;case"base64":this.text=m,this.end=v,S=3;break;default:this.write=B,this.end=P;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(S)}o.prototype.write=function(T){if(T.length===0)return"";var S,E;if(this.lastNeed){if(S=this.fillLast(T),S===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<T.length?S?S+this.text(T,E):this.text(T,E):S||""},o.prototype.end=d,o.prototype.text=c,o.prototype.fillLast=function(T){if(this.lastNeed<=T.length)return T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,this.lastTotal-this.lastNeed,0,T.length),this.lastNeed-=T.length};function s(T){return T<=127?0:T>>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function i(T,S,E){var M=S.length-1;if(M<E)return 0;var $=s(S[M]);return $>=0?($>0&&(T.lastNeed=$-1),$):--M<E||$===-2?0:($=s(S[M]),$>=0?($>0&&(T.lastNeed=$-2),$):--M<E||$===-2?0:($=s(S[M]),$>=0?($>0&&($===2?$=0:T.lastNeed=$-3),$):0))}function a(T,S,E){if((S[0]&192)!==128)return T.lastNeed=0,"\uFFFD";if(T.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return T.lastNeed=1,"\uFFFD";if(T.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return T.lastNeed=2,"\uFFFD"}}function l(T){var S=this.lastTotal-this.lastNeed,E=a(this,T);if(E!==void 0)return E;if(this.lastNeed<=T.length)return T.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,S,0,T.length),this.lastNeed-=T.length}function c(T,S){var E=i(this,T,S);if(!this.lastNeed)return T.toString("utf8",S);this.lastTotal=E;var M=T.length-(E-this.lastNeed);return T.copy(this.lastChar,0,M),T.toString("utf8",S,M)}function d(T){var S=T&&T.length?this.write(T):"";return this.lastNeed?S+"\uFFFD":S}function y(T,S){if((T.length-S)%2===0){var E=T.toString("utf16le",S);if(E){var M=E.charCodeAt(E.length-1);if(M>=55296&&M<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",S,T.length-1)}function g(T){var S=T&&T.length?this.write(T):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,E)}return S}function m(T,S){var E=(T.length-S)%3;return E===0?T.toString("base64",S):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",S,T.length-E))}function v(T){var S=T&&T.length?this.write(T):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function B(T){return T.toString(this.encoding)}function P(T){return T&&T.length?this.write(T):""}return Ps}var Kr,Nm,Ps,Hm,Wr,bC,Um=it(()=>{C();O();R();ii();Kr={},Nm=!1;Ps={},Hm=!1;Wr=JE();Wr.StringDecoder;bC=Wr.StringDecoder});function YE(){if(jm)return Es;jm=!0;var t=Es={},e,n;function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?n=clearTimeout:n=o}catch{n=o}})();function s(B){if(e===setTimeout)return setTimeout(B,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(B,0);try{return e(B,0)}catch{try{return e.call(null,B,0)}catch{return e.call(this||cr,B,0)}}}function i(B){if(n===clearTimeout)return clearTimeout(B);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(B);try{return n(B)}catch{try{return n.call(null,B)}catch{return n.call(this||cr,B)}}}var a=[],l=!1,c,d=-1;function y(){!l||!c||(l=!1,c.length?a=c.concat(a):d=-1,a.length&&g())}function g(){if(!l){var B=s(y);l=!0;for(var P=a.length;P;){for(c=a,a=[];++d<P;)c&&c[d].run();d=-1,P=a.length}c=null,l=!1,i(B)}}t.nextTick=function(B){var P=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)P[T-1]=arguments[T];a.push(new m(B,P)),a.length===1&&!l&&s(g)};function m(B,P){(this||cr).fun=B,(this||cr).array=P}m.prototype.run=function(){(this||cr).fun.apply(null,(this||cr).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function v(){}return t.on=v,t.addListener=v,t.once=v,t.off=v,t.removeListener=v,t.removeAllListeners=v,t.emit=v,t.prependListener=v,t.prependOnceListener=v,t.listeners=function(B){return[]},t.binding=function(B){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(B){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},Es}var Es,jm,cr,We,Ss=it(()=>{C();O();R();Es={},jm=!1,cr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;We=YE();We.platform="browser";We.addListener;We.argv;We.binding;We.browser;We.chdir;We.cwd;We.emit;We.env;We.listeners;We.nextTick;We.off;We.on;We.once;We.prependListener;We.prependOnceListener;We.removeAllListeners;We.removeListener;We.title;We.umask;We.version;We.versions});function XE(){if($m)return ks;$m=!0;var t=We;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function n(s,i){for(var a="",l=0,c=-1,d=0,y,g=0;g<=s.length;++g){if(g<s.length)y=s.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(c===g-1||d===1))if(c!==g-1&&d===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",l=0):(a=a.slice(0,m),l=a.length-1-a.lastIndexOf("/")),c=g,d=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=g,d=0;continue}}i&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+s.slice(c+1,g):a=s.slice(c+1,g),l=g-c-1;c=g,d=0}else y===46&&d!==-1?++d:d=-1}return a}function r(s,i){var a=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return a?a===i.root?a+l:a+s+l:l}var o={resolve:function(){for(var i="",a=!1,l,c=arguments.length-1;c>=-1&&!a;c--){var d;c>=0?d=arguments[c]:(l===void 0&&(l=t.cwd()),d=l),e(d),d.length!==0&&(i=d+"/"+i,a=d.charCodeAt(0)===47)}return i=n(i,!a),a?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var a=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!a),i.length===0&&!a&&(i="."),i.length>0&&l&&(i+="/"),a?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,a=0;a<arguments.length;++a){var l=arguments[a];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":o.normalize(i)},relative:function(i,a){if(e(i),e(a),i===a||(i=o.resolve(i),a=o.resolve(a),i===a))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var c=i.length,d=c-l,y=1;y<a.length&&a.charCodeAt(y)===47;++y);for(var g=a.length,m=g-y,v=d<m?d:m,B=-1,P=0;P<=v;++P){if(P===v){if(m>v){if(a.charCodeAt(y+P)===47)return a.slice(y+P+1);if(P===0)return a.slice(y+P)}else d>v&&(i.charCodeAt(l+P)===47?B=P:P===0&&(B=0));break}var T=i.charCodeAt(l+P),S=a.charCodeAt(y+P);if(T!==S)break;T===47&&(B=P)}var E="";for(P=l+B+1;P<=c;++P)(P===c||i.charCodeAt(P)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+a.slice(y+B):(y+=B,a.charCodeAt(y)===47&&++y,a.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var a=i.charCodeAt(0),l=a===47,c=-1,d=!0,y=i.length-1;y>=1;--y)if(a=i.charCodeAt(y),a===47){if(!d){c=y;break}}else d=!1;return c===-1?l?"/":".":l&&c===1?"//":i.slice(0,c)},basename:function(i,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,c=-1,d=!0,y;if(a!==void 0&&a.length>0&&a.length<=i.length){if(a.length===i.length&&a===i)return"";var g=a.length-1,m=-1;for(y=i.length-1;y>=0;--y){var v=i.charCodeAt(y);if(v===47){if(!d){l=y+1;break}}else m===-1&&(d=!1,m=y+1),g>=0&&(v===a.charCodeAt(g)?--g===-1&&(c=y):(g=-1,c=m))}return l===c?c=m:c===-1&&(c=i.length),i.slice(l,c)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!d){l=y+1;break}}else c===-1&&(d=!1,c=y+1);return c===-1?"":i.slice(l,c)}},extname:function(i){e(i);for(var a=-1,l=0,c=-1,d=!0,y=0,g=i.length-1;g>=0;--g){var m=i.charCodeAt(g);if(m===47){if(!d){l=g+1;break}continue}c===-1&&(d=!1,c=g+1),m===46?a===-1?a=g:y!==1&&(y=1):a!==-1&&(y=-1)}return a===-1||c===-1||y===0||y===1&&a===c-1&&a===l+1?"":i.slice(a,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var a={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return a;var l=i.charCodeAt(0),c=l===47,d;c?(a.root="/",d=1):d=0;for(var y=-1,g=0,m=-1,v=!0,B=i.length-1,P=0;B>=d;--B){if(l=i.charCodeAt(B),l===47){if(!v){g=B+1;break}continue}m===-1&&(v=!1,m=B+1),l===46?y===-1?y=B:P!==1&&(P=1):y!==-1&&(P=-1)}return y===-1||m===-1||P===0||P===1&&y===m-1&&y===g+1?m!==-1&&(g===0&&c?a.base=a.name=i.slice(1,m):a.base=a.name=i.slice(g,m)):(g===0&&c?(a.name=i.slice(1,y),a.base=i.slice(1,m)):(a.name=i.slice(g,y),a.base=i.slice(g,m)),a.ext=i.slice(y,m)),g>0?a.dir=i.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,ks=o,ks}function Mn(t){throw new RangeError(nS[t])}function Lm(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);let o=function(s,i){let a=[],l=s.length;for(;l--;)a[l]=i(s[l]);return a}((t=t.replace(tS,".")).split("."),e).join(".");return r+o}function Ym(t){let e=[],n=0,r=t.length;for(;n<r;){let o=t.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){let s=t.charCodeAt(n++);(64512&s)==56320?e.push(((1023&o)<<10)+(1023&s)+65536):(e.push(o),n--)}else e.push(o)}return e}function iS(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Bt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function zr(t,e,n){if(t&&Ot.isObject(t)&&t instanceof Bt)return t;var r=new Bt;return r.parse(t,e,n),r}function gS(){if(Vm)return Rs;Vm=!0;var t=Ke;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function n(s,i){for(var a="",l=0,c=-1,d=0,y,g=0;g<=s.length;++g){if(g<s.length)y=s.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(c===g-1||d===1))if(c!==g-1&&d===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",l=0):(a=a.slice(0,m),l=a.length-1-a.lastIndexOf("/")),c=g,d=0;continue}}else if(a.length===2||a.length===1){a="",l=0,c=g,d=0;continue}}i&&(a.length>0?a+="/..":a="..",l=2)}else a.length>0?a+="/"+s.slice(c+1,g):a=s.slice(c+1,g),l=g-c-1;c=g,d=0}else y===46&&d!==-1?++d:d=-1}return a}function r(s,i){var a=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return a?a===i.root?a+l:a+s+l:l}var o={resolve:function(){for(var i="",a=!1,l,c=arguments.length-1;c>=-1&&!a;c--){var d;c>=0?d=arguments[c]:(l===void 0&&(l=t.cwd()),d=l),e(d),d.length!==0&&(i=d+"/"+i,a=d.charCodeAt(0)===47)}return i=n(i,!a),a?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var a=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!a),i.length===0&&!a&&(i="."),i.length>0&&l&&(i+="/"),a?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,a=0;a<arguments.length;++a){var l=arguments[a];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":o.normalize(i)},relative:function(i,a){if(e(i),e(a),i===a||(i=o.resolve(i),a=o.resolve(a),i===a))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var c=i.length,d=c-l,y=1;y<a.length&&a.charCodeAt(y)===47;++y);for(var g=a.length,m=g-y,v=d<m?d:m,B=-1,P=0;P<=v;++P){if(P===v){if(m>v){if(a.charCodeAt(y+P)===47)return a.slice(y+P+1);if(P===0)return a.slice(y+P)}else d>v&&(i.charCodeAt(l+P)===47?B=P:P===0&&(B=0));break}var T=i.charCodeAt(l+P),S=a.charCodeAt(y+P);if(T!==S)break;T===47&&(B=P)}var E="";for(P=l+B+1;P<=c;++P)(P===c||i.charCodeAt(P)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+a.slice(y+B):(y+=B,a.charCodeAt(y)===47&&++y,a.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var a=i.charCodeAt(0),l=a===47,c=-1,d=!0,y=i.length-1;y>=1;--y)if(a=i.charCodeAt(y),a===47){if(!d){c=y;break}}else d=!1;return c===-1?l?"/":".":l&&c===1?"//":i.slice(0,c)},basename:function(i,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,c=-1,d=!0,y;if(a!==void 0&&a.length>0&&a.length<=i.length){if(a.length===i.length&&a===i)return"";var g=a.length-1,m=-1;for(y=i.length-1;y>=0;--y){var v=i.charCodeAt(y);if(v===47){if(!d){l=y+1;break}}else m===-1&&(d=!1,m=y+1),g>=0&&(v===a.charCodeAt(g)?--g===-1&&(c=y):(g=-1,c=m))}return l===c?c=m:c===-1&&(c=i.length),i.slice(l,c)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!d){l=y+1;break}}else c===-1&&(d=!1,c=y+1);return c===-1?"":i.slice(l,c)}},extname:function(i){e(i);for(var a=-1,l=0,c=-1,d=!0,y=0,g=i.length-1;g>=0;--g){var m=i.charCodeAt(g);if(m===47){if(!d){l=g+1;break}continue}c===-1&&(d=!1,c=g+1),m===46?a===-1?a=g:y!==1&&(y=1):a!==-1&&(y=-1)}return a===-1||c===-1||y===0||y===1&&a===c-1&&a===l+1?"":i.slice(a,c)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var a={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return a;var l=i.charCodeAt(0),c=l===47,d;c?(a.root="/",d=1):d=0;for(var y=-1,g=0,m=-1,v=!0,B=i.length-1,P=0;B>=d;--B){if(l=i.charCodeAt(B),l===47){if(!v){g=B+1;break}continue}m===-1&&(v=!1,m=B+1),l===46?y===-1?y=B:P!==1&&(P=1):y!==-1&&(P=-1)}return y===-1||m===-1||P===0||P===1&&y===m-1&&y===g+1?m!==-1&&(g===0&&c?a.base=a.name=i.slice(1,m):a.base=a.name=i.slice(g,m)):(g===0&&c?(a.name=i.slice(1,y),a.base=i.slice(1,m)):(a.name=i.slice(g,y),a.base=i.slice(g,m)),a.ext=i.slice(y,m)),g>0?a.dir=i.slice(0,g-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,Rs=o,Rs}function ES(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Ms?SS(t):kS(t)}function SS(t){let e=t.hostname,n=t.pathname;for(let r=0;r<n.length;r++)if(n[r]==="%"){let o=n.codePointAt(r+2)||32;if(n[r+1]==="2"&&o===102||n[r+1]==="5"&&o===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(_S,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,o=n[2];if(r<vS||r>TS||o!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function kS(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let n=0;n<e.length;n++)if(e[n]==="%"){let r=e.codePointAt(n+2)||32;if(e[n+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function IS(t){let e=Jm.resolve(t),n=t.charCodeAt(t.length-1);(n===hS||Ms&&n===mS)&&e[e.length-1]!==Jm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(bS,"%25")),!Ms&&e.includes("\\")&&(e=e.replace(wS,"%5C")),e.includes(`
11
- `)&&(e=e.replace(xS,"%0A")),e.includes("\r")&&(e=e.replace(BS,"%0D")),e.includes(" ")&&(e=e.replace(PS,"%09")),r.pathname=e,r}function ZS(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Ds?LS(t):FS(t)}function LS(t){let e=t.hostname,n=t.pathname;for(let r=0;r<n.length;r++)if(n[r]==="%"){let o=n.codePointAt(r+2)||32;if(n[r+1]==="2"&&o===102||n[r+1]==="5"&&o===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(DS,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,o=n[2];if(r<OS||r>MS||o!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function FS(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let n=0;n<e.length;n++)if(e[n]==="%"){let r=e.codePointAt(n+2)||32;if(e[n+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function KS(t){let e=Zm.resolve(t),n=t.charCodeAt(t.length-1);(n===RS||Ds&&n===CS)&&e[e.length-1]!==Zm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(NS,"%25")),!Ds&&e.includes("\\")&&(e=e.replace(HS,"%5C")),e.includes(`
12
- `)&&(e=e.replace(US,"%0A")),e.includes("\r")&&(e=e.replace(jS,"%0D")),e.includes(" ")&&(e=e.replace($S,"%09")),r.pathname=e,r}var ks,$m,Zm,dr,QE,eS,tS,nS,Mt,Is,Fm,Xm,Km,Wm,rS,oS,qr,aS,Jt,je,sS,Ot,lS,uS,cS,fS,Os,qm,zm,Gm,dS,pS,As,fr,Cs,Rs,Vm,Jm,yS,mS,hS,vS,TS,Ms,_S,bS,wS,xS,BS,PS,AS,CS,RS,OS,MS,Ds,DS,NS,HS,US,jS,$S,Qm=it(()=>{C();O();R();No();Ss();ks={},$m=!1;Zm=XE(),dr=2147483647,QE=/^xn--/,eS=/[^\0-\x7E]/,tS=/[\x2E\u3002\uFF0E\uFF61]/g,nS={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Mt=Math.floor,Is=String.fromCharCode;Fm=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Xm=function(t,e,n){let r=0;for(t=n?Mt(t/700):t>>1,t+=Mt(t/e);t>455;r+=36)t=Mt(t/35);return Mt(r+36*t/(t+38))},Km=function(t){let e=[],n=t.length,r=0,o=128,s=72,i=t.lastIndexOf("-");i<0&&(i=0);for(let l=0;l<i;++l)t.charCodeAt(l)>=128&&Mn("not-basic"),e.push(t.charCodeAt(l));for(let l=i>0?i+1:0;l<n;){let c=r;for(let y=1,g=36;;g+=36){l>=n&&Mn("invalid-input");let m=(a=t.charCodeAt(l++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(m>=36||m>Mt((dr-r)/y))&&Mn("overflow"),r+=m*y;let v=g<=s?1:g>=s+26?26:g-s;if(m<v)break;let B=36-v;y>Mt(dr/B)&&Mn("overflow"),y*=B}let d=e.length+1;s=Xm(r-c,d,c==0),Mt(r/d)>dr-o&&Mn("overflow"),o+=Mt(r/d),r%=d,e.splice(r++,0,o)}var a;return String.fromCodePoint(...e)},Wm=function(t){let e=[],n=(t=Ym(t)).length,r=128,o=0,s=72;for(let l of t)l<128&&e.push(Is(l));let i=e.length,a=i;for(i&&e.push("-");a<n;){let l=dr;for(let d of t)d>=r&&d<l&&(l=d);let c=a+1;l-r>Mt((dr-o)/c)&&Mn("overflow"),o+=(l-r)*c,r=l;for(let d of t)if(d<r&&++o>dr&&Mn("overflow"),d==r){let y=o;for(let g=36;;g+=36){let m=g<=s?1:g>=s+26?26:g-s;if(y<m)break;let v=y-m,B=36-m;e.push(Is(Fm(m+v%B,0))),y=Mt(v/B)}e.push(Is(Fm(y,0))),s=Xm(o,c,a==i),o=0,++a}++o,++r}return e.join("")},rS={version:"2.1.0",ucs2:{decode:Ym,encode:t=>String.fromCodePoint(...t)},decode:Km,encode:Wm,toASCII:function(t){return Lm(t,function(e){return eS.test(e)?"xn--"+Wm(e):e})},toUnicode:function(t){return Lm(t,function(e){return QE.test(e)?Km(e.slice(4).toLowerCase()):e})}};oS=function(t,e,n,r){e=e||"&",n=n||"=";var o={};if(typeof t!="string"||t.length===0)return o;var s=/\+/g;t=t.split(e);var i=1e3;r&&typeof r.maxKeys=="number"&&(i=r.maxKeys);var a=t.length;i>0&&a>i&&(a=i);for(var l=0;l<a;++l){var c,d,y,g,m=t[l].replace(s,"%20"),v=m.indexOf(n);v>=0?(c=m.substr(0,v),d=m.substr(v+1)):(c=m,d=""),y=decodeURIComponent(c),g=decodeURIComponent(d),iS(o,y)?Array.isArray(o[y])?o[y].push(g):o[y]=[o[y],g]:o[y]=g}return o},qr=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},aS=function(t,e,n,r){return e=e||"&",n=n||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(o){var s=encodeURIComponent(qr(o))+n;return Array.isArray(t[o])?t[o].map(function(i){return s+encodeURIComponent(qr(i))}).join(e):s+encodeURIComponent(qr(t[o]))}).join(e):r?encodeURIComponent(qr(r))+n+encodeURIComponent(qr(t)):""},Jt={};Jt.decode=Jt.parse=oS,Jt.encode=Jt.stringify=aS;Jt.decode;Jt.encode;Jt.parse;Jt.stringify;je={},sS=rS,Ot={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};je.parse=zr,je.resolve=function(t,e){return zr(t,!1,!0).resolve(e)},je.resolveObject=function(t,e){return t?zr(t,!1,!0).resolveObject(e):e},je.format=function(t){return Ot.isString(t)&&(t=zr(t)),t instanceof Bt?t.format():Bt.prototype.format.call(t)},je.Url=Bt;lS=/^([a-z0-9.+-]+:)/i,uS=/:[0-9]*$/,cS=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,fS=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
13
- `," "]),Os=["'"].concat(fS),qm=["%","/","?",";","#"].concat(Os),zm=["/","?","#"],Gm=/^[+a-z0-9A-Z_-]{0,63}$/,dS=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pS={javascript:!0,"javascript:":!0},As={javascript:!0,"javascript:":!0},fr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Cs=Jt;Bt.prototype.parse=function(t,e,n){if(!Ot.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),o=r!==-1&&r<t.indexOf("#")?"?":"#",s=t.split(o);s[0]=s[0].replace(/\\/g,"/");var i=t=s.join(o);if(i=i.trim(),!n&&t.split("#").length===1){var a=cS.exec(i);if(a)return this.path=i,this.href=i,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?Cs.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=lS.exec(i);if(l){var c=(l=l[0]).toLowerCase();this.protocol=c,i=i.substr(l.length)}if(n||l||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var d=i.substr(0,2)==="//";!d||l&&As[l]||(i=i.substr(2),this.slashes=!0)}if(!As[l]&&(d||l&&!fr[l])){for(var y,g,m=-1,v=0;v<zm.length;v++)(B=i.indexOf(zm[v]))!==-1&&(m===-1||B<m)&&(m=B);for((g=m===-1?i.lastIndexOf("@"):i.lastIndexOf("@",m))!==-1&&(y=i.slice(0,g),i=i.slice(g+1),this.auth=decodeURIComponent(y)),m=-1,v=0;v<qm.length;v++){var B;(B=i.indexOf(qm[v]))!==-1&&(m===-1||B<m)&&(m=B)}m===-1&&(m=i.length),this.host=i.slice(0,m),i=i.slice(m),this.parseHost(),this.hostname=this.hostname||"";var P=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!P)for(var T=this.hostname.split(/\./),S=(v=0,T.length);v<S;v++){var E=T[v];if(E&&!E.match(Gm)){for(var M="",$=0,oe=E.length;$<oe;$++)E.charCodeAt($)>127?M+="x":M+=E[$];if(!M.match(Gm)){var X=T.slice(0,v),ue=T.slice(v+1),ee=E.match(dS);ee&&(X.push(ee[1]),ue.unshift(ee[2])),ue.length&&(i="/"+ue.join(".")+i),this.hostname=X.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=sS.toASCII(this.hostname));var ie=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+ie,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!pS[c])for(v=0,S=Os.length;v<S;v++){var Ie=Os[v];if(i.indexOf(Ie)!==-1){var $e=encodeURIComponent(Ie);$e===Ie&&($e=escape(Ie)),i=i.split(Ie).join($e)}}var Ne=i.indexOf("#");Ne!==-1&&(this.hash=i.substr(Ne),i=i.slice(0,Ne));var Me=i.indexOf("?");if(Me!==-1?(this.search=i.substr(Me),this.query=i.substr(Me+1),e&&(this.query=Cs.parse(this.query)),i=i.slice(0,Me)):e&&(this.search="",this.query={}),i&&(this.pathname=i),fr[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){ie=this.pathname||"";var Ve=this.search||"";this.path=ie+Ve}return this.href=this.format(),this},Bt.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,s="";this.host?o=t+this.host:this.hostname&&(o=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&Ot.isObject(this.query)&&Object.keys(this.query).length&&(s=Cs.stringify(this.query));var i=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||fr[e])&&o!==!1?(o="//"+(o||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):o||(o=""),r&&r.charAt(0)!=="#"&&(r="#"+r),i&&i.charAt(0)!=="?"&&(i="?"+i),e+o+(n=n.replace(/[?#]/g,function(a){return encodeURIComponent(a)}))+(i=i.replace("#","%23"))+r},Bt.prototype.resolve=function(t){return this.resolveObject(zr(t,!1,!0)).format()},Bt.prototype.resolveObject=function(t){if(Ot.isString(t)){var e=new Bt;e.parse(t,!1,!0),t=e}for(var n=new Bt,r=Object.keys(this),o=0;o<r.length;o++){var s=r[o];n[s]=this[s]}if(n.hash=t.hash,t.href==="")return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var i=Object.keys(t),a=0;a<i.length;a++){var l=i[a];l!=="protocol"&&(n[l]=t[l])}return fr[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!fr[t.protocol]){for(var c=Object.keys(t),d=0;d<c.length;d++){var y=c[d];n[y]=t[y]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||As[t.protocol])n.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),n.pathname=g.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var m=n.pathname||"",v=n.search||"";n.path=m+v}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var B=n.pathname&&n.pathname.charAt(0)==="/",P=t.host||t.pathname&&t.pathname.charAt(0)==="/",T=P||B||n.host&&t.pathname,S=T,E=n.pathname&&n.pathname.split("/")||[],M=(g=t.pathname&&t.pathname.split("/")||[],n.protocol&&!fr[n.protocol]);if(M&&(n.hostname="",n.port=null,n.host&&(E[0]===""?E[0]=n.host:E.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host=null),T=T&&(g[0]===""||E[0]==="")),P)n.host=t.host||t.host===""?t.host:n.host,n.hostname=t.hostname||t.hostname===""?t.hostname:n.hostname,n.search=t.search,n.query=t.query,E=g;else if(g.length)E||(E=[]),E.pop(),E=E.concat(g),n.search=t.search,n.query=t.query;else if(!Ot.isNullOrUndefined(t.search))return M&&(n.hostname=n.host=E.shift(),(ee=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ee.shift(),n.host=n.hostname=ee.shift())),n.search=t.search,n.query=t.query,Ot.isNull(n.pathname)&&Ot.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var $=E.slice(-1)[0],oe=(n.host||t.host||E.length>1)&&($==="."||$==="..")||$==="",X=0,ue=E.length;ue>=0;ue--)($=E[ue])==="."?E.splice(ue,1):$===".."?(E.splice(ue,1),X++):X&&(E.splice(ue,1),X--);if(!T&&!S)for(;X--;X)E.unshift("..");!T||E[0]===""||E[0]&&E[0].charAt(0)==="/"||E.unshift(""),oe&&E.join("/").substr(-1)!=="/"&&E.push("");var ee,ie=E[0]===""||E[0]&&E[0].charAt(0)==="/";return M&&(n.hostname=n.host=ie?"":E.length?E.shift():"",(ee=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=ee.shift(),n.host=n.hostname=ee.shift())),(T=T||n.host&&E.length)&&!ie&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),Ot.isNull(n.pathname)&&Ot.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},Bt.prototype.parseHost=function(){var t=this.host,e=uS.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};je.Url;je.format;je.resolve;je.resolveObject;Rs={},Vm=!1;Jm=gS(),yS=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;je.URL=typeof URL<"u"?URL:null;je.pathToFileURL=IS;je.fileURLToPath=ES;je.Url;je.format;je.resolve;je.resolveObject;je.URL;mS=92,hS=47,vS=97,TS=122,Ms=yS==="win32",_S=/\//g,bS=/%/g,wS=/\\/g,xS=/\n/g,BS=/\r/g,PS=/\t/g;AS=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;je.URL=typeof URL<"u"?URL:null;je.pathToFileURL=KS;je.fileURLToPath=ZS;je.Url;je.format;je.resolve;je.resolveObject;je.parse;je.URL;CS=92,RS=47,OS=97,MS=122,Ds=AS==="win32",DS=/\//g,NS=/%/g,HS=/\\/g,US=/\n/g,jS=/\r/g,$S=/\t/g});var Rh={};jn(Rh,{Agent:()=>tk,ClientRequest:()=>nk,IncomingMessage:()=>rk,METHODS:()=>ik,STATUS_CODES:()=>ok,default:()=>Yt,get:()=>ak,globalAgent:()=>sk,request:()=>lk});function xh(){if(eh)return bt;eh=!0,bt.fetch=r(Dn.fetch)&&r(Dn.ReadableStream),bt.writableStream=r(Dn.WritableStream),bt.abortController=r(Dn.AbortController);var t;function e(){if(t!==void 0)return t;if(Dn.XMLHttpRequest){t=new Dn.XMLHttpRequest;try{t.open("GET",Dn.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function n(o){var s=e();if(!s)return!1;try{return s.responseType=o,s.responseType===o}catch{}return!1}bt.arraybuffer=bt.fetch||n("arraybuffer"),bt.msstream=!bt.fetch&&n("ms-stream"),bt.mozchunkedarraybuffer=!bt.fetch&&n("moz-chunked-arraybuffer"),bt.overrideMimeType=bt.fetch||(e()?r(e().overrideMimeType):!1);function r(o){return typeof o=="function"}return t=null,bt}function Bh(){return th||(th=!0,Ns=yt.EventEmitter),Ns}function WS(){if(nh)return Hs;nh=!0;function t(v,B){var P=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);B&&(T=T.filter(function(S){return Object.getOwnPropertyDescriptor(v,S).enumerable})),P.push.apply(P,T)}return P}function e(v){for(var B=1;B<arguments.length;B++){var P=arguments[B]!=null?arguments[B]:{};B%2?t(Object(P),!0).forEach(function(T){n(v,T,P[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(P)):t(Object(P)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(P,T))})}return v}function n(v,B,P){return B=i(B),B in v?Object.defineProperty(v,B,{value:P,enumerable:!0,configurable:!0,writable:!0}):v[B]=P,v}function r(v,B){if(!(v instanceof B))throw new TypeError("Cannot call a class as a function")}function o(v,B){for(var P=0;P<B.length;P++){var T=B[P];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,i(T.key),T)}}function s(v,B,P){return B&&o(v.prototype,B),Object.defineProperty(v,"prototype",{writable:!1}),v}function i(v){var B=a(v,"string");return typeof B=="symbol"?B:String(B)}function a(v,B){if(typeof v!="object"||v===null)return v;var P=v[Symbol.toPrimitive];if(P!==void 0){var T=P.call(v,B||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(B==="string"?String:Number)(v)}var l=At(),c=l.Buffer,d=L,y=d.inspect,g=y&&y.custom||"inspect";function m(v,B,P){c.prototype.copy.call(v,B,P)}return Hs=function(){function v(){r(this,v),this.head=null,this.tail=null,this.length=0}return s(v,[{key:"push",value:function(P){var T={data:P,next:null};this.length>0?this.tail.next=T:this.head=T,this.tail=T,++this.length}},{key:"unshift",value:function(P){var T={data:P,next:this.head};this.length===0&&(this.tail=T),this.head=T,++this.length}},{key:"shift",value:function(){if(this.length!==0){var P=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,P}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(P){if(this.length===0)return"";for(var T=this.head,S=""+T.data;T=T.next;)S+=P+T.data;return S}},{key:"concat",value:function(P){if(this.length===0)return c.alloc(0);for(var T=c.allocUnsafe(P>>>0),S=this.head,E=0;S;)m(S.data,T,E),E+=S.data.length,S=S.next;return T}},{key:"consume",value:function(P,T){var S;return P<this.head.data.length?(S=this.head.data.slice(0,P),this.head.data=this.head.data.slice(P)):P===this.head.data.length?S=this.shift():S=T?this._getString(P):this._getBuffer(P),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(P){var T=this.head,S=1,E=T.data;for(P-=E.length;T=T.next;){var M=T.data,$=P>M.length?M.length:P;if($===M.length?E+=M:E+=M.slice(0,P),P-=$,P===0){$===M.length?(++S,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=M.slice($));break}++S}return this.length-=S,E}},{key:"_getBuffer",value:function(P){var T=c.allocUnsafe(P),S=this.head,E=1;for(S.data.copy(T),P-=S.data.length;S=S.next;){var M=S.data,$=P>M.length?M.length:P;if(M.copy(T,T.length-P,0,$),P-=$,P===0){$===M.length?(++E,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=M.slice($));break}++E}return this.length-=E,T}},{key:g,value:function(P,T){return y(this,e(e({},T),{},{depth:0,customInspect:!1}))}}]),v}(),Hs}function Ph(){if(rh)return Us;rh=!0;var t=St;function e(a,l){var c=this,d=this._readableState&&this._readableState.destroyed,y=this._writableState&&this._writableState.destroyed;return d||y?(l?l(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(s,this,a)):t.nextTick(s,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(g){!l&&g?c._writableState?c._writableState.errorEmitted?t.nextTick(r,c):(c._writableState.errorEmitted=!0,t.nextTick(n,c,g)):t.nextTick(n,c,g):l?(t.nextTick(r,c),l(g)):t.nextTick(r,c)}),this)}function n(a,l){s(a,l),r(a)}function r(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(a,l){a.emit("error",l)}function i(a,l){var c=a._readableState,d=a._writableState;c&&c.autoDestroy||d&&d.autoDestroy?a.destroy(l):a.emit("error",l)}return Us={destroy:e,undestroy:o,errorOrDestroy:i},Us}function gr(){if(ih)return js;ih=!0;let t={};function e(i,a,l){l||(l=Error);function c(y,g,m){return typeof a=="string"?a:a(y,g,m)}class d extends l{constructor(g,m,v){super(c(g,m,v))}}d.prototype.name=l.name,d.prototype.code=i,t[i]=d}function n(i,a){if(Array.isArray(i)){let l=i.length;return i=i.map(c=>String(c)),l>2?`one of ${a} ${i.slice(0,l-1).join(", ")}, or `+i[l-1]:l===2?`one of ${a} ${i[0]} or ${i[1]}`:`of ${a} ${i[0]}`}else return`of ${a} ${String(i)}`}function r(i,a,l){return i.substr(0,a.length)===a}function o(i,a,l){return(l===void 0||l>i.length)&&(l=i.length),i.substring(l-a.length,l)===a}function s(i,a,l){return typeof l!="number"&&(l=0),l+a.length>i.length?!1:i.indexOf(a,l)!==-1}return e("ERR_INVALID_OPT_VALUE",function(i,a){return'The value "'+a+'" is invalid for option "'+i+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(i,a,l){let c;typeof a=="string"&&r(a,"not ")?(c="must not be",a=a.replace(/^not /,"")):c="must be";let d;if(o(i," argument"))d=`The ${i} ${c} ${n(a,"type")}`;else{let y=s(i,".")?"property":"argument";d=`The "${i}" ${y} ${c} ${n(a,"type")}`}return d+=`. Received type ${typeof l}`,d},TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),js.codes=t,js}function Eh(){if(oh)return $s;oh=!0;var t=gr().codes.ERR_INVALID_OPT_VALUE;function e(r,o,s){return r.highWaterMark!=null?r.highWaterMark:o?r[s]:null}function n(r,o,s,i){var a=e(o,i,s);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var l=i?s:"highWaterMark";throw new t(l,a)}return Math.floor(a)}return r.objectMode?16:16*1024}return $s={getHighWaterMark:n},$s}function Sh(){if(ah)return Zs;ah=!0;var t=St;Zs=ee;function e(A){var k=this;this.next=null,this.entry=null,this.finish=function(){Te(k,A)}}var n;ee.WritableState=X;var r={deprecate:Mm()},o=Bh(),s=At().Buffer,i=(typeof sh<"u"?sh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(A){return s.from(A)}function l(A){return s.isBuffer(A)||A instanceof i}var c=Ph(),d=Eh(),y=d.getHighWaterMark,g=gr().codes,m=g.ERR_INVALID_ARG_TYPE,v=g.ERR_METHOD_NOT_IMPLEMENTED,B=g.ERR_MULTIPLE_CALLBACK,P=g.ERR_STREAM_CANNOT_PIPE,T=g.ERR_STREAM_DESTROYED,S=g.ERR_STREAM_NULL_VALUES,E=g.ERR_STREAM_WRITE_AFTER_END,M=g.ERR_UNKNOWN_ENCODING,$=c.errorOrDestroy;Ct()(ee,o);function oe(){}function X(A,k,j){n=n||pr(),A=A||{},typeof j!="boolean"&&(j=k instanceof n),this.objectMode=!!A.objectMode,j&&(this.objectMode=this.objectMode||!!A.writableObjectMode),this.highWaterMark=y(this,A,"writableHighWaterMark",j),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Y=A.decodeStrings===!1;this.decodeStrings=!Y,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ae){Ae(k,ae)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=A.emitClose!==!1,this.autoDestroy=!!A.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}X.prototype.getBuffer=function(){for(var k=this.bufferedRequest,j=[];k;)j.push(k),k=k.next;return j},function(){try{Object.defineProperty(X.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ue;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ue=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(k){return ue.call(this,k)?!0:this!==ee?!1:k&&k._writableState instanceof X}})):ue=function(k){return k instanceof this};function ee(A){n=n||pr();var k=this instanceof n;if(!k&&!ue.call(ee,this))return new ee(A);this._writableState=new X(A,this,k),this.writable=!0,A&&(typeof A.write=="function"&&(this._write=A.write),typeof A.writev=="function"&&(this._writev=A.writev),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.final=="function"&&(this._final=A.final)),o.call(this)}ee.prototype.pipe=function(){$(this,new P)};function ie(A,k){var j=new E;$(A,j),t.nextTick(k,j)}function Oe(A,k,j,Y){var ae;return j===null?ae=new S:typeof j!="string"&&!k.objectMode&&(ae=new m("chunk",["string","Buffer"],j)),ae?($(A,ae),t.nextTick(Y,ae),!1):!0}ee.prototype.write=function(A,k,j){var Y=this._writableState,ae=!1,b=!Y.objectMode&&l(A);return b&&!s.isBuffer(A)&&(A=a(A)),typeof k=="function"&&(j=k,k=null),b?k="buffer":k||(k=Y.defaultEncoding),typeof j!="function"&&(j=oe),Y.ending?ie(this,j):(b||Oe(this,Y,A,j))&&(Y.pendingcb++,ae=$e(this,Y,b,A,k,j)),ae},ee.prototype.cork=function(){this._writableState.corked++},ee.prototype.uncork=function(){var A=this._writableState;A.corked&&(A.corked--,!A.writing&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&ce(this,A))},ee.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new M(k);return this._writableState.defaultEncoding=k,this},Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Ie(A,k,j){return!A.objectMode&&A.decodeStrings!==!1&&typeof k=="string"&&(k=s.from(k,j)),k}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $e(A,k,j,Y,ae,b){if(!j){var w=Ie(k,Y,ae);Y!==w&&(j=!0,ae="buffer",Y=w)}var W=k.objectMode?1:Y.length;k.length+=W;var Q=k.length<k.highWaterMark;if(Q||(k.needDrain=!0),k.writing||k.corked){var He=k.lastBufferedRequest;k.lastBufferedRequest={chunk:Y,encoding:ae,isBuf:j,callback:b,next:null},He?He.next=k.lastBufferedRequest:k.bufferedRequest=k.lastBufferedRequest,k.bufferedRequestCount+=1}else Ne(A,k,!1,W,Y,ae,b);return Q}function Ne(A,k,j,Y,ae,b,w){k.writelen=Y,k.writecb=w,k.writing=!0,k.sync=!0,k.destroyed?k.onwrite(new T("write")):j?A._writev(ae,k.onwrite):A._write(ae,b,k.onwrite),k.sync=!1}function Me(A,k,j,Y,ae){--k.pendingcb,j?(t.nextTick(ae,Y),t.nextTick(F,A,k),A._writableState.errorEmitted=!0,$(A,Y)):(ae(Y),A._writableState.errorEmitted=!0,$(A,Y),F(A,k))}function Ve(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0}function Ae(A,k){var j=A._writableState,Y=j.sync,ae=j.writecb;if(typeof ae!="function")throw new B;if(Ve(j),k)Me(A,j,Y,k,ae);else{var b=ve(j)||A.destroyed;!b&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&ce(A,j),Y?t.nextTick(he,A,j,b,ae):he(A,j,b,ae)}}function he(A,k,j,Y){j||Se(A,k),k.pendingcb--,Y(),F(A,k)}function Se(A,k){k.length===0&&k.needDrain&&(k.needDrain=!1,A.emit("drain"))}function ce(A,k){k.bufferProcessing=!0;var j=k.bufferedRequest;if(A._writev&&j&&j.next){var Y=k.bufferedRequestCount,ae=new Array(Y),b=k.corkedRequestsFree;b.entry=j;for(var w=0,W=!0;j;)ae[w]=j,j.isBuf||(W=!1),j=j.next,w+=1;ae.allBuffers=W,Ne(A,k,!0,k.length,ae,"",b.finish),k.pendingcb++,k.lastBufferedRequest=null,b.next?(k.corkedRequestsFree=b.next,b.next=null):k.corkedRequestsFree=new e(k),k.bufferedRequestCount=0}else{for(;j;){var Q=j.chunk,He=j.encoding,_e=j.callback,U=k.objectMode?1:Q.length;if(Ne(A,k,!1,U,Q,He,_e),j=j.next,k.bufferedRequestCount--,k.writing)break}j===null&&(k.lastBufferedRequest=null)}k.bufferedRequest=j,k.bufferProcessing=!1}ee.prototype._write=function(A,k,j){j(new v("_write()"))},ee.prototype._writev=null,ee.prototype.end=function(A,k,j){var Y=this._writableState;return typeof A=="function"?(j=A,A=null,k=null):typeof k=="function"&&(j=k,k=null),A!=null&&this.write(A,k),Y.corked&&(Y.corked=1,this.uncork()),Y.ending||fe(this,Y,j),this},Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ve(A){return A.ending&&A.length===0&&A.bufferedRequest===null&&!A.finished&&!A.writing}function D(A,k){A._final(function(j){k.pendingcb--,j&&$(A,j),k.prefinished=!0,A.emit("prefinish"),F(A,k)})}function Z(A,k){!k.prefinished&&!k.finalCalled&&(typeof A._final=="function"&&!k.destroyed?(k.pendingcb++,k.finalCalled=!0,t.nextTick(D,A,k)):(k.prefinished=!0,A.emit("prefinish")))}function F(A,k){var j=ve(k);if(j&&(Z(A,k),k.pendingcb===0&&(k.finished=!0,A.emit("finish"),k.autoDestroy))){var Y=A._readableState;(!Y||Y.autoDestroy&&Y.endEmitted)&&A.destroy()}return j}function fe(A,k,j){k.ending=!0,F(A,k),j&&(k.finished?t.nextTick(j):A.once("finish",j)),k.ended=!0,A.writable=!1}function Te(A,k,j){var Y=A.entry;for(A.entry=null;Y;){var ae=Y.callback;k.pendingcb--,ae(j),Y=Y.next}k.corkedRequestsFree.next=A}return Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(k){this._writableState&&(this._writableState.destroyed=k)}}),ee.prototype.destroy=c.destroy,ee.prototype._undestroy=c.undestroy,ee.prototype._destroy=function(A,k){k(A)},Zs}function pr(){if(lh)return Ls;lh=!0;var t=St,e=Object.keys||function(d){var y=[];for(var g in d)y.push(g);return y};Ls=a;var n=kh(),r=Sh();Ct()(a,n);for(var o=e(r.prototype),s=0;s<o.length;s++){var i=o[s];a.prototype[i]||(a.prototype[i]=r.prototype[i])}function a(d){if(!(this instanceof a))return new a(d);n.call(this,d),r.call(this,d),this.allowHalfOpen=!0,d&&(d.readable===!1&&(this.readable=!1),d.writable===!1&&(this.writable=!1),d.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",l)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||t.nextTick(c,this)}function c(d){d.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=y,this._writableState.destroyed=y)}}),Ls}function el(){if(uh)return Fs;uh=!0;var t=gr().codes.ERR_STREAM_PREMATURE_CLOSE;function e(s){var i=!1;return function(){if(!i){i=!0;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];s.apply(this,l)}}}function n(){}function r(s){return s.setHeader&&typeof s.abort=="function"}function o(s,i,a){if(typeof i=="function")return o(s,null,i);i||(i={}),a=e(a||n);var l=i.readable||i.readable!==!1&&s.readable,c=i.writable||i.writable!==!1&&s.writable,d=function(){s.writable||g()},y=s._writableState&&s._writableState.finished,g=function(){c=!1,y=!0,l||a.call(s)},m=s._readableState&&s._readableState.endEmitted,v=function(){l=!1,m=!0,c||a.call(s)},B=function(E){a.call(s,E)},P=function(){var E;if(l&&!m)return(!s._readableState||!s._readableState.ended)&&(E=new t),a.call(s,E);if(c&&!y)return(!s._writableState||!s._writableState.ended)&&(E=new t),a.call(s,E)},T=function(){s.req.on("finish",g)};return r(s)?(s.on("complete",g),s.on("abort",P),s.req?T():s.on("request",T)):c&&!s._writableState&&(s.on("end",d),s.on("close",d)),s.on("end",v),s.on("finish",g),i.error!==!1&&s.on("error",B),s.on("close",P),function(){s.removeListener("complete",g),s.removeListener("abort",P),s.removeListener("request",T),s.req&&s.req.removeListener("finish",g),s.removeListener("end",d),s.removeListener("close",d),s.removeListener("finish",g),s.removeListener("end",v),s.removeListener("error",B),s.removeListener("close",P)}}return Fs=o,Fs}function qS(){if(ch)return Ks;ch=!0;var t=St,e;function n(M,$,oe){return $=r($),$ in M?Object.defineProperty(M,$,{value:oe,enumerable:!0,configurable:!0,writable:!0}):M[$]=oe,M}function r(M){var $=o(M,"string");return typeof $=="symbol"?$:String($)}function o(M,$){if(typeof M!="object"||M===null)return M;var oe=M[Symbol.toPrimitive];if(oe!==void 0){var X=oe.call(M,$||"default");if(typeof X!="object")return X;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(M)}var s=el(),i=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),c=Symbol("ended"),d=Symbol("lastPromise"),y=Symbol("handlePromise"),g=Symbol("stream");function m(M,$){return{value:M,done:$}}function v(M){var $=M[i];if($!==null){var oe=M[g].read();oe!==null&&(M[d]=null,M[i]=null,M[a]=null,$(m(oe,!1)))}}function B(M){t.nextTick(v,M)}function P(M,$){return function(oe,X){M.then(function(){if($[c]){oe(m(void 0,!0));return}$[y](oe,X)},X)}}var T=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((e={get stream(){return this[g]},next:function(){var $=this,oe=this[l];if(oe!==null)return Promise.reject(oe);if(this[c])return Promise.resolve(m(void 0,!0));if(this[g].destroyed)return new Promise(function(ie,Oe){t.nextTick(function(){$[l]?Oe($[l]):ie(m(void 0,!0))})});var X=this[d],ue;if(X)ue=new Promise(P(X,this));else{var ee=this[g].read();if(ee!==null)return Promise.resolve(m(ee,!1));ue=new Promise(this[y])}return this[d]=ue,ue}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var $=this;return new Promise(function(oe,X){$[g].destroy(null,function(ue){if(ue){X(ue);return}oe(m(void 0,!0))})})}),e),T),E=function($){var oe,X=Object.create(S,(oe={},n(oe,g,{value:$,writable:!0}),n(oe,i,{value:null,writable:!0}),n(oe,a,{value:null,writable:!0}),n(oe,l,{value:null,writable:!0}),n(oe,c,{value:$._readableState.endEmitted,writable:!0}),n(oe,y,{value:function(ee,ie){var Oe=X[g].read();Oe?(X[d]=null,X[i]=null,X[a]=null,ee(m(Oe,!1))):(X[i]=ee,X[a]=ie)},writable:!0}),oe));return X[d]=null,s($,function(ue){if(ue&&ue.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ee=X[a];ee!==null&&(X[d]=null,X[i]=null,X[a]=null,ee(ue)),X[l]=ue;return}var ie=X[i];ie!==null&&(X[d]=null,X[i]=null,X[a]=null,ie(m(void 0,!0))),X[c]=!0}),$.on("readable",B.bind(null,X)),X};return Ks=E,Ks}function zS(){return fh||(fh=!0,Ws=function(){throw new Error("Readable.from is not available in the browser")}),Ws}function kh(){if(dh)return qs;dh=!0;var t=St;qs=ie;var e;ie.ReadableState=ee,yt.EventEmitter;var n=function(w,W){return w.listeners(W).length},r=Bh(),o=At().Buffer,s=(typeof ph<"u"?ph:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(b){return o.from(b)}function a(b){return o.isBuffer(b)||b instanceof s}var l=L,c;l&&l.debuglog?c=l.debuglog("stream"):c=function(){};var d=WS(),y=Ph(),g=Eh(),m=g.getHighWaterMark,v=gr().codes,B=v.ERR_INVALID_ARG_TYPE,P=v.ERR_STREAM_PUSH_AFTER_EOF,T=v.ERR_METHOD_NOT_IMPLEMENTED,S=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,E,M,$;Ct()(ie,r);var oe=y.errorOrDestroy,X=["error","close","destroy","pause","resume"];function ue(b,w,W){if(typeof b.prependListener=="function")return b.prependListener(w,W);!b._events||!b._events[w]?b.on(w,W):Array.isArray(b._events[w])?b._events[w].unshift(W):b._events[w]=[W,b._events[w]]}function ee(b,w,W){e=e||pr(),b=b||{},typeof W!="boolean"&&(W=w instanceof e),this.objectMode=!!b.objectMode,W&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=m(this,b,"readableHighWaterMark",W),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=b.emitClose!==!1,this.autoDestroy=!!b.autoDestroy,this.destroyed=!1,this.defaultEncoding=b.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(E||(E=Wr.StringDecoder),this.decoder=new E(b.encoding),this.encoding=b.encoding)}function ie(b){if(e=e||pr(),!(this instanceof ie))return new ie(b);var w=this instanceof e;this._readableState=new ee(b,this,w),this.readable=!0,b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy)),r.call(this)}Object.defineProperty(ie.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(w){this._readableState&&(this._readableState.destroyed=w)}}),ie.prototype.destroy=y.destroy,ie.prototype._undestroy=y.undestroy,ie.prototype._destroy=function(b,w){w(b)},ie.prototype.push=function(b,w){var W=this._readableState,Q;return W.objectMode?Q=!0:typeof b=="string"&&(w=w||W.defaultEncoding,w!==W.encoding&&(b=o.from(b,w),w=""),Q=!0),Oe(this,b,w,!1,Q)},ie.prototype.unshift=function(b){return Oe(this,b,null,!0,!1)};function Oe(b,w,W,Q,He){c("readableAddChunk",w);var _e=b._readableState;if(w===null)_e.reading=!1,Ae(b,_e);else{var U;if(He||(U=$e(_e,w)),U)oe(b,U);else if(_e.objectMode||w&&w.length>0)if(typeof w!="string"&&!_e.objectMode&&Object.getPrototypeOf(w)!==o.prototype&&(w=i(w)),Q)_e.endEmitted?oe(b,new S):Ie(b,_e,w,!0);else if(_e.ended)oe(b,new P);else{if(_e.destroyed)return!1;_e.reading=!1,_e.decoder&&!W?(w=_e.decoder.write(w),_e.objectMode||w.length!==0?Ie(b,_e,w,!1):ce(b,_e)):Ie(b,_e,w,!1)}else Q||(_e.reading=!1,ce(b,_e))}return!_e.ended&&(_e.length<_e.highWaterMark||_e.length===0)}function Ie(b,w,W,Q){w.flowing&&w.length===0&&!w.sync?(w.awaitDrain=0,b.emit("data",W)):(w.length+=w.objectMode?1:W.length,Q?w.buffer.unshift(W):w.buffer.push(W),w.needReadable&&he(b)),ce(b,w)}function $e(b,w){var W;return!a(w)&&typeof w!="string"&&w!==void 0&&!b.objectMode&&(W=new B("chunk",["string","Buffer","Uint8Array"],w)),W}ie.prototype.isPaused=function(){return this._readableState.flowing===!1},ie.prototype.setEncoding=function(b){E||(E=Wr.StringDecoder);var w=new E(b);this._readableState.decoder=w,this._readableState.encoding=this._readableState.decoder.encoding;for(var W=this._readableState.buffer.head,Q="";W!==null;)Q+=w.write(W.data),W=W.next;return this._readableState.buffer.clear(),Q!==""&&this._readableState.buffer.push(Q),this._readableState.length=Q.length,this};var Ne=1073741824;function Me(b){return b>=Ne?b=Ne:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function Ve(b,w){return b<=0||w.length===0&&w.ended?0:w.objectMode?1:b!==b?w.flowing&&w.length?w.buffer.head.data.length:w.length:(b>w.highWaterMark&&(w.highWaterMark=Me(b)),b<=w.length?b:w.ended?w.length:(w.needReadable=!0,0))}ie.prototype.read=function(b){c("read",b),b=parseInt(b,10);var w=this._readableState,W=b;if(b!==0&&(w.emittedReadable=!1),b===0&&w.needReadable&&((w.highWaterMark!==0?w.length>=w.highWaterMark:w.length>0)||w.ended))return c("read: emitReadable",w.length,w.ended),w.length===0&&w.ended?j(this):he(this),null;if(b=Ve(b,w),b===0&&w.ended)return w.length===0&&j(this),null;var Q=w.needReadable;c("need readable",Q),(w.length===0||w.length-b<w.highWaterMark)&&(Q=!0,c("length less than watermark",Q)),w.ended||w.reading?(Q=!1,c("reading or ended",Q)):Q&&(c("do read"),w.reading=!0,w.sync=!0,w.length===0&&(w.needReadable=!0),this._read(w.highWaterMark),w.sync=!1,w.reading||(b=Ve(W,w)));var He;return b>0?He=k(b,w):He=null,He===null?(w.needReadable=w.length<=w.highWaterMark,b=0):(w.length-=b,w.awaitDrain=0),w.length===0&&(w.ended||(w.needReadable=!0),W!==b&&w.ended&&j(this)),He!==null&&this.emit("data",He),He};function Ae(b,w){if(c("onEofChunk"),!w.ended){if(w.decoder){var W=w.decoder.end();W&&W.length&&(w.buffer.push(W),w.length+=w.objectMode?1:W.length)}w.ended=!0,w.sync?he(b):(w.needReadable=!1,w.emittedReadable||(w.emittedReadable=!0,Se(b)))}}function he(b){var w=b._readableState;c("emitReadable",w.needReadable,w.emittedReadable),w.needReadable=!1,w.emittedReadable||(c("emitReadable",w.flowing),w.emittedReadable=!0,t.nextTick(Se,b))}function Se(b){var w=b._readableState;c("emitReadable_",w.destroyed,w.length,w.ended),!w.destroyed&&(w.length||w.ended)&&(b.emit("readable"),w.emittedReadable=!1),w.needReadable=!w.flowing&&!w.ended&&w.length<=w.highWaterMark,A(b)}function ce(b,w){w.readingMore||(w.readingMore=!0,t.nextTick(ve,b,w))}function ve(b,w){for(;!w.reading&&!w.ended&&(w.length<w.highWaterMark||w.flowing&&w.length===0);){var W=w.length;if(c("maybeReadMore read 0"),b.read(0),W===w.length)break}w.readingMore=!1}ie.prototype._read=function(b){oe(this,new T("_read()"))},ie.prototype.pipe=function(b,w){var W=this,Q=this._readableState;switch(Q.pipesCount){case 0:Q.pipes=b;break;case 1:Q.pipes=[Q.pipes,b];break;default:Q.pipes.push(b);break}Q.pipesCount+=1,c("pipe count=%d opts=%j",Q.pipesCount,w);var He=(!w||w.end!==!1)&&b!==t.stdout&&b!==t.stderr,_e=He?Pt:u;Q.endEmitted?t.nextTick(_e):W.once("end",_e),b.on("unpipe",U);function U(f,_){c("onunpipe"),f===W&&_&&_.hasUnpiped===!1&&(_.hasUnpiped=!0,hr())}function Pt(){c("onend"),b.end()}var It=D(W);b.on("drain",It);var vt=!1;function hr(){c("cleanup"),b.removeListener("close",vr),b.removeListener("finish",h),b.removeListener("drain",It),b.removeListener("error",wt),b.removeListener("unpipe",U),W.removeListener("end",Pt),W.removeListener("end",u),W.removeListener("data",Xr),vt=!0,Q.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&It()}W.on("data",Xr);function Xr(f){c("ondata");var _=b.write(f);c("dest.write",_),_===!1&&((Q.pipesCount===1&&Q.pipes===b||Q.pipesCount>1&&ae(Q.pipes,b)!==-1)&&!vt&&(c("false write response, pause",Q.awaitDrain),Q.awaitDrain++),W.pause())}function wt(f){c("onerror",f),u(),b.removeListener("error",wt),n(b,"error")===0&&oe(b,f)}ue(b,"error",wt);function vr(){b.removeListener("finish",h),u()}b.once("close",vr);function h(){c("onfinish"),b.removeListener("close",vr),u()}b.once("finish",h);function u(){c("unpipe"),W.unpipe(b)}return b.emit("pipe",W),Q.flowing||(c("pipe resume"),W.resume()),b};function D(b){return function(){var W=b._readableState;c("pipeOnDrain",W.awaitDrain),W.awaitDrain&&W.awaitDrain--,W.awaitDrain===0&&n(b,"data")&&(W.flowing=!0,A(b))}}ie.prototype.unpipe=function(b){var w=this._readableState,W={hasUnpiped:!1};if(w.pipesCount===0)return this;if(w.pipesCount===1)return b&&b!==w.pipes?this:(b||(b=w.pipes),w.pipes=null,w.pipesCount=0,w.flowing=!1,b&&b.emit("unpipe",this,W),this);if(!b){var Q=w.pipes,He=w.pipesCount;w.pipes=null,w.pipesCount=0,w.flowing=!1;for(var _e=0;_e<He;_e++)Q[_e].emit("unpipe",this,{hasUnpiped:!1});return this}var U=ae(w.pipes,b);return U===-1?this:(w.pipes.splice(U,1),w.pipesCount-=1,w.pipesCount===1&&(w.pipes=w.pipes[0]),b.emit("unpipe",this,W),this)},ie.prototype.on=function(b,w){var W=r.prototype.on.call(this,b,w),Q=this._readableState;return b==="data"?(Q.readableListening=this.listenerCount("readable")>0,Q.flowing!==!1&&this.resume()):b==="readable"&&!Q.endEmitted&&!Q.readableListening&&(Q.readableListening=Q.needReadable=!0,Q.flowing=!1,Q.emittedReadable=!1,c("on readable",Q.length,Q.reading),Q.length?he(this):Q.reading||t.nextTick(F,this)),W},ie.prototype.addListener=ie.prototype.on,ie.prototype.removeListener=function(b,w){var W=r.prototype.removeListener.call(this,b,w);return b==="readable"&&t.nextTick(Z,this),W},ie.prototype.removeAllListeners=function(b){var w=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&t.nextTick(Z,this),w};function Z(b){var w=b._readableState;w.readableListening=b.listenerCount("readable")>0,w.resumeScheduled&&!w.paused?w.flowing=!0:b.listenerCount("data")>0&&b.resume()}function F(b){c("readable nexttick read 0"),b.read(0)}ie.prototype.resume=function(){var b=this._readableState;return b.flowing||(c("resume"),b.flowing=!b.readableListening,fe(this,b)),b.paused=!1,this};function fe(b,w){w.resumeScheduled||(w.resumeScheduled=!0,t.nextTick(Te,b,w))}function Te(b,w){c("resume",w.reading),w.reading||b.read(0),w.resumeScheduled=!1,b.emit("resume"),A(b),w.flowing&&!w.reading&&b.read(0)}ie.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function A(b){var w=b._readableState;for(c("flow",w.flowing);w.flowing&&b.read()!==null;);}ie.prototype.wrap=function(b){var w=this,W=this._readableState,Q=!1;b.on("end",function(){if(c("wrapped end"),W.decoder&&!W.ended){var U=W.decoder.end();U&&U.length&&w.push(U)}w.push(null)}),b.on("data",function(U){if(c("wrapped data"),W.decoder&&(U=W.decoder.write(U)),!(W.objectMode&&U==null)&&!(!W.objectMode&&(!U||!U.length))){var Pt=w.push(U);Pt||(Q=!0,b.pause())}});for(var He in b)this[He]===void 0&&typeof b[He]=="function"&&(this[He]=function(Pt){return function(){return b[Pt].apply(b,arguments)}}(He));for(var _e=0;_e<X.length;_e++)b.on(X[_e],this.emit.bind(this,X[_e]));return this._read=function(U){c("wrapped _read",U),Q&&(Q=!1,b.resume())},this},typeof Symbol=="function"&&(ie.prototype[Symbol.asyncIterator]=function(){return M===void 0&&(M=qS()),M(this)}),Object.defineProperty(ie.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ie.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ie.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(w){this._readableState&&(this._readableState.flowing=w)}}),ie._fromList=k,Object.defineProperty(ie.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function k(b,w){if(w.length===0)return null;var W;return w.objectMode?W=w.buffer.shift():!b||b>=w.length?(w.decoder?W=w.buffer.join(""):w.buffer.length===1?W=w.buffer.first():W=w.buffer.concat(w.length),w.buffer.clear()):W=w.buffer.consume(b,w.decoder),W}function j(b){var w=b._readableState;c("endReadable",w.endEmitted),w.endEmitted||(w.ended=!0,t.nextTick(Y,w,b))}function Y(b,w){if(c("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,w.readable=!1,w.emit("end"),b.autoDestroy)){var W=w._writableState;(!W||W.autoDestroy&&W.finished)&&w.destroy()}}typeof Symbol=="function"&&(ie.from=function(b,w){return $===void 0&&($=zS()),$(ie,b,w)});function ae(b,w){for(var W=0,Q=b.length;W<Q;W++)if(b[W]===w)return W;return-1}return qs}function Ih(){if(gh)return zs;gh=!0,zs=a;var t=gr().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,r=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=t.ERR_TRANSFORM_WITH_LENGTH_0,s=pr();Ct()(a,s);function i(d,y){var g=this._transformState;g.transforming=!1;var m=g.writecb;if(m===null)return this.emit("error",new n);g.writechunk=null,g.writecb=null,y!=null&&this.push(y),m(d);var v=this._readableState;v.reading=!1,(v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}function a(d){if(!(this instanceof a))return new a(d);s.call(this,d),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",l)}function l(){var d=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(y,g){c(d,y,g)}):c(this,null,null)}a.prototype.push=function(d,y){return this._transformState.needTransform=!1,s.prototype.push.call(this,d,y)},a.prototype._transform=function(d,y,g){g(new e("_transform()"))},a.prototype._write=function(d,y,g){var m=this._transformState;if(m.writecb=g,m.writechunk=d,m.writeencoding=y,!m.transforming){var v=this._readableState;(m.needTransform||v.needReadable||v.length<v.highWaterMark)&&this._read(v.highWaterMark)}},a.prototype._read=function(d){var y=this._transformState;y.writechunk!==null&&!y.transforming?(y.transforming=!0,this._transform(y.writechunk,y.writeencoding,y.afterTransform)):y.needTransform=!0},a.prototype._destroy=function(d,y){s.prototype._destroy.call(this,d,function(g){y(g)})};function c(d,y,g){if(y)return d.emit("error",y);if(g!=null&&d.push(g),d._writableState.length)throw new o;if(d._transformState.transforming)throw new r;return d.push(null)}return zs}function GS(){if(yh)return Gs;yh=!0,Gs=e;var t=Ih();Ct()(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return e.prototype._transform=function(n,r,o){o(null,n)},Gs}function VS(){if(mh)return Vs;mh=!0;var t;function e(g){var m=!1;return function(){m||(m=!0,g.apply(void 0,arguments))}}var n=gr().codes,r=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function s(g){if(g)throw g}function i(g){return g.setHeader&&typeof g.abort=="function"}function a(g,m,v,B){B=e(B);var P=!1;g.on("close",function(){P=!0}),t===void 0&&(t=el()),t(g,{readable:m,writable:v},function(S){if(S)return B(S);P=!0,B()});var T=!1;return function(S){if(!P&&!T){if(T=!0,i(g))return g.abort();if(typeof g.destroy=="function")return g.destroy();B(S||new o("pipe"))}}}function l(g){g()}function c(g,m){return g.pipe(m)}function d(g){return!g.length||typeof g[g.length-1]!="function"?s:g.pop()}function y(){for(var g=arguments.length,m=new Array(g),v=0;v<g;v++)m[v]=arguments[v];var B=d(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new r("streams");var P,T=m.map(function(S,E){var M=E<m.length-1,$=E>0;return a(S,M,$,function(oe){P||(P=oe),oe&&T.forEach(l),!M&&(T.forEach(l),B(P))})});return m.reduce(c)}return Vs=y,Vs}function Ah(){return hh||(hh=!0,ht=ht=kh(),ht.Stream=ht,ht.Readable=ht,ht.Writable=Sh(),ht.Duplex=pr(),ht.Transform=Ih(),ht.PassThrough=GS(),ht.finished=el(),ht.pipeline=VS()),ht}function Ch(){if(vh)return Uo;vh=!0;var t=At().Buffer,e=St,n=xh(),r=Ct(),o=Ah(),s=Uo.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=Uo.IncomingMessage=function(a,l,c,d){var y=this||jo;if(o.Readable.call(y),y._mode=c,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){e.nextTick(function(){y.emit("close")})}),c==="fetch"){let T=function(){m.read().then(function(S){if(!y._destroyed){if(d(S.done),S.done){y.push(null);return}y.push(t.from(S.value)),T()}}).catch(function(S){d(!0),y._destroyed||y.emit("error",S)})};if(y._fetchResponse=l,y.url=l.url,y.statusCode=l.status,y.statusMessage=l.statusText,l.headers.forEach(function(S,E){y.headers[E.toLowerCase()]=S,y.rawHeaders.push(E,S)}),n.writableStream){var g=new WritableStream({write:function(S){return d(!1),new Promise(function(E,M){y._destroyed?M():y.push(t.from(S))?E():y._resumeFetch=E})},close:function(){d(!0),y._destroyed||y.push(null)},abort:function(S){d(!0),y._destroyed||y.emit("error",S)}});try{l.body.pipeTo(g).catch(function(S){d(!0),y._destroyed||y.emit("error",S)});return}catch{}}var m=l.body.getReader();T()}else{y._xhr=a,y._pos=0,y.url=a.responseURL,y.statusCode=a.status,y.statusMessage=a.statusText;var v=a.getAllResponseHeaders().split(/\r?\n/);if(v.forEach(function(T){var S=T.match(/^([^:]+):\s*(.*)/);if(S){var E=S[1].toLowerCase();E==="set-cookie"?(y.headers[E]===void 0&&(y.headers[E]=[]),y.headers[E].push(S[2])):y.headers[E]!==void 0?y.headers[E]+=", "+S[2]:y.headers[E]=S[2],y.rawHeaders.push(S[1],S[2])}}),y._charset="x-user-defined",!n.overrideMimeType){var B=y.rawHeaders["mime-type"];if(B){var P=B.match(/;\s*charset=([^;])(;|$)/);P&&(y._charset=P[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};return r(i,o.Readable),i.prototype._read=function(){var a=this||jo,l=a._resumeFetch;l&&(a._resumeFetch=null,l())},i.prototype._onXHRProgress=function(a){var l=this||jo,c=l._xhr,d=null;switch(l._mode){case"text":if(d=c.responseText,d.length>l._pos){var y=d.substr(l._pos);if(l._charset==="x-user-defined"){for(var g=t.alloc(y.length),m=0;m<y.length;m++)g[m]=y.charCodeAt(m)&255;l.push(g)}else l.push(y,l._charset);l._pos=d.length}break;case"arraybuffer":if(c.readyState!==s.DONE||!c.response)break;d=c.response,l.push(t.from(new Uint8Array(d)));break;case"moz-chunked-arraybuffer":if(d=c.response,c.readyState!==s.LOADING||!d)break;l.push(t.from(new Uint8Array(d)));break;case"ms-stream":if(d=c.response,c.readyState!==s.LOADING)break;var v=new jo.MSStreamReader;v.onprogress=function(){v.result.byteLength>l._pos&&(l.push(t.from(new Uint8Array(v.result.slice(l._pos)))),l._pos=v.result.byteLength)},v.onload=function(){a(!0),l.push(null)},v.readAsArrayBuffer(d);break}l._xhr.readyState===s.DONE&&l._mode!=="ms-stream"&&(a(!0),l.push(null))},Uo}function JS(){if(Th)return Js;Th=!0;var t=At().Buffer,e=St,n=xh(),r=Ct(),o=Ch(),s=Ah(),i=o.IncomingMessage,a=o.readyStates;function l(g,m){return n.fetch&&m?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&g?"arraybuffer":"text"}var c=Js=function(g){var m=this||rt;s.Writable.call(m),m._opts=g,m._body=[],m._headers={},g.auth&&m.setHeader("Authorization","Basic "+t.from(g.auth).toString("base64")),Object.keys(g.headers).forEach(function(P){m.setHeader(P,g.headers[P])});var v,B=!0;if(g.mode==="disable-fetch"||"requestTimeout"in g&&!n.abortController)B=!1,v=!0;else if(g.mode==="prefer-streaming")v=!1;else if(g.mode==="allow-wrong-content-type")v=!n.overrideMimeType;else if(!g.mode||g.mode==="default"||g.mode==="prefer-fast")v=!0;else throw new Error("Invalid value for opts.mode");m._mode=l(v,B),m._fetchTimer=null,m._socketTimeout=null,m._socketTimer=null,m.on("finish",function(){m._onFinish()})};r(c,s.Writable),c.prototype.setHeader=function(g,m){var v=this||rt,B=g.toLowerCase();y.indexOf(B)===-1&&(v._headers[B]={name:g,value:m})},c.prototype.getHeader=function(g){var m=(this||rt)._headers[g.toLowerCase()];return m?m.value:null},c.prototype.removeHeader=function(g){var m=this||rt;delete m._headers[g.toLowerCase()]},c.prototype._onFinish=function(){var g=this||rt;if(!g._destroyed){var m=g._opts;"timeout"in m&&m.timeout!==0&&g.setTimeout(m.timeout);var v=g._headers,B=null;m.method!=="GET"&&m.method!=="HEAD"&&(B=new Blob(g._body,{type:(v["content-type"]||{}).value||""}));var P=[];if(Object.keys(v).forEach(function(M){var $=v[M].name,oe=v[M].value;Array.isArray(oe)?oe.forEach(function(X){P.push([$,X])}):P.push([$,oe])}),g._mode==="fetch"){var T=null;if(n.abortController){var S=new AbortController;T=S.signal,g._fetchAbortController=S,"requestTimeout"in m&&m.requestTimeout!==0&&(g._fetchTimer=rt.setTimeout(function(){g.emit("requestTimeout"),g._fetchAbortController&&g._fetchAbortController.abort()},m.requestTimeout))}rt.fetch(g._opts.url,{method:g._opts.method,headers:P,body:B||void 0,mode:"cors",credentials:m.withCredentials?"include":"same-origin",signal:T}).then(function(M){g._fetchResponse=M,g._resetTimers(!1),g._connect()},function(M){g._resetTimers(!0),g._destroyed||g.emit("error",M)})}else{var E=g._xhr=new rt.XMLHttpRequest;try{E.open(g._opts.method,g._opts.url,!0)}catch(M){e.nextTick(function(){g.emit("error",M)});return}"responseType"in E&&(E.responseType=g._mode),"withCredentials"in E&&(E.withCredentials=!!m.withCredentials),g._mode==="text"&&"overrideMimeType"in E&&E.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in m&&(E.timeout=m.requestTimeout,E.ontimeout=function(){g.emit("requestTimeout")}),P.forEach(function(M){E.setRequestHeader(M[0],M[1])}),g._response=null,E.onreadystatechange=function(){switch(E.readyState){case a.LOADING:case a.DONE:g._onXHRProgress();break}},g._mode==="moz-chunked-arraybuffer"&&(E.onprogress=function(){g._onXHRProgress()}),E.onerror=function(){g._destroyed||(g._resetTimers(!0),g.emit("error",new Error("XHR error")))};try{E.send(B)}catch(M){e.nextTick(function(){g.emit("error",M)});return}}}};function d(g){try{var m=g.status;return m!==null&&m!==0}catch{return!1}}c.prototype._onXHRProgress=function(){var g=this||rt;g._resetTimers(!1),!(!d(g._xhr)||g._destroyed)&&(g._response||g._connect(),g._response._onXHRProgress(g._resetTimers.bind(g)))},c.prototype._connect=function(){var g=this||rt;g._destroyed||(g._response=new i(g._xhr,g._fetchResponse,g._mode,g._resetTimers.bind(g)),g._response.on("error",function(m){g.emit("error",m)}),g.emit("response",g._response))},c.prototype._write=function(g,m,v){var B=this||rt;B._body.push(g),v()},c.prototype._resetTimers=function(g){var m=this||rt;rt.clearTimeout(m._socketTimer),m._socketTimer=null,g?(rt.clearTimeout(m._fetchTimer),m._fetchTimer=null):m._socketTimeout&&(m._socketTimer=rt.setTimeout(function(){m.emit("timeout")},m._socketTimeout))},c.prototype.abort=c.prototype.destroy=function(g){var m=this||rt;m._destroyed=!0,m._resetTimers(!0),m._response&&(m._response._destroyed=!0),m._xhr?m._xhr.abort():m._fetchAbortController&&m._fetchAbortController.abort(),g&&m.emit("error",g)},c.prototype.end=function(g,m,v){var B=this||rt;typeof g=="function"&&(v=g,g=void 0),s.Writable.prototype.end.call(B,g,m,v)},c.prototype.setTimeout=function(g,m){var v=this||rt;m&&v.once("timeout",m),v._socketTimeout=g,v._resetTimers(!1)},c.prototype.flushHeaders=function(){},c.prototype.setNoDelay=function(){},c.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return Js}function YS(){if(_h)return Ys;_h=!0,Ys=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},r=0;r<arguments.length;r++){var o=arguments[r];for(var s in o)t.call(o,s)&&(n[s]=o[s])}return n}return Ys}function XS(){return bh||(bh=!0,Xs={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),Xs}function ek(){if(wh)return Qs;wh=!0;var t=JS(),e=Ch(),n=YS(),r=XS(),o=je,s=Qs;return s.request=function(i,a){typeof i=="string"?i=o.parse(i):i=n(i);var l=QS.location.protocol.search(/^https?:$/)===-1?"http:":"",c=i.protocol||l,d=i.hostname||i.host,y=i.port,g=i.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),i.url=(d?c+"//"+d:"")+(y?":"+y:"")+g,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var m=new t(i);return a&&m.on("response",a),m},s.get=function(a,l){var c=s.request(a,l);return c.end(),c},s.ClientRequest=t,s.IncomingMessage=e.IncomingMessage,s.Agent=function(){},s.Agent.defaultMaxSockets=4,s.globalAgent=new s.Agent,s.STATUS_CODES=r,s.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Qs}var bt,eh,Dn,Ns,th,Hs,nh,Us,rh,js,ih,$s,oh,Zs,ah,sh,Ls,lh,Fs,uh,Ks,ch,Ws,fh,qs,dh,ph,zs,gh,Gs,yh,Vs,mh,ht,hh,Uo,vh,jo,Js,Th,rt,Ys,_h,Xs,bh,Qs,wh,QS,Yt,tk,nk,rk,ik,ok,ak,sk,lk,Oh=it(()=>{C();O();R();os();Gy();as();ii();Am();No();ws();Dm();Um();Qm();Ss();bt={},eh=!1,Dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ns={},th=!1;Hs={},nh=!1;Us={},rh=!1;js={},ih=!1;$s={},oh=!1;Zs={},ah=!1,sh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ls={},lh=!1;Fs={},uh=!1;Ks={},ch=!1;Ws={},fh=!1;qs={},dh=!1,ph=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zs={},gh=!1;Gs={},yh=!1;Vs={},mh=!1;ht={},hh=!1;Uo={},vh=!1,jo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Js={},Th=!1,rt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ys={},_h=!1;Xs={},bh=!1;Qs={},wh=!1,QS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Yt=ek(),tk=Yt.Agent,nk=Yt.ClientRequest,rk=Yt.IncomingMessage,ik=Yt.METHODS,ok=Yt.STATUS_CODES,ak=Yt.get,sk=Yt.globalAgent,lk=Yt.request});C();O();R();var Ay={};jn(Ay,{defaults:()=>lP,markdown:()=>sP});C();O();R();C();O();R();C();O();R();var no=Tr(Ln(),1),ze=Tr(Ln(),1),Zt=Tr(Ln(),1),tr=Tr(Ln(),1),pt=Tr(Ln(),1),Sa=Object.defineProperty,oT=Object.defineProperties,aT=Object.getOwnPropertyDescriptors,vi=Object.getOwnPropertySymbols,ff=Object.prototype.hasOwnProperty,df=Object.prototype.propertyIsEnumerable,Ic=(t,e,n)=>e in t?Sa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,x=(t,e)=>{for(var n in e||(e={}))ff.call(e,n)&&Ic(t,n,e[n]);if(vi)for(var n of vi(e))df.call(e,n)&&Ic(t,n,e[n]);return t},H=(t,e)=>oT(t,aT(e)),p=(t,e)=>Sa(t,"name",{value:e,configurable:!0}),pf=(t,e)=>{var n={};for(var r in t)ff.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&vi)for(var r of vi(t))e.indexOf(r)<0&&df.call(t,r)&&(n[r]=t[r]);return n},gf=(t,e)=>{for(var n in e)Sa(t,n,{get:e[n],enumerable:!0})},re={};gf(re,{BRAND:()=>mx,DIRTY:()=>Vn,EMPTY_PATH:()=>gx,INVALID:()=>de,NEVER:()=>OB,OK:()=>ct,ParseInputLazyPath:()=>Et,ParseStatus:()=>gt,Schema:()=>me,ZodAny:()=>Pi,ZodArray:()=>Nr,ZodBigInt:()=>Ua,ZodBoolean:()=>ja,ZodBranded:()=>$a,ZodCatch:()=>Za,ZodDate:()=>La,ZodDefault:()=>co,ZodDiscriminatedUnion:()=>ug,ZodEffects:()=>wn,ZodEnum:()=>ir,ZodError:()=>$t,ZodFirstPartyTypeKind:()=>Vp,ZodFunction:()=>fg,ZodIntersection:()=>Ka,ZodIssueCode:()=>G,ZodLazy:()=>Wa,ZodLiteral:()=>qa,ZodMap:()=>gg,ZodNaN:()=>mg,ZodNativeEnum:()=>za,ZodNever:()=>bn,ZodNull:()=>Ga,ZodNullable:()=>Yn,ZodNumber:()=>Va,ZodObject:()=>Xn,ZodOptional:()=>nn,ZodParsedType:()=>ne,ZodPipeline:()=>Ja,ZodPromise:()=>po,ZodReadonly:()=>go,ZodRecord:()=>xg,ZodRef:()=>Pg,ZodSchema:()=>me,ZodSet:()=>Eg,ZodString:()=>ft,ZodSymbol:()=>Ug,ZodTransformer:()=>wn,ZodTuple:()=>er,ZodType:()=>me,ZodUndefined:()=>Ya,ZodUnion:()=>Xa,ZodUnknown:()=>Ir,ZodVoid:()=>Lg,addIssueToContext:()=>te,agent:()=>Ux,aimodel:()=>Fx,any:()=>eB,array:()=>iB,bigint:()=>Vx,boolean:()=>my,coerce:()=>RB,conversation:()=>Dx,createZodEnum:()=>fo,cuid2Regex:()=>kg,cuidRegex:()=>Sg,custom:()=>sg,datasource:()=>Kx,date:()=>Jx,datetimeRegex:()=>Dg,default:()=>BB,discriminatedUnion:()=>lB,effect:()=>cf,emailRegex:()=>Cg,enum:()=>TB,errorUtil:()=>se,event:()=>jx,fromJsonSchema:()=>AB,fromObject:()=>CB,function:()=>mB,getErrorMap:()=>Mr,getParsedType:()=>tn,instanceof:()=>zx,intent:()=>Lx,intersection:()=>uB,ipv4Regex:()=>Og,ipv6Regex:()=>Mg,isAborted:()=>ya,isAsync:()=>xi,isDirty:()=>ma,isEmojiRegex:()=>hx,isValid:()=>Dr,jsonSchemaToZui:()=>yo,knowledgebase:()=>Wx,late:()=>qx,lazy:()=>hB,literal:()=>vB,makeIssue:()=>wi,map:()=>gB,message:()=>Hx,nan:()=>Gx,nativeEnum:()=>_B,never:()=>nB,null:()=>Qx,nullable:()=>xB,number:()=>yy,object:()=>oB,objectToZui:()=>Hr,objectUtil:()=>ga,oboolean:()=>IB,onumber:()=>kB,optional:()=>wB,ostring:()=>SB,pipeline:()=>EB,preprocess:()=>PB,processCreateParams:()=>ye,promise:()=>bB,quotelessJson:()=>px,readonly:()=>pB,record:()=>fB,ref:()=>dB,set:()=>yB,setErrorMap:()=>Xp,strictObject:()=>aB,string:()=>gy,symbol:()=>Yx,table:()=>$x,tablerow:()=>Zx,transformer:()=>cf,tuple:()=>cB,ulidRegex:()=>Ig,undefined:()=>Xx,union:()=>sB,unknown:()=>tB,user:()=>Nx,util:()=>be,uuidRegex:()=>Ag,variable:()=>Mx,void:()=>rB,zuiToJsonSchema:()=>ns});var ke="x-zui",yf=(0,ze.createContext)({formData:void 0,formSchema:void 0,setFormData:p(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:p(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:p(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),Ac=p((t,e,n)=>{var r;let o=(r=e[ke])==null?void 0:r[t];if(typeof o>"u")return!1;if(typeof o=="boolean")return o;if(typeof o=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;let i=new Function("return "+o)()(n);switch(typeof i){case"object":case"boolean":return i;default:return!1}}return!1},"parseMaskableField"),mf=p((t,e)=>{let n=(0,ze.useContext)(yf);if(n===void 0)throw new Error("useFormData must be used within a FormDataProvider");let r=(0,ze.useMemo)(()=>vn(n.formData,e),[n.formData,e]),o=(0,ze.useMemo)(()=>{var m;return n.validation.formValid===null?{formValid:null,formErrors:null}:n.validation.formValid===!1?{formValid:!1,formErrors:((m=n.validation.formErrors)==null?void 0:m.filter(v=>Tf(v.path,e)).map(v=>({message:v.message,code:v.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[n.validation.formValid,n.validation.formErrors,e]),s=n.dataTransform?n.dataTransform(r):r,i=(0,ze.useMemo)(()=>Ac("hidden",t,s),[t,s]),a=(0,ze.useMemo)(()=>Ac("disabled",t,s),[t,s]);(0,ze.useEffect)(()=>{n.setHiddenState(m=>Fn(m,e,i||{})),n.setDisabledState(m=>Fn(m,e,a||{}))},[JSON.stringify({fieldSchema:t,data:r})]);let{disabled:l,hidden:c}=(0,ze.useMemo)(()=>{let m=i===!0||vn(n.hiddenState,e),v=a===!0||vn(n.disabledState,e);return{hidden:m===!0,disabled:v===!0}},[n.hiddenState,n.disabledState,i,a,e]),d=(0,ze.useCallback)((m,v)=>{n.setFormData(B=>Fn(B,m,v))},[n.setFormData]),y=(0,ze.useCallback)((m,v=void 0)=>{let B=Gn(t.items);n.setFormData(P=>{let T=vn(P,m)||[];return v===void 0&&(v=B),Fn(P,m,Array.isArray(T)?[...T,v]:[v])})},[n.setFormData]),g=(0,ze.useCallback)((m,v)=>{n.setFormData(B=>{let P=vn(B,m)||[];return Array.isArray(P)?(P.splice(v,1),Fn(B,m,P)):B})},[n.setFormData]);return x(H(x({},n),{data:r,disabled:l,hidden:c,handlePropertyChange:d,addArrayItem:y,removeArrayItem:g}),o)},"useFormData");function Fn(t,e,n){if(e.length===0)return n;let r=e.length;return e.reduce((o,s,i)=>(i===r-1?o[s]=n:o[s]||(o[s]=isNaN(Number(s))?{}:[]),o[s]),t??{}),x({},t)}p(Fn,"setObjectPath");var Gn=p((t,e)=>{var n,r,o,s;if(Array.isArray(t))return Gn(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((n=t.anyOf)!=null&&n.length)return Gn(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([a,l])=>{var c;i[a]=Gn(l,!((c=t.required)!=null&&c.includes(a))||hf(l)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[Gn(t.items)]:[];if(t.type==="string")return(r=t.enum)!=null&&r.length?t.enum[0]:"";if(t.type==="number")return(o=t.enum)!=null&&o.length?t.enum[0]:0;if(t.type==="boolean")return(s=t.enum)!=null&&s.length?t.enum[0]:!1}},"getDefaultValues"),sT=p(({children:t,setFormData:e,formData:n,formSchema:r,disableValidation:o,onValidation:s,dataTransform:i})=>{let[a,l]=(0,ze.useState)({}),[c,d]=(0,ze.useState)({}),y=i?i(n):n,g=(0,ze.useMemo)(()=>{if(o)return{formValid:null,formErrors:null};if(!r)return{formValid:null,formErrors:null};let m=yo(r).safeParse(y);return m.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:m.error.issues}},[JSON.stringify({transformedData:y})]);return(0,ze.useEffect)(()=>{s&&s(g)},[g]),ze.default.createElement(yf.Provider,{value:{formData:n,setFormData:e,formSchema:r,validation:g,hiddenState:a,setHiddenState:l,disabledState:c,setDisabledState:d,dataTransform:i}},t)},"FormDataProvider");function vn(t,e){return e.reduce((n,r)=>n?n[r]:null,t)}p(vn,"getPathData");function hf(t){var e;return((e=t.anyOf)==null?void 0:e.some(n=>n.not&&Object.keys(n.not).length===0))||!1}p(hf,"isOptional");function Ti(t,e){let n=x({},t);for(let r in e)e.hasOwnProperty(r)&&(typeof e[r]=="object"&&e[r]!==null&&!Array.isArray(e[r])?typeof n[r]=="object"&&n[r]!==null&&!Array.isArray(n[r])?n[r]=Ti(n[r],e[r]):n[r]=Ti({},e[r]):n[r]=e[r]);return n}p(Ti,"deepMerge");var lT=p((t,e)=>{let{handlePropertyChange:n,data:r}=mf(t,e),{discriminator:o,value:s,discriminatedSchema:i}=(0,no.useMemo)(()=>{let a=vf(t.anyOf),l=a?.key?r?.[a.key]:t.default||null,c=uT(a?.key||null,l,t.anyOf);return{discriminator:a,value:l,discriminatedSchema:c}},[t.anyOf,r]);return(0,no.useEffect)(()=>{o?.key&&o?.values.length&&Object.keys(r||{}).length<1&&!t.default&&n(e,{[o.key]:o.values[0]})},[]),{discriminator:o,discriminatorValue:s,discriminatedSchema:i}},"useDiscriminator"),vf=p(t=>{let e=t?.map(n=>n.type!=="object"||!n.properties?null:Object.entries(n.properties).map(([r,o])=>{var s;return o.type==="string"&&((s=o.enum)!=null&&s.length)?{key:r,value:o.enum[0]}:null}).filter(r=>!!r)).flat().reduce((n,r)=>{if(!r)return n;let{key:o,value:s}=r;return n.key===null&&(n.key=o),n.key===o&&n.values.push(s),n},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),uT=p((t,e,n)=>{var r,o;if(!n?.length||!t||!e)return null;for(let s of n){if(s.type!=="object")continue;let i=(r=s.properties)==null?void 0:r[t];if(i?.type==="string"&&((o=i.enum)!=null&&o.length)&&i.enum[0]===e)return H(x({},s),{properties:H(x({},s.properties),{[t]:H(x({},i),{[ke]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),cT=p(t=>{var e;return(e=t.anyOf)!=null&&e.length?vf(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),fT=p((t,e)=>{var n,r,o;let s=cT(e),i=((n=e[ke])==null?void 0:n.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let d=(r=t?.[s])==null?void 0:r.default;return d?{Component:d,type:s,id:"default",params:{}}:null}let a=i[0],l=((o=t?.[s])==null?void 0:o[a])||null;if(!l)return console.warn(`Component ${s}.${a} not found`),null;let c=i[1]||{};return{Component:l,type:s,id:a,params:c}},"resolveComponent");function Tf(t,e){return t.length!==e.length?!1:t.every((n,r)=>n===e[r])}p(Tf,"pathMatches");function aa(t,e){return e||(e=new RegExp("/s|-|_| ","g")),wf(t).split(e).map(_f).map(xf).reduce(bf)}p(aa,"formatTitle");function _f(t){return t.charAt(0).toUpperCase()+t.substring(1)}p(_f,"capitalize");function bf(t,e){return`${t} ${e}`}p(bf,"combine");function wf(t){return t.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}p(wf,"decamelize");function xf(t,e,n){let r=t.toLowerCase(),o=t.toUpperCase();for(let s of mT)if(s.toLowerCase()===r)return s;return dT.includes(o)?o:e===0||e===n.length-1||t.length>=4?t:yT.includes(r)||gT.includes(r)||pT.includes(r)?r:t}p(xf,"handleSpecialWords");var dT=["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"],pT=["a","an","the"],gT=["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"],yT=["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"],mT=["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 Bf(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:jt(t)}p(Bf,"primitiveToTypscriptLiteralType");function jt(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${jt(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}p(jt,"primitiveToTypescriptValue");function Pf(t){return typeof t>"u"?"undefined":JSON.stringify(t)}p(Pf,"unknownToTypescriptValue");var Cc=p(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:jt(t),"toPropertyKey"),hT=p(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),Ef=p(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(hT).filter(r=>!!r).join("")},"toTypeArgumentName"),pe=p(t=>{let e=(t??"").split(`
8
+ `+o.split(`
9
+ `).map(function(f){return" "+f}).join(`
10
+ `)):o=t.stylize("[Circular]","special")),Nn(i)){if(s&&a.match(/^\d+$/))return o;(i=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=t.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=t.stylize(i,"string"))}return i+": "+o}function Em(t){return Array.isArray(t)}function ps(t){return typeof t=="boolean"}function $a(t){return t===null}function Sm(t){return typeof t=="number"}function Da(t){return typeof t=="string"}function Nn(t){return t===void 0}function Vr(t){return lr(t)&&gs(t)==="[object RegExp]"}function lr(t){return typeof t=="object"&&t!==null}function Ha(t){return lr(t)&&gs(t)==="[object Date]"}function Jr(t){return lr(t)&&(gs(t)==="[object Error]"||t instanceof Error)}function Ca(t){return typeof t=="function"}function gs(t){return Object.prototype.toString.call(t)}function ls(t){return t<10?"0"+t.toString(10):t.toString(10)}function iE(){var t=new Date,e=[ls(t.getHours()),ls(t.getMinutes()),ls(t.getSeconds())].join(":");return[t.getDate(),rE[t.getMonth()],e].join(" ")}function km(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function aE(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}var om,qt,Gt,sr,Qe,Mn,Vt,or,Aa,je,NB,fs,Ua,um,DB,HB,UB,$B,ZB,cm,fm,Vy,jB,KB,LB,dm,Ee,FB,WB,zB,pm,ds,xt,_t,qB,We,VB,JB,XB,Gr,L,Nt,am,eE,ka,Bm,Ia,rE,Rn,yC,Za=ot(()=>{O();M();R();sr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qe=om={};(function(){try{qt=typeof setTimeout=="function"?setTimeout:us}catch{qt=us}try{Gt=typeof clearTimeout=="function"?clearTimeout:cs}catch{Gt=cs}})();Vt=[],or=!1,Aa=-1;Qe.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Vt.push(new Gy(t,e)),Vt.length!==1||or||sm(lm)},Gy.prototype.run=function(){(this||sr).fun.apply(null,(this||sr).array)},Qe.title="browser",Qe.browser=!0,Qe.env={},Qe.argv=[],Qe.version="",Qe.versions={},Qe.on=zt,Qe.addListener=zt,Qe.once=zt,Qe.off=zt,Qe.removeListener=zt,Qe.removeAllListeners=zt,Qe.emit=zt,Qe.prependListener=zt,Qe.prependOnceListener=zt,Qe.listeners=function(t){return[]},Qe.binding=function(t){throw new Error("process.binding is not supported")},Qe.cwd=function(){return"/"},Qe.chdir=function(t){throw new Error("process.chdir is not supported")},Qe.umask=function(){return 0};je=om;je.addListener;je.argv;je.binding;je.browser;je.chdir;je.cwd;je.emit;je.env;je.listeners;je.nextTick;je.off;je.on;je.once;je.prependListener;je.prependOnceListener;je.removeAllListeners;je.removeListener;je.title;je.umask;je.version;je.versions;NB=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",fs=Object.prototype.toString,Ua=function(t){return!(NB&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&fs.call(t)==="[object Arguments]"},um=function(t){return!!Ua(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&fs.call(t)!=="[object Array]"&&fs.call(t.callee)==="[object Function]"},DB=function(){return Ua(arguments)}();Ua.isLegacyArguments=um;HB=DB?Ua:um,UB=Object.prototype.toString,$B=Function.prototype.toString,ZB=/^\s*(?:function)?\*/,cm=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",fm=Object.getPrototypeOf,Vy=function(){if(!cm)return!1;try{return Function("return function*() {}")()}catch{}}(),jB=Vy?fm(Vy):{},KB=function(t){return typeof t=="function"&&(!!ZB.test($B.call(t))||(cm?fm(t)===jB:UB.call(t)==="[object GeneratorFunction]"))},LB=typeof Object.create=="function"?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},dm=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Ee={},FB=dm,WB=HB,zB=KB;pm=typeof BigInt<"u",ds=typeof Symbol<"u",xt=ds&&Symbol.toStringTag!==void 0,_t=typeof Uint8Array<"u",qB=typeof ArrayBuffer<"u";if(_t&&xt)var GB=Object.getPrototypeOf(Uint8Array.prototype),Et=Dn(Object.getOwnPropertyDescriptor(GB,Symbol.toStringTag).get);We=Dn(Object.prototype.toString),VB=Dn(Number.prototype.valueOf),JB=Dn(String.prototype.valueOf),XB=Dn(Boolean.prototype.valueOf);if(pm)var YB=Dn(BigInt.prototype.valueOf);if(ds)var QB=Dn(Symbol.prototype.valueOf);Ee.isArgumentsObject=WB,Ee.isGeneratorFunction=zB,Ee.isPromise=function(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},Ee.isArrayBufferView=function(t){return qB&&ArrayBuffer.isView?ArrayBuffer.isView(t):Jy(t)||Yy(t)},Ee.isTypedArray=Jy,Ee.isUint8Array=gm,Ee.isUint8ClampedArray=ym,Ee.isUint16Array=mm,Ee.isUint32Array=hm,Ee.isInt8Array=vm,Ee.isInt16Array=Tm,Ee.isInt32Array=_m,Ee.isFloat32Array=bm,Ee.isFloat64Array=wm,Ee.isBigInt64Array=xm,Ee.isBigUint64Array=Pm,Ba.working=typeof Map<"u"&&Ba(new Map),Ee.isMap=function(t){return typeof Map<"u"&&(Ba.working?Ba(t):t instanceof Map)},Ea.working=typeof Set<"u"&&Ea(new Set),Ee.isSet=function(t){return typeof Set<"u"&&(Ea.working?Ea(t):t instanceof Set)},Sa.working=typeof WeakMap<"u"&&Sa(new WeakMap),Ee.isWeakMap=function(t){return typeof WeakMap<"u"&&(Sa.working?Sa(t):t instanceof WeakMap)},as.working=typeof WeakSet<"u"&&as(new WeakSet),Ee.isWeakSet=function(t){return as(t)},Oa.working=typeof ArrayBuffer<"u"&&Oa(new ArrayBuffer),Ee.isArrayBuffer=Xy,Ra.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ra(new DataView(new ArrayBuffer(1),0,1)),Ee.isDataView=Yy,Ma.working=typeof SharedArrayBuffer<"u"&&Ma(new SharedArrayBuffer),Ee.isSharedArrayBuffer=Qy,Ee.isAsyncFunction=function(t){return We(t)==="[object AsyncFunction]"},Ee.isMapIterator=function(t){return We(t)==="[object Map Iterator]"},Ee.isSetIterator=function(t){return We(t)==="[object Set Iterator]"},Ee.isGeneratorObject=function(t){return We(t)==="[object Generator]"},Ee.isWebAssemblyCompiledModule=function(t){return We(t)==="[object WebAssembly.Module]"},Ee.isNumberObject=em,Ee.isStringObject=tm,Ee.isBooleanObject=nm,Ee.isBigIntObject=rm,Ee.isSymbolObject=im,Ee.isBoxedPrimitive=function(t){return em(t)||tm(t)||nm(t)||rm(t)||im(t)},Ee.isAnyArrayBuffer=function(t){return _t&&(Xy(t)||Qy(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(Ee,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})});Gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,L={},Nt=je,am=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++)n[e[r]]=Object.getOwnPropertyDescriptor(t,e[r]);return n},eE=/%[sdj%]/g;L.format=function(t){if(!Da(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(ln(arguments[n]));return e.join(" ")}n=1;for(var r=arguments,a=r.length,s=String(t).replace(eE,function(o){if(o==="%%")return"%";if(n>=a)return o;switch(o){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return o}}),i=r[n];n<a;i=r[++n])$a(i)||!lr(i)?s+=" "+i:s+=" "+ln(i);return s},L.deprecate=function(t,e){if(Nt!==void 0&&Nt.noDeprecation===!0)return t;if(Nt===void 0)return function(){return L.deprecate(t,e).apply(this||Gr,arguments)};var n=!1;return function(){if(!n){if(Nt.throwDeprecation)throw new Error(e);Nt.traceDeprecation?console.trace(e):console.error(e),n=!0}return t.apply(this||Gr,arguments)}};ka={},Bm=/^$/;Nt.env.NODE_DEBUG&&(Ia=Nt.env.NODE_DEBUG,Ia=Ia.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Bm=new RegExp("^"+Ia+"$","i"));L.debuglog=function(t){if(t=t.toUpperCase(),!ka[t])if(Bm.test(t)){var e=Nt.pid;ka[t]=function(){var n=L.format.apply(L,arguments);console.error("%s %d: %s",t,e,n)}}else ka[t]=function(){};return ka[t]},L.inspect=ln,ln.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ln.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},L.types=Ee,L.isArray=Em,L.isBoolean=ps,L.isNull=$a,L.isNullOrUndefined=function(t){return t==null},L.isNumber=Sm,L.isString=Da,L.isSymbol=function(t){return typeof t=="symbol"},L.isUndefined=Nn,L.isRegExp=Vr,L.types.isRegExp=Vr,L.isObject=lr,L.isDate=Ha,L.types.isDate=Ha,L.isError=Jr,L.types.isNativeError=Jr,L.isFunction=Ca,L.isPrimitive=function(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||t===void 0},L.isBuffer=dm;rE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];L.log=function(){console.log("%s - %s",iE(),L.format.apply(L,arguments))},L.inherits=LB,L._extend=function(t,e){if(!e||!lr(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};Rn=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;L.promisify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');if(Rn&&t[Rn]){var e;if(typeof(e=t[Rn])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Rn,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var n,r,a=new Promise(function(o,l){n=o,r=l}),s=[],i=0;i<arguments.length;i++)s.push(arguments[i]);s.push(function(o,l){o?r(o):n(l)});try{t.apply(this||Gr,s)}catch(o){r(o)}return a}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Rn&&Object.defineProperty(e,Rn,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,am(t))},L.promisify.custom=Rn,L.callbackify=function(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var a=n.pop();if(typeof a!="function")throw new TypeError("The last argument must be of type Function");var s=this||Gr,i=function(){return a.apply(s,arguments)};t.apply(this||Gr,n).then(function(o){Nt.nextTick(i.bind(null,null,o))},function(o){Nt.nextTick(aE.bind(null,o,i))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,am(t)),e};L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;L.promisify;L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;yC=L.promisify;L.types});var bC,Im=ot(()=>{O();M();R();Za();L._extend;L.callbackify;L.debuglog;L.deprecate;L.format;L.inherits;L.inspect;L.isArray;L.isBoolean;L.isBuffer;L.isDate;L.isError;L.isFunction;L.isNull;L.isNullOrUndefined;L.isNumber;L.isObject;L.isPrimitive;L.isRegExp;L.isString;L.isSymbol;L.isUndefined;L.log;bC=L.promisify;L.types;L.TextEncoder=globalThis.TextEncoder;L.TextDecoder=globalThis.TextDecoder});function vs(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function oE(){!ur||!Hn||(ur=!1,Hn.length?Jt=Hn.concat(Jt):ja=-1,Jt.length&&Am())}function Am(){if(!ur){var t=setTimeout(oE,0);ur=!0;for(var e=Jt.length;e;){for(Hn=Jt,Jt=[];++ja<e;)Hn&&Hn[ja].run();ja=-1,e=Jt.length}Hn=null,ur=!1,clearTimeout(t)}}function sE(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];Jt.push(new Cm(t,e)),Jt.length===1&&!ur&&setTimeout(Am,0)}function Cm(t,e){this.fun=t,this.array=e}function ct(){}function PE(t){vs("_linkedBinding")}function kE(t){vs("dlopen")}function IE(){return[]}function AE(){return[]}function $E(t,e){if(!t)throw new Error(e||"assertion error")}function LE(){return!1}function oS(){return un.now()/1e3}function hs(t){var e=Math.floor((Date.now()-un.now())*.001),n=un.now()*.001,r=Math.floor(n)+e,a=Math.floor(n%1*1e9);return t&&(r=r-t[0],a=a-t[1],a<0&&(r--,a+=ms)),[r,a]}function cn(){return At}function vS(t){return[]}var Jt,ur,Hn,ja,lE,uE,cE,fE,dE,pE,gE,yE,mE,hE,vE,TE,_E,bE,wE,xE,BE,EE,SE,CE,OE,Ts,RE,ME,NE,DE,HE,UE,ZE,jE,KE,FE,WE,zE,qE,GE,VE,JE,XE,YE,QE,eS,tS,nS,rS,iS,aS,un,ys,ms,sS,lS,uS,cS,fS,dS,pS,gS,yS,mS,hS,At,_s=ot(()=>{O();M();R();Jt=[],ur=!1,ja=-1;Cm.prototype.run=function(){this.fun.apply(null,this.array)};lE="browser",uE="x64",cE="browser",fE={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},dE=["/usr/bin/node"],pE=[],gE="v16.8.0",yE={},mE=function(t,e){console.warn((e?e+": ":"")+t)},hE=function(t){vs("binding")},vE=function(t){return 0},TE=function(){return"/"},_E=function(t){},bE={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};wE=ct,xE=[];BE={},EE=!1,SE={};CE=ct,OE=ct,Ts=function(){return{}},RE=Ts,ME=Ts,NE=ct,DE=ct,HE=ct,UE={};ZE={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},jE=ct,KE=ct;FE=ct,WE=ct,zE=ct,qE=ct,GE=ct,VE=void 0,JE=void 0,XE=void 0,YE=ct,QE=2,eS=1,tS="/bin/usr/node",nS=9229,rS="node",iS=[],aS=ct,un={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};un.now===void 0&&(ys=Date.now(),un.timing&&un.timing.navigationStart&&(ys=un.timing.navigationStart),un.now=()=>Date.now()-ys);ms=1e9;hs.bigint=function(t){var e=hs(t);return typeof BigInt>"u"?e[0]*ms+e[1]:BigInt(e[0]*ms)+BigInt(e[1])};sS=10,lS={},uS=0;cS=cn,fS=cn,dS=cn,pS=cn,gS=cn,yS=ct,mS=cn,hS=cn;At={version:gE,versions:yE,arch:uE,platform:cE,release:bE,_rawDebug:wE,moduleLoadList:xE,binding:hE,_linkedBinding:PE,_events:lS,_eventsCount:uS,_maxListeners:sS,on:cn,addListener:cS,once:fS,off:dS,removeListener:pS,removeAllListeners:gS,emit:yS,prependListener:mS,prependOnceListener:hS,listeners:vS,domain:BE,_exiting:EE,config:SE,dlopen:kE,uptime:oS,_getActiveRequests:IE,_getActiveHandles:AE,reallyExit:CE,_kill:OE,cpuUsage:Ts,resourceUsage:RE,memoryUsage:ME,kill:NE,exit:DE,openStdin:HE,allowedNodeEnvironmentFlags:UE,assert:$E,features:ZE,_fatalExceptions:jE,setUncaughtExceptionCaptureCallback:KE,hasUncaughtExceptionCaptureCallback:LE,emitWarning:mE,nextTick:sE,_tickCallback:FE,_debugProcess:WE,_debugEnd:zE,_startProfilerIdleNotifier:qE,_stopProfilerIdleNotifier:GE,stdout:VE,stdin:XE,stderr:JE,abort:YE,umask:vE,chdir:_E,cwd:TE,env:fE,title:lE,argv:dE,execArgv:pE,pid:QE,ppid:eS,execPath:tS,debugPort:nS,hrtime:hs,argv0:rS,_preload_modules:iS,setSourceMapsEnabled:aS}});function Rm(){if(Om)return bs;Om=!0,bs=t;function t(n,r){if(e("noDeprecation"))return n;var a=!1;function s(){if(!a){if(e("throwDeprecation"))throw new Error(r);e("traceDeprecation")?console.trace(r):console.warn(r),a=!0}return n.apply(this||ws,arguments)}return s}function e(n){try{if(!ws.localStorage)return!1}catch{return!1}var r=ws.localStorage[n];return r==null?!1:String(r).toLowerCase()==="true"}return bs}var bs,Om,ws,Mm=ot(()=>{O();M();R();bs={},Om=!1,ws=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global});function TS(){if(Nm)return Yr;Nm=!0;var t=Rt(),e=t.Buffer;function n(a,s){for(var i in a)s[i]=a[i]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Yr=t:(n(t,Yr),Yr.Buffer=r);function r(a,s,i){return e(a,s,i)}return r.prototype=Object.create(e.prototype),n(e,r),r.from=function(a,s,i){if(typeof a=="number")throw new TypeError("Argument must not be a number");return e(a,s,i)},r.alloc=function(a,s,i){if(typeof a!="number")throw new TypeError("Argument must be a number");var o=e(a);return s!==void 0?typeof i=="string"?o.fill(s,i):o.fill(s):o.fill(0),o},r.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return e(a)},r.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(a)},Yr}function _S(){if(Dm)return xs;Dm=!0;var t=TS().Buffer,e=t.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(v){if(!v)return"utf8";for(var S;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(S)return;v=(""+v).toLowerCase(),S=!0}}function r(v){var S=n(v);if(typeof S!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return S||v}xs.StringDecoder=a;function a(v){this.encoding=r(v);var S;switch(this.encoding){case"utf16le":this.text=y,this.end=g,S=4;break;case"utf8":this.fillLast=l,S=4;break;case"base64":this.text=h,this.end=w,S=3;break;default:this.write=P,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(S)}a.prototype.write=function(v){if(v.length===0)return"";var S,E;if(this.lastNeed){if(S=this.fillLast(v),S===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<v.length?S?S+this.text(v,E):this.text(v,E):S||""},a.prototype.end=p,a.prototype.text=f,a.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function s(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function i(v,S,E){var H=S.length-1;if(H<E)return 0;var K=s(S[H]);return K>=0?(K>0&&(v.lastNeed=K-1),K):--H<E||K===-2?0:(K=s(S[H]),K>=0?(K>0&&(v.lastNeed=K-2),K):--H<E||K===-2?0:(K=s(S[H]),K>=0?(K>0&&(K===2?K=0:v.lastNeed=K-3),K):0))}function o(v,S,E){if((S[0]&192)!==128)return v.lastNeed=0,"\uFFFD";if(v.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return v.lastNeed=1,"\uFFFD";if(v.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return v.lastNeed=2,"\uFFFD"}}function l(v){var S=this.lastTotal-this.lastNeed,E=o(this,v);if(E!==void 0)return E;if(this.lastNeed<=v.length)return v.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,S,0,v.length),this.lastNeed-=v.length}function f(v,S){var E=i(this,v,S);if(!this.lastNeed)return v.toString("utf8",S);this.lastTotal=E;var H=v.length-(E-this.lastNeed);return v.copy(this.lastChar,0,H),v.toString("utf8",S,H)}function p(v){var S=v&&v.length?this.write(v):"";return this.lastNeed?S+"\uFFFD":S}function y(v,S){if((v.length-S)%2===0){var E=v.toString("utf16le",S);if(E){var H=E.charCodeAt(E.length-1);if(H>=55296&&H<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",S,v.length-1)}function g(v){var S=v&&v.length?this.write(v):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,E)}return S}function h(v,S){var E=(v.length-S)%3;return E===0?v.toString("base64",S):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",S,v.length-E))}function w(v){var S=v&&v.length?this.write(v):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function P(v){return v.toString(this.encoding)}function B(v){return v&&v.length?this.write(v):""}return xs}var Yr,Nm,xs,Dm,Qr,NC,Hm=ot(()=>{O();M();R();fi();Yr={},Nm=!1;xs={},Dm=!1;Qr=_S();Qr.StringDecoder;NC=Qr.StringDecoder});function bS(){if(Um)return Ps;Um=!0;var t=Ps={},e,n;function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?n=clearTimeout:n=a}catch{n=a}})();function s(P){if(e===setTimeout)return setTimeout(P,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(P,0);try{return e(P,0)}catch{try{return e.call(null,P,0)}catch{return e.call(this||cr,P,0)}}}function i(P){if(n===clearTimeout)return clearTimeout(P);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(P);try{return n(P)}catch{try{return n.call(null,P)}catch{return n.call(this||cr,P)}}}var o=[],l=!1,f,p=-1;function y(){!l||!f||(l=!1,f.length?o=f.concat(o):p=-1,o.length&&g())}function g(){if(!l){var P=s(y);l=!0;for(var B=o.length;B;){for(f=o,o=[];++p<B;)f&&f[p].run();p=-1,B=o.length}f=null,l=!1,i(P)}}t.nextTick=function(P){var B=new Array(arguments.length-1);if(arguments.length>1)for(var v=1;v<arguments.length;v++)B[v-1]=arguments[v];o.push(new h(P,B)),o.length===1&&!l&&s(g)};function h(P,B){(this||cr).fun=P,(this||cr).array=B}h.prototype.run=function(){(this||cr).fun.apply(null,(this||cr).array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={};function w(){}return t.on=w,t.addListener=w,t.once=w,t.off=w,t.removeListener=w,t.removeAllListeners=w,t.emit=w,t.prependListener=w,t.prependOnceListener=w,t.listeners=function(P){return[]},t.binding=function(P){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(P){throw new Error("process.chdir is not supported")},t.umask=function(){return 0},Ps}var Ps,Um,cr,Ke,Bs=ot(()=>{O();M();R();Ps={},Um=!1,cr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ke=bS();Ke.platform="browser";Ke.addListener;Ke.argv;Ke.binding;Ke.browser;Ke.chdir;Ke.cwd;Ke.emit;Ke.env;Ke.listeners;Ke.nextTick;Ke.off;Ke.on;Ke.once;Ke.prependListener;Ke.prependOnceListener;Ke.removeAllListeners;Ke.removeListener;Ke.title;Ke.umask;Ke.version;Ke.versions});function wS(){if($m)return Es;$m=!0;var t=Ke;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function n(s,i){for(var o="",l=0,f=-1,p=0,y,g=0;g<=s.length;++g){if(g<s.length)y=s.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(f===g-1||p===1))if(f!==g-1&&p===2){if(o.length<2||l!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var h=o.lastIndexOf("/");if(h!==o.length-1){h===-1?(o="",l=0):(o=o.slice(0,h),l=o.length-1-o.lastIndexOf("/")),f=g,p=0;continue}}else if(o.length===2||o.length===1){o="",l=0,f=g,p=0;continue}}i&&(o.length>0?o+="/..":o="..",l=2)}else o.length>0?o+="/"+s.slice(f+1,g):o=s.slice(f+1,g),l=g-f-1;f=g,p=0}else y===46&&p!==-1?++p:p=-1}return o}function r(s,i){var o=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return o?o===i.root?o+l:o+s+l:l}var a={resolve:function(){for(var i="",o=!1,l,f=arguments.length-1;f>=-1&&!o;f--){var p;f>=0?p=arguments[f]:(l===void 0&&(l=t.cwd()),p=l),e(p),p.length!==0&&(i=p+"/"+i,o=p.charCodeAt(0)===47)}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var o=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!o),i.length===0&&!o&&(i="."),i.length>0&&l&&(i+="/"),o?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,o=0;o<arguments.length;++o){var l=arguments[o];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":a.normalize(i)},relative:function(i,o){if(e(i),e(o),i===o||(i=a.resolve(i),o=a.resolve(o),i===o))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,p=f-l,y=1;y<o.length&&o.charCodeAt(y)===47;++y);for(var g=o.length,h=g-y,w=p<h?p:h,P=-1,B=0;B<=w;++B){if(B===w){if(h>w){if(o.charCodeAt(y+B)===47)return o.slice(y+B+1);if(B===0)return o.slice(y+B)}else p>w&&(i.charCodeAt(l+B)===47?P=B:B===0&&(P=0));break}var v=i.charCodeAt(l+B),S=o.charCodeAt(y+B);if(v!==S)break;v===47&&(P=B)}var E="";for(B=l+P+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+o.slice(y+P):(y+=P,o.charCodeAt(y)===47&&++y,o.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var o=i.charCodeAt(0),l=o===47,f=-1,p=!0,y=i.length-1;y>=1;--y)if(o=i.charCodeAt(y),o===47){if(!p){f=y;break}}else p=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,p=!0,y;if(o!==void 0&&o.length>0&&o.length<=i.length){if(o.length===i.length&&o===i)return"";var g=o.length-1,h=-1;for(y=i.length-1;y>=0;--y){var w=i.charCodeAt(y);if(w===47){if(!p){l=y+1;break}}else h===-1&&(p=!1,h=y+1),g>=0&&(w===o.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!p){l=y+1;break}}else f===-1&&(p=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var o=-1,l=0,f=-1,p=!0,y=0,g=i.length-1;g>=0;--g){var h=i.charCodeAt(g);if(h===47){if(!p){l=g+1;break}continue}f===-1&&(p=!1,f=g+1),h===46?o===-1?o=g:y!==1&&(y=1):o!==-1&&(y=-1)}return o===-1||f===-1||y===0||y===1&&o===f-1&&o===l+1?"":i.slice(o,f)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var o={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return o;var l=i.charCodeAt(0),f=l===47,p;f?(o.root="/",p=1):p=0;for(var y=-1,g=0,h=-1,w=!0,P=i.length-1,B=0;P>=p;--P){if(l=i.charCodeAt(P),l===47){if(!w){g=P+1;break}continue}h===-1&&(w=!1,h=P+1),l===46?y===-1?y=P:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===g+1?h!==-1&&(g===0&&f?o.base=o.name=i.slice(1,h):o.base=o.name=i.slice(g,h)):(g===0&&f?(o.name=i.slice(1,y),o.base=i.slice(1,h)):(o.name=i.slice(g,y),o.base=i.slice(g,h)),o.ext=i.slice(y,h)),g>0?o.dir=i.slice(0,g-1):f&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,Es=a,Es}function Un(t){throw new RangeError(ES[t])}function jm(t,e){let n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]);let a=function(s,i){let o=[],l=s.length;for(;l--;)o[l]=i(s[l]);return o}((t=t.replace(BS,".")).split("."),e).join(".");return r+a}function Jm(t){let e=[],n=0,r=t.length;for(;n<r;){let a=t.charCodeAt(n++);if(a>=55296&&a<=56319&&n<r){let s=t.charCodeAt(n++);(64512&s)==56320?e.push(((1023&a)<<10)+(1023&s)+65536):(e.push(a),n--)}else e.push(a)}return e}function kS(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function St(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function ti(t,e,n){if(t&&Dt.isObject(t)&&t instanceof St)return t;var r=new St;return r.parse(t,e,n),r}function US(){if(Gm)return As;Gm=!0;var t=je;function e(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function n(s,i){for(var o="",l=0,f=-1,p=0,y,g=0;g<=s.length;++g){if(g<s.length)y=s.charCodeAt(g);else{if(y===47)break;y=47}if(y===47){if(!(f===g-1||p===1))if(f!==g-1&&p===2){if(o.length<2||l!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var h=o.lastIndexOf("/");if(h!==o.length-1){h===-1?(o="",l=0):(o=o.slice(0,h),l=o.length-1-o.lastIndexOf("/")),f=g,p=0;continue}}else if(o.length===2||o.length===1){o="",l=0,f=g,p=0;continue}}i&&(o.length>0?o+="/..":o="..",l=2)}else o.length>0?o+="/"+s.slice(f+1,g):o=s.slice(f+1,g),l=g-f-1;f=g,p=0}else y===46&&p!==-1?++p:p=-1}return o}function r(s,i){var o=i.dir||i.root,l=i.base||(i.name||"")+(i.ext||"");return o?o===i.root?o+l:o+s+l:l}var a={resolve:function(){for(var i="",o=!1,l,f=arguments.length-1;f>=-1&&!o;f--){var p;f>=0?p=arguments[f]:(l===void 0&&(l=t.cwd()),p=l),e(p),p.length!==0&&(i=p+"/"+i,o=p.charCodeAt(0)===47)}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(i){if(e(i),i.length===0)return".";var o=i.charCodeAt(0)===47,l=i.charCodeAt(i.length-1)===47;return i=n(i,!o),i.length===0&&!o&&(i="."),i.length>0&&l&&(i+="/"),o?"/"+i:i},isAbsolute:function(i){return e(i),i.length>0&&i.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var i,o=0;o<arguments.length;++o){var l=arguments[o];e(l),l.length>0&&(i===void 0?i=l:i+="/"+l)}return i===void 0?".":a.normalize(i)},relative:function(i,o){if(e(i),e(o),i===o||(i=a.resolve(i),o=a.resolve(o),i===o))return"";for(var l=1;l<i.length&&i.charCodeAt(l)===47;++l);for(var f=i.length,p=f-l,y=1;y<o.length&&o.charCodeAt(y)===47;++y);for(var g=o.length,h=g-y,w=p<h?p:h,P=-1,B=0;B<=w;++B){if(B===w){if(h>w){if(o.charCodeAt(y+B)===47)return o.slice(y+B+1);if(B===0)return o.slice(y+B)}else p>w&&(i.charCodeAt(l+B)===47?P=B:B===0&&(P=0));break}var v=i.charCodeAt(l+B),S=o.charCodeAt(y+B);if(v!==S)break;v===47&&(P=B)}var E="";for(B=l+P+1;B<=f;++B)(B===f||i.charCodeAt(B)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+o.slice(y+P):(y+=P,o.charCodeAt(y)===47&&++y,o.slice(y))},_makeLong:function(i){return i},dirname:function(i){if(e(i),i.length===0)return".";for(var o=i.charCodeAt(0),l=o===47,f=-1,p=!0,y=i.length-1;y>=1;--y)if(o=i.charCodeAt(y),o===47){if(!p){f=y;break}}else p=!1;return f===-1?l?"/":".":l&&f===1?"//":i.slice(0,f)},basename:function(i,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');e(i);var l=0,f=-1,p=!0,y;if(o!==void 0&&o.length>0&&o.length<=i.length){if(o.length===i.length&&o===i)return"";var g=o.length-1,h=-1;for(y=i.length-1;y>=0;--y){var w=i.charCodeAt(y);if(w===47){if(!p){l=y+1;break}}else h===-1&&(p=!1,h=y+1),g>=0&&(w===o.charCodeAt(g)?--g===-1&&(f=y):(g=-1,f=h))}return l===f?f=h:f===-1&&(f=i.length),i.slice(l,f)}else{for(y=i.length-1;y>=0;--y)if(i.charCodeAt(y)===47){if(!p){l=y+1;break}}else f===-1&&(p=!1,f=y+1);return f===-1?"":i.slice(l,f)}},extname:function(i){e(i);for(var o=-1,l=0,f=-1,p=!0,y=0,g=i.length-1;g>=0;--g){var h=i.charCodeAt(g);if(h===47){if(!p){l=g+1;break}continue}f===-1&&(p=!1,f=g+1),h===46?o===-1?o=g:y!==1&&(y=1):o!==-1&&(y=-1)}return o===-1||f===-1||y===0||y===1&&o===f-1&&o===l+1?"":i.slice(o,f)},format:function(i){if(i===null||typeof i!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof i);return r("/",i)},parse:function(i){e(i);var o={root:"",dir:"",base:"",ext:"",name:""};if(i.length===0)return o;var l=i.charCodeAt(0),f=l===47,p;f?(o.root="/",p=1):p=0;for(var y=-1,g=0,h=-1,w=!0,P=i.length-1,B=0;P>=p;--P){if(l=i.charCodeAt(P),l===47){if(!w){g=P+1;break}continue}h===-1&&(w=!1,h=P+1),l===46?y===-1?y=P:B!==1&&(B=1):y!==-1&&(B=-1)}return y===-1||h===-1||B===0||B===1&&y===h-1&&y===g+1?h!==-1&&(g===0&&f?o.base=o.name=i.slice(1,h):o.base=o.name=i.slice(g,h)):(g===0&&f?(o.name=i.slice(1,y),o.base=i.slice(1,h)):(o.name=i.slice(g,y),o.base=i.slice(g,h)),o.ext=i.slice(y,h)),g>0?o.dir=i.slice(0,g-1):f&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return a.posix=a,As=a,As}function JS(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Os?XS(t):YS(t)}function XS(t){let e=t.hostname,n=t.pathname;for(let r=0;r<n.length;r++)if(n[r]==="%"){let a=n.codePointAt(r+2)||32;if(n[r+1]==="2"&&a===102||n[r+1]==="5"&&a===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(FS,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<KS||r>LS||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function YS(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let n=0;n<e.length;n++)if(e[n]==="%"){let r=e.codePointAt(n+2)||32;if(e[n+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function QS(t){let e=Vm.resolve(t),n=t.charCodeAt(t.length-1);(n===jS||Os&&n===ZS)&&e[e.length-1]!==Vm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(WS,"%25")),!Os&&e.includes("\\")&&(e=e.replace(zS,"%5C")),e.includes(`
11
+ `)&&(e=e.replace(qS,"%0A")),e.includes("\r")&&(e=e.replace(GS,"%0D")),e.includes(" ")&&(e=e.replace(VS,"%09")),r.pathname=e,r}function fk(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Rs?dk(t):pk(t)}function dk(t){let e=t.hostname,n=t.pathname;for(let r=0;r<n.length;r++)if(n[r]==="%"){let a=n.codePointAt(r+2)||32;if(n[r+1]==="2"&&a===102||n[r+1]==="5"&&a===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(n=n.replace(ak,"\\"),n=decodeURIComponent(n),e!=="")return`\\\\${e}${n}`;{let r=n.codePointAt(1)|32,a=n[2];if(r<rk||r>ik||a!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return n.slice(1)}}function pk(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let n=0;n<e.length;n++)if(e[n]==="%"){let r=e.codePointAt(n+2)||32;if(e[n+1]==="2"&&r===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function gk(t){let e=Zm.resolve(t),n=t.charCodeAt(t.length-1);(n===nk||Rs&&n===tk)&&e[e.length-1]!==Zm.sep&&(e+="/");let r=new URL("file://");return e.includes("%")&&(e=e.replace(ok,"%25")),!Rs&&e.includes("\\")&&(e=e.replace(sk,"%5C")),e.includes(`
12
+ `)&&(e=e.replace(lk,"%0A")),e.includes("\r")&&(e=e.replace(uk,"%0D")),e.includes(" ")&&(e=e.replace(ck,"%09")),r.pathname=e,r}var Es,$m,Zm,dr,xS,PS,BS,ES,Ht,Ss,Km,Xm,Lm,Fm,SS,IS,ei,AS,Xt,De,CS,Dt,OS,RS,MS,NS,Cs,Wm,zm,qm,DS,HS,ks,fr,Is,As,Gm,Vm,$S,ZS,jS,KS,LS,Os,FS,WS,zS,qS,GS,VS,ek,tk,nk,rk,ik,Rs,ak,ok,sk,lk,uk,ck,Ym=ot(()=>{O();M();R();Za();Bs();Es={},$m=!1;Zm=wS(),dr=2147483647,xS=/^xn--/,PS=/[^\0-\x7E]/,BS=/[\x2E\u3002\uFF0E\uFF61]/g,ES={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ht=Math.floor,Ss=String.fromCharCode;Km=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Xm=function(t,e,n){let r=0;for(t=n?Ht(t/700):t>>1,t+=Ht(t/e);t>455;r+=36)t=Ht(t/35);return Ht(r+36*t/(t+38))},Lm=function(t){let e=[],n=t.length,r=0,a=128,s=72,i=t.lastIndexOf("-");i<0&&(i=0);for(let l=0;l<i;++l)t.charCodeAt(l)>=128&&Un("not-basic"),e.push(t.charCodeAt(l));for(let l=i>0?i+1:0;l<n;){let f=r;for(let y=1,g=36;;g+=36){l>=n&&Un("invalid-input");let h=(o=t.charCodeAt(l++))-48<10?o-22:o-65<26?o-65:o-97<26?o-97:36;(h>=36||h>Ht((dr-r)/y))&&Un("overflow"),r+=h*y;let w=g<=s?1:g>=s+26?26:g-s;if(h<w)break;let P=36-w;y>Ht(dr/P)&&Un("overflow"),y*=P}let p=e.length+1;s=Xm(r-f,p,f==0),Ht(r/p)>dr-a&&Un("overflow"),a+=Ht(r/p),r%=p,e.splice(r++,0,a)}var o;return String.fromCodePoint(...e)},Fm=function(t){let e=[],n=(t=Jm(t)).length,r=128,a=0,s=72;for(let l of t)l<128&&e.push(Ss(l));let i=e.length,o=i;for(i&&e.push("-");o<n;){let l=dr;for(let p of t)p>=r&&p<l&&(l=p);let f=o+1;l-r>Ht((dr-a)/f)&&Un("overflow"),a+=(l-r)*f,r=l;for(let p of t)if(p<r&&++a>dr&&Un("overflow"),p==r){let y=a;for(let g=36;;g+=36){let h=g<=s?1:g>=s+26?26:g-s;if(y<h)break;let w=y-h,P=36-h;e.push(Ss(Km(h+w%P,0))),y=Ht(w/P)}e.push(Ss(Km(y,0))),s=Xm(a,f,o==i),a=0,++o}++a,++r}return e.join("")},SS={version:"2.1.0",ucs2:{decode:Jm,encode:t=>String.fromCodePoint(...t)},decode:Lm,encode:Fm,toASCII:function(t){return jm(t,function(e){return PS.test(e)?"xn--"+Fm(e):e})},toUnicode:function(t){return jm(t,function(e){return xS.test(e)?Lm(e.slice(4).toLowerCase()):e})}};IS=function(t,e,n,r){e=e||"&",n=n||"=";var a={};if(typeof t!="string"||t.length===0)return a;var s=/\+/g;t=t.split(e);var i=1e3;r&&typeof r.maxKeys=="number"&&(i=r.maxKeys);var o=t.length;i>0&&o>i&&(o=i);for(var l=0;l<o;++l){var f,p,y,g,h=t[l].replace(s,"%20"),w=h.indexOf(n);w>=0?(f=h.substr(0,w),p=h.substr(w+1)):(f=h,p=""),y=decodeURIComponent(f),g=decodeURIComponent(p),kS(a,y)?Array.isArray(a[y])?a[y].push(g):a[y]=[a[y],g]:a[y]=g}return a},ei=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},AS=function(t,e,n,r){return e=e||"&",n=n||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(a){var s=encodeURIComponent(ei(a))+n;return Array.isArray(t[a])?t[a].map(function(i){return s+encodeURIComponent(ei(i))}).join(e):s+encodeURIComponent(ei(t[a]))}).join(e):r?encodeURIComponent(ei(r))+n+encodeURIComponent(ei(t)):""},Xt={};Xt.decode=Xt.parse=IS,Xt.encode=Xt.stringify=AS;Xt.decode;Xt.encode;Xt.parse;Xt.stringify;De={},CS=SS,Dt={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};De.parse=ti,De.resolve=function(t,e){return ti(t,!1,!0).resolve(e)},De.resolveObject=function(t,e){return t?ti(t,!1,!0).resolveObject(e):e},De.format=function(t){return Dt.isString(t)&&(t=ti(t)),t instanceof St?t.format():St.prototype.format.call(t)},De.Url=St;OS=/^([a-z0-9.+-]+:)/i,RS=/:[0-9]*$/,MS=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,NS=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
13
+ `," "]),Cs=["'"].concat(NS),Wm=["%","/","?",";","#"].concat(Cs),zm=["/","?","#"],qm=/^[+a-z0-9A-Z_-]{0,63}$/,DS=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,HS={javascript:!0,"javascript:":!0},ks={javascript:!0,"javascript:":!0},fr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Is=Xt;St.prototype.parse=function(t,e,n){if(!Dt.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var r=t.indexOf("?"),a=r!==-1&&r<t.indexOf("#")?"?":"#",s=t.split(a);s[0]=s[0].replace(/\\/g,"/");var i=t=s.join(a);if(i=i.trim(),!n&&t.split("#").length===1){var o=MS.exec(i);if(o)return this.path=i,this.href=i,this.pathname=o[1],o[2]?(this.search=o[2],this.query=e?Is.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var l=OS.exec(i);if(l){var f=(l=l[0]).toLowerCase();this.protocol=f,i=i.substr(l.length)}if(n||l||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var p=i.substr(0,2)==="//";!p||l&&ks[l]||(i=i.substr(2),this.slashes=!0)}if(!ks[l]&&(p||l&&!fr[l])){for(var y,g,h=-1,w=0;w<zm.length;w++)(P=i.indexOf(zm[w]))!==-1&&(h===-1||P<h)&&(h=P);for((g=h===-1?i.lastIndexOf("@"):i.lastIndexOf("@",h))!==-1&&(y=i.slice(0,g),i=i.slice(g+1),this.auth=decodeURIComponent(y)),h=-1,w=0;w<Wm.length;w++){var P;(P=i.indexOf(Wm[w]))!==-1&&(h===-1||P<h)&&(h=P)}h===-1&&(h=i.length),this.host=i.slice(0,h),i=i.slice(h),this.parseHost(),this.hostname=this.hostname||"";var B=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!B)for(var v=this.hostname.split(/\./),S=(w=0,v.length);w<S;w++){var E=v[w];if(E&&!E.match(qm)){for(var H="",K=0,ae=E.length;K<ae;K++)E.charCodeAt(K)>127?H+="x":H+=E[K];if(!H.match(qm)){var Q=v.slice(0,w),ge=v.slice(w+1),oe=E.match(DS);oe&&(Q.push(oe[1]),ge.unshift(oe[2])),ge.length&&(i="/"+ge.join(".")+i),this.hostname=Q.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),B||(this.hostname=CS.toASCII(this.hostname));var re=this.port?":"+this.port:"",Oe=this.hostname||"";this.host=Oe+re,this.href+=this.host,B&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!HS[f])for(w=0,S=Cs.length;w<S;w++){var ze=Cs[w];if(i.indexOf(ze)!==-1){var tt=encodeURIComponent(ze);tt===ze&&(tt=escape(ze)),i=i.split(ze).join(tt)}}var Ve=i.indexOf("#");Ve!==-1&&(this.hash=i.substr(Ve),i=i.slice(0,Ve));var Je=i.indexOf("?");if(Je!==-1?(this.search=i.substr(Je),this.query=i.substr(Je+1),e&&(this.query=Is.parse(this.query)),i=i.slice(0,Je)):e&&(this.search="",this.query={}),i&&(this.pathname=i),fr[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){re=this.pathname||"";var mt=this.search||"";this.path=re+mt}return this.href=this.format(),this},St.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",n=this.pathname||"",r=this.hash||"",a=!1,s="";this.host?a=t+this.host:this.hostname&&(a=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&Dt.isObject(this.query)&&Object.keys(this.query).length&&(s=Is.stringify(this.query));var i=this.search||s&&"?"+s||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||fr[e])&&a!==!1?(a="//"+(a||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):a||(a=""),r&&r.charAt(0)!=="#"&&(r="#"+r),i&&i.charAt(0)!=="?"&&(i="?"+i),e+a+(n=n.replace(/[?#]/g,function(o){return encodeURIComponent(o)}))+(i=i.replace("#","%23"))+r},St.prototype.resolve=function(t){return this.resolveObject(ti(t,!1,!0)).format()},St.prototype.resolveObject=function(t){if(Dt.isString(t)){var e=new St;e.parse(t,!1,!0),t=e}for(var n=new St,r=Object.keys(this),a=0;a<r.length;a++){var s=r[a];n[s]=this[s]}if(n.hash=t.hash,t.href==="")return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var i=Object.keys(t),o=0;o<i.length;o++){var l=i[o];l!=="protocol"&&(n[l]=t[l])}return fr[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!fr[t.protocol]){for(var f=Object.keys(t),p=0;p<f.length;p++){var y=f[p];n[y]=t[y]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||ks[t.protocol])n.pathname=t.pathname;else{for(var g=(t.pathname||"").split("/");g.length&&!(t.host=g.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),g[0]!==""&&g.unshift(""),g.length<2&&g.unshift(""),n.pathname=g.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var h=n.pathname||"",w=n.search||"";n.path=h+w}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var P=n.pathname&&n.pathname.charAt(0)==="/",B=t.host||t.pathname&&t.pathname.charAt(0)==="/",v=B||P||n.host&&t.pathname,S=v,E=n.pathname&&n.pathname.split("/")||[],H=(g=t.pathname&&t.pathname.split("/")||[],n.protocol&&!fr[n.protocol]);if(H&&(n.hostname="",n.port=null,n.host&&(E[0]===""?E[0]=n.host:E.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(g[0]===""?g[0]=t.host:g.unshift(t.host)),t.host=null),v=v&&(g[0]===""||E[0]==="")),B)n.host=t.host||t.host===""?t.host:n.host,n.hostname=t.hostname||t.hostname===""?t.hostname:n.hostname,n.search=t.search,n.query=t.query,E=g;else if(g.length)E||(E=[]),E.pop(),E=E.concat(g),n.search=t.search,n.query=t.query;else if(!Dt.isNullOrUndefined(t.search))return H&&(n.hostname=n.host=E.shift(),(oe=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=oe.shift(),n.host=n.hostname=oe.shift())),n.search=t.search,n.query=t.query,Dt.isNull(n.pathname)&&Dt.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!E.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var K=E.slice(-1)[0],ae=(n.host||t.host||E.length>1)&&(K==="."||K==="..")||K==="",Q=0,ge=E.length;ge>=0;ge--)(K=E[ge])==="."?E.splice(ge,1):K===".."?(E.splice(ge,1),Q++):Q&&(E.splice(ge,1),Q--);if(!v&&!S)for(;Q--;Q)E.unshift("..");!v||E[0]===""||E[0]&&E[0].charAt(0)==="/"||E.unshift(""),ae&&E.join("/").substr(-1)!=="/"&&E.push("");var oe,re=E[0]===""||E[0]&&E[0].charAt(0)==="/";return H&&(n.hostname=n.host=re?"":E.length?E.shift():"",(oe=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=oe.shift(),n.host=n.hostname=oe.shift())),(v=v||n.host&&E.length)&&!re&&E.unshift(""),E.length?n.pathname=E.join("/"):(n.pathname=null,n.path=null),Dt.isNull(n.pathname)&&Dt.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},St.prototype.parseHost=function(){var t=this.host,e=RS.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};De.Url;De.format;De.resolve;De.resolveObject;As={},Gm=!1;Vm=US(),$S=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;De.URL=typeof URL<"u"?URL:null;De.pathToFileURL=QS;De.fileURLToPath=JS;De.Url;De.format;De.resolve;De.resolveObject;De.URL;ZS=92,jS=47,KS=97,LS=122,Os=$S==="win32",FS=/\//g,WS=/%/g,zS=/\\/g,qS=/\n/g,GS=/\r/g,VS=/\t/g;ek=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;De.URL=typeof URL<"u"?URL:null;De.pathToFileURL=gk;De.fileURLToPath=fk;De.Url;De.format;De.resolve;De.resolveObject;De.parse;De.URL;tk=92,nk=47,rk=97,ik=122,Rs=ek==="win32",ak=/\//g,ok=/%/g,sk=/\\/g,lk=/\n/g,uk=/\r/g,ck=/\t/g});var Ch={};Ln(Ch,{Agent:()=>Bk,ClientRequest:()=>Ek,IncomingMessage:()=>Sk,METHODS:()=>kk,STATUS_CODES:()=>Ik,default:()=>Yt,get:()=>Ak,globalAgent:()=>Ck,request:()=>Ok});function wh(){if(Qm)return Pt;Qm=!0,Pt.fetch=r($n.fetch)&&r($n.ReadableStream),Pt.writableStream=r($n.WritableStream),Pt.abortController=r($n.AbortController);var t;function e(){if(t!==void 0)return t;if($n.XMLHttpRequest){t=new $n.XMLHttpRequest;try{t.open("GET",$n.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function n(a){var s=e();if(!s)return!1;try{return s.responseType=a,s.responseType===a}catch{}return!1}Pt.arraybuffer=Pt.fetch||n("arraybuffer"),Pt.msstream=!Pt.fetch&&n("ms-stream"),Pt.mozchunkedarraybuffer=!Pt.fetch&&n("moz-chunked-arraybuffer"),Pt.overrideMimeType=Pt.fetch||(e()?r(e().overrideMimeType):!1);function r(a){return typeof a=="function"}return t=null,Pt}function xh(){return eh||(eh=!0,Ms=Tt.EventEmitter),Ms}function yk(){if(th)return Ns;th=!0;function t(w,P){var B=Object.keys(w);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(w);P&&(v=v.filter(function(S){return Object.getOwnPropertyDescriptor(w,S).enumerable})),B.push.apply(B,v)}return B}function e(w){for(var P=1;P<arguments.length;P++){var B=arguments[P]!=null?arguments[P]:{};P%2?t(Object(B),!0).forEach(function(v){n(w,v,B[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(B)):t(Object(B)).forEach(function(v){Object.defineProperty(w,v,Object.getOwnPropertyDescriptor(B,v))})}return w}function n(w,P,B){return P=i(P),P in w?Object.defineProperty(w,P,{value:B,enumerable:!0,configurable:!0,writable:!0}):w[P]=B,w}function r(w,P){if(!(w instanceof P))throw new TypeError("Cannot call a class as a function")}function a(w,P){for(var B=0;B<P.length;B++){var v=P[B];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(w,i(v.key),v)}}function s(w,P,B){return P&&a(w.prototype,P),Object.defineProperty(w,"prototype",{writable:!1}),w}function i(w){var P=o(w,"string");return typeof P=="symbol"?P:String(P)}function o(w,P){if(typeof w!="object"||w===null)return w;var B=w[Symbol.toPrimitive];if(B!==void 0){var v=B.call(w,P||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(w)}var l=Rt(),f=l.Buffer,p=L,y=p.inspect,g=y&&y.custom||"inspect";function h(w,P,B){f.prototype.copy.call(w,P,B)}return Ns=function(){function w(){r(this,w),this.head=null,this.tail=null,this.length=0}return s(w,[{key:"push",value:function(B){var v={data:B,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(B){var v={data:B,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(B){if(this.length===0)return"";for(var v=this.head,S=""+v.data;v=v.next;)S+=B+v.data;return S}},{key:"concat",value:function(B){if(this.length===0)return f.alloc(0);for(var v=f.allocUnsafe(B>>>0),S=this.head,E=0;S;)h(S.data,v,E),E+=S.data.length,S=S.next;return v}},{key:"consume",value:function(B,v){var S;return B<this.head.data.length?(S=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?S=this.shift():S=v?this._getString(B):this._getBuffer(B),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var v=this.head,S=1,E=v.data;for(B-=E.length;v=v.next;){var H=v.data,K=B>H.length?H.length:B;if(K===H.length?E+=H:E+=H.slice(0,B),B-=K,B===0){K===H.length?(++S,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=H.slice(K));break}++S}return this.length-=S,E}},{key:"_getBuffer",value:function(B){var v=f.allocUnsafe(B),S=this.head,E=1;for(S.data.copy(v),B-=S.data.length;S=S.next;){var H=S.data,K=B>H.length?H.length:B;if(H.copy(v,v.length-B,0,K),B-=K,B===0){K===H.length?(++E,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=H.slice(K));break}++E}return this.length-=E,v}},{key:g,value:function(B,v){return y(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),w}(),Ns}function Ph(){if(nh)return Ds;nh=!0;var t=At;function e(o,l){var f=this,p=this._readableState&&this._readableState.destroyed,y=this._writableState&&this._writableState.destroyed;return p||y?(l?l(o):o&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(s,this,o)):t.nextTick(s,this,o)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(o||null,function(g){!l&&g?f._writableState?f._writableState.errorEmitted?t.nextTick(r,f):(f._writableState.errorEmitted=!0,t.nextTick(n,f,g)):t.nextTick(n,f,g):l?(t.nextTick(r,f),l(g)):t.nextTick(r,f)}),this)}function n(o,l){s(o,l),r(o)}function r(o){o._writableState&&!o._writableState.emitClose||o._readableState&&!o._readableState.emitClose||o.emit("close")}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(o,l){o.emit("error",l)}function i(o,l){var f=o._readableState,p=o._writableState;f&&f.autoDestroy||p&&p.autoDestroy?o.destroy(l):o.emit("error",l)}return Ds={destroy:e,undestroy:a,errorOrDestroy:i},Ds}function gr(){if(rh)return Hs;rh=!0;let t={};function e(i,o,l){l||(l=Error);function f(y,g,h){return typeof o=="string"?o:o(y,g,h)}class p extends l{constructor(g,h,w){super(f(g,h,w))}}p.prototype.name=l.name,p.prototype.code=i,t[i]=p}function n(i,o){if(Array.isArray(i)){let l=i.length;return i=i.map(f=>String(f)),l>2?`one of ${o} ${i.slice(0,l-1).join(", ")}, or `+i[l-1]:l===2?`one of ${o} ${i[0]} or ${i[1]}`:`of ${o} ${i[0]}`}else return`of ${o} ${String(i)}`}function r(i,o,l){return i.substr(0,o.length)===o}function a(i,o,l){return(l===void 0||l>i.length)&&(l=i.length),i.substring(l-o.length,l)===o}function s(i,o,l){return typeof l!="number"&&(l=0),l+o.length>i.length?!1:i.indexOf(o,l)!==-1}return e("ERR_INVALID_OPT_VALUE",function(i,o){return'The value "'+o+'" is invalid for option "'+i+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(i,o,l){let f;typeof o=="string"&&r(o,"not ")?(f="must not be",o=o.replace(/^not /,"")):f="must be";let p;if(a(i," argument"))p=`The ${i} ${f} ${n(o,"type")}`;else{let y=s(i,".")?"property":"argument";p=`The "${i}" ${y} ${f} ${n(o,"type")}`}return p+=`. Received type ${typeof l}`,p},TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",function(i){return"The "+i+" method is not implemented"}),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",function(i){return"Cannot call "+i+" after a stream was destroyed"}),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",function(i){return"Unknown encoding: "+i},TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Hs.codes=t,Hs}function Bh(){if(ih)return Us;ih=!0;var t=gr().codes.ERR_INVALID_OPT_VALUE;function e(r,a,s){return r.highWaterMark!=null?r.highWaterMark:a?r[s]:null}function n(r,a,s,i){var o=e(a,i,s);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var l=i?s:"highWaterMark";throw new t(l,o)}return Math.floor(o)}return r.objectMode?16:16*1024}return Us={getHighWaterMark:n},Us}function Eh(){if(ah)return $s;ah=!0;var t=At;$s=oe;function e(A){var k=this;this.next=null,this.entry=null,this.finish=function(){Te(k,A)}}var n;oe.WritableState=Q;var r={deprecate:Rm()},a=xh(),s=Rt().Buffer,i=(typeof oh<"u"?oh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(A){return s.from(A)}function l(A){return s.isBuffer(A)||A instanceof i}var f=Ph(),p=Bh(),y=p.getHighWaterMark,g=gr().codes,h=g.ERR_INVALID_ARG_TYPE,w=g.ERR_METHOD_NOT_IMPLEMENTED,P=g.ERR_MULTIPLE_CALLBACK,B=g.ERR_STREAM_CANNOT_PIPE,v=g.ERR_STREAM_DESTROYED,S=g.ERR_STREAM_NULL_VALUES,E=g.ERR_STREAM_WRITE_AFTER_END,H=g.ERR_UNKNOWN_ENCODING,K=f.errorOrDestroy;Mt()(oe,a);function ae(){}function Q(A,k,Z){n=n||pr(),A=A||{},typeof Z!="boolean"&&(Z=k instanceof n),this.objectMode=!!A.objectMode,Z&&(this.objectMode=this.objectMode||!!A.writableObjectMode),this.highWaterMark=y(this,A,"writableHighWaterMark",Z),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=A.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ie){Ue(k,ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=A.emitClose!==!1,this.autoDestroy=!!A.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}Q.prototype.getBuffer=function(){for(var k=this.bufferedRequest,Z=[];k;)Z.push(k),k=k.next;return Z},function(){try{Object.defineProperty(Q.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ge;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ge=Function.prototype[Symbol.hasInstance],Object.defineProperty(oe,Symbol.hasInstance,{value:function(k){return ge.call(this,k)?!0:this!==oe?!1:k&&k._writableState instanceof Q}})):ge=function(k){return k instanceof this};function oe(A){n=n||pr();var k=this instanceof n;if(!k&&!ge.call(oe,this))return new oe(A);this._writableState=new Q(A,this,k),this.writable=!0,A&&(typeof A.write=="function"&&(this._write=A.write),typeof A.writev=="function"&&(this._writev=A.writev),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.final=="function"&&(this._final=A.final)),a.call(this)}oe.prototype.pipe=function(){K(this,new B)};function re(A,k){var Z=new E;K(A,Z),t.nextTick(k,Z)}function Oe(A,k,Z,J){var ie;return Z===null?ie=new S:typeof Z!="string"&&!k.objectMode&&(ie=new h("chunk",["string","Buffer"],Z)),ie?(K(A,ie),t.nextTick(J,ie),!1):!0}oe.prototype.write=function(A,k,Z){var J=this._writableState,ie=!1,_=!J.objectMode&&l(A);return _&&!s.isBuffer(A)&&(A=o(A)),typeof k=="function"&&(Z=k,k=null),_?k="buffer":k||(k=J.defaultEncoding),typeof Z!="function"&&(Z=ae),J.ending?re(this,Z):(_||Oe(this,J,A,Z))&&(J.pendingcb++,ie=tt(this,J,_,A,k,Z)),ie},oe.prototype.cork=function(){this._writableState.corked++},oe.prototype.uncork=function(){var A=this._writableState;A.corked&&(A.corked--,!A.writing&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&fe(this,A))},oe.prototype.setDefaultEncoding=function(k){if(typeof k=="string"&&(k=k.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((k+"").toLowerCase())>-1))throw new H(k);return this._writableState.defaultEncoding=k,this},Object.defineProperty(oe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ze(A,k,Z){return!A.objectMode&&A.decodeStrings!==!1&&typeof k=="string"&&(k=s.from(k,Z)),k}Object.defineProperty(oe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function tt(A,k,Z,J,ie,_){if(!Z){var x=ze(k,J,ie);J!==x&&(Z=!0,ie="buffer",J=x)}var z=k.objectMode?1:J.length;k.length+=z;var Y=k.length<k.highWaterMark;if(Y||(k.needDrain=!0),k.writing||k.corked){var Me=k.lastBufferedRequest;k.lastBufferedRequest={chunk:J,encoding:ie,isBuf:Z,callback:_,next:null},Me?Me.next=k.lastBufferedRequest:k.bufferedRequest=k.lastBufferedRequest,k.bufferedRequestCount+=1}else Ve(A,k,!1,z,J,ie,_);return Y}function Ve(A,k,Z,J,ie,_,x){k.writelen=J,k.writecb=x,k.writing=!0,k.sync=!0,k.destroyed?k.onwrite(new v("write")):Z?A._writev(ie,k.onwrite):A._write(ie,_,k.onwrite),k.sync=!1}function Je(A,k,Z,J,ie){--k.pendingcb,Z?(t.nextTick(ie,J),t.nextTick(F,A,k),A._writableState.errorEmitted=!0,K(A,J)):(ie(J),A._writableState.errorEmitted=!0,K(A,J),F(A,k))}function mt(A){A.writing=!1,A.writecb=null,A.length-=A.writelen,A.writelen=0}function Ue(A,k){var Z=A._writableState,J=Z.sync,ie=Z.writecb;if(typeof ie!="function")throw new P;if(mt(Z),k)Je(A,Z,J,k,ie);else{var _=ve(Z)||A.destroyed;!_&&!Z.corked&&!Z.bufferProcessing&&Z.bufferedRequest&&fe(A,Z),J?t.nextTick(Pe,A,Z,_,ie):Pe(A,Z,_,ie)}}function Pe(A,k,Z,J){Z||Se(A,k),k.pendingcb--,J(),F(A,k)}function Se(A,k){k.length===0&&k.needDrain&&(k.needDrain=!1,A.emit("drain"))}function fe(A,k){k.bufferProcessing=!0;var Z=k.bufferedRequest;if(A._writev&&Z&&Z.next){var J=k.bufferedRequestCount,ie=new Array(J),_=k.corkedRequestsFree;_.entry=Z;for(var x=0,z=!0;Z;)ie[x]=Z,Z.isBuf||(z=!1),Z=Z.next,x+=1;ie.allBuffers=z,Ve(A,k,!0,k.length,ie,"",_.finish),k.pendingcb++,k.lastBufferedRequest=null,_.next?(k.corkedRequestsFree=_.next,_.next=null):k.corkedRequestsFree=new e(k),k.bufferedRequestCount=0}else{for(;Z;){var Y=Z.chunk,Me=Z.encoding,_e=Z.callback,$=k.objectMode?1:Y.length;if(Ve(A,k,!1,$,Y,Me,_e),Z=Z.next,k.bufferedRequestCount--,k.writing)break}Z===null&&(k.lastBufferedRequest=null)}k.bufferedRequest=Z,k.bufferProcessing=!1}oe.prototype._write=function(A,k,Z){Z(new w("_write()"))},oe.prototype._writev=null,oe.prototype.end=function(A,k,Z){var J=this._writableState;return typeof A=="function"?(Z=A,A=null,k=null):typeof k=="function"&&(Z=k,k=null),A!=null&&this.write(A,k),J.corked&&(J.corked=1,this.uncork()),J.ending||de(this,J,Z),this},Object.defineProperty(oe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ve(A){return A.ending&&A.length===0&&A.bufferedRequest===null&&!A.finished&&!A.writing}function D(A,k){A._final(function(Z){k.pendingcb--,Z&&K(A,Z),k.prefinished=!0,A.emit("prefinish"),F(A,k)})}function j(A,k){!k.prefinished&&!k.finalCalled&&(typeof A._final=="function"&&!k.destroyed?(k.pendingcb++,k.finalCalled=!0,t.nextTick(D,A,k)):(k.prefinished=!0,A.emit("prefinish")))}function F(A,k){var Z=ve(k);if(Z&&(j(A,k),k.pendingcb===0&&(k.finished=!0,A.emit("finish"),k.autoDestroy))){var J=A._readableState;(!J||J.autoDestroy&&J.endEmitted)&&A.destroy()}return Z}function de(A,k,Z){k.ending=!0,F(A,k),Z&&(k.finished?t.nextTick(Z):A.once("finish",Z)),k.ended=!0,A.writable=!1}function Te(A,k,Z){var J=A.entry;for(A.entry=null;J;){var ie=J.callback;k.pendingcb--,ie(Z),J=J.next}k.corkedRequestsFree.next=A}return Object.defineProperty(oe.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(k){this._writableState&&(this._writableState.destroyed=k)}}),oe.prototype.destroy=f.destroy,oe.prototype._undestroy=f.undestroy,oe.prototype._destroy=function(A,k){k(A)},$s}function pr(){if(sh)return Zs;sh=!0;var t=At,e=Object.keys||function(p){var y=[];for(var g in p)y.push(g);return y};Zs=o;var n=Sh(),r=Eh();Mt()(o,n);for(var a=e(r.prototype),s=0;s<a.length;s++){var i=a[s];o.prototype[i]||(o.prototype[i]=r.prototype[i])}function o(p){if(!(this instanceof o))return new o(p);n.call(this,p),r.call(this,p),this.allowHalfOpen=!0,p&&(p.readable===!1&&(this.readable=!1),p.writable===!1&&(this.writable=!1),p.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",l)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||t.nextTick(f,this)}function f(p){p.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(y){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=y,this._writableState.destroyed=y)}}),Zs}function Ys(){if(lh)return js;lh=!0;var t=gr().codes.ERR_STREAM_PREMATURE_CLOSE;function e(s){var i=!1;return function(){if(!i){i=!0;for(var o=arguments.length,l=new Array(o),f=0;f<o;f++)l[f]=arguments[f];s.apply(this,l)}}}function n(){}function r(s){return s.setHeader&&typeof s.abort=="function"}function a(s,i,o){if(typeof i=="function")return a(s,null,i);i||(i={}),o=e(o||n);var l=i.readable||i.readable!==!1&&s.readable,f=i.writable||i.writable!==!1&&s.writable,p=function(){s.writable||g()},y=s._writableState&&s._writableState.finished,g=function(){f=!1,y=!0,l||o.call(s)},h=s._readableState&&s._readableState.endEmitted,w=function(){l=!1,h=!0,f||o.call(s)},P=function(E){o.call(s,E)},B=function(){var E;if(l&&!h)return(!s._readableState||!s._readableState.ended)&&(E=new t),o.call(s,E);if(f&&!y)return(!s._writableState||!s._writableState.ended)&&(E=new t),o.call(s,E)},v=function(){s.req.on("finish",g)};return r(s)?(s.on("complete",g),s.on("abort",B),s.req?v():s.on("request",v)):f&&!s._writableState&&(s.on("end",p),s.on("close",p)),s.on("end",w),s.on("finish",g),i.error!==!1&&s.on("error",P),s.on("close",B),function(){s.removeListener("complete",g),s.removeListener("abort",B),s.removeListener("request",v),s.req&&s.req.removeListener("finish",g),s.removeListener("end",p),s.removeListener("close",p),s.removeListener("finish",g),s.removeListener("end",w),s.removeListener("error",P),s.removeListener("close",B)}}return js=a,js}function mk(){if(uh)return Ks;uh=!0;var t=At,e;function n(H,K,ae){return K=r(K),K in H?Object.defineProperty(H,K,{value:ae,enumerable:!0,configurable:!0,writable:!0}):H[K]=ae,H}function r(H){var K=a(H,"string");return typeof K=="symbol"?K:String(K)}function a(H,K){if(typeof H!="object"||H===null)return H;var ae=H[Symbol.toPrimitive];if(ae!==void 0){var Q=ae.call(H,K||"default");if(typeof Q!="object")return Q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(K==="string"?String:Number)(H)}var s=Ys(),i=Symbol("lastResolve"),o=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),p=Symbol("lastPromise"),y=Symbol("handlePromise"),g=Symbol("stream");function h(H,K){return{value:H,done:K}}function w(H){var K=H[i];if(K!==null){var ae=H[g].read();ae!==null&&(H[p]=null,H[i]=null,H[o]=null,K(h(ae,!1)))}}function P(H){t.nextTick(w,H)}function B(H,K){return function(ae,Q){H.then(function(){if(K[f]){ae(h(void 0,!0));return}K[y](ae,Q)},Q)}}var v=Object.getPrototypeOf(function(){}),S=Object.setPrototypeOf((e={get stream(){return this[g]},next:function(){var K=this,ae=this[l];if(ae!==null)return Promise.reject(ae);if(this[f])return Promise.resolve(h(void 0,!0));if(this[g].destroyed)return new Promise(function(re,Oe){t.nextTick(function(){K[l]?Oe(K[l]):re(h(void 0,!0))})});var Q=this[p],ge;if(Q)ge=new Promise(B(Q,this));else{var oe=this[g].read();if(oe!==null)return Promise.resolve(h(oe,!1));ge=new Promise(this[y])}return this[p]=ge,ge}},n(e,Symbol.asyncIterator,function(){return this}),n(e,"return",function(){var K=this;return new Promise(function(ae,Q){K[g].destroy(null,function(ge){if(ge){Q(ge);return}ae(h(void 0,!0))})})}),e),v),E=function(K){var ae,Q=Object.create(S,(ae={},n(ae,g,{value:K,writable:!0}),n(ae,i,{value:null,writable:!0}),n(ae,o,{value:null,writable:!0}),n(ae,l,{value:null,writable:!0}),n(ae,f,{value:K._readableState.endEmitted,writable:!0}),n(ae,y,{value:function(oe,re){var Oe=Q[g].read();Oe?(Q[p]=null,Q[i]=null,Q[o]=null,oe(h(Oe,!1))):(Q[i]=oe,Q[o]=re)},writable:!0}),ae));return Q[p]=null,s(K,function(ge){if(ge&&ge.code!=="ERR_STREAM_PREMATURE_CLOSE"){var oe=Q[o];oe!==null&&(Q[p]=null,Q[i]=null,Q[o]=null,oe(ge)),Q[l]=ge;return}var re=Q[i];re!==null&&(Q[p]=null,Q[i]=null,Q[o]=null,re(h(void 0,!0))),Q[f]=!0}),K.on("readable",P.bind(null,Q)),Q};return Ks=E,Ks}function hk(){return ch||(ch=!0,Ls=function(){throw new Error("Readable.from is not available in the browser")}),Ls}function Sh(){if(fh)return Fs;fh=!0;var t=At;Fs=re;var e;re.ReadableState=oe,Tt.EventEmitter;var n=function(x,z){return x.listeners(z).length},r=xh(),a=Rt().Buffer,s=(typeof dh<"u"?dh:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function i(_){return a.from(_)}function o(_){return a.isBuffer(_)||_ instanceof s}var l=L,f;l&&l.debuglog?f=l.debuglog("stream"):f=function(){};var p=yk(),y=Ph(),g=Bh(),h=g.getHighWaterMark,w=gr().codes,P=w.ERR_INVALID_ARG_TYPE,B=w.ERR_STREAM_PUSH_AFTER_EOF,v=w.ERR_METHOD_NOT_IMPLEMENTED,S=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,E,H,K;Mt()(re,r);var ae=y.errorOrDestroy,Q=["error","close","destroy","pause","resume"];function ge(_,x,z){if(typeof _.prependListener=="function")return _.prependListener(x,z);!_._events||!_._events[x]?_.on(x,z):Array.isArray(_._events[x])?_._events[x].unshift(z):_._events[x]=[z,_._events[x]]}function oe(_,x,z){e=e||pr(),_=_||{},typeof z!="boolean"&&(z=x instanceof e),this.objectMode=!!_.objectMode,z&&(this.objectMode=this.objectMode||!!_.readableObjectMode),this.highWaterMark=h(this,_,"readableHighWaterMark",z),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=_.emitClose!==!1,this.autoDestroy=!!_.autoDestroy,this.destroyed=!1,this.defaultEncoding=_.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,_.encoding&&(E||(E=Qr.StringDecoder),this.decoder=new E(_.encoding),this.encoding=_.encoding)}function re(_){if(e=e||pr(),!(this instanceof re))return new re(_);var x=this instanceof e;this._readableState=new oe(_,this,x),this.readable=!0,_&&(typeof _.read=="function"&&(this._read=_.read),typeof _.destroy=="function"&&(this._destroy=_.destroy)),r.call(this)}Object.defineProperty(re.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(x){this._readableState&&(this._readableState.destroyed=x)}}),re.prototype.destroy=y.destroy,re.prototype._undestroy=y.undestroy,re.prototype._destroy=function(_,x){x(_)},re.prototype.push=function(_,x){var z=this._readableState,Y;return z.objectMode?Y=!0:typeof _=="string"&&(x=x||z.defaultEncoding,x!==z.encoding&&(_=a.from(_,x),x=""),Y=!0),Oe(this,_,x,!1,Y)},re.prototype.unshift=function(_){return Oe(this,_,null,!0,!1)};function Oe(_,x,z,Y,Me){f("readableAddChunk",x);var _e=_._readableState;if(x===null)_e.reading=!1,Ue(_,_e);else{var $;if(Me||($=tt(_e,x)),$)ae(_,$);else if(_e.objectMode||x&&x.length>0)if(typeof x!="string"&&!_e.objectMode&&Object.getPrototypeOf(x)!==a.prototype&&(x=i(x)),Y)_e.endEmitted?ae(_,new S):ze(_,_e,x,!0);else if(_e.ended)ae(_,new B);else{if(_e.destroyed)return!1;_e.reading=!1,_e.decoder&&!z?(x=_e.decoder.write(x),_e.objectMode||x.length!==0?ze(_,_e,x,!1):fe(_,_e)):ze(_,_e,x,!1)}else Y||(_e.reading=!1,fe(_,_e))}return!_e.ended&&(_e.length<_e.highWaterMark||_e.length===0)}function ze(_,x,z,Y){x.flowing&&x.length===0&&!x.sync?(x.awaitDrain=0,_.emit("data",z)):(x.length+=x.objectMode?1:z.length,Y?x.buffer.unshift(z):x.buffer.push(z),x.needReadable&&Pe(_)),fe(_,x)}function tt(_,x){var z;return!o(x)&&typeof x!="string"&&x!==void 0&&!_.objectMode&&(z=new P("chunk",["string","Buffer","Uint8Array"],x)),z}re.prototype.isPaused=function(){return this._readableState.flowing===!1},re.prototype.setEncoding=function(_){E||(E=Qr.StringDecoder);var x=new E(_);this._readableState.decoder=x,this._readableState.encoding=this._readableState.decoder.encoding;for(var z=this._readableState.buffer.head,Y="";z!==null;)Y+=x.write(z.data),z=z.next;return this._readableState.buffer.clear(),Y!==""&&this._readableState.buffer.push(Y),this._readableState.length=Y.length,this};var Ve=1073741824;function Je(_){return _>=Ve?_=Ve:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}function mt(_,x){return _<=0||x.length===0&&x.ended?0:x.objectMode?1:_!==_?x.flowing&&x.length?x.buffer.head.data.length:x.length:(_>x.highWaterMark&&(x.highWaterMark=Je(_)),_<=x.length?_:x.ended?x.length:(x.needReadable=!0,0))}re.prototype.read=function(_){f("read",_),_=parseInt(_,10);var x=this._readableState,z=_;if(_!==0&&(x.emittedReadable=!1),_===0&&x.needReadable&&((x.highWaterMark!==0?x.length>=x.highWaterMark:x.length>0)||x.ended))return f("read: emitReadable",x.length,x.ended),x.length===0&&x.ended?Z(this):Pe(this),null;if(_=mt(_,x),_===0&&x.ended)return x.length===0&&Z(this),null;var Y=x.needReadable;f("need readable",Y),(x.length===0||x.length-_<x.highWaterMark)&&(Y=!0,f("length less than watermark",Y)),x.ended||x.reading?(Y=!1,f("reading or ended",Y)):Y&&(f("do read"),x.reading=!0,x.sync=!0,x.length===0&&(x.needReadable=!0),this._read(x.highWaterMark),x.sync=!1,x.reading||(_=mt(z,x)));var Me;return _>0?Me=k(_,x):Me=null,Me===null?(x.needReadable=x.length<=x.highWaterMark,_=0):(x.length-=_,x.awaitDrain=0),x.length===0&&(x.ended||(x.needReadable=!0),z!==_&&x.ended&&Z(this)),Me!==null&&this.emit("data",Me),Me};function Ue(_,x){if(f("onEofChunk"),!x.ended){if(x.decoder){var z=x.decoder.end();z&&z.length&&(x.buffer.push(z),x.length+=x.objectMode?1:z.length)}x.ended=!0,x.sync?Pe(_):(x.needReadable=!1,x.emittedReadable||(x.emittedReadable=!0,Se(_)))}}function Pe(_){var x=_._readableState;f("emitReadable",x.needReadable,x.emittedReadable),x.needReadable=!1,x.emittedReadable||(f("emitReadable",x.flowing),x.emittedReadable=!0,t.nextTick(Se,_))}function Se(_){var x=_._readableState;f("emitReadable_",x.destroyed,x.length,x.ended),!x.destroyed&&(x.length||x.ended)&&(_.emit("readable"),x.emittedReadable=!1),x.needReadable=!x.flowing&&!x.ended&&x.length<=x.highWaterMark,A(_)}function fe(_,x){x.readingMore||(x.readingMore=!0,t.nextTick(ve,_,x))}function ve(_,x){for(;!x.reading&&!x.ended&&(x.length<x.highWaterMark||x.flowing&&x.length===0);){var z=x.length;if(f("maybeReadMore read 0"),_.read(0),z===x.length)break}x.readingMore=!1}re.prototype._read=function(_){ae(this,new v("_read()"))},re.prototype.pipe=function(_,x){var z=this,Y=this._readableState;switch(Y.pipesCount){case 0:Y.pipes=_;break;case 1:Y.pipes=[Y.pipes,_];break;default:Y.pipes.push(_);break}Y.pipesCount+=1,f("pipe count=%d opts=%j",Y.pipesCount,x);var Me=(!x||x.end!==!1)&&_!==t.stdout&&_!==t.stderr,_e=Me?kt:u;Y.endEmitted?t.nextTick(_e):z.once("end",_e),_.on("unpipe",$);function $(c,T){f("onunpipe"),c===z&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,hr())}function kt(){f("onend"),_.end()}var Ot=D(z);_.on("drain",Ot);var wt=!1;function hr(){f("cleanup"),_.removeListener("close",vr),_.removeListener("finish",m),_.removeListener("drain",Ot),_.removeListener("error",Bt),_.removeListener("unpipe",$),z.removeListener("end",kt),z.removeListener("end",u),z.removeListener("data",oi),wt=!0,Y.awaitDrain&&(!_._writableState||_._writableState.needDrain)&&Ot()}z.on("data",oi);function oi(c){f("ondata");var T=_.write(c);f("dest.write",T),T===!1&&((Y.pipesCount===1&&Y.pipes===_||Y.pipesCount>1&&ie(Y.pipes,_)!==-1)&&!wt&&(f("false write response, pause",Y.awaitDrain),Y.awaitDrain++),z.pause())}function Bt(c){f("onerror",c),u(),_.removeListener("error",Bt),n(_,"error")===0&&ae(_,c)}ge(_,"error",Bt);function vr(){_.removeListener("finish",m),u()}_.once("close",vr);function m(){f("onfinish"),_.removeListener("close",vr),u()}_.once("finish",m);function u(){f("unpipe"),z.unpipe(_)}return _.emit("pipe",z),Y.flowing||(f("pipe resume"),z.resume()),_};function D(_){return function(){var z=_._readableState;f("pipeOnDrain",z.awaitDrain),z.awaitDrain&&z.awaitDrain--,z.awaitDrain===0&&n(_,"data")&&(z.flowing=!0,A(_))}}re.prototype.unpipe=function(_){var x=this._readableState,z={hasUnpiped:!1};if(x.pipesCount===0)return this;if(x.pipesCount===1)return _&&_!==x.pipes?this:(_||(_=x.pipes),x.pipes=null,x.pipesCount=0,x.flowing=!1,_&&_.emit("unpipe",this,z),this);if(!_){var Y=x.pipes,Me=x.pipesCount;x.pipes=null,x.pipesCount=0,x.flowing=!1;for(var _e=0;_e<Me;_e++)Y[_e].emit("unpipe",this,{hasUnpiped:!1});return this}var $=ie(x.pipes,_);return $===-1?this:(x.pipes.splice($,1),x.pipesCount-=1,x.pipesCount===1&&(x.pipes=x.pipes[0]),_.emit("unpipe",this,z),this)},re.prototype.on=function(_,x){var z=r.prototype.on.call(this,_,x),Y=this._readableState;return _==="data"?(Y.readableListening=this.listenerCount("readable")>0,Y.flowing!==!1&&this.resume()):_==="readable"&&!Y.endEmitted&&!Y.readableListening&&(Y.readableListening=Y.needReadable=!0,Y.flowing=!1,Y.emittedReadable=!1,f("on readable",Y.length,Y.reading),Y.length?Pe(this):Y.reading||t.nextTick(F,this)),z},re.prototype.addListener=re.prototype.on,re.prototype.removeListener=function(_,x){var z=r.prototype.removeListener.call(this,_,x);return _==="readable"&&t.nextTick(j,this),z},re.prototype.removeAllListeners=function(_){var x=r.prototype.removeAllListeners.apply(this,arguments);return(_==="readable"||_===void 0)&&t.nextTick(j,this),x};function j(_){var x=_._readableState;x.readableListening=_.listenerCount("readable")>0,x.resumeScheduled&&!x.paused?x.flowing=!0:_.listenerCount("data")>0&&_.resume()}function F(_){f("readable nexttick read 0"),_.read(0)}re.prototype.resume=function(){var _=this._readableState;return _.flowing||(f("resume"),_.flowing=!_.readableListening,de(this,_)),_.paused=!1,this};function de(_,x){x.resumeScheduled||(x.resumeScheduled=!0,t.nextTick(Te,_,x))}function Te(_,x){f("resume",x.reading),x.reading||_.read(0),x.resumeScheduled=!1,_.emit("resume"),A(_),x.flowing&&!x.reading&&_.read(0)}re.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function A(_){var x=_._readableState;for(f("flow",x.flowing);x.flowing&&_.read()!==null;);}re.prototype.wrap=function(_){var x=this,z=this._readableState,Y=!1;_.on("end",function(){if(f("wrapped end"),z.decoder&&!z.ended){var $=z.decoder.end();$&&$.length&&x.push($)}x.push(null)}),_.on("data",function($){if(f("wrapped data"),z.decoder&&($=z.decoder.write($)),!(z.objectMode&&$==null)&&!(!z.objectMode&&(!$||!$.length))){var kt=x.push($);kt||(Y=!0,_.pause())}});for(var Me in _)this[Me]===void 0&&typeof _[Me]=="function"&&(this[Me]=function(kt){return function(){return _[kt].apply(_,arguments)}}(Me));for(var _e=0;_e<Q.length;_e++)_.on(Q[_e],this.emit.bind(this,Q[_e]));return this._read=function($){f("wrapped _read",$),Y&&(Y=!1,_.resume())},this},typeof Symbol=="function"&&(re.prototype[Symbol.asyncIterator]=function(){return H===void 0&&(H=mk()),H(this)}),Object.defineProperty(re.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(re.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(re.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){this._readableState&&(this._readableState.flowing=x)}}),re._fromList=k,Object.defineProperty(re.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function k(_,x){if(x.length===0)return null;var z;return x.objectMode?z=x.buffer.shift():!_||_>=x.length?(x.decoder?z=x.buffer.join(""):x.buffer.length===1?z=x.buffer.first():z=x.buffer.concat(x.length),x.buffer.clear()):z=x.buffer.consume(_,x.decoder),z}function Z(_){var x=_._readableState;f("endReadable",x.endEmitted),x.endEmitted||(x.ended=!0,t.nextTick(J,x,_))}function J(_,x){if(f("endReadableNT",_.endEmitted,_.length),!_.endEmitted&&_.length===0&&(_.endEmitted=!0,x.readable=!1,x.emit("end"),_.autoDestroy)){var z=x._writableState;(!z||z.autoDestroy&&z.finished)&&x.destroy()}}typeof Symbol=="function"&&(re.from=function(_,x){return K===void 0&&(K=hk()),K(re,_,x)});function ie(_,x){for(var z=0,Y=_.length;z<Y;z++)if(_[z]===x)return z;return-1}return Fs}function kh(){if(ph)return Ws;ph=!0,Ws=o;var t=gr().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,n=t.ERR_MULTIPLE_CALLBACK,r=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=t.ERR_TRANSFORM_WITH_LENGTH_0,s=pr();Mt()(o,s);function i(p,y){var g=this._transformState;g.transforming=!1;var h=g.writecb;if(h===null)return this.emit("error",new n);g.writechunk=null,g.writecb=null,y!=null&&this.push(y),h(p);var w=this._readableState;w.reading=!1,(w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}function o(p){if(!(this instanceof o))return new o(p);s.call(this,p),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,p&&(typeof p.transform=="function"&&(this._transform=p.transform),typeof p.flush=="function"&&(this._flush=p.flush)),this.on("prefinish",l)}function l(){var p=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(y,g){f(p,y,g)}):f(this,null,null)}o.prototype.push=function(p,y){return this._transformState.needTransform=!1,s.prototype.push.call(this,p,y)},o.prototype._transform=function(p,y,g){g(new e("_transform()"))},o.prototype._write=function(p,y,g){var h=this._transformState;if(h.writecb=g,h.writechunk=p,h.writeencoding=y,!h.transforming){var w=this._readableState;(h.needTransform||w.needReadable||w.length<w.highWaterMark)&&this._read(w.highWaterMark)}},o.prototype._read=function(p){var y=this._transformState;y.writechunk!==null&&!y.transforming?(y.transforming=!0,this._transform(y.writechunk,y.writeencoding,y.afterTransform)):y.needTransform=!0},o.prototype._destroy=function(p,y){s.prototype._destroy.call(this,p,function(g){y(g)})};function f(p,y,g){if(y)return p.emit("error",y);if(g!=null&&p.push(g),p._writableState.length)throw new a;if(p._transformState.transforming)throw new r;return p.push(null)}return Ws}function vk(){if(gh)return zs;gh=!0,zs=e;var t=kh();Mt()(e,t);function e(n){if(!(this instanceof e))return new e(n);t.call(this,n)}return e.prototype._transform=function(n,r,a){a(null,n)},zs}function Tk(){if(yh)return qs;yh=!0;var t;function e(g){var h=!1;return function(){h||(h=!0,g.apply(void 0,arguments))}}var n=gr().codes,r=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function s(g){if(g)throw g}function i(g){return g.setHeader&&typeof g.abort=="function"}function o(g,h,w,P){P=e(P);var B=!1;g.on("close",function(){B=!0}),t===void 0&&(t=Ys()),t(g,{readable:h,writable:w},function(S){if(S)return P(S);B=!0,P()});var v=!1;return function(S){if(!B&&!v){if(v=!0,i(g))return g.abort();if(typeof g.destroy=="function")return g.destroy();P(S||new a("pipe"))}}}function l(g){g()}function f(g,h){return g.pipe(h)}function p(g){return!g.length||typeof g[g.length-1]!="function"?s:g.pop()}function y(){for(var g=arguments.length,h=new Array(g),w=0;w<g;w++)h[w]=arguments[w];var P=p(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new r("streams");var B,v=h.map(function(S,E){var H=E<h.length-1,K=E>0;return o(S,H,K,function(ae){B||(B=ae),ae&&v.forEach(l),!H&&(v.forEach(l),P(B))})});return h.reduce(f)}return qs=y,qs}function Ih(){return mh||(mh=!0,bt=bt=Sh(),bt.Stream=bt,bt.Readable=bt,bt.Writable=Eh(),bt.Duplex=pr(),bt.Transform=kh(),bt.PassThrough=vk(),bt.finished=Ys(),bt.pipeline=Tk()),bt}function Ah(){if(hh)return Ka;hh=!0;var t=Rt().Buffer,e=At,n=wh(),r=Mt(),a=Ih(),s=Ka.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i=Ka.IncomingMessage=function(o,l,f,p){var y=this||La;if(a.Readable.call(y),y._mode=f,y.headers={},y.rawHeaders=[],y.trailers={},y.rawTrailers=[],y.on("end",function(){e.nextTick(function(){y.emit("close")})}),f==="fetch"){let v=function(){h.read().then(function(S){if(!y._destroyed){if(p(S.done),S.done){y.push(null);return}y.push(t.from(S.value)),v()}}).catch(function(S){p(!0),y._destroyed||y.emit("error",S)})};if(y._fetchResponse=l,y.url=l.url,y.statusCode=l.status,y.statusMessage=l.statusText,l.headers.forEach(function(S,E){y.headers[E.toLowerCase()]=S,y.rawHeaders.push(E,S)}),n.writableStream){var g=new WritableStream({write:function(S){return p(!1),new Promise(function(E,H){y._destroyed?H():y.push(t.from(S))?E():y._resumeFetch=E})},close:function(){p(!0),y._destroyed||y.push(null)},abort:function(S){p(!0),y._destroyed||y.emit("error",S)}});try{l.body.pipeTo(g).catch(function(S){p(!0),y._destroyed||y.emit("error",S)});return}catch{}}var h=l.body.getReader();v()}else{y._xhr=o,y._pos=0,y.url=o.responseURL,y.statusCode=o.status,y.statusMessage=o.statusText;var w=o.getAllResponseHeaders().split(/\r?\n/);if(w.forEach(function(v){var S=v.match(/^([^:]+):\s*(.*)/);if(S){var E=S[1].toLowerCase();E==="set-cookie"?(y.headers[E]===void 0&&(y.headers[E]=[]),y.headers[E].push(S[2])):y.headers[E]!==void 0?y.headers[E]+=", "+S[2]:y.headers[E]=S[2],y.rawHeaders.push(S[1],S[2])}}),y._charset="x-user-defined",!n.overrideMimeType){var P=y.rawHeaders["mime-type"];if(P){var B=P.match(/;\s*charset=([^;])(;|$)/);B&&(y._charset=B[1].toLowerCase())}y._charset||(y._charset="utf-8")}}};return r(i,a.Readable),i.prototype._read=function(){var o=this||La,l=o._resumeFetch;l&&(o._resumeFetch=null,l())},i.prototype._onXHRProgress=function(o){var l=this||La,f=l._xhr,p=null;switch(l._mode){case"text":if(p=f.responseText,p.length>l._pos){var y=p.substr(l._pos);if(l._charset==="x-user-defined"){for(var g=t.alloc(y.length),h=0;h<y.length;h++)g[h]=y.charCodeAt(h)&255;l.push(g)}else l.push(y,l._charset);l._pos=p.length}break;case"arraybuffer":if(f.readyState!==s.DONE||!f.response)break;p=f.response,l.push(t.from(new Uint8Array(p)));break;case"moz-chunked-arraybuffer":if(p=f.response,f.readyState!==s.LOADING||!p)break;l.push(t.from(new Uint8Array(p)));break;case"ms-stream":if(p=f.response,f.readyState!==s.LOADING)break;var w=new La.MSStreamReader;w.onprogress=function(){w.result.byteLength>l._pos&&(l.push(t.from(new Uint8Array(w.result.slice(l._pos)))),l._pos=w.result.byteLength)},w.onload=function(){o(!0),l.push(null)},w.readAsArrayBuffer(p);break}l._xhr.readyState===s.DONE&&l._mode!=="ms-stream"&&(o(!0),l.push(null))},Ka}function _k(){if(vh)return Gs;vh=!0;var t=Rt().Buffer,e=At,n=wh(),r=Mt(),a=Ah(),s=Ih(),i=a.IncomingMessage,o=a.readyStates;function l(g,h){return n.fetch&&h?"fetch":n.mozchunkedarraybuffer?"moz-chunked-arraybuffer":n.msstream?"ms-stream":n.arraybuffer&&g?"arraybuffer":"text"}var f=Gs=function(g){var h=this||at;s.Writable.call(h),h._opts=g,h._body=[],h._headers={},g.auth&&h.setHeader("Authorization","Basic "+t.from(g.auth).toString("base64")),Object.keys(g.headers).forEach(function(B){h.setHeader(B,g.headers[B])});var w,P=!0;if(g.mode==="disable-fetch"||"requestTimeout"in g&&!n.abortController)P=!1,w=!0;else if(g.mode==="prefer-streaming")w=!1;else if(g.mode==="allow-wrong-content-type")w=!n.overrideMimeType;else if(!g.mode||g.mode==="default"||g.mode==="prefer-fast")w=!0;else throw new Error("Invalid value for opts.mode");h._mode=l(w,P),h._fetchTimer=null,h._socketTimeout=null,h._socketTimer=null,h.on("finish",function(){h._onFinish()})};r(f,s.Writable),f.prototype.setHeader=function(g,h){var w=this||at,P=g.toLowerCase();y.indexOf(P)===-1&&(w._headers[P]={name:g,value:h})},f.prototype.getHeader=function(g){var h=(this||at)._headers[g.toLowerCase()];return h?h.value:null},f.prototype.removeHeader=function(g){var h=this||at;delete h._headers[g.toLowerCase()]},f.prototype._onFinish=function(){var g=this||at;if(!g._destroyed){var h=g._opts;"timeout"in h&&h.timeout!==0&&g.setTimeout(h.timeout);var w=g._headers,P=null;h.method!=="GET"&&h.method!=="HEAD"&&(P=new Blob(g._body,{type:(w["content-type"]||{}).value||""}));var B=[];if(Object.keys(w).forEach(function(H){var K=w[H].name,ae=w[H].value;Array.isArray(ae)?ae.forEach(function(Q){B.push([K,Q])}):B.push([K,ae])}),g._mode==="fetch"){var v=null;if(n.abortController){var S=new AbortController;v=S.signal,g._fetchAbortController=S,"requestTimeout"in h&&h.requestTimeout!==0&&(g._fetchTimer=at.setTimeout(function(){g.emit("requestTimeout"),g._fetchAbortController&&g._fetchAbortController.abort()},h.requestTimeout))}at.fetch(g._opts.url,{method:g._opts.method,headers:B,body:P||void 0,mode:"cors",credentials:h.withCredentials?"include":"same-origin",signal:v}).then(function(H){g._fetchResponse=H,g._resetTimers(!1),g._connect()},function(H){g._resetTimers(!0),g._destroyed||g.emit("error",H)})}else{var E=g._xhr=new at.XMLHttpRequest;try{E.open(g._opts.method,g._opts.url,!0)}catch(H){e.nextTick(function(){g.emit("error",H)});return}"responseType"in E&&(E.responseType=g._mode),"withCredentials"in E&&(E.withCredentials=!!h.withCredentials),g._mode==="text"&&"overrideMimeType"in E&&E.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in h&&(E.timeout=h.requestTimeout,E.ontimeout=function(){g.emit("requestTimeout")}),B.forEach(function(H){E.setRequestHeader(H[0],H[1])}),g._response=null,E.onreadystatechange=function(){switch(E.readyState){case o.LOADING:case o.DONE:g._onXHRProgress();break}},g._mode==="moz-chunked-arraybuffer"&&(E.onprogress=function(){g._onXHRProgress()}),E.onerror=function(){g._destroyed||(g._resetTimers(!0),g.emit("error",new Error("XHR error")))};try{E.send(P)}catch(H){e.nextTick(function(){g.emit("error",H)});return}}}};function p(g){try{var h=g.status;return h!==null&&h!==0}catch{return!1}}f.prototype._onXHRProgress=function(){var g=this||at;g._resetTimers(!1),!(!p(g._xhr)||g._destroyed)&&(g._response||g._connect(),g._response._onXHRProgress(g._resetTimers.bind(g)))},f.prototype._connect=function(){var g=this||at;g._destroyed||(g._response=new i(g._xhr,g._fetchResponse,g._mode,g._resetTimers.bind(g)),g._response.on("error",function(h){g.emit("error",h)}),g.emit("response",g._response))},f.prototype._write=function(g,h,w){var P=this||at;P._body.push(g),w()},f.prototype._resetTimers=function(g){var h=this||at;at.clearTimeout(h._socketTimer),h._socketTimer=null,g?(at.clearTimeout(h._fetchTimer),h._fetchTimer=null):h._socketTimeout&&(h._socketTimer=at.setTimeout(function(){h.emit("timeout")},h._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(g){var h=this||at;h._destroyed=!0,h._resetTimers(!0),h._response&&(h._response._destroyed=!0),h._xhr?h._xhr.abort():h._fetchAbortController&&h._fetchAbortController.abort(),g&&h.emit("error",g)},f.prototype.end=function(g,h,w){var P=this||at;typeof g=="function"&&(w=g,g=void 0),s.Writable.prototype.end.call(P,g,h,w)},f.prototype.setTimeout=function(g,h){var w=this||at;h&&w.once("timeout",h),w._socketTimeout=g,w._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return Gs}function bk(){if(Th)return Vs;Th=!0,Vs=e;var t=Object.prototype.hasOwnProperty;function e(){for(var n={},r=0;r<arguments.length;r++){var a=arguments[r];for(var s in a)t.call(a,s)&&(n[s]=a[s])}return n}return Vs}function wk(){return _h||(_h=!0,Js={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),Js}function Pk(){if(bh)return Xs;bh=!0;var t=_k(),e=Ah(),n=bk(),r=wk(),a=De,s=Xs;return s.request=function(i,o){typeof i=="string"?i=a.parse(i):i=n(i);var l=xk.location.protocol.search(/^https?:$/)===-1?"http:":"",f=i.protocol||l,p=i.hostname||i.host,y=i.port,g=i.path||"/";p&&p.indexOf(":")!==-1&&(p="["+p+"]"),i.url=(p?f+"//"+p:"")+(y?":"+y:"")+g,i.method=(i.method||"GET").toUpperCase(),i.headers=i.headers||{};var h=new t(i);return o&&h.on("response",o),h},s.get=function(o,l){var f=s.request(o,l);return f.end(),f},s.ClientRequest=t,s.IncomingMessage=e.IncomingMessage,s.Agent=function(){},s.Agent.defaultMaxSockets=4,s.globalAgent=new s.Agent,s.STATUS_CODES=r,s.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],Xs}var Pt,Qm,$n,Ms,eh,Ns,th,Ds,nh,Hs,rh,Us,ih,$s,ah,oh,Zs,sh,js,lh,Ks,uh,Ls,ch,Fs,fh,dh,Ws,ph,zs,gh,qs,yh,bt,mh,Ka,hh,La,Gs,vh,at,Vs,Th,Js,_h,Xs,bh,xk,Yt,Bk,Ek,Sk,kk,Ik,Ak,Ck,Ok,Oh=ot(()=>{O();M();R();rs();qy();is();fi();Im();Za();_s();Mm();Hm();Ym();Bs();Pt={},Qm=!1,$n=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ms={},eh=!1;Ns={},th=!1;Ds={},nh=!1;Hs={},rh=!1;Us={},ih=!1;$s={},ah=!1,oh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Zs={},sh=!1;js={},lh=!1;Ks={},uh=!1;Ls={},ch=!1;Fs={},fh=!1,dh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ws={},ph=!1;zs={},gh=!1;qs={},yh=!1;bt={},mh=!1;Ka={},hh=!1,La=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Gs={},vh=!1,at=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Vs={},Th=!1;Js={},_h=!1;Xs={},bh=!1,xk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Yt=Pk(),Bk=Yt.Agent,Ek=Yt.ClientRequest,Sk=Yt.IncomingMessage,kk=Yt.METHODS,Ik=Yt.STATUS_CODES,Ak=Yt.get,Ck=Yt.globalAgent,Ok=Yt.request});O();M();R();var Iy={};Ln(Iy,{defaults:()=>OB,markdown:()=>CB});O();M();R();O();M();R();O();M();R();var Po=Object.defineProperty,Kv=Object.defineProperties,Lv=Object.getOwnPropertyDescriptors,xi=Object.getOwnPropertySymbols,Vc=Object.prototype.hasOwnProperty,Jc=Object.prototype.propertyIsEnumerable,dc=(t,e,n)=>e in t?Po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,b=(t,e)=>{for(var n in e||(e={}))Vc.call(e,n)&&dc(t,n,e[n]);if(xi)for(var n of xi(e))Jc.call(e,n)&&dc(t,n,e[n]);return t},N=(t,e)=>Kv(t,Lv(e)),d=(t,e)=>Po(t,"name",{value:e,configurable:!0}),Xc=(t,e)=>{var n={};for(var r in t)Vc.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&xi)for(var r of xi(t))e.indexOf(r)<0&&Jc.call(t,r)&&(n[r]=t[r]);return n},ia=(t,e)=>{for(var n in e)Po(t,n,{get:e[n],enumerable:!0})},Fv={};ia(Fv,{errors:()=>tf,fromJSONSchema:()=>qg,fromJSONSchemaLegacy:()=>tB,fromObject:()=>wo,toJSONSchema:()=>st,toJSONSchemaLegacy:()=>SB,toTypescriptSchema:()=>Do,toTypescriptType:()=>Bo});var ne={};ia(ne,{BRAND:()=>Cx,DIRTY:()=>Vn,EMPTY_PATH:()=>Sx,INVALID:()=>pe,NEVER:()=>CP,OK:()=>pt,ParseInputLazyPath:()=>It,ParseStatus:()=>vt,Schema:()=>he,ZodAny:()=>Kr,ZodArray:()=>Lr,ZodBigInt:()=>Zo,ZodBoolean:()=>jo,ZodBranded:()=>Ko,ZodCatch:()=>Lo,ZodDate:()=>Fo,ZodDefault:()=>ya,ZodDiscriminatedUnion:()=>ug,ZodEffects:()=>Bn,ZodEnum:()=>ir,ZodError:()=>Kt,ZodFirstPartyTypeKind:()=>Jp,ZodFunction:()=>fg,ZodIntersection:()=>zo,ZodIssueCode:()=>q,ZodLazy:()=>qo,ZodLiteral:()=>Go,ZodMap:()=>pg,ZodNaN:()=>yg,ZodNativeEnum:()=>Vo,ZodNever:()=>zr,ZodNull:()=>Jo,ZodNullable:()=>Qn,ZodNumber:()=>Xo,ZodObject:()=>er,ZodOptional:()=>an,ZodParsedType:()=>te,ZodPipeline:()=>Yo,ZodPromise:()=>ha,ZodReadonly:()=>va,ZodRecord:()=>wg,ZodRef:()=>Pg,ZodSchema:()=>he,ZodSet:()=>Bg,ZodString:()=>gt,ZodSymbol:()=>Dg,ZodTransformer:()=>Bn,ZodTuple:()=>nr,ZodType:()=>he,ZodUndefined:()=>Ta,ZodUnion:()=>Qo,ZodUnknown:()=>Dr,ZodVoid:()=>Zg,addIssueToContext:()=>ee,agent:()=>Ux,aimodel:()=>Lx,any:()=>eP,array:()=>iP,bigint:()=>Vx,boolean:()=>Lg,coerce:()=>AP,conversation:()=>Nx,createZodEnum:()=>ma,cuid2Regex:()=>Sg,cuidRegex:()=>Eg,custom:()=>sg,datasource:()=>Fx,date:()=>Jx,default:()=>PP,discriminatedUnion:()=>lP,effect:()=>zc,emailRegex:()=>Ag,enum:()=>TP,errorUtil:()=>ue,event:()=>$x,function:()=>mP,getErrorMap:()=>Zr,getParsedType:()=>rn,instanceof:()=>qx,intent:()=>Kx,intersection:()=>uP,ipv4Regex:()=>Og,ipv6Regex:()=>Rg,isAborted:()=>To,isAsync:()=>Ei,isDirty:()=>_o,isEmojiRegex:()=>Ox,isValid:()=>jr,knowledgebase:()=>Wx,late:()=>zx,lazy:()=>hP,literal:()=>vP,makeIssue:()=>Bi,map:()=>gP,message:()=>Hx,nan:()=>Gx,nativeEnum:()=>_P,never:()=>nP,null:()=>Qx,nullable:()=>xP,number:()=>Kg,object:()=>aP,objectUtil:()=>vo,oboolean:()=>IP,onumber:()=>kP,optional:()=>wP,ostring:()=>SP,pipeline:()=>EP,preprocess:()=>BP,processCreateParams:()=>me,promise:()=>bP,quotelessJson:()=>Ex,readonly:()=>pP,record:()=>fP,ref:()=>dP,set:()=>yP,setErrorMap:()=>Qp,strictObject:()=>oP,string:()=>jg,symbol:()=>Xx,table:()=>Zx,tablerow:()=>jx,transformer:()=>zc,tuple:()=>cP,ulidRegex:()=>kg,undefined:()=>Yx,union:()=>sP,unknown:()=>tP,user:()=>Dx,util:()=>be,uuidRegex:()=>Ig,variable:()=>Mx,void:()=>rP});var le="x-zui";function Yc(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:se(t)}d(Yc,"primitiveToTypscriptLiteralType");function se(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${se(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}d(se,"primitiveToTypescriptValue");function Jn(t){return typeof t>"u"?"undefined":JSON.stringify(t)}d(Jn,"unknownToTypescriptValue");var Qc=d((t,e)=>{let n=Object.entries(t),r=e?" as const":"";return`{ ${n.map(([a,s])=>`${lo(a)}: ${Jn(s)}`).join(", ")} }${r}`},"recordOfUnknownToTypescriptRecord"),lo=d(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:se(t),"toPropertyKey"),Wv=d(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),ef=d(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(Wv).filter(r=>!!r).join("")},"toTypeArgumentName"),nt=d(t=>{let e=(t??"").split(`
14
14
  `).filter(n=>n.trim().length>0);return e.length===0?"":e.length===1?`/** ${e[0]} */`:`/**
15
15
  * ${e.join(`
16
16
  * `)}
17
- */`},"getMultilineComment"),Sf={};gf(Sf,{JsonSchemaToZuiError:()=>Af,ObjectToZuiError:()=>sa,UnrepresentableGenericError:()=>la,UnsupportedZuiToJsonSchemaError:()=>vT,UnsupportedZuiToTypescriptSchemaError:()=>mn,UnsupportedZuiToTypescriptTypeError:()=>$f,UntitledDeclarationError:()=>Lf,ZuiToJsonSchemaError:()=>Of,ZuiToTypescriptSchemaError:()=>Nf,ZuiToTypescriptTypeError:()=>ro,ZuiTransformError:()=>nr});var kf=class extends Error{constructor(e,n){super(n),this.transform=e}};p(kf,"ZuiTransformError");var nr=kf,If=class extends nr{constructor(e){super("json-schema-to-zui",e)}};p(If,"JsonSchemaToZuiError");var Af=If,Cf=class extends nr{constructor(e){super("object-to-zui",e)}};p(Cf,"ObjectToZuiError");var sa=Cf,Rf=class extends nr{constructor(e){super("zui-to-json-schema",e)}};p(Rf,"ZuiToJsonSchemaError");var Of=Rf,Mf=class extends Of{constructor(e){super(`Zod type ${e} cannot be transformed to JSON Schema.`)}};p(Mf,"UnsupportedZuiToJsonSchemaError");var vT=Mf,Df=class extends nr{constructor(e){super("zui-to-typescript-schema",e)}};p(Df,"ZuiToTypescriptSchemaError");var Nf=Df,Hf=class extends Nf{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};p(Hf,"UnsupportedZuiToTypescriptSchemaError");var mn=Hf,Uf=class extends nr{constructor(e){super("zui-to-typescript-type",e)}};p(Uf,"ZuiToTypescriptTypeError");var ro=Uf,jf=class extends ro{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};p(jf,"UnsupportedZuiToTypescriptTypeError");var $f=jf,Zf=class extends ro{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};p(Zf,"UntitledDeclarationError");var Lf=Zf,Ff=class extends ro{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};p(Ff,"UnrepresentableGenericError");var la=Ff,Kf=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],TT=p(t=>Kf.includes(t),"isPrimitive"),_T=p(t=>Kf.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),Rc=p(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),Wf=class{constructor(e,n,r=!1){this.key=e,this.value=n,this.optional=r}};p(Wf,"KeyValue");var li=Wf,qf=class{constructor(e){this.schema=e}};p(qf,"FnParameters");var Oc=qf,zf=class{constructor(e){this.schema=e}};p(zf,"FnReturn");var Mc=zf,Gf=class{constructor(e){this.props=e}};p(Gf,"Declaration");var ci=Gf;function _i(t,e={}){let n=xT(t,e),r=Ce(n,{});return e.formatter&&(r=e.formatter(r)),r}p(_i,"toTypescript");function Ce(t,e){var n,r,o;let s=H(x({},e),{parent:t});if(t===null)return"";if(t instanceof ci)return bT(t,s);if(t instanceof li){if(t.value instanceof q.ZodOptional){let m=t.value._def.innerType;return m instanceof q.Schema&&!m.description&&t.value.description&&(m=m?.describe(t.value.description)),Ce(new li(t.key,m,!0),s)}let l=pe(t.value._def.description),c=l?.trim().length>0?`
18
- `:"",d=t.value.describe(""),g=t.optional||t.value.isOptional()?"?":"";return`${c}${l}${c}${t.key}${g}: ${Ce(d,s)}${c}`}if(t instanceof Oc){if(t.schema instanceof q.ZodTuple){let d="";for(let y=0;y<t.schema.items.length;y++){let g=(o=(r=(n=t.schema.items[y])==null?void 0:n.ui)==null?void 0:r.title)!=null?o:`arg${y}`,m=t.schema.items[y];d+=`${Ce(new li(Cc(g),m),s)}${y<t.schema.items.length-1?", ":""} `}return d}let l=Ce(t.schema,s);return l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")||l.startsWith("(")&&l.endsWith(")")||l.startsWith("Array<")&&l.endsWith(">")||l.startsWith("Record<")&&l.endsWith(">")||_T(l)?`args: ${l}`:l}if(t instanceof Mc)return t.schema instanceof q.ZodOptional?`${Ce(t.schema.unwrap(),s)} | undefined`:Ce(t.schema,s);let a=t._def;switch(a.typeName){case q.ZodFirstPartyTypeKind.ZodString:return`${pe(a.description)} string`.trim();case q.ZodFirstPartyTypeKind.ZodNumber:case q.ZodFirstPartyTypeKind.ZodNaN:case q.ZodFirstPartyTypeKind.ZodBigInt:return`${pe(a.description)} number`.trim();case q.ZodFirstPartyTypeKind.ZodBoolean:return`${pe(t._def.description)} boolean`.trim();case q.ZodFirstPartyTypeKind.ZodDate:return`${pe(a.description)} Date`.trim();case q.ZodFirstPartyTypeKind.ZodUndefined:return`${pe(a.description)} undefined`.trim();case q.ZodFirstPartyTypeKind.ZodNull:return`${pe(a.description)} null`.trim();case q.ZodFirstPartyTypeKind.ZodAny:return`${pe(a.description)} any`.trim();case q.ZodFirstPartyTypeKind.ZodUnknown:return`${pe(a.description)} unknown`.trim();case q.ZodFirstPartyTypeKind.ZodNever:return`${pe(a.description)} never`.trim();case q.ZodFirstPartyTypeKind.ZodVoid:return`${pe(a.description)} void`.trim();case q.ZodFirstPartyTypeKind.ZodArray:let l=Ce(a.type,s);return TT(l)?`${l}[]`:`Array<${l}>`;case q.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(a.shape()).map(([E,M])=>Ce(new li(Cc(E),M),s)).join("; ")} }`;case q.ZodFirstPartyTypeKind.ZodUnion:let d=a.options.map(E=>Ce(E,s));return`${pe(a.description)}
19
- ${d.join(" | ")}`;case q.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let y=a.options.map(E=>Ce(E,s));return`${pe(t._def.description)}
20
- ${y.join(" | ")}`;case q.ZodFirstPartyTypeKind.ZodIntersection:return`${Ce(a.left,s)} & ${Ce(a.right,s)}`;case q.ZodFirstPartyTypeKind.ZodTuple:return a.items.length===0?"":`[${a.items.map(E=>Ce(E,s)).join(", ")}]`;case q.ZodFirstPartyTypeKind.ZodRecord:let m=Ce(a.keyType,s),v=Ce(a.valueType,s);return`${pe(a.description)} { [key: ${m}]: ${v} }`;case q.ZodFirstPartyTypeKind.ZodMap:return`Map<${Ce(a.keyType,s)}, ${Ce(a.valueType,s)}>`;case q.ZodFirstPartyTypeKind.ZodSet:return`Set<${Ce(a.valueType,s)}>`;case q.ZodFirstPartyTypeKind.ZodFunction:let B=Ce(new Oc(a.args),s),P=Ce(new Mc(a.returns),s);return`${pe(a.description)}
21
- (${B}) => ${P}`;case q.ZodFirstPartyTypeKind.ZodLazy:return Ce(a.getter(),s);case q.ZodFirstPartyTypeKind.ZodLiteral:let T=Bf(a.value);return`${pe(a.description)}
22
- ${T}`.trim();case q.ZodFirstPartyTypeKind.ZodEnum:return a.values.map(jt).join(" | ");case q.ZodFirstPartyTypeKind.ZodEffects:return Ce(a.schema,s);case q.ZodFirstPartyTypeKind.ZodNativeEnum:throw new $f(q.ZodFirstPartyTypeKind.ZodNativeEnum);case q.ZodFirstPartyTypeKind.ZodOptional:return`${Ce(a.innerType,s)} | undefined`;case q.ZodFirstPartyTypeKind.ZodNullable:return`${Ce(a.innerType,s)} | null`;case q.ZodFirstPartyTypeKind.ZodDefault:return Ce(a.innerType,s);case q.ZodFirstPartyTypeKind.ZodCatch:return Ce(a.innerType,s);case q.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${Ce(a.type,s)}>`;case q.ZodFirstPartyTypeKind.ZodBranded:return Ce(a.type,s);case q.ZodFirstPartyTypeKind.ZodPipeline:return Ce(a.in,s);case q.ZodFirstPartyTypeKind.ZodSymbol:return`${pe(a.description)} symbol`.trim();case q.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${Ce(a.innerType,s)}>`;case q.ZodFirstPartyTypeKind.ZodRef:return Ef(a.uri);default:be.assertNever(a)}}p(Ce,"sUnwrapZod");var bT=p((t,e)=>{if(t.props.type==="none")return Ce(t.props.schema,e);let n=pe(t.props.schema.description),r=t.props.schema.describe(""),o=Ce(r,e);if(t.props.type==="variable")return Rc(`${n}declare const ${t.props.identifier}: ${o};`);let s=t.props.args.length>0?`<${t.props.args.map(Ef).join(", ")}>`:"";return Rc(`${n}type ${t.props.identifier}${s} = ${o};`)},"unwrapDeclaration"),wT=p(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),xT=p((t,e)=>{let n=wT(e),r=t.getReferences();if(n==="none"){if(r.length>0)throw new la;return new ci({type:"none",schema:t})}let o="title"in t.ui?t.ui.title:null;if(!o)throw new Lf;if(n==="variable"){if(r.length>0)throw new la;return new ci({type:"variable",identifier:o,schema:t})}return new ci({type:"type",identifier:o,schema:t,args:r})},"getDeclarationProps"),BT=typeof global=="object"&&global&&global.Object===Object&&global,Vf=BT,PT=typeof self=="object"&&self&&self.Object===Object&&self,ET=Vf||PT||Function("return this")(),Ft=ET,ST=Ft.Symbol,rn=ST,Jf=Object.prototype,kT=Jf.hasOwnProperty,IT=Jf.toString,wr=rn?rn.toStringTag:void 0;function Yf(t){var e=kT.call(t,wr),n=t[wr];try{t[wr]=void 0;var r=!0}catch{}var o=IT.call(t);return r&&(e?t[wr]=n:delete t[wr]),o}p(Yf,"getRawTag");var AT=Yf,CT=Object.prototype,RT=CT.toString;function Xf(t){return RT.call(t)}p(Xf,"objectToString");var OT=Xf,MT="[object Null]",DT="[object Undefined]",Dc=rn?rn.toStringTag:void 0;function Qf(t){return t==null?t===void 0?DT:MT:Dc&&Dc in Object(t)?AT(t):OT(t)}p(Qf,"baseGetTag");var rr=Qf;function ed(t){return t!=null&&typeof t=="object"}p(ed,"isObjectLike");var Jn=ed,NT="[object Symbol]";function td(t){return typeof t=="symbol"||Jn(t)&&rr(t)==NT}p(td,"isSymbol");var ka=td;function nd(t,e){for(var n=-1,r=t==null?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}p(nd,"arrayMap");var HT=nd,UT=Array.isArray,Lt=UT,jT=1/0,Nc=rn?rn.prototype:void 0,Hc=Nc?Nc.toString:void 0;function Ia(t){if(typeof t=="string")return t;if(Lt(t))return HT(t,Ia)+"";if(ka(t))return Hc?Hc.call(t):"";var e=t+"";return e=="0"&&1/t==-jT?"-0":e}p(Ia,"baseToString");var $T=Ia;function rd(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}p(rd,"isObject");var Aa=rd;function id(t){return t}p(id,"identity");var ZT=id,LT="[object AsyncFunction]",FT="[object Function]",KT="[object GeneratorFunction]",WT="[object Proxy]";function od(t){if(!Aa(t))return!1;var e=rr(t);return e==FT||e==KT||e==LT||e==WT}p(od,"isFunction");var ad=od,qT=Ft["__core-js_shared__"],na=qT,Uc=function(){var t=/[^.]+$/.exec(na&&na.keys&&na.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function sd(t){return!!Uc&&Uc in t}p(sd,"isMasked");var zT=sd,GT=Function.prototype,VT=GT.toString;function ld(t){if(t!=null){try{return VT.call(t)}catch{}try{return t+""}catch{}}return""}p(ld,"toSource");var xn=ld,JT=/[\\^$.*+?()[\]{}|]/g,YT=/^\[object .+?Constructor\]$/,XT=Function.prototype,QT=Object.prototype,e_=XT.toString,t_=QT.hasOwnProperty,n_=RegExp("^"+e_.call(t_).replace(JT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ud(t){if(!Aa(t)||zT(t))return!1;var e=ad(t)?n_:YT;return e.test(xn(t))}p(ud,"baseIsNative");var r_=ud;function cd(t,e){return t?.[e]}p(cd,"getValue");var i_=cd;function fd(t,e){var n=i_(t,e);return r_(n)?n:void 0}p(fd,"getNative");var Bn=fd,o_=Bn(Ft,"WeakMap"),ua=o_,a_=function(){try{var t=Bn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),jc=a_,s_=9007199254740991,l_=/^(?:0|[1-9]\d*)$/;function dd(t,e){var n=typeof t;return e=e??s_,!!e&&(n=="number"||n!="symbol"&&l_.test(t))&&t>-1&&t%1==0&&t<e}p(dd,"isIndex");var pd=dd;function gd(t,e,n){e=="__proto__"&&jc?jc(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}p(gd,"baseAssignValue");var u_=gd;function yd(t,e){return t===e||t!==t&&e!==e}p(yd,"eq");var md=yd,c_=9007199254740991;function hd(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=c_}p(hd,"isLength");var Ca=hd;function vd(t){return t!=null&&Ca(t.length)&&!ad(t)}p(vd,"isArrayLike");var f_=vd,d_=Object.prototype;function Td(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||d_;return t===n}p(Td,"isPrototype");var p_=Td;function _d(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}p(_d,"baseTimes");var g_=_d,y_="[object Arguments]";function bd(t){return Jn(t)&&rr(t)==y_}p(bd,"baseIsArguments");var $c=bd,wd=Object.prototype,m_=wd.hasOwnProperty,h_=wd.propertyIsEnumerable,v_=$c(function(){return arguments}())?$c:function(t){return Jn(t)&&m_.call(t,"callee")&&!h_.call(t,"callee")},xd=v_;function Bd(){return!1}p(Bd,"stubFalse");var T_=Bd,Pd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Zc=Pd&&typeof module=="object"&&module&&!module.nodeType&&module,__=Zc&&Zc.exports===Pd,Lc=__?Ft.Buffer:void 0,b_=Lc?Lc.isBuffer:void 0,w_=b_||T_,ca=w_,x_="[object Arguments]",B_="[object Array]",P_="[object Boolean]",E_="[object Date]",S_="[object Error]",k_="[object Function]",I_="[object Map]",A_="[object Number]",C_="[object Object]",R_="[object RegExp]",O_="[object Set]",M_="[object String]",D_="[object WeakMap]",N_="[object ArrayBuffer]",H_="[object DataView]",U_="[object Float32Array]",j_="[object Float64Array]",$_="[object Int8Array]",Z_="[object Int16Array]",L_="[object Int32Array]",F_="[object Uint8Array]",K_="[object Uint8ClampedArray]",W_="[object Uint16Array]",q_="[object Uint32Array]",Le={};Le[U_]=Le[j_]=Le[$_]=Le[Z_]=Le[L_]=Le[F_]=Le[K_]=Le[W_]=Le[q_]=!0;Le[x_]=Le[B_]=Le[N_]=Le[P_]=Le[H_]=Le[E_]=Le[S_]=Le[k_]=Le[I_]=Le[A_]=Le[C_]=Le[R_]=Le[O_]=Le[M_]=Le[D_]=!1;function Ed(t){return Jn(t)&&Ca(t.length)&&!!Le[rr(t)]}p(Ed,"baseIsTypedArray");var z_=Ed;function Sd(t){return function(e){return t(e)}}p(Sd,"baseUnary");var G_=Sd,kd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kr=kd&&typeof module=="object"&&module&&!module.nodeType&&module,V_=kr&&kr.exports===kd,ra=V_&&Vf.process,J_=function(){try{var t=kr&&kr.require&&kr.require("util").types;return t||ra&&ra.binding&&ra.binding("util")}catch{}}(),Fc=J_,Kc=Fc&&Fc.isTypedArray,Y_=Kc?G_(Kc):z_,Id=Y_,X_=Object.prototype,Q_=X_.hasOwnProperty;function Ad(t,e){var n=Lt(t),r=!n&&xd(t),o=!n&&!r&&ca(t),s=!n&&!r&&!o&&Id(t),i=n||r||o||s,a=i?g_(t.length,String):[],l=a.length;for(var c in t)(e||Q_.call(t,c))&&!(i&&(c=="length"||o&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||pd(c,l)))&&a.push(c);return a}p(Ad,"arrayLikeKeys");var eb=Ad;function Cd(t,e){return function(n){return t(e(n))}}p(Cd,"overArg");var tb=Cd,nb=tb(Object.keys,Object),rb=nb,ib=Object.prototype,ob=ib.hasOwnProperty;function Rd(t){if(!p_(t))return rb(t);var e=[];for(var n in Object(t))ob.call(t,n)&&n!="constructor"&&e.push(n);return e}p(Rd,"baseKeys");var ab=Rd;function Od(t){return f_(t)?eb(t):ab(t)}p(Od,"keys");var Ra=Od,sb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,lb=/^\w*$/;function Md(t,e){if(Lt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||ka(t)?!0:lb.test(t)||!sb.test(t)||e!=null&&t in Object(e)}p(Md,"isKey");var Oa=Md,ub=Bn(Object,"create"),Cr=ub;function Dd(){this.__data__=Cr?Cr(null):{},this.size=0}p(Dd,"hashClear");var cb=Dd;function Nd(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}p(Nd,"hashDelete");var fb=Nd,db="__lodash_hash_undefined__",pb=Object.prototype,gb=pb.hasOwnProperty;function Hd(t){var e=this.__data__;if(Cr){var n=e[t];return n===db?void 0:n}return gb.call(e,t)?e[t]:void 0}p(Hd,"hashGet");var yb=Hd,mb=Object.prototype,hb=mb.hasOwnProperty;function Ud(t){var e=this.__data__;return Cr?e[t]!==void 0:hb.call(e,t)}p(Ud,"hashHas");var vb=Ud,Tb="__lodash_hash_undefined__";function jd(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Cr&&e===void 0?Tb:e,this}p(jd,"hashSet");var _b=jd;function Pn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}p(Pn,"Hash");Pn.prototype.clear=cb;Pn.prototype.delete=fb;Pn.prototype.get=yb;Pn.prototype.has=vb;Pn.prototype.set=_b;var Wc=Pn;function $d(){this.__data__=[],this.size=0}p($d,"listCacheClear");var bb=$d;function Zd(t,e){for(var n=t.length;n--;)if(md(t[n][0],e))return n;return-1}p(Zd,"assocIndexOf");var io=Zd,wb=Array.prototype,xb=wb.splice;function Ld(t){var e=this.__data__,n=io(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():xb.call(e,n,1),--this.size,!0}p(Ld,"listCacheDelete");var Bb=Ld;function Fd(t){var e=this.__data__,n=io(e,t);return n<0?void 0:e[n][1]}p(Fd,"listCacheGet");var Pb=Fd;function Kd(t){return io(this.__data__,t)>-1}p(Kd,"listCacheHas");var Eb=Kd;function Wd(t,e){var n=this.__data__,r=io(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}p(Wd,"listCacheSet");var Sb=Wd;function En(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}p(En,"ListCache");En.prototype.clear=bb;En.prototype.delete=Bb;En.prototype.get=Pb;En.prototype.has=Eb;En.prototype.set=Sb;var oo=En,kb=Bn(Ft,"Map"),Rr=kb;function qd(){this.size=0,this.__data__={hash:new Wc,map:new(Rr||oo),string:new Wc}}p(qd,"mapCacheClear");var Ib=qd;function zd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}p(zd,"isKeyable");var Ab=zd;function Gd(t,e){var n=t.__data__;return Ab(e)?n[typeof e=="string"?"string":"hash"]:n.map}p(Gd,"getMapData");var ao=Gd;function Vd(t){var e=ao(this,t).delete(t);return this.size-=e?1:0,e}p(Vd,"mapCacheDelete");var Cb=Vd;function Jd(t){return ao(this,t).get(t)}p(Jd,"mapCacheGet");var Rb=Jd;function Yd(t){return ao(this,t).has(t)}p(Yd,"mapCacheHas");var Ob=Yd;function Xd(t,e){var n=ao(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}p(Xd,"mapCacheSet");var Mb=Xd;function Sn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}p(Sn,"MapCache");Sn.prototype.clear=Ib;Sn.prototype.delete=Cb;Sn.prototype.get=Rb;Sn.prototype.has=Ob;Sn.prototype.set=Mb;var so=Sn,Db="Expected a function";function lo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Db);var n=p(function(){var r=arguments,o=e?e.apply(this,r):r[0],s=n.cache;if(s.has(o))return s.get(o);var i=t.apply(this,r);return n.cache=s.set(o,i)||s,i},"memoized");return n.cache=new(lo.Cache||so),n}p(lo,"memoize");lo.Cache=so;var Nb=lo,Hb=500;function Qd(t){var e=Nb(t,function(r){return n.size===Hb&&n.clear(),r}),n=e.cache;return e}p(Qd,"memoizeCapped");var Ub=Qd,jb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$b=/\\(\\)?/g,Zb=Ub(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(jb,function(n,r,o,s){e.push(o?s.replace($b,"$1"):r||n)}),e}),Lb=Zb;function ep(t){return t==null?"":$T(t)}p(ep,"toString");var Fb=ep;function tp(t,e){return Lt(t)?t:Oa(t,e)?[t]:Lb(Fb(t))}p(tp,"castPath");var np=tp,Kb=1/0;function rp(t){if(typeof t=="string"||ka(t))return t;var e=t+"";return e=="0"&&1/t==-Kb?"-0":e}p(rp,"toKey");var uo=rp;function ip(t,e){e=np(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[uo(e[n++])];return n&&n==r?t:void 0}p(ip,"baseGet");var op=ip;function ap(t,e,n){var r=t==null?void 0:op(t,e);return r===void 0?n:r}p(ap,"get");var Wb=ap;function sp(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}p(sp,"arrayPush");var qb=sp;function lp(){this.__data__=new oo,this.size=0}p(lp,"stackClear");var zb=lp;function up(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}p(up,"stackDelete");var Gb=up;function cp(t){return this.__data__.get(t)}p(cp,"stackGet");var Vb=cp;function fp(t){return this.__data__.has(t)}p(fp,"stackHas");var Jb=fp,Yb=200;function dp(t,e){var n=this.__data__;if(n instanceof oo){var r=n.__data__;if(!Rr||r.length<Yb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new so(r)}return n.set(t,e),this.size=n.size,this}p(dp,"stackSet");var Xb=dp;function kn(t){var e=this.__data__=new oo(t);this.size=e.size}p(kn,"Stack");kn.prototype.clear=zb;kn.prototype.delete=Gb;kn.prototype.get=Vb;kn.prototype.has=Jb;kn.prototype.set=Xb;var fi=kn;function pp(t,e){for(var n=-1,r=t==null?0:t.length,o=0,s=[];++n<r;){var i=t[n];e(i,n,t)&&(s[o++]=i)}return s}p(pp,"arrayFilter");var Qb=pp;function gp(){return[]}p(gp,"stubArray");var ew=gp,tw=Object.prototype,nw=tw.propertyIsEnumerable,qc=Object.getOwnPropertySymbols,rw=qc?function(t){return t==null?[]:(t=Object(t),Qb(qc(t),function(e){return nw.call(t,e)}))}:ew,iw=rw;function yp(t,e,n){var r=e(t);return Lt(t)?r:qb(r,n(t))}p(yp,"baseGetAllKeys");var ow=yp;function mp(t){return ow(t,Ra,iw)}p(mp,"getAllKeys");var zc=mp,aw=Bn(Ft,"DataView"),fa=aw,sw=Bn(Ft,"Promise"),da=sw,lw=Bn(Ft,"Set"),pa=lw,Gc="[object Map]",uw="[object Object]",Vc="[object Promise]",Jc="[object Set]",Yc="[object WeakMap]",Xc="[object DataView]",cw=xn(fa),fw=xn(Rr),dw=xn(da),pw=xn(pa),gw=xn(ua),hn=rr;(fa&&hn(new fa(new ArrayBuffer(1)))!=Xc||Rr&&hn(new Rr)!=Gc||da&&hn(da.resolve())!=Vc||pa&&hn(new pa)!=Jc||ua&&hn(new ua)!=Yc)&&(hn=p(function(t){var e=rr(t),n=e==uw?t.constructor:void 0,r=n?xn(n):"";if(r)switch(r){case cw:return Xc;case fw:return Gc;case dw:return Vc;case pw:return Jc;case gw:return Yc}return e},"getTag"));var Qc=hn,yw=Ft.Uint8Array,ef=yw,mw="__lodash_hash_undefined__";function hp(t){return this.__data__.set(t,mw),this}p(hp,"setCacheAdd");var hw=hp;function vp(t){return this.__data__.has(t)}p(vp,"setCacheHas");var vw=vp;function Or(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new so;++e<n;)this.add(t[e])}p(Or,"SetCache");Or.prototype.add=Or.prototype.push=hw;Or.prototype.has=vw;var Tw=Or;function Tp(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}p(Tp,"arraySome");var _w=Tp;function _p(t,e){return t.has(e)}p(_p,"cacheHas");var bw=_p,ww=1,xw=2;function bp(t,e,n,r,o,s){var i=n&ww,a=t.length,l=e.length;if(a!=l&&!(i&&l>a))return!1;var c=s.get(t),d=s.get(e);if(c&&d)return c==e&&d==t;var y=-1,g=!0,m=n&xw?new Tw:void 0;for(s.set(t,e),s.set(e,t);++y<a;){var v=t[y],B=e[y];if(r)var P=i?r(B,v,y,e,t,s):r(v,B,y,t,e,s);if(P!==void 0){if(P)continue;g=!1;break}if(m){if(!_w(e,function(T,S){if(!bw(m,S)&&(v===T||o(v,T,n,r,s)))return m.push(S)})){g=!1;break}}else if(!(v===B||o(v,B,n,r,s))){g=!1;break}}return s.delete(t),s.delete(e),g}p(bp,"equalArrays");var wp=bp;function xp(t){var e=-1,n=Array(t.size);return t.forEach(function(r,o){n[++e]=[o,r]}),n}p(xp,"mapToArray");var Bw=xp;function Bp(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}p(Bp,"setToArray");var Pw=Bp,Ew=1,Sw=2,kw="[object Boolean]",Iw="[object Date]",Aw="[object Error]",Cw="[object Map]",Rw="[object Number]",Ow="[object RegExp]",Mw="[object Set]",Dw="[object String]",Nw="[object Symbol]",Hw="[object ArrayBuffer]",Uw="[object DataView]",tf=rn?rn.prototype:void 0,ia=tf?tf.valueOf:void 0;function Pp(t,e,n,r,o,s,i){switch(n){case Uw:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Hw:return!(t.byteLength!=e.byteLength||!s(new ef(t),new ef(e)));case kw:case Iw:case Rw:return md(+t,+e);case Aw:return t.name==e.name&&t.message==e.message;case Ow:case Dw:return t==e+"";case Cw:var a=Bw;case Mw:var l=r&Ew;if(a||(a=Pw),t.size!=e.size&&!l)return!1;var c=i.get(t);if(c)return c==e;r|=Sw,i.set(t,e);var d=wp(a(t),a(e),r,o,s,i);return i.delete(t),d;case Nw:if(ia)return ia.call(t)==ia.call(e)}return!1}p(Pp,"equalByTag");var jw=Pp,$w=1,Zw=Object.prototype,Lw=Zw.hasOwnProperty;function Ep(t,e,n,r,o,s){var i=n&$w,a=zc(t),l=a.length,c=zc(e),d=c.length;if(l!=d&&!i)return!1;for(var y=l;y--;){var g=a[y];if(!(i?g in e:Lw.call(e,g)))return!1}var m=s.get(t),v=s.get(e);if(m&&v)return m==e&&v==t;var B=!0;s.set(t,e),s.set(e,t);for(var P=i;++y<l;){g=a[y];var T=t[g],S=e[g];if(r)var E=i?r(S,T,g,e,t,s):r(T,S,g,t,e,s);if(!(E===void 0?T===S||o(T,S,n,r,s):E)){B=!1;break}P||(P=g=="constructor")}if(B&&!P){var M=t.constructor,$=e.constructor;M!=$&&"constructor"in t&&"constructor"in e&&!(typeof M=="function"&&M instanceof M&&typeof $=="function"&&$ instanceof $)&&(B=!1)}return s.delete(t),s.delete(e),B}p(Ep,"equalObjects");var Fw=Ep,Kw=1,nf="[object Arguments]",rf="[object Array]",ui="[object Object]",Ww=Object.prototype,of=Ww.hasOwnProperty;function Sp(t,e,n,r,o,s){var i=Lt(t),a=Lt(e),l=i?rf:Qc(t),c=a?rf:Qc(e);l=l==nf?ui:l,c=c==nf?ui:c;var d=l==ui,y=c==ui,g=l==c;if(g&&ca(t)){if(!ca(e))return!1;i=!0,d=!1}if(g&&!d)return s||(s=new fi),i||Id(t)?wp(t,e,n,r,o,s):jw(t,e,l,n,r,o,s);if(!(n&Kw)){var m=d&&of.call(t,"__wrapped__"),v=y&&of.call(e,"__wrapped__");if(m||v){var B=m?t.value():t,P=v?e.value():e;return s||(s=new fi),o(B,P,n,r,s)}}return g?(s||(s=new fi),Fw(t,e,n,r,o,s)):!1}p(Sp,"baseIsEqualDeep");var qw=Sp;function Ma(t,e,n,r,o){return t===e?!0:t==null||e==null||!Jn(t)&&!Jn(e)?t!==t&&e!==e:qw(t,e,n,r,Ma,o)}p(Ma,"baseIsEqual");var Da=Ma,zw=1,Gw=2;function kp(t,e,n,r){var o=n.length,s=o,i=!r;if(t==null)return!s;for(t=Object(t);o--;){var a=n[o];if(i&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++o<s;){a=n[o];var l=a[0],c=t[l],d=a[1];if(i&&a[2]){if(c===void 0&&!(l in t))return!1}else{var y=new fi;if(r)var g=r(c,d,l,t,e,y);if(!(g===void 0?Da(d,c,zw|Gw,r,y):g))return!1}}return!0}p(kp,"baseIsMatch");var Vw=kp;function Ip(t){return t===t&&!Aa(t)}p(Ip,"isStrictComparable");var Ap=Ip;function Cp(t){for(var e=Ra(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,Ap(o)]}return e}p(Cp,"getMatchData");var Jw=Cp;function Rp(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}p(Rp,"matchesStrictComparable");var Op=Rp;function Mp(t){var e=Jw(t);return e.length==1&&e[0][2]?Op(e[0][0],e[0][1]):function(n){return n===t||Vw(n,t,e)}}p(Mp,"baseMatches");var Yw=Mp;function Dp(t,e){return t!=null&&e in Object(t)}p(Dp,"baseHasIn");var Xw=Dp;function Np(t,e,n){e=np(e,t);for(var r=-1,o=e.length,s=!1;++r<o;){var i=uo(e[r]);if(!(s=t!=null&&n(t,i)))break;t=t[i]}return s||++r!=o?s:(o=t==null?0:t.length,!!o&&Ca(o)&&pd(i,o)&&(Lt(t)||xd(t)))}p(Np,"hasPath");var Qw=Np;function Hp(t,e){return t!=null&&Qw(t,e,Xw)}p(Hp,"hasIn");var ex=Hp,tx=1,nx=2;function Up(t,e){return Oa(t)&&Ap(e)?Op(uo(t),e):function(n){var r=Wb(n,t);return r===void 0&&r===e?ex(n,t):Da(e,r,tx|nx)}}p(Up,"baseMatchesProperty");var rx=Up;function jp(t){return function(e){return e?.[t]}}p(jp,"baseProperty");var ix=jp;function $p(t){return function(e){return op(e,t)}}p($p,"basePropertyDeep");var ox=$p;function Zp(t){return Oa(t)?ix(uo(t)):ox(t)}p(Zp,"property");var ax=Zp;function Lp(t){return typeof t=="function"?t:t==null?ZT:typeof t=="object"?Lt(t)?rx(t[0],t[1]):Yw(t):ax(t)}p(Lp,"baseIteratee");var sx=Lp;function Fp(t){return function(e,n,r){for(var o=-1,s=Object(e),i=r(e),a=i.length;a--;){var l=i[t?a:++o];if(n(s[l],l,s)===!1)break}return e}}p(Fp,"createBaseFor");var lx=Fp,ux=lx(),cx=ux;function Kp(t,e){return t&&cx(t,e,Ra)}p(Kp,"baseForOwn");var fx=Kp;function Wp(t,e){return Da(t,e)}p(Wp,"isEqual");var _n=Wp;function qp(t,e){var n={};return e=sx(e,3),fx(t,function(r,o,s){u_(n,o,e(r,o,s))}),n}p(qp,"mapValues");var dx=qp;function Na(t){return Xe(t)}p(Na,"toTypescriptSchema");function Xe(t){let n=t._def;switch(n.typeName){case q.ZodFirstPartyTypeKind.ZodString:return`${pe(n.description)}z.string()`.trim();case q.ZodFirstPartyTypeKind.ZodNumber:return`${pe(n.description)}z.number()`.trim();case q.ZodFirstPartyTypeKind.ZodNaN:return`${pe(n.description)}z.nan()`.trim();case q.ZodFirstPartyTypeKind.ZodBigInt:return`${pe(n.description)}z.bigint()`.trim();case q.ZodFirstPartyTypeKind.ZodBoolean:return`${pe(t._def.description)}z.boolean()`.trim();case q.ZodFirstPartyTypeKind.ZodDate:return`${pe(n.description)}z.date()`.trim();case q.ZodFirstPartyTypeKind.ZodUndefined:return`${pe(n.description)}z.undefined()`.trim();case q.ZodFirstPartyTypeKind.ZodNull:return`${pe(n.description)}z.null()`.trim();case q.ZodFirstPartyTypeKind.ZodAny:return`${pe(n.description)}z.any()`.trim();case q.ZodFirstPartyTypeKind.ZodUnknown:return`${pe(n.description)}z.unknown()`.trim();case q.ZodFirstPartyTypeKind.ZodNever:return`${pe(n.description)}z.never()`.trim();case q.ZodFirstPartyTypeKind.ZodVoid:return`${pe(n.description)}z.void()`.trim();case q.ZodFirstPartyTypeKind.ZodArray:return`z.array(${Xe(n.type)})`;case q.ZodFirstPartyTypeKind.ZodObject:let r=dx(n.shape(),$=>$ instanceof q.Schema?Xe($):"z.any()");return[`${pe(n.description)}z.object({`,...Object.entries(r).map(([$,oe])=>` ${$}: ${oe},`),"})"].join(`
23
- `).trim();case q.ZodFirstPartyTypeKind.ZodUnion:let o=n.options.map(Xe);return`${pe(n.description)}z.union([${o.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let s=n.options.map(Xe),i=jt(n.discriminator);return`${pe(n.description)}z.discriminatedUnion(${i}, [${s.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodIntersection:let a=Xe(n.left),l=Xe(n.right);return`${pe(n.description)}z.intersection(${a}, ${l})`.trim();case q.ZodFirstPartyTypeKind.ZodTuple:let c=n.items.map(Xe);return`${pe(n.description)}z.tuple([${c.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodRecord:let d=Xe(n.keyType),y=Xe(n.valueType);return`${pe(n.description)}z.record(${d}, ${y})`.trim();case q.ZodFirstPartyTypeKind.ZodMap:let g=Xe(n.keyType),m=Xe(n.valueType);return`${pe(n.description)}z.map(${g}, ${m})`.trim();case q.ZodFirstPartyTypeKind.ZodSet:return`${pe(n.description)}z.set(${Xe(n.valueType)})`.trim();case q.ZodFirstPartyTypeKind.ZodFunction:let v=n.args.items.map(Xe),B=v.length?`.args(${v.join(", ")})`:"",P=Xe(n.returns);return`${pe(n.description)}z.function()${B}.returns(${P})`.trim();case q.ZodFirstPartyTypeKind.ZodLazy:return`${pe(n.description)}z.lazy(() => ${Xe(n.getter())})`.trim();case q.ZodFirstPartyTypeKind.ZodLiteral:let T=jt(n.value);return`${pe(n.description)}z.literal(${T})`.trim();case q.ZodFirstPartyTypeKind.ZodEnum:let S=n.values.map(jt);return`${pe(n.description)}z.enum([${S.join(", ")}])`.trim();case q.ZodFirstPartyTypeKind.ZodEffects:throw new mn(q.ZodFirstPartyTypeKind.ZodEffects);case q.ZodFirstPartyTypeKind.ZodNativeEnum:throw new mn(q.ZodFirstPartyTypeKind.ZodNativeEnum);case q.ZodFirstPartyTypeKind.ZodOptional:return`${pe(n.description)}z.optional(${Xe(n.innerType)})`.trim();case q.ZodFirstPartyTypeKind.ZodNullable:return`${pe(n.description)}z.nullable(${Xe(n.innerType)})`.trim();case q.ZodFirstPartyTypeKind.ZodDefault:let E=Pf(n.defaultValue());return`${pe(n.description)}${Xe(n.innerType)}.default(${E})`.trim();case q.ZodFirstPartyTypeKind.ZodCatch:throw new mn(q.ZodFirstPartyTypeKind.ZodCatch);case q.ZodFirstPartyTypeKind.ZodPromise:return`${pe(n.description)}z.promise(${Xe(n.type)})`.trim();case q.ZodFirstPartyTypeKind.ZodBranded:throw new mn(q.ZodFirstPartyTypeKind.ZodBranded);case q.ZodFirstPartyTypeKind.ZodPipeline:throw new mn(q.ZodFirstPartyTypeKind.ZodPipeline);case q.ZodFirstPartyTypeKind.ZodSymbol:throw new mn(q.ZodFirstPartyTypeKind.ZodSymbol);case q.ZodFirstPartyTypeKind.ZodReadonly:return`${pe(n.description)}z.readonly(${Xe(n.innerType)})`.trim();case q.ZodFirstPartyTypeKind.ZodRef:let M=jt(n.uri);return`${pe(n.description)}z.ref(${M})`.trim();default:be.assertNever(n)}}p(Xe,"sUnwrapZod");var zp=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}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}};p(zp,"ParseInputLazyPath");var Et=zp,af=p((t,e)=>{if(Dr(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 n=new $t(t.common.issues);return this._error=n,this._error}}},"handleResult"),Gp=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 tn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gt,ctx:{common:e.parent.common,data:e.data,parsedType:tn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(xi(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;let o={common:{issues:[],async:(r=n?.async)!=null?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tn(e)},s=this._parseSync({data:e,path:o.path,parent:o});return af(o,s)}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:tn(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(xi(o)?o:Promise.resolve(o));return af(r,s)}refine(e,n){let r=p(o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n,"getIssueProperties");return this._refinement((o,s)=>{let i=e(o),a=p(()=>s.addIssue(x({code:G.custom},r(o))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new wn({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return nn.create(this,this._def)}nullable(){return Yn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nr.create(this,this._def)}promise(){return po.create(this,this._def)}or(e){return Xa.create([this,e],this._def)}and(e){return Ka.create(this,e,this._def)}transform(e){return new wn(H(x({},ye(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new co(H(x({},ye(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new $a(x({typeName:"ZodBranded",type:this},ye(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new Za(H(x({},ye(this._def)),{innerType:this,catchValue:n,typeName:"ZodCatch"}))}describe(e){let n=this.constructor;return new n(H(x({},this._def),{description:e}))}pipe(e){return Ja.create(this,e)}readonly(){return go.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){for(let[n,r]of Object.entries(e))this._def[ke]=H(x({},this._def[ke]),{[n]:r});return this}getMetadata(){return x({},this._def[ke])}setMetadata(e){this._def[ke]=x({},e)}get ui(){let e=this._getMetadataRoot();return x({},e._def[ke])}_setZuiMeta(e,n){let r=this._getMetadataRoot();r._def[ke]=H(x({},r._def[ke]),{[e]:n})}_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 n,r,o;return(o=(n=this._def)[r=ke])!=null||(n[r]={}),this._def[ke].displayAs=[e.id,e.params],this}title(e){return this._setZuiMeta("title",e),this}hidden(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this._setZuiMeta("hidden",n),this}disabled(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this._setZuiMeta("disabled",n),this}placeholder(e){return this._setZuiMeta("placeholder",e),this}toJsonSchema(e){return ns(this,e)}toTypescript(e){return _i(this,e)}toTypescriptSchema(){return Na(this)}async toTypescriptAsync(e){let n=_i(this,H(x({},e),{formatter:void 0}));return e?.formatter&&(n=await e.formatter(n)),n}static fromObject(e,n){return Hr(e,n)}static fromJsonSchema(e){return yo(e)}};p(Gp,"ZodType");var me=Gp,Vp=(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))(Vp||{}),be;(t=>{t.assertEqual=p(o=>o,"assertEqual");function e(o){}t.assertIs=e,p(e,"assertIs");function n(o){throw new Error("assertNever called")}t.assertNever=n,p(n,"assertNever"),t.arrayToEnum=p(o=>{let s={};for(let i of o)s[i]=i;return s},"arrayToEnum"),t.getValidEnumValues=p(o=>{let s=(0,t.objectKeys)(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=p(o=>(0,t.objectKeys)(o).map(function(s){return o[s]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=p((o,s)=>{for(let i of o)if(s(i))return i},"find"),t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,p(r,"joinValues"),t.jsonStringifyReplacer=p((o,s)=>typeof s=="bigint"?s.toString():s,"jsonStringifyReplacer"),t.compareFunctions=p((o,s)=>o.toString()===s.toString(),"compareFunctions")})(be||(be={}));var ga;(t=>{t.mergeShapes=p((e,n)=>x(x({},e),n),"mergeShapes")})(ga||(ga={}));var ne=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tn=p(t=>{switch(typeof t){case"undefined":return ne.undefined;case"string":return ne.string;case"number":return isNaN(t)?ne.nan:ne.number;case"boolean":return ne.boolean;case"function":return ne.function;case"bigint":return ne.bigint;case"symbol":return ne.symbol;case"object":return Array.isArray(t)?ne.array:t===null?ne.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ne.promise:typeof Map<"u"&&t instanceof Map?ne.map:typeof Set<"u"&&t instanceof Set?ne.set:typeof Date<"u"&&t instanceof Date?ne.date:ne.object;default:return ne.unknown}},"getParsedType");function ye(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o,[ke]:t?.[ke]}:{errorMap:p((i,a)=>i.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},"customMap"),description:o,[ke]:t?.[ke]}}p(ye,"processCreateParams");var Ha=p((t,e)=>{let n;switch(t.code){case G.invalid_type:t.received===ne.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:be.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case G.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case G.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;case G.unresolved_reference:n="Unresolved reference";break;default:n=e.defaultError,be.assertNever(t)}return{message:n}},"errorMap"),sf=Ha,G=be.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"]),px=p(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),bi=class Jp extends Error{constructor(e){super(),this.issues=[],this.addIssue=p(r=>{this.issues=[...this.issues,r]},"addIssue"),this.addIssues=p((r=[])=>{this.issues=[...this.issues,...r]},"addIssues");let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=p(s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){let c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}},"processError");return o(this),r}static assert(e){if(!(e instanceof Jp))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(e(o))):r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};p(bi,"ZodError");bi.create=p(t=>new bi(t),"create");var $t=bi,Yp=Ha;function Xp(t){Yp=t}p(Xp,"setErrorMap");function Mr(){return Yp}p(Mr,"getErrorMap");var wi=p(t=>{var e;let{data:n,path:r,errorMaps:o,issueData:s}=t,i=[...r,...s.path||[]],a=H(x({},s),{path:i}),l="",c=o.filter(d=>!!d).slice().reverse();for(let d of c)l=d(a,{data:n,defaultError:l}).message;return H(x({},s),{path:i,message:(e=s.message)!=null?e:l})},"makeIssue"),gx=[];function te(t,e){let n=wi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Mr(),Ha].filter(r=>!!r)});t.common.issues.push(n)}p(te,"addIssueToContext");var Qp=class eg{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return de;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n)r.push({key:await o.key,value:await o.value});return eg.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return de;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}};p(Qp,"ParseStatus");var gt=Qp,de=Object.freeze({status:"aborted"}),Vn=p(t=>({status:"dirty",value:t}),"DIRTY"),ct=p(t=>({status:"valid",value:t}),"OK"),ya=p(t=>t.status==="aborted","isAborted"),ma=p(t=>t.status==="dirty","isDirty"),Dr=p(t=>t.status==="valid","isValid"),xi=p(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),se;(t=>{t.errToObj=p(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=p(e=>typeof e=="string"?e:e?.message,"toString")})(se||(se={}));var Bi=class tg extends me{constructor(){super(...arguments),this._any=!0}_parse(e){return ct(e.data)}isEqual(e){return e instanceof tg}};p(Bi,"ZodAny");Bi.create=p(t=>new Bi(x({typeName:"ZodAny"},ye(t))),"create");var Pi=Bi,Ei=class Kn extends me{dereference(e){return new Kn(H(x({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var n,r,o,s,i,a;return e instanceof Kn?_n((n=this._def.exactLength)==null?void 0:n.value,(r=e._def.exactLength)==null?void 0:r.value)&&_n((o=this._def.maxLength)==null?void 0:o.value,(s=e._def.maxLength)==null?void 0:s.value)&&_n((i=this._def.minLength)==null?void 0:i.value,(a=e._def.minLength)==null?void 0:a.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==ne.array)return te(n,{code:G.invalid_type,expected:ne.array,received:n.parsedType}),de;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(te(n,{code:i?G.too_big:G.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(te(n,{code:G.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(te(n,{code:G.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Et(n,i,n.path,a)))).then(i=>gt.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Et(n,i,n.path,a)));return gt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new Kn(H(x({},this._def),{minLength:{value:e,message:se.toString(n)}}))}max(e,n){return new Kn(H(x({},this._def),{maxLength:{value:e,message:se.toString(n)}}))}length(e,n){return new Kn(H(x({},this._def),{exactLength:{value:e,message:se.toString(n)}}))}nonempty(e){return this.min(1,e)}};p(Ei,"ZodArray");Ei.create=p((t,e)=>new Ei(x({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},ye(e))),"create");var Nr=Ei,yx={compare:_n},ng=class{constructor(e=[],n={}){this._options=x(x({},yx),n),this._items=[];for(let r of e)this.add(r)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(n=>this._options.compare(n,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(n=>e.has(n))}};p(ng,"CustomSet");var tt=ng,Si=class di extends me{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)!==ne.bigint){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.bigint,received:s.parsedType}),de}let r,o=new gt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):be.assertNever(s);return{status:o.value,value:e.data}}isEqual(e){if(!(e instanceof di)||this._def.coerce!==e._def.coerce)return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}gte(e,n){return this.setLimit("min",e,!0,se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,se.toString(n))}setLimit(e,n,r,o){return new di(H(x({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(o)}]}))}_addCheck(e){return new di(H(x({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:se.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};p(Si,"ZodBigInt");Si.create=p(t=>{var e;return new Si(x({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},ye(t)))},"create");var Ua=Si,ki=class rg extends me{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==ne.boolean){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.boolean,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof rg?this._def.coerce===e._def.coerce:!1}};p(ki,"ZodBoolean");ki.create=p(t=>new ki(x({typeName:"ZodBoolean",coerce:t?.coerce||!1},ye(t))),"create");var ja=ki,mx=Symbol("zod_brand"),ig=class og extends me{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}isEqual(e){return e instanceof og?this._def.type.isEqual(e._def.type):!1}};p(ig,"ZodBranded");var $a=ig,Ii=class ag extends me{_parse(e){let{ctx:n}=this._processInputParams(e),r=H(x({},n),{common:H(x({},n.common),{issues:[]})}),o=this._def.innerType._parse({data:r.data,path:r.path,parent:x({},r)});return xi(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new $t(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $t(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof ag?this._def.innerType.isEqual(e._def.innerType)&&be.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};p(Ii,"ZodCatch");Ii.create=p((t,e)=>new Ii(x({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},ye(e))),"create");var Za=Ii,sg=p((t,e={},n)=>t?Pi.create().superRefine((r,o)=>{var s,i;if(!t(r)){let a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(i=(s=a.fatal)!=null?s:n)!=null?i:!0,c=typeof a=="string"?{message:a}:a;o.addIssue(H(x({code:"custom"},c),{fatal:l}))}}):Pi.create(),"custom"),Ai=class ha extends me{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ne.date){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.date,received:s.parsedType}),de}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_date}),de}let r=new gt,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):be.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ha(H(x({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:se.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:se.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof ha))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)&&this._def.coerce===e._def.coerce}};p(Ai,"ZodDate");Ai.create=p(t=>new Ai(x({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},ye(t))),"create");var La=Ai,Ci=class va extends me{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===ne.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}dereference(e){return new va(H(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof va?this._def.innerType.isEqual(e._def.innerType)&&_n(this._def.defaultValue(),e._def.defaultValue()):!1}};p(Ci,"ZodDefault");Ci.create=p((t,e,n)=>new Ci(x({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},ye(n))),"create");var co=Ci,Kt=p(t=>Array.from(new Set(t)),"unique"),Ut=p(t=>t instanceof Wa?Ut(t.schema):t instanceof wn?Ut(t.innerType()):t instanceof qa?[t.value]:t instanceof ir?t.options:t instanceof za?be.objectValues(t.enum):t instanceof co?Ut(t._def.innerType):t instanceof Ya?[void 0]:t instanceof Ga?[null]:t instanceof nn?[void 0,...Ut(t.unwrap())]:t instanceof Yn?[null,...Ut(t.unwrap())]:t instanceof $a||t instanceof go?Ut(t.unwrap()):t instanceof Za?Ut(t._def.innerType):[],"getDiscriminator"),lg=class Wn extends me{dereference(e){let n=this.options.map(o=>o.dereference(e)),r=Wn._getOptionsMap(this.discriminator,n);return new Wn(H(x({},this._def),{options:n,optionsMap:r}))}getReferences(){return Kt(this.options.flatMap(e=>e.getReferences()))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.object)return te(n,{code:G.invalid_type,expected:ne.object,received:n.parsedType}),de;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(te(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),de)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=Wn._getOptionsMap(e,n);return new Wn(x({typeName:"ZodDiscriminatedUnion",discriminator:e,options:n,optionsMap:o},ye(r)))}static _getOptionsMap(e,n){let r=new Map;for(let o of n){let s=Ut(o.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(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return r}isEqual(e){if(!(e instanceof Wn)||this._def.discriminator!==e._def.discriminator)return!1;let n=p((s,i)=>s.isEqual(i),"compare"),r=new tt(this._def.options,{compare:n}),o=new tt(e._def.options,{compare:n});return r.isEqual(o)}};p(lg,"ZodDiscriminatedUnion");var ug=lg;function fo(t,e){return new ir(x({values:t,typeName:"ZodEnum"},ye(e)))}p(fo,"createZodEnum");var Fa=class pi extends me{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{expected:be.joinValues(r),received:n.parsedType,code:G.invalid_type}),de}if(this._def.values.indexOf(e.data)===-1){let n=this._getOrReturnCtx(e),r=this._def.values;return te(n,{received:n.data,code:G.invalid_enum_value,options:r}),de}return ct(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return pi.create(e,x(x({},this._def),n))}exclude(e,n=this._def){return pi.create(this.options.filter(r=>!e.includes(r)),x(x({},this._def),n))}isEqual(e){if(!(e instanceof pi))return!1;let n=new tt(this._def.values),r=new tt(e._def.values);return n.isEqual(r)}};p(Fa,"ZodEnum");Fa.create=fo;var ir=Fa,cg=class qn extends me{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let n=this._def.args.dereference(e),r=this._def.returns.dereference(e);return new qn(H(x({},this._def),{args:n,returns:r}))}getReferences(){return Kt([...this._def.args.getReferences(),...this._def.returns.getReferences()])}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.function)return te(n,{code:G.invalid_type,expected:ne.function,received:n.parsedType}),de;function r(a,l){return wi({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Mr(),sf].filter(c=>!!c),issueData:{code:G.invalid_arguments,argumentsError:l}})}p(r,"makeArgsIssue");function o(a,l){return wi({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Mr(),sf].filter(c=>!!c),issueData:{code:G.invalid_return_type,returnTypeError:l}})}p(o,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof po){let a=this;return ct(async function(...l){let c=new $t([]),d=await a._def.args.parseAsync(l,s).catch(m=>{throw c.addIssue(r(l,m)),c}),y=await Reflect.apply(i,this,d);return await a._def.returns._def.type.parseAsync(y,s).catch(m=>{throw c.addIssue(o(y,m)),c})})}else{let a=this;return ct(function(...l){let c=a._def.args.safeParse(l,s);if(!c.success)throw new $t([r(l,c.error)]);let d=Reflect.apply(i,this,c.data),y=a._def.returns.safeParse(d,s);if(!y.success)throw new $t([o(d,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qn(H(x({},this._def),{args:er.create(e).rest(Ir.create())}))}returns(e){return new qn(H(x({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new qn(x({args:e||er.create([]).rest(Ir.create()),returns:n||Ir.create(),typeName:"ZodFunction"},ye(r)))}isEqual(e){return e instanceof qn&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};p(cg,"ZodFunction");var fg=cg;function Ri(t,e){let n=tn(t),r=tn(e);if(t===e)return{valid:!0,data:t};if(n===ne.object&&r===ne.object){let o=be.objectKeys(e),s=be.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i=x(x({},t),e);for(let a of s){let l=Ri(t[a],e[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===ne.array&&r===ne.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],l=Ri(i,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ne.date&&r===ne.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}p(Ri,"mergeValues");var Oi=class Ta extends me{dereference(e){return new Ta(H(x({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Kt([...this._def.left.getReferences(),...this._def.right.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=p((s,i)=>{if(ya(s)||ya(i))return de;let a=Ri(s.value,i.value);return a.valid?((ma(s)||ma(i))&&n.dirty(),{status:n.value,value:a.data}):(te(r,{code:G.invalid_intersection_types}),de)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}isEqual(e){if(!(e instanceof Ta))return!1;let n=p((s,i)=>s.isEqual(i),"compare"),r=new tt([this._def.left,this._def.right],{compare:n}),o=new tt([e._def.left,e._def.right],{compare:n});return r.isEqual(o)}};p(Oi,"ZodIntersection");Oi.create=p((t,e,n)=>new Oi(x({left:t,right:e,typeName:"ZodIntersection"},ye(n))),"create");var Ka=Oi,Mi=class dg extends me{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}isEqual(e){return e instanceof dg?this._def.getter().isEqual(e._def.getter()):!1}};p(Mi,"ZodLazy");Mi.create=p((t,e)=>new Mi(x({getter:t,typeName:"ZodLazy"},ye(e))),"create");var Wa=Mi,Di=class pg extends me{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return te(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),de}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof pg?_n(this._def.value,e._def.value):!1}};p(Di,"ZodLiteral");Di.create=p((t,e)=>new Di(x({value:t,typeName:"ZodLiteral"},ye(e))),"create");var qa=Di,Ni=class _a extends me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new _a(H(x({},this._def),{keyType:n,valueType:r}))}getReferences(){return Kt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.map)return te(r,{code:G.invalid_type,expected:ne.map,received:r.parsedType}),de;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new Et(r,a,r.path,[c,"key"])),value:s._parse(new Et(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of i){let c=await l.key,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return de;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(c.value,d.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let l of i){let c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return de;(c.status==="dirty"||d.status==="dirty")&&n.dirty(),a.set(c.value,d.value)}return{status:n.value,value:a}}}isEqual(e){return!(!(e instanceof _a)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};p(Ni,"ZodMap");Ni.create=p((t,e,n)=>new Ni(x({valueType:e,keyType:t,typeName:"ZodMap"},ye(n))),"create");var gg=Ni,Hi=class yg extends me{_parse(e){if(this._getType(e)!==ne.nan){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.nan,received:r.parsedType}),de}return{status:"valid",value:e.data}}isEqual(e){return e instanceof yg}};p(Hi,"ZodNaN");Hi.create=p(t=>new Hi(x({typeName:"ZodNaN"},ye(t))),"create");var mg=Hi,Ui=class hg extends me{_parse(e){let n=be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ne.string&&r.parsedType!==ne.number){let o=be.objectValues(n);return te(r,{expected:be.joinValues(o),received:r.parsedType,code:G.invalid_type}),de}if(n.indexOf(e.data)===-1){let o=be.objectValues(n);return te(r,{received:r.data,code:G.invalid_enum_value,options:o}),de}return ct(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof hg?_n(this._def.values,e._def.values):!1}};p(Ui,"ZodNativeEnum");Ui.create=p((t,e)=>new Ui(x({values:t,typeName:"ZodNativeEnum"},ye(e))),"create");var za=Ui,ji=class vg extends me{_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:G.invalid_type,expected:ne.never,received:n.parsedType}),de}isEqual(e){return e instanceof vg}};p(ji,"ZodNever");ji.create=p(t=>new ji(x({typeName:"ZodNever"},ye(t))),"create");var bn=ji,$i=class Tg extends me{_parse(e){if(this._getType(e)!==ne.null){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.null,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof Tg}};p($i,"ZodNull");$i.create=p(t=>new $i(x({typeName:"ZodNull"},ye(t))),"create");var Ga=$i,Zi=class ba extends me{dereference(e){return new ba(H(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===ne.null?ct(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof ba?this._def.innerType.isEqual(e._def.innerType):!1}};p(Zi,"ZodNullable");Zi.create=p((t,e)=>new Zi(x({innerType:t,typeName:"ZodNullable"},ye(e))),"create");var Yn=Zi;function _g(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(t.toFixed(o).replace(".","")),i=parseInt(e.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}p(_g,"floatSafeRemainder");var Li=class gi extends me{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)!==ne.number){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.number,received:s.parsedType}),de}let r,o=new gt;for(let s of this._def.checks)s.kind==="int"?be.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?_g(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),te(r,{code:G.not_finite,message:s.message}),o.dirty()):be.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,se.toString(n))}gt(e,n){return this.setLimit("min",e,!1,se.toString(n))}lte(e,n){return this.setLimit("max",e,!0,se.toString(n))}lt(e,n){return this.setLimit("max",e,!1,se.toString(n))}setLimit(e,n,r,o){return new gi(H(x({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:se.toString(o)}]}))}_addCheck(e){return new gi(H(x({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:se.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:se.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:se.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:se.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:se.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:se.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:se.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:se.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:se.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&be.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof gi))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};p(Li,"ZodNumber");Li.create=p(t=>new Li(x({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},ye(t))),"create");var Va=Li;function Tn(t){if(t instanceof Xn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=nn.create(Tn(r))}return new Xn(H(x({},t._def),{shape:p(()=>e,"shape")}))}else return t instanceof Nr?new Nr(H(x({},t._def),{type:Tn(t.element)})):t instanceof nn?nn.create(Tn(t.unwrap())):t instanceof Yn?Yn.create(Tn(t.unwrap())):t instanceof er?er.create(t.items.map(e=>Tn(e))):t}p(Tn,"deepPartialify");var on=class Tt extends me{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(),n=be.objectKeys(e);return this._cached={shape:e,keys:n}}dereference(e){let n=this._def.shape(),r={};for(let o in n)r[o]=n[o].dereference(e);return new Tt(H(x({},this._def),{shape:p(()=>r,"shape")}))}getReferences(){let e=this._def.shape(),n=[];for(let r in e)n.push(...e[r].getReferences());return Kt(n)}_parse(e){if(this._getType(e)!==ne.object){let c=this._getOrReturnCtx(e);return te(c,{code:G.invalid_type,expected:ne.object,received:c.parsedType}),de}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof bn&&this._def.unknownKeys==="strip"))for(let c in o.data)i.includes(c)||a.push(c);let l=[];for(let c of i){let d=s[c],y=o.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Et(o,y,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof bn){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(c==="strict")a.length>0&&(te(o,{code:G.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of a){let y=o.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Et(o,y,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of l){let y=await d.key;c.push({key:y,value:await d.value,alwaysSet:d.alwaysSet})}return c}).then(c=>gt.mergeObjectSync(r,c)):gt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return se.errToObj,new Tt(x(H(x({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:p((n,r)=>{var o,s,i,a;let l=(i=(s=(o=this._def).errorMap)==null?void 0:s.call(o,n,r).message)!=null?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=se.errToObj(e).message)!=null?a:l}:{message:l}},"errorMap")}:{}))}strip(){return new Tt(H(x({},this._def),{unknownKeys:"strip"}))}passthrough(){return new Tt(H(x({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new Tt(H(x({},this._def),{shape:p(()=>x(x({},this._def.shape()),e),"shape")}))}merge(e){return new Tt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:p(()=>x(x({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Tt(H(x({},this._def),{catchall:e}))}pick(e){let n={};return be.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Tt(H(x({},this._def),{shape:p(()=>n,"shape")}))}omit(e){let n={};return be.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Tt(H(x({},this._def),{shape:p(()=>n,"shape")}))}deepPartial(){return Tn(this)}partial(e){let n={};return be.objectKeys(this.shape).forEach(r=>{let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o?.optional()}),new Tt(H(x({},this._def),{shape:p(()=>n,"shape")}))}required(e){let n={};return be.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof nn;)s=s._def.innerType;n[r]=s}}),new Tt(H(x({},this._def),{shape:p(()=>n,"shape")}))}keyof(){return fo(be.objectKeys(this.shape))}isEqual(e){if(!(e instanceof Tt)||!this._def.catchall.isEqual(e._def.catchall)||this._def.unknownKeys!==e._def.unknownKeys)return!1;let n=this._def.shape(),r=e._def.shape(),o=p((a,l)=>a[0]===l[0]&&a[1].isEqual(l[1]),"compare"),s=new tt(Object.entries(n),{compare:o}),i=new tt(Object.entries(r),{compare:o});return s.isEqual(i)}};p(on,"ZodObject");on.create=p((t,e)=>new on(x({shape:p(()=>t,"shape"),unknownKeys:"strip",catchall:bn.create(),typeName:"ZodObject"},ye(e))),"create");on.strictCreate=p((t,e)=>new on(x({shape:p(()=>t,"shape"),unknownKeys:"strict",catchall:bn.create(),typeName:"ZodObject"},ye(e))),"strictCreate");on.lazycreate=p((t,e)=>new on(x({shape:t,unknownKeys:"strip",catchall:bn.create(),typeName:"ZodObject"},ye(e))),"lazycreate");var Xn=on,Fi=class wa extends me{dereference(e){return new wa(H(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===ne.undefined?ct(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof wa?this._def.innerType.isEqual(e._def.innerType):!1}};p(Fi,"ZodOptional");Fi.create=p((t,e)=>new Fi(x({innerType:t,typeName:"ZodOptional"},ye(e))),"create");var nn=Fi,bg=class yi extends me{dereference(e){return new yi(H(x({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Kt([...this._def.in.getReferences(),...this._def.out.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return p(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?de:s.status==="dirty"?(n.dirty(),Vn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})},"handleAsync")();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?de:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new yi({in:e,out:n,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof yi)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};p(bg,"ZodPipeline");var Ja=bg,Ki=class xa extends me{unwrap(){return this._def.type}dereference(e){return new xa(H(x({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==ne.promise&&n.common.async===!1)return te(n,{code:G.invalid_type,expected:ne.promise,received:n.parsedType}),de;let r=n.parsedType===ne.promise?n.data:Promise.resolve(n.data);return ct(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}isEqual(e){return e instanceof xa?this._def.type.isEqual(e._def.type):!1}};p(Ki,"ZodPromise");Ki.create=p((t,e)=>new Ki(x({type:t,typeName:"ZodPromise"},ye(e))),"create");var po=Ki,Wi=class Ba extends me{dereference(e){return new Ba(H(x({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){let n=this._def.innerType._parse(e);return Dr(n)&&(n.value=Object.freeze(n.value)),n}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Ba?this._def.innerType.isEqual(e._def.innerType):!1}};p(Wi,"ZodReadonly");Wi.create=p((t,e)=>new Wi(x({innerType:t,typeName:"ZodReadonly"},ye(e))),"create");var go=Wi,wg=class Br extends me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new Br(H(x({},this._def),{keyType:n,valueType:r}))}getReferences(){return Kt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.object)return te(r,{code:G.invalid_type,expected:ne.object,received:r.parsedType}),de;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Et(r,a,r.path,a)),value:i._parse(new Et(r,r.data[a],r.path,a))});return r.common.async?gt.mergeObjectAsync(n,o):gt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof me?new Br(x({keyType:e,valueType:n,typeName:"ZodRecord"},ye(r))):new Br(x({keyType:ft.create(),valueType:e,typeName:"ZodRecord"},ye(n)))}isEqual(e){return!(!(e instanceof Br)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};p(wg,"ZodRecord");var xg=wg,qi=class Bg extends me{dereference(e){let n=e[this._def.uri];return n||this}getReferences(){return[this._def.uri]}_parse(e){let n=this._getOrReturnCtx(e);return te(n,{code:G.unresolved_reference}),de}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Bg?this._def.uri===e._def.uri:!1}};p(qi,"ZodRef");qi.create=p(t=>new qi({typeName:"ZodRef",uri:t}),"create");var Pg=qi,zi=class Pr extends me{dereference(e){return new Pr(H(x({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.set)return te(r,{code:G.invalid_type,expected:ne.set,received:r.parsedType}),de;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(te(r,{code:G.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(te(r,{code:G.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(l){let c=new Set;for(let d of l){if(d.status==="aborted")return de;d.status==="dirty"&&n.dirty(),c.add(d.value)}return{status:n.value,value:c}}p(i,"finalizeSet");let a=[...r.data.values()].map((l,c)=>s._parse(new Et(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(e,n){return new Pr(H(x({},this._def),{minSize:{value:e,message:se.toString(n)}}))}max(e,n){return new Pr(H(x({},this._def),{maxSize:{value:e,message:se.toString(n)}}))}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}isEqual(e){var n,r,o,s;if(!(e instanceof Pr))return!1;let i=(n=this._def.minSize)==null?void 0:n.value,a=(r=e._def.minSize)==null?void 0:r.value;if(i!==a)return!1;let l=(o=this._def.maxSize)==null?void 0:o.value,c=(s=e._def.maxSize)==null?void 0:s.value;return l!==c?!1:this._def.valueType.isEqual(e._def.valueType)}};p(zi,"ZodSet");zi.create=p((t,e)=>new zi(x({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},ye(e))),"create");var Eg=zi,Sg=/^c[^\s-]{8,}$/i,kg=/^[a-z][a-z0-9]*$/,Ig=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ag=/^[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,Cg=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hx=p(t=>t===Rg,"isEmojiRegex"),oa,Og=/^(((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}))$/,Mg=/^(([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})))$/,Dg=p(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 Ng(t,e){return!!((e==="v4"||!e)&&Og.test(t)||(e==="v6"||!e)&&Mg.test(t))}p(Ng,"isValidIP");var Gi=class zn extends me{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ne.string){let s=this._getOrReturnCtx(e);return te(s,{code:G.invalid_type,expected:ne.string,received:s.parsedType}),de}let r=new gt,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),te(o,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?te(o,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&te(o,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Cg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"email",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")oa||(oa=new RegExp(Rg,"u")),oa.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"emoji",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Ag.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"uuid",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Sg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"cuid",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")kg.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"cuid2",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")Ig.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"ulid",code:G.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),te(o,{validation:"url",code:G.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"regex",code:G.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.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)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Dg(s).test(e.data)||(o=this._getOrReturnCtx(e,o),te(o,{code:G.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?Ng(e.data,s.version)||(o=this._getOrReturnCtx(e,o),te(o,{validation:"ip",code:G.invalid_string,message:s.message}),r.dirty()):be.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),x({validation:n,code:G.invalid_string},se.errToObj(r)))}_addCheck(e){return new zn(H(x({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(x({kind:"email"},se.errToObj(e)))}url(e){return this._addCheck(x({kind:"url"},se.errToObj(e)))}emoji(e){return this._addCheck(x({kind:"emoji"},se.errToObj(e)))}uuid(e){return this._addCheck(x({kind:"uuid"},se.errToObj(e)))}cuid(e){return this._addCheck(x({kind:"cuid"},se.errToObj(e)))}cuid2(e){return this._addCheck(x({kind:"cuid2"},se.errToObj(e)))}ulid(e){return this._addCheck(x({kind:"ulid"},se.errToObj(e)))}ip(e){return this._addCheck(x({kind:"ip"},se.errToObj(e)))}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(x({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!=null?n:!1},se.errToObj(e?.message)))}regex(e,n){return this._addCheck(x({kind:"regex",regex:e},se.errToObj(n)))}includes(e,n){return this._addCheck(x({kind:"includes",value:e,position:n?.position},se.errToObj(n?.message)))}startsWith(e,n){return this._addCheck(x({kind:"startsWith",value:e},se.errToObj(n)))}endsWith(e,n){return this._addCheck(x({kind:"endsWith",value:e},se.errToObj(n)))}min(e,n){return this._addCheck(x({kind:"min",value:e},se.errToObj(n)))}max(e,n){return this._addCheck(x({kind:"max",value:e},se.errToObj(n)))}length(e,n){return this._addCheck(x({kind:"length",value:e},se.errToObj(n)))}nonempty(e){return this.min(1,se.errToObj(e))}trim(){return new zn(H(x({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[ke]=H(x({},this._def[ke]),{secret:!0}),this}toLowerCase(){return new zn(H(x({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new zn(H(x({},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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}isEqual(e){if(!(e instanceof zn))return!1;let n=new tt(this._def.checks),r=new tt(e._def.checks);return n.isEqual(r)}};p(Gi,"ZodString");Gi.create=p(t=>{var e;return new Gi(x({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},ye(t)))},"create");var ft=Gi,Vi=class Hg extends me{_parse(e){if(this._getType(e)!==ne.symbol){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.symbol,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof Hg}};p(Vi,"ZodSymbol");Vi.create=p(t=>new Vi(x({typeName:"ZodSymbol"},ye(t))),"create");var Ug=Vi,Qn=class Pa extends me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new Pa(H(x({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:p(i=>{te(r,i),i.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return de;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?de:l.status==="dirty"||n.value==="dirty"?Vn(l.value):l});{if(n.value==="aborted")return de;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?de:a.status==="dirty"||n.value==="dirty"?Vn(a.value):a}}if(o.type==="refinement"){let i=p(a=>{let l=o.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a},"executeRefinement");if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?de:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?de:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Dr(i))return i;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Dr(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):i);be.assertNever(o)}isEqual(e){return!(e instanceof Pa)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:be.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):(be.assertNever(this._def.effect),!1)}};p(Qn,"ZodEffects");Qn.create=p((t,e,n)=>new Qn(x({schema:t,typeName:"ZodEffects",effect:e},ye(n))),"create");Qn.createWithPreprocess=p((t,e,n)=>new Qn(x({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},ye(n))),"createWithPreprocess");var wn=Qn,Ji=class mi extends me{dereference(e){let n=this._def.items.map(o=>o.dereference(e)),r=this._def.rest?this._def.rest.dereference(e):null;return new mi(H(x({},this._def),{items:n,rest:r}))}getReferences(){return Kt([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ne.array)return te(r,{code:G.invalid_type,expected:ne.array,received:r.parsedType}),de;if(r.data.length<this._def.items.length)return te(r,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),de;!this._def.rest&&r.data.length>this._def.items.length&&(te(r,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Et(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>gt.mergeArray(n,i)):gt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new mi(H(x({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof mi)||!this._restEquals(e))return!1;let n=p((s,i)=>s.isEqual(i),"compare"),r=new tt(this._def.items,{compare:n}),o=new tt(e._def.items,{compare:n});return r.isEqual(o)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};p(Ji,"ZodTuple");Ji.create=p((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ji(x({items:t,typeName:"ZodTuple",rest:null},ye(e)))},"create");var er=Ji,Yi=class jg extends me{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.undefined,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof jg}};p(Yi,"ZodUndefined");Yi.create=p(t=>new Yi(x({typeName:"ZodUndefined"},ye(t))),"create");var Ya=Yi,Xi=class Ea extends me{dereference(e){let n=this._def.options.map(r=>r.dereference(e));return new Ea(H(x({},this._def),{options:n}))}getReferences(){return Kt(this._def.options.reduce((e,n)=>[...e,...n.getReferences()],[]))}_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new $t(a.ctx.common.issues));return te(n,{code:G.invalid_union,unionErrors:i}),de}if(p(o,"handleResults"),n.common.async)return Promise.all(r.map(async s=>{let i=H(x({},n),{common:H(x({},n.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let l of r){let c=H(x({},n),{common:H(x({},n.common),{issues:[]}),parent:null}),d=l._parseSync({data:n.data,path:n.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(l=>new $t(l));return te(n,{code:G.invalid_union,unionErrors:a}),de}}get options(){return this._def.options}isEqual(e){if(!(e instanceof Ea))return!1;let n=p((s,i)=>s.isEqual(i),"compare"),r=new tt([...this._def.options],{compare:n}),o=new tt([...e._def.options],{compare:n});return r.isEqual(o)}};p(Xi,"ZodUnion");Xi.create=p((t,e)=>new Xi(x({options:t,typeName:"ZodUnion"},ye(e))),"create");var Xa=Xi,Qi=class $g extends me{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ct(e.data)}isEqual(e){return e instanceof $g}};p(Qi,"ZodUnknown");Qi.create=p(t=>new Qi(x({typeName:"ZodUnknown"},ye(t))),"create");var Ir=Qi,eo=class Zg extends me{_parse(e){if(this._getType(e)!==ne.undefined){let r=this._getOrReturnCtx(e);return te(r,{code:G.invalid_type,expected:ne.void,received:r.parsedType}),de}return ct(e.data)}isEqual(e){return e instanceof Zg}};p(eo,"ZodVoid");eo.create=p(t=>new eo(x({typeName:"ZodVoid"},ye(t))),"create");var Lg=eo,vx=/^\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))?$/,Hr=p((t,e,n=!0)=>{if(typeof t!="object")throw new sa("Input must be an object");let r=p(i=>{let a=i;return e?.nullable&&(a=a.nullable()),e?.optional&&(a=a.optional()),e?.passtrough&&typeof a.passthrough=="function"&&(a=a.passthrough()),a},"applyOptions"),o=Object.entries(t).reduce((i,[a,l])=>{if(l===null)i[a]=r(re.null());else switch(typeof l){case"string":i[a]=vx.test(l)?r(re.string().datetime()):r(re.string());break;case"number":i[a]=r(re.number());break;case"boolean":i[a]=r(re.boolean());break;case"object":Array.isArray(l)?l.length===0?i[a]=r(re.array(re.unknown())):typeof l[0]=="object"?i[a]=r(re.array(Hr(l[0],e,!1))):["string","number","boolean"].includes(typeof l[0])&&(i[a]=r(re.array(re[typeof l[0]]()))):i[a]=r(Hr(l,e,!1));break;default:throw new sa(`Unsupported type for key ${a}`)}return i},{}),s=Object.keys(o).length>0;return e?.passtrough||!n&&!s?re.object(o).passthrough():re.object(o)},"objectToZui");function Fg(){return{}}p(Fg,"parseAnyDef");function Qa(t,e,n,r){r?.errorMessages&&n&&(t.errorMessage=H(x({},t.errorMessage),{[e]:n}))}p(Qa,"addErrorMessage");function De(t,e,n,r,o){t[e]=n,Qa(t,e,r,o)}p(De,"setResponseValueAndErrors");function Kg(t,e){var n,r;let o={type:"array"};return((r=(n=t.type)==null?void 0:n._def)==null?void 0:r.typeName)!=="ZodAny"&&(o.items=Re(t.type._def,H(x({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&De(o,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&De(o,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(De(o,"minItems",t.exactLength.value,t.exactLength.message,e),De(o,"maxItems",t.exactLength.value,t.exactLength.message,e)),o}p(Kg,"parseArrayDef");function Wg(t,e){let n=x({type:"integer",format:"int64"},t.coerce?{[ke]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"?r.inclusive?De(n,"minimum",r.value,r.message,e):De(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),De(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?De(n,"maximum",r.value,r.message,e):De(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),De(n,"maximum",r.value,r.message,e));break;case"multipleOf":De(n,"multipleOf",r.value,r.message,e);break}return n}p(Wg,"parseBigintDef");function qg(t){return x({type:"boolean"},t.coerce?{[ke]:{coerce:t.coerce||void 0}}:{})}p(qg,"parseBooleanDef");function zg(t,e){return Re(t.type._def,e)}p(zg,"parseBrandedDef");var Tx=p((t,e)=>Re(t.innerType._def,e),"parseCatchDef");function Gg(t,e){return e.dateStrategy=="integer"?_x(t,e):x({type:"string",format:"date-time"},t.coerce?{[ke]:{coerce:t.coerce||void 0}}:{})}p(Gg,"parseDateDef");var _x=p((t,e)=>{let n=x({type:"integer",format:"unix-time"},t.coerce?{[ke]:{coerce:t.coerce||void 0}}:{});for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"&&De(n,"minimum",r.value,r.message,e);break;case"max":e.target==="jsonSchema7"&&De(n,"maximum",r.value,r.message,e);break}return n},"integerDateParser");function Vg(t,e){return H(x({},Re(t.innerType._def,e)),{default:t.defaultValue()})}p(Vg,"parseDefaultDef");function Jg(t,e){return e.effectStrategy==="input"?Re(t.schema._def,e):{}}p(Jg,"parseEffectsDef");function Yg(t){return{type:"string",enum:t.values}}p(Yg,"parseEnumDef");var bx=p(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function Xg(t,e){let n=[Re(t.left._def,H(x({},e),{currentPath:[...e.currentPath,"allOf","0"]})),Re(t.right._def,H(x({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(s=>!!s),r=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return n.forEach(s=>{if(bx(s))o.push(...s.allOf),s.unevaluatedProperties===void 0&&(r=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let a=s,{additionalProperties:l}=a;i=pf(a,["additionalProperties"])}else r=void 0;o.push(i)}}),o.length?x({allOf:o},r):void 0}p(Xg,"parseIntersectionDef");function Qg(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}p(Qg,"parseLiteralDef");var xr={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 es(t,e){let n=x({type:"string"},t.coerce?{[ke]:{coerce:t.coerce||void 0}}:{});function r(o){return e.patternStrategy==="escape"?wx(o):o}if(p(r,"processPattern"),t.checks)for(let o of t.checks)switch(o.kind){case"min":De(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e);break;case"max":De(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"email":switch(e.emailStrategy){case"format:email":yn(n,"email",o.message,e);break;case"format:idn-email":yn(n,"idn-email",o.message,e);break;case"pattern:zod":Ht(n,xr.email,o.message,e);break}break;case"url":yn(n,"uri",o.message,e);break;case"uuid":yn(n,"uuid",o.message,e);break;case"regex":Ht(n,o.regex.source,o.message,e);break;case"cuid":Ht(n,xr.cuid,o.message,e);break;case"cuid2":Ht(n,xr.cuid2,o.message,e);break;case"startsWith":Ht(n,"^"+r(o.value),o.message,e);break;case"endsWith":Ht(n,r(o.value)+"$",o.message,e);break;case"datetime":yn(n,"date-time",o.message,e);break;case"length":De(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,o.message,e),De(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value,o.message,e);break;case"includes":{Ht(n,r(o.value),o.message,e);break}case"ip":{o.version!=="v6"&&yn(n,"ipv4",o.message,e),o.version!=="v4"&&yn(n,"ipv6",o.message,e);break}case"emoji":Ht(n,xr.emoji,o.message,e);break;case"ulid":{Ht(n,xr.ulid,o.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}p(es,"parseStringDef");var wx=p(t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),"escapeNonAlphaNumeric"),yn=p((t,e,n,r)=>{var o;t.format||(o=t.anyOf)!=null&&o.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(x({format:t.format},t.errorMessage&&r.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(x({format:e},n&&r.errorMessages&&{errorMessage:{format:n}}))):De(t,"format",e,n,r)},"addFormat"),Ht=p((t,e,n,r)=>{var o;t.pattern||(o=t.allOf)!=null&&o.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(x({pattern:t.pattern},t.errorMessage&&r.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(x({pattern:e},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):De(t,"pattern",e,n,r)},"addPattern");function ts(t,e){var n,r,o,s,i;if(e.target==="openApi3"&&((n=t.keyType)==null?void 0:n._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((l,c)=>{var d;return H(x({},l),{[c]:(d=Re(t.valueType._def,H(x({},e),{currentPath:[...e.currentPath,"properties",c]})))!=null?d:{}})},{}),additionalProperties:!1};let a={type:"object",additionalProperties:(r=Re(t.valueType._def,H(x({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:{}};if(e.target==="openApi3")return a;if(((o=t.keyType)==null?void 0:o._def.typeName)==="ZodString"&&((s=t.keyType._def.checks)!=null&&s.length)){let l=Object.entries(es(t.keyType._def,e)).reduce((c,[d,y])=>d==="type"?c:H(x({},c),{[d]:y}),{});return H(x({},a),{propertyNames:l})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return H(x({},a),{propertyNames:{enum:t.keyType._def.values}});return a}p(ts,"parseRecordDef");function ey(t,e){if(e.mapStrategy==="record")return ts(t,e);let n=Re(t.keyType._def,H(x({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},r=Re(t.valueType._def,H(x({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}p(ey,"parseMapDef");function ty(t){let e=t.values,r=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),o=Array.from(new Set(r.map(s=>typeof s)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:r.filter(s=>typeof s=="string"||typeof s=="number")}}p(ty,"parseNativeEnumDef");function ny(){return{not:{}}}p(ny,"parseNeverDef");function ry(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}p(ry,"parseNullDef");var to={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function iy(t,e){if(e.target==="openApi3")return lf(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in to&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((o,s)=>{let i=to[s._def.typeName];return i&&!o.includes(i)?[...o,i]:o},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.reduce((o,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...o,i];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(r.length===n.length){let o=r.filter((s,i,a)=>a.indexOf(s)===i);return{type:o.length>1?o:o[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,o)=>[...r,...o._def.values.filter(s=>!r.includes(s))],[])};return lf(t,e)}p(iy,"parseUnionDef");var lf=p((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((o,s)=>Re(o._def,H(x({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${s}`]}))).filter(o=>!!o&&(!e.strictUnions||typeof o=="object"&&Object.keys(o).length>0)),r=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(n.length)return e.unionStrategy==="anyOf"?x({anyOf:n},r):x({oneOf:n},r)},"asUnionOf");function oy(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:to[t.innerType._def.typeName],nullable:!0}:{type:[to[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let r=Re(t.innerType._def,H(x({},e),{currentPath:[...e.currentPath]}));return r&&H(x({},r),{nullable:!0})}let n=Re(t.innerType._def,H(x({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return n&&{anyOf:[n,{type:"null"}]}}p(oy,"parseNullableDef");function ay(t,e){let n=x({type:"number"},t.coerce?{[ke]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"int":n.type="integer",Qa(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?De(n,"minimum",r.value,r.message,e):De(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),De(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?De(n,"maximum",r.value,r.message,e):De(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),De(n,"maximum",r.value,r.message,e));break;case"multipleOf":De(n,"multipleOf",r.value,r.message,e);break}return n}p(ay,"parseNumberDef");function sy(t,e){var n;let r=H(x({type:"object"},Object.entries(t.shape()).reduce((o,[s,i])=>{if(i===void 0||i._def===void 0)return o;let a=Re(i._def,H(x({},e),{currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]}));return a===void 0?o:{properties:H(x({},o.properties),{[s]:a}),required:i.isOptional()?o.required:[...o.required,s]}},{properties:{},required:[]})),{additionalProperties:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":(n=Re(t.catchall._def,H(x({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:!0});return r.required.length||delete r.required,r}p(sy,"parseObjectDef");var xx=p((t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Re(t.innerType._def,e);let r=Re(t.innerType._def,H(x({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),Bx=p((t,e)=>{if(e.pipeStrategy==="input")return Re(t.in._def,e);if(e.pipeStrategy==="output")return Re(t.out._def,e);let n=Re(t.in._def,H(x({},e),{currentPath:[...e.currentPath,"allOf","0"]})),r=Re(t.out._def,H(x({},e),{currentPath:[...e.currentPath,"allOf",n?"1":"0"]}));return{allOf:[n,r].filter(o=>o!==void 0)}},"parsePipelineDef");function ly(t,e){return Re(t.type._def,e)}p(ly,"parsePromiseDef");function uy(t,e){let r={type:"array",uniqueItems:!0,items:Re(t.valueType._def,H(x({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&De(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&De(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}p(uy,"parseSetDef");function cy(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Re(n._def,H(x({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Re(t.rest._def,H(x({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Re(n._def,H(x({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[])}}p(cy,"parseTupleDef");function fy(){return{not:{}}}p(fy,"parseUndefinedDef");function dy(){return{}}p(dy,"parseUnknownDef");var Px=p((t,e)=>Re(t.innerType._def,e),"parseReadonlyDef");function py(t){return{$ref:t.uri}}p(py,"parseRefDef");function Re(t,e,n=!1){let r=e.seen.get(t);if(r&&!n){let i=Ex(r,e);if(i!==void 0)return i}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let s=kx(t,t.typeName,e);return s&&Ix(t,e,s),o.jsonSchema=s,s}p(Re,"parseDef");var Ex=p((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Sx(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),Sx=p((t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},"getRelativePath"),kx=p((t,e,n)=>{switch(e){case"ZodString":return es(t,n);case"ZodNumber":return ay(t,n);case"ZodObject":return sy(t,n);case"ZodBigInt":return Wg(t,n);case"ZodBoolean":return qg(t);case"ZodDate":return Gg(t,n);case"ZodUndefined":return fy();case"ZodNull":return ry(n);case"ZodArray":return Kg(t,n);case"ZodUnion":case"ZodDiscriminatedUnion":return iy(t,n);case"ZodIntersection":return Xg(t,n);case"ZodTuple":return cy(t,n);case"ZodRecord":return ts(t,n);case"ZodRef":return py(t);case"ZodLiteral":return Qg(t,n);case"ZodEnum":return Yg(t);case"ZodNativeEnum":return ty(t);case"ZodNullable":return oy(t,n);case"ZodOptional":return xx(t,n);case"ZodMap":return ey(t,n);case"ZodSet":return uy(t,n);case"ZodLazy":return Re(t.getter()._def,n);case"ZodPromise":return ly(t,n);case"ZodNaN":case"ZodNever":return ny();case"ZodEffects":return Jg(t,n);case"ZodAny":return Fg();case"ZodUnknown":return dy();case"ZodDefault":return Vg(t,n);case"ZodBranded":return zg(t,n);case"ZodReadonly":return Px(t,n);case"ZodCatch":return Tx(t,n);case"ZodPipeline":return Bx(t,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})(e)}},"selectParser"),Ix=p((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),Object.assign(n,{[ke]:x(x({},t[ke]),n[ke])}),n),"addMeta"),uf={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"},Ax=p(t=>typeof t=="string"?H(x({},uf),{name:t}):x(x({},uf),t),"getDefaultOptions"),Cx=p(t=>{let e=Ax(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return H(x({},e),{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))})},"getRefs"),Rx=p((t,e)=>{var n;let r=Cx(e),o=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[c,d])=>{var y;return H(x({},l),{[c]:(y=Re(d._def,H(x({},r),{currentPath:[...r.basePath,r.definitionPath,c]}),!0))!=null?y:{}})},{}):void 0,s=typeof e=="string"?e:e?.name,i=(n=Re(t._def,s===void 0?r:H(x({},r),{currentPath:[...r.basePath,r.definitionPath,s]}),!1))!=null?n:{},a=s===void 0?o?H(x({},i),{[r.definitionPath]:o}):i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:H(x({},o),{[s]:i})};return r.target==="jsonSchema7"?a.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(a.$schema="https://json-schema.org/draft/2019-09/schema#"),a},"zodToJsonSchema"),ns=p((t,e={target:"openApi3"})=>{let n=Rx(t,e);return e.$schemaUrl===!1?delete n.$schema:typeof e.$schemaUrl=="string"&&(n.$schema=e.$schemaUrl),n},"zuiToJsonSchema"),Ox=["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"],yA=ir.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Mx=p(t=>ft.create().displayAs({id:"variable",params:x({type:t?.type||"any"},t?.params)}),"variable"),Dx=p(t=>ft.create().displayAs({id:"conversation",params:x({},t?.params)}),"conversation"),Nx=p(t=>ft.create().displayAs({id:"user",params:x({},t?.params)}),"user"),Hx=p(t=>ft.create().displayAs({id:"message",params:x({},t?.params)}),"message"),Ux=p(t=>ft.create().displayAs({id:"agent",params:x({},t?.params)}),"agent"),jx=p(t=>ft.create().displayAs({id:"event",params:x({},t?.params)}),"event"),$x=p(t=>ft.create().displayAs({id:"table",params:x({},t?.params)}),"table"),Zx=p(t=>ft.create().displayAs({id:"tablerow",params:x({},t?.params)}),"tablerow"),Lx=p(t=>ft.create().displayAs({id:"intent",params:x({},t?.params)}),"intent"),Fx=p(()=>ir.create(Ox).displayAs({id:"dropdown",params:{}}),"aimodel"),Kx=p(t=>ft.create().displayAs({id:"datasource",params:x({},t)}),"datasource"),Wx=p(t=>ft.create().displayAs({id:"knowledgebase",params:x({},t)}),"knowledgebase"),qx={object:Xn.lazycreate},zx=p((t,e={message:`Input not instance of ${t.name}`})=>sg(n=>n instanceof t,e),"instanceOfType"),gy=ft.create,yy=Va.create,Gx=mg.create,Vx=Ua.create,my=ja.create,Jx=La.create,Yx=Ug.create,Xx=Ya.create,Qx=Ga.create,eB=Pi.create,tB=Ir.create,nB=bn.create,rB=Lg.create,iB=Nr.create,oB=Xn.create,aB=Xn.strictCreate,sB=Xa.create,lB=ug.create,uB=Ka.create,cB=er.create,fB=xg.create,dB=Pg.create,pB=go.create,gB=gg.create,yB=Eg.create,mB=fg.create,hB=Wa.create,vB=qa.create,TB=ir.create,_B=za.create,bB=po.create,cf=wn.create,wB=nn.create,xB=Yn.create,BB=co.create,PB=wn.createWithPreprocess,EB=Ja.create,SB=p(()=>gy().optional(),"ostring"),kB=p(()=>yy().optional(),"onumber"),IB=p(()=>my().optional(),"oboolean"),AB=me.fromJsonSchema,CB=me.fromObject,RB={string:p(t=>ft.create(H(x({},t),{coerce:!0})),"string"),number:p(t=>Va.create(H(x({},t),{coerce:!0})),"number"),boolean:p(t=>ja.create(H(x({},t),{coerce:!0})),"boolean"),bigint:p(t=>Ua.create(H(x({},t),{coerce:!0})),"bigint"),date:p(t=>La.create(H(x({},t),{coerce:!0})),"date")},OB=de,q=re,hy=p((t,e)=>t.anyOf.length?t.anyOf.length===1?nt(t.anyOf[0],H(x({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((n,r)=>nt(n,H(x({},e),{path:[...e.path,"anyOf",r]}))).join(", ")}])`:"z.any()","parseAnyOf"),MB=p(t=>{var e;return(e=t[ke])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),DB=p(t=>"z.any()","parseDefault"),NB=p((t,e)=>`z.union([${t.type.map(n=>nt(H(x({},t),{type:n}),e)).join(", ")}])`,"parseMultipleType"),HB=p((t,e)=>`z.any().refine((value) => !${nt(t.not,H(x({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),UB=p(t=>"z.null()","parseNull"),jB=p(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),$B=p((t,...e)=>Object.keys(t).reduce((n,r)=>(e.includes(r)||(n[r]=t[r]),n),{}),"omit");function at(t,e,n){var r;let o=t[e],s="";if(o!==void 0){let i=n({value:o,json:JSON.stringify(o)});if(i){let a=i[0],l=i.length===3?i[1]:"",c=i.length===3?i[2]:i[1];s+=a,((r=t.errorMessage)==null?void 0:r[e])!==void 0&&(s+=l+JSON.stringify(t.errorMessage[e])),s+=c}}return s}p(at,"withMessage");var Er=Symbol("Original index"),ZB=p(t=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="boolean")e.push(r?{[Er]:n}:{[Er]:n,not:{}});else{if(Er in r)return t;e.push(H(x({},r),{[Er]:n}))}}return e},"ensureOriginalIndex");function Ur(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let n=t.allOf[0];return nt(n,H(x({},e),{path:[...e.path,"allOf",n[Er]]}))}else{let[n,r]=jB(ZB(t.allOf));return`z.intersection(${Ur({allOf:n},e)}, ${Ur({allOf:r},e)})`}}p(Ur,"parseAllOf");var LB=p((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((r,o)=>nt(r,H(x({},e),{path:[...e.path,"items",o]})))}])`;let n=t.items?`z.array(${nt(t.items,H(x({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return n+=at(t,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=at(t,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseArray"),FB=p(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),KB=p(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"),WB=p((t,e)=>{let n=nt(t.if,H(x({},e),{path:[...e.path,"if"]})),r=nt(t.then,H(x({},e),{path:[...e.path,"then"]})),o=nt(t.else,H(x({},e),{path:[...e.path,"else"]}));return`z.union([${r}, ${o}]).superRefine((value,ctx) => {
17
+ */`},"getMultilineComment"),tf={};ia(tf,{JSONSchemaToZuiError:()=>aa,ObjectToZuiError:()=>uo,UnrepresentableGenericError:()=>co,UnsupportedJSONSchemaToZuiError:()=>nn,UnsupportedZuiCheckToJSONSchemaError:()=>uf,UnsupportedZuiToJSONSchemaError:()=>dt,UnsupportedZuiToTypescriptSchemaError:()=>vn,UnsupportedZuiToTypescriptTypeError:()=>mf,UntitledDeclarationError:()=>vf,ZuiToJSONSchemaError:()=>oa,ZuiToTypescriptSchemaError:()=>df,ZuiToTypescriptTypeError:()=>sa,ZuiTransformError:()=>rr});var nf=class extends Error{constructor(e,n){super(n),this.transform=e}};d(nf,"ZuiTransformError");var rr=nf,rf=class extends rr{constructor(e){super("json-schema-to-zui",e)}};d(rf,"JSONSchemaToZuiError");var aa=rf,af=class extends rr{constructor(e){super("object-to-zui",e)}};d(af,"ObjectToZuiError");var uo=af,of=class extends rr{constructor(e){super("zui-to-json-schema",e)}};d(of,"ZuiToJSONSchemaError");var oa=of,sf=class extends oa{constructor(e,{suggestedAlternative:n}={}){super(`Zod type ${e} cannot be transformed to JSON Schema.`+(n?` Suggested alternative: ${n}`:""))}};d(sf,"UnsupportedZuiToJSONSchemaError");var dt=sf,lf=class extends oa{constructor({zodType:e,checkKind:n}){super(`Zod check .${n}() of type ${e} cannot be transformed to JSON Schema.`)}};d(lf,"UnsupportedZuiCheckToJSONSchemaError");var uf=lf,cf=class extends aa{constructor(e){super(`JSON Schema ${JSON.stringify(e)} cannot be transformed to ZUI type.`)}};d(cf,"UnsupportedJSONSchemaToZuiError");var nn=cf,ff=class extends rr{constructor(e){super("zui-to-typescript-schema",e)}};d(ff,"ZuiToTypescriptSchemaError");var df=ff,pf=class extends df{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};d(pf,"UnsupportedZuiToTypescriptSchemaError");var vn=pf,gf=class extends rr{constructor(e){super("zui-to-typescript-type",e)}};d(gf,"ZuiToTypescriptTypeError");var sa=gf,yf=class extends sa{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};d(yf,"UnsupportedZuiToTypescriptTypeError");var mf=yf,hf=class extends sa{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};d(hf,"UntitledDeclarationError");var vf=hf,Tf=class extends sa{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};d(Tf,"UnrepresentableGenericError");var co=Tf,_f=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],zv=d(t=>_f.includes(t),"isPrimitive"),qv=d(t=>_f.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),pc=d(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),bf=class{constructor(e,n,r=!1){this.key=e,this.value=n,this.optional=r}};d(bf,"KeyValue");var di=bf,wf=class{constructor(e){this.schema=e}};d(wf,"FnParameters");var gc=wf,xf=class{constructor(e){this.schema=e}};d(xf,"FnReturn");var yc=xf,Pf=class{constructor(e){this.props=e}};d(Pf,"Declaration");var gi=Pf;function Bo(t,e={}){let n=Jv(t,e),r=ke(n,{});return e.formatter&&(r=e.formatter(r)),r}d(Bo,"toTypescriptType");function ke(t,e){var n,r,a;let s=N(b({},e),{parent:t});if(t===null)return"";if(t instanceof gi)return Gv(t,s);if(t instanceof di){if(t.value instanceof C.ZodOptional){let h=t.value._def.innerType;return ke(new di(t.key,h,!0),s)}let l=nt(t.value.description),f=l?.trim().length>0?`
18
+ `:"",p=t.value.describe(""),g=t.optional||t.value.isOptional()?"?":"";return`${f}${l}${f}${t.key}${g}: ${ke(p,s)}${f}`}if(t instanceof gc){if(t.schema instanceof C.ZodTuple){let p="";for(let y=0;y<t.schema.items.length;y++){let g=(a=(r=(n=t.schema.items[y])==null?void 0:n.ui)==null?void 0:r.title)!=null?a:`arg${y}`,h=t.schema.items[y];p+=`${ke(new di(lo(g),h),s)}${y<t.schema.items.length-1?", ":""} `}return p}let l=ke(t.schema,s);return l.startsWith("{")&&l.endsWith("}")||l.startsWith("[")&&l.endsWith("]")||l.startsWith("(")&&l.endsWith(")")||l.startsWith("Array<")&&l.endsWith(">")||l.startsWith("Record<")&&l.endsWith(">")||qv(l)?`args: ${l}`:l}if(t instanceof yc)return t.schema instanceof C.ZodOptional?`${ke(t.schema.unwrap(),s)} | undefined`:ke(t.schema,s);let i=t,o=i._def;switch(o.typeName){case C.ZodFirstPartyTypeKind.ZodString:return`${nt(i.description)} string`.trim();case C.ZodFirstPartyTypeKind.ZodNumber:case C.ZodFirstPartyTypeKind.ZodNaN:case C.ZodFirstPartyTypeKind.ZodBigInt:return`${nt(i.description)} number`.trim();case C.ZodFirstPartyTypeKind.ZodBoolean:return`${nt(i.description)} boolean`.trim();case C.ZodFirstPartyTypeKind.ZodDate:return`${nt(i.description)} Date`.trim();case C.ZodFirstPartyTypeKind.ZodUndefined:return`${nt(i.description)} undefined`.trim();case C.ZodFirstPartyTypeKind.ZodNull:return`${nt(i.description)} null`.trim();case C.ZodFirstPartyTypeKind.ZodAny:return`${nt(i.description)} any`.trim();case C.ZodFirstPartyTypeKind.ZodUnknown:return`${nt(i.description)} unknown`.trim();case C.ZodFirstPartyTypeKind.ZodNever:return`${nt(i.description)} never`.trim();case C.ZodFirstPartyTypeKind.ZodVoid:return`${nt(i.description)} void`.trim();case C.ZodFirstPartyTypeKind.ZodArray:let l=ke(o.type,s);return zv(l)?`${l}[]`:`Array<${l}>`;case C.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(o.shape()).map(([E,H])=>ke(new di(lo(E),H),s)).join("; ")} }`;case C.ZodFirstPartyTypeKind.ZodUnion:let p=o.options.map(E=>ke(E,s));return`${nt(i.description)}
19
+ ${p.join(" | ")}`;case C.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let y=o.options.map(E=>ke(E,s));return`${nt(i.description)}
20
+ ${y.join(" | ")}`;case C.ZodFirstPartyTypeKind.ZodIntersection:return`${ke(o.left,s)} & ${ke(o.right,s)}`;case C.ZodFirstPartyTypeKind.ZodTuple:return o.items.length===0?"":`[${o.items.map(E=>ke(E,s)).join(", ")}]`;case C.ZodFirstPartyTypeKind.ZodRecord:let h=ke(o.keyType,s),w=ke(o.valueType,s);return`${nt(i.description)} { [key: ${h}]: ${w} }`;case C.ZodFirstPartyTypeKind.ZodMap:return`Map<${ke(o.keyType,s)}, ${ke(o.valueType,s)}>`;case C.ZodFirstPartyTypeKind.ZodSet:return`Set<${ke(o.valueType,s)}>`;case C.ZodFirstPartyTypeKind.ZodFunction:let P=ke(new gc(o.args),s),B=ke(new yc(o.returns),s);return`${nt(i.description)}
21
+ (${P}) => ${B}`;case C.ZodFirstPartyTypeKind.ZodLazy:return ke(o.getter(),s);case C.ZodFirstPartyTypeKind.ZodLiteral:let v=Yc(o.value);return`${nt(i.description)}
22
+ ${v}`.trim();case C.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(se).join(" | ");case C.ZodFirstPartyTypeKind.ZodEffects:return ke(o.schema,s);case C.ZodFirstPartyTypeKind.ZodNativeEnum:throw new mf(C.ZodFirstPartyTypeKind.ZodNativeEnum);case C.ZodFirstPartyTypeKind.ZodOptional:return`${ke(o.innerType,s)} | undefined`;case C.ZodFirstPartyTypeKind.ZodNullable:return`${ke(o.innerType,s)} | null`;case C.ZodFirstPartyTypeKind.ZodDefault:return ke(o.innerType,s);case C.ZodFirstPartyTypeKind.ZodCatch:return ke(o.innerType,s);case C.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${ke(o.type,s)}>`;case C.ZodFirstPartyTypeKind.ZodBranded:return ke(o.type,s);case C.ZodFirstPartyTypeKind.ZodPipeline:return ke(o.in,s);case C.ZodFirstPartyTypeKind.ZodSymbol:return`${nt(i.description)} symbol`.trim();case C.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${ke(o.innerType,s)}>`;case C.ZodFirstPartyTypeKind.ZodRef:return ef(o.uri);default:be.assertNever(o)}}d(ke,"sUnwrapZod");var Gv=d((t,e)=>{if(t.props.type==="none")return ke(t.props.schema,e);let n=nt(t.props.schema.description),r=t.props.schema.describe(""),a=ke(r,e);if(t.props.type==="variable")return pc(`${n}declare const ${t.props.identifier}: ${a};`);let s=t.props.args.length>0?`<${t.props.args.map(ef).join(", ")}>`:"";return pc(`${n}type ${t.props.identifier}${s} = ${a};`)},"unwrapDeclaration"),Vv=d(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),Jv=d((t,e)=>{let n=Vv(e),r=t.getReferences();if(n==="none"){if(r.length>0)throw new co;return new gi({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new vf;if(n==="variable"){if(r.length>0)throw new co;return new gi({type:"variable",identifier:a,schema:t})}return new gi({type:"type",identifier:a,schema:t,args:r})},"getDeclarationProps"),Xv=typeof global=="object"&&global&&global.Object===Object&&global,Bf=Xv,Yv=typeof self=="object"&&self&&self.Object===Object&&self,Qv=Bf||Yv||Function("return this")(),Ft=Qv,eT=Ft.Symbol,on=eT,Ef=Object.prototype,tT=Ef.hasOwnProperty,nT=Ef.toString,_r=on?on.toStringTag:void 0;function Sf(t){var e=tT.call(t,_r),n=t[_r];try{t[_r]=void 0;var r=!0}catch{}var a=nT.call(t);return r&&(e?t[_r]=n:delete t[_r]),a}d(Sf,"getRawTag");var rT=Sf,iT=Object.prototype,aT=iT.toString;function kf(t){return aT.call(t)}d(kf,"objectToString");var oT=kf,sT="[object Null]",lT="[object Undefined]",mc=on?on.toStringTag:void 0;function If(t){return t==null?t===void 0?lT:sT:mc&&mc in Object(t)?rT(t):oT(t)}d(If,"baseGetTag");var En=If;function Af(t){return t!=null&&typeof t=="object"}d(Af,"isObjectLike");var Pn=Af,uT="[object Symbol]";function Cf(t){return typeof t=="symbol"||Pn(t)&&En(t)==uT}d(Cf,"isSymbol");var Eo=Cf;function Of(t,e){for(var n=-1,r=t==null?0:t.length,a=Array(r);++n<r;)a[n]=e(t[n],n,t);return a}d(Of,"arrayMap");var Rf=Of,cT=Array.isArray,Lt=cT,fT=1/0,hc=on?on.prototype:void 0,vc=hc?hc.toString:void 0;function So(t){if(typeof t=="string")return t;if(Lt(t))return Rf(t,So)+"";if(Eo(t))return vc?vc.call(t):"";var e=t+"";return e=="0"&&1/t==-fT?"-0":e}d(So,"baseToString");var dT=So;function Mf(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}d(Mf,"isObject");var Yn=Mf;function Nf(t){return t}d(Nf,"identity");var pT=Nf,gT="[object AsyncFunction]",yT="[object Function]",mT="[object GeneratorFunction]",hT="[object Proxy]";function Df(t){if(!Yn(t))return!1;var e=En(t);return e==yT||e==mT||e==gT||e==hT}d(Df,"isFunction");var Hf=Df,vT=Ft["__core-js_shared__"],no=vT,Tc=function(){var t=/[^.]+$/.exec(no&&no.keys&&no.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Uf(t){return!!Tc&&Tc in t}d(Uf,"isMasked");var TT=Uf,_T=Function.prototype,bT=_T.toString;function $f(t){if(t!=null){try{return bT.call(t)}catch{}try{return t+""}catch{}}return""}d($f,"toSource");var Sn=$f,wT=/[\\^$.*+?()[\]{}|]/g,xT=/^\[object .+?Constructor\]$/,PT=Function.prototype,BT=Object.prototype,ET=PT.toString,ST=BT.hasOwnProperty,kT=RegExp("^"+ET.call(ST).replace(wT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zf(t){if(!Yn(t)||TT(t))return!1;var e=Hf(t)?kT:xT;return e.test(Sn(t))}d(Zf,"baseIsNative");var IT=Zf;function jf(t,e){return t?.[e]}d(jf,"getValue");var AT=jf;function Kf(t,e){var n=AT(t,e);return IT(n)?n:void 0}d(Kf,"getNative");var kn=Kf,CT=kn(Ft,"WeakMap"),fo=CT,OT=function(){try{var t=kn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),_c=OT,RT=9007199254740991,MT=/^(?:0|[1-9]\d*)$/;function Lf(t,e){var n=typeof t;return e=e??RT,!!e&&(n=="number"||n!="symbol"&&MT.test(t))&&t>-1&&t%1==0&&t<e}d(Lf,"isIndex");var ko=Lf;function Ff(t,e,n){e=="__proto__"&&_c?_c(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}d(Ff,"baseAssignValue");var Wf=Ff;function zf(t,e){return t===e||t!==t&&e!==e}d(zf,"eq");var Io=zf,NT=Object.prototype,DT=NT.hasOwnProperty;function qf(t,e,n){var r=t[e];(!(DT.call(t,e)&&Io(r,n))||n===void 0&&!(e in t))&&Wf(t,e,n)}d(qf,"assignValue");var HT=qf,UT=9007199254740991;function Gf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=UT}d(Gf,"isLength");var Ao=Gf;function Vf(t){return t!=null&&Ao(t.length)&&!Hf(t)}d(Vf,"isArrayLike");var Jf=Vf,$T=Object.prototype;function Xf(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$T;return t===n}d(Xf,"isPrototype");var Yf=Xf;function Qf(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}d(Qf,"baseTimes");var ZT=Qf,jT="[object Arguments]";function ed(t){return Pn(t)&&En(t)==jT}d(ed,"baseIsArguments");var bc=ed,td=Object.prototype,KT=td.hasOwnProperty,LT=td.propertyIsEnumerable,FT=bc(function(){return arguments}())?bc:function(t){return Pn(t)&&KT.call(t,"callee")&&!LT.call(t,"callee")},nd=FT;function rd(){return!1}d(rd,"stubFalse");var WT=rd,id=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wc=id&&typeof module=="object"&&module&&!module.nodeType&&module,zT=wc&&wc.exports===id,xc=zT?Ft.Buffer:void 0,qT=xc?xc.isBuffer:void 0,GT=qT||WT,po=GT,VT="[object Arguments]",JT="[object Array]",XT="[object Boolean]",YT="[object Date]",QT="[object Error]",e_="[object Function]",t_="[object Map]",n_="[object Number]",r_="[object Object]",i_="[object RegExp]",a_="[object Set]",o_="[object String]",s_="[object WeakMap]",l_="[object ArrayBuffer]",u_="[object DataView]",c_="[object Float32Array]",f_="[object Float64Array]",d_="[object Int8Array]",p_="[object Int16Array]",g_="[object Int32Array]",y_="[object Uint8Array]",m_="[object Uint8ClampedArray]",h_="[object Uint16Array]",v_="[object Uint32Array]",$e={};$e[c_]=$e[f_]=$e[d_]=$e[p_]=$e[g_]=$e[y_]=$e[m_]=$e[h_]=$e[v_]=!0;$e[VT]=$e[JT]=$e[l_]=$e[XT]=$e[u_]=$e[YT]=$e[QT]=$e[e_]=$e[t_]=$e[n_]=$e[r_]=$e[i_]=$e[a_]=$e[o_]=$e[s_]=!1;function ad(t){return Pn(t)&&Ao(t.length)&&!!$e[En(t)]}d(ad,"baseIsTypedArray");var T_=ad;function od(t){return function(e){return t(e)}}d(od,"baseUnary");var __=od,sd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mr=sd&&typeof module=="object"&&module&&!module.nodeType&&module,b_=Mr&&Mr.exports===sd,ro=b_&&Bf.process,w_=function(){try{var t=Mr&&Mr.require&&Mr.require("util").types;return t||ro&&ro.binding&&ro.binding("util")}catch{}}(),Pc=w_,Bc=Pc&&Pc.isTypedArray,x_=Bc?__(Bc):T_,ld=x_,P_=Object.prototype,B_=P_.hasOwnProperty;function ud(t,e){var n=Lt(t),r=!n&&nd(t),a=!n&&!r&&po(t),s=!n&&!r&&!a&&ld(t),i=n||r||a||s,o=i?ZT(t.length,String):[],l=o.length;for(var f in t)(e||B_.call(t,f))&&!(i&&(f=="length"||a&&(f=="offset"||f=="parent")||s&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||ko(f,l)))&&o.push(f);return o}d(ud,"arrayLikeKeys");var cd=ud;function fd(t,e){return function(n){return t(e(n))}}d(fd,"overArg");var dd=fd,E_=dd(Object.keys,Object),S_=E_,k_=Object.prototype,I_=k_.hasOwnProperty;function pd(t){if(!Yf(t))return S_(t);var e=[];for(var n in Object(t))I_.call(t,n)&&n!="constructor"&&e.push(n);return e}d(pd,"baseKeys");var A_=pd;function gd(t){return Jf(t)?cd(t):A_(t)}d(gd,"keys");var Co=gd;function yd(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}d(yd,"nativeKeysIn");var C_=yd,O_=Object.prototype,R_=O_.hasOwnProperty;function md(t){if(!Yn(t))return C_(t);var e=Yf(t),n=[];for(var r in t)r=="constructor"&&(e||!R_.call(t,r))||n.push(r);return n}d(md,"baseKeysIn");var M_=md;function hd(t){return Jf(t)?cd(t,!0):M_(t)}d(hd,"keysIn");var N_=hd,D_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H_=/^\w*$/;function vd(t,e){if(Lt(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Eo(t)?!0:H_.test(t)||!D_.test(t)||e!=null&&t in Object(e)}d(vd,"isKey");var Oo=vd,U_=kn(Object,"create"),Hr=U_;function Td(){this.__data__=Hr?Hr(null):{},this.size=0}d(Td,"hashClear");var $_=Td;function _d(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}d(_d,"hashDelete");var Z_=_d,j_="__lodash_hash_undefined__",K_=Object.prototype,L_=K_.hasOwnProperty;function bd(t){var e=this.__data__;if(Hr){var n=e[t];return n===j_?void 0:n}return L_.call(e,t)?e[t]:void 0}d(bd,"hashGet");var F_=bd,W_=Object.prototype,z_=W_.hasOwnProperty;function wd(t){var e=this.__data__;return Hr?e[t]!==void 0:z_.call(e,t)}d(wd,"hashHas");var q_=wd,G_="__lodash_hash_undefined__";function xd(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Hr&&e===void 0?G_:e,this}d(xd,"hashSet");var V_=xd;function In(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(In,"Hash");In.prototype.clear=$_;In.prototype.delete=Z_;In.prototype.get=F_;In.prototype.has=q_;In.prototype.set=V_;var Ec=In;function Pd(){this.__data__=[],this.size=0}d(Pd,"listCacheClear");var J_=Pd;function Bd(t,e){for(var n=t.length;n--;)if(Io(t[n][0],e))return n;return-1}d(Bd,"assocIndexOf");var la=Bd,X_=Array.prototype,Y_=X_.splice;function Ed(t){var e=this.__data__,n=la(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():Y_.call(e,n,1),--this.size,!0}d(Ed,"listCacheDelete");var Q_=Ed;function Sd(t){var e=this.__data__,n=la(e,t);return n<0?void 0:e[n][1]}d(Sd,"listCacheGet");var eb=Sd;function kd(t){return la(this.__data__,t)>-1}d(kd,"listCacheHas");var tb=kd;function Id(t,e){var n=this.__data__,r=la(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}d(Id,"listCacheSet");var nb=Id;function An(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(An,"ListCache");An.prototype.clear=J_;An.prototype.delete=Q_;An.prototype.get=eb;An.prototype.has=tb;An.prototype.set=nb;var ua=An,rb=kn(Ft,"Map"),Ur=rb;function Ad(){this.size=0,this.__data__={hash:new Ec,map:new(Ur||ua),string:new Ec}}d(Ad,"mapCacheClear");var ib=Ad;function Cd(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}d(Cd,"isKeyable");var ab=Cd;function Od(t,e){var n=t.__data__;return ab(e)?n[typeof e=="string"?"string":"hash"]:n.map}d(Od,"getMapData");var ca=Od;function Rd(t){var e=ca(this,t).delete(t);return this.size-=e?1:0,e}d(Rd,"mapCacheDelete");var ob=Rd;function Md(t){return ca(this,t).get(t)}d(Md,"mapCacheGet");var sb=Md;function Nd(t){return ca(this,t).has(t)}d(Nd,"mapCacheHas");var lb=Nd;function Dd(t,e){var n=ca(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}d(Dd,"mapCacheSet");var ub=Dd;function Cn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}d(Cn,"MapCache");Cn.prototype.clear=ib;Cn.prototype.delete=ob;Cn.prototype.get=sb;Cn.prototype.has=lb;Cn.prototype.set=ub;var fa=Cn,cb="Expected a function";function da(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(cb);var n=d(function(){var r=arguments,a=e?e.apply(this,r):r[0],s=n.cache;if(s.has(a))return s.get(a);var i=t.apply(this,r);return n.cache=s.set(a,i)||s,i},"memoized");return n.cache=new(da.Cache||fa),n}d(da,"memoize");da.Cache=fa;var fb=da,db=500;function Hd(t){var e=fb(t,function(r){return n.size===db&&n.clear(),r}),n=e.cache;return e}d(Hd,"memoizeCapped");var pb=Hd,gb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yb=/\\(\\)?/g,mb=pb(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(gb,function(n,r,a,s){e.push(a?s.replace(yb,"$1"):r||n)}),e}),hb=mb;function Ud(t){return t==null?"":dT(t)}d(Ud,"toString");var vb=Ud;function $d(t,e){return Lt(t)?t:Oo(t,e)?[t]:hb(vb(t))}d($d,"castPath");var pa=$d,Tb=1/0;function Zd(t){if(typeof t=="string"||Eo(t))return t;var e=t+"";return e=="0"&&1/t==-Tb?"-0":e}d(Zd,"toKey");var Wr=Zd;function jd(t,e){e=pa(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Wr(e[n++])];return n&&n==r?t:void 0}d(jd,"baseGet");var Ro=jd;function Kd(t,e,n){var r=t==null?void 0:Ro(t,e);return r===void 0?n:r}d(Kd,"get");var _b=Kd;function Ld(t,e){for(var n=-1,r=e.length,a=t.length;++n<r;)t[a+n]=e[n];return t}d(Ld,"arrayPush");var Fd=Ld,bb=dd(Object.getPrototypeOf,Object),Wd=bb,wb="[object Object]",xb=Function.prototype,Pb=Object.prototype,zd=xb.toString,Bb=Pb.hasOwnProperty,Eb=zd.call(Object);function qd(t){if(!Pn(t)||En(t)!=wb)return!1;var e=Wd(t);if(e===null)return!0;var n=Bb.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&zd.call(n)==Eb}d(qd,"isPlainObject");var Sc=qd;function Gd(){this.__data__=new ua,this.size=0}d(Gd,"stackClear");var Sb=Gd;function Vd(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}d(Vd,"stackDelete");var kb=Vd;function Jd(t){return this.__data__.get(t)}d(Jd,"stackGet");var Ib=Jd;function Xd(t){return this.__data__.has(t)}d(Xd,"stackHas");var Ab=Xd,Cb=200;function Yd(t,e){var n=this.__data__;if(n instanceof ua){var r=n.__data__;if(!Ur||r.length<Cb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new fa(r)}return n.set(t,e),this.size=n.size,this}d(Yd,"stackSet");var Ob=Yd;function On(t){var e=this.__data__=new ua(t);this.size=e.size}d(On,"Stack");On.prototype.clear=Sb;On.prototype.delete=kb;On.prototype.get=Ib;On.prototype.has=Ab;On.prototype.set=Ob;var yi=On;function Qd(t,e){for(var n=-1,r=t==null?0:t.length,a=0,s=[];++n<r;){var i=t[n];e(i,n,t)&&(s[a++]=i)}return s}d(Qd,"arrayFilter");var Rb=Qd;function ep(){return[]}d(ep,"stubArray");var tp=ep,Mb=Object.prototype,Nb=Mb.propertyIsEnumerable,kc=Object.getOwnPropertySymbols,Db=kc?function(t){return t==null?[]:(t=Object(t),Rb(kc(t),function(e){return Nb.call(t,e)}))}:tp,np=Db,Hb=Object.getOwnPropertySymbols,Ub=Hb?function(t){for(var e=[];t;)Fd(e,np(t)),t=Wd(t);return e}:tp,$b=Ub;function rp(t,e,n){var r=e(t);return Lt(t)?r:Fd(r,n(t))}d(rp,"baseGetAllKeys");var ip=rp;function ap(t){return ip(t,Co,np)}d(ap,"getAllKeys");var Ic=ap;function op(t){return ip(t,N_,$b)}d(op,"getAllKeysIn");var Zb=op,jb=kn(Ft,"DataView"),go=jb,Kb=kn(Ft,"Promise"),yo=Kb,Lb=kn(Ft,"Set"),mo=Lb,Ac="[object Map]",Fb="[object Object]",Cc="[object Promise]",Oc="[object Set]",Rc="[object WeakMap]",Mc="[object DataView]",Wb=Sn(go),zb=Sn(Ur),qb=Sn(yo),Gb=Sn(mo),Vb=Sn(fo),Tn=En;(go&&Tn(new go(new ArrayBuffer(1)))!=Mc||Ur&&Tn(new Ur)!=Ac||yo&&Tn(yo.resolve())!=Cc||mo&&Tn(new mo)!=Oc||fo&&Tn(new fo)!=Rc)&&(Tn=d(function(t){var e=En(t),n=e==Fb?t.constructor:void 0,r=n?Sn(n):"";if(r)switch(r){case Wb:return Mc;case zb:return Ac;case qb:return Cc;case Gb:return Oc;case Vb:return Rc}return e},"getTag"));var Nc=Tn,Jb=Ft.Uint8Array,Dc=Jb,Xb="__lodash_hash_undefined__";function sp(t){return this.__data__.set(t,Xb),this}d(sp,"setCacheAdd");var Yb=sp;function lp(t){return this.__data__.has(t)}d(lp,"setCacheHas");var Qb=lp;function $r(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new fa;++e<n;)this.add(t[e])}d($r,"SetCache");$r.prototype.add=$r.prototype.push=Yb;$r.prototype.has=Qb;var ew=$r;function up(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}d(up,"arraySome");var tw=up;function cp(t,e){return t.has(e)}d(cp,"cacheHas");var nw=cp,rw=1,iw=2;function fp(t,e,n,r,a,s){var i=n&rw,o=t.length,l=e.length;if(o!=l&&!(i&&l>o))return!1;var f=s.get(t),p=s.get(e);if(f&&p)return f==e&&p==t;var y=-1,g=!0,h=n&iw?new ew:void 0;for(s.set(t,e),s.set(e,t);++y<o;){var w=t[y],P=e[y];if(r)var B=i?r(P,w,y,e,t,s):r(w,P,y,t,e,s);if(B!==void 0){if(B)continue;g=!1;break}if(h){if(!tw(e,function(v,S){if(!nw(h,S)&&(w===v||a(w,v,n,r,s)))return h.push(S)})){g=!1;break}}else if(!(w===P||a(w,P,n,r,s))){g=!1;break}}return s.delete(t),s.delete(e),g}d(fp,"equalArrays");var dp=fp;function pp(t){var e=-1,n=Array(t.size);return t.forEach(function(r,a){n[++e]=[a,r]}),n}d(pp,"mapToArray");var aw=pp;function gp(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}d(gp,"setToArray");var ow=gp,sw=1,lw=2,uw="[object Boolean]",cw="[object Date]",fw="[object Error]",dw="[object Map]",pw="[object Number]",gw="[object RegExp]",yw="[object Set]",mw="[object String]",hw="[object Symbol]",vw="[object ArrayBuffer]",Tw="[object DataView]",Hc=on?on.prototype:void 0,io=Hc?Hc.valueOf:void 0;function yp(t,e,n,r,a,s,i){switch(n){case Tw:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case vw:return!(t.byteLength!=e.byteLength||!s(new Dc(t),new Dc(e)));case uw:case cw:case pw:return Io(+t,+e);case fw:return t.name==e.name&&t.message==e.message;case gw:case mw:return t==e+"";case dw:var o=aw;case yw:var l=r&sw;if(o||(o=ow),t.size!=e.size&&!l)return!1;var f=i.get(t);if(f)return f==e;r|=lw,i.set(t,e);var p=dp(o(t),o(e),r,a,s,i);return i.delete(t),p;case hw:if(io)return io.call(t)==io.call(e)}return!1}d(yp,"equalByTag");var _w=yp,bw=1,ww=Object.prototype,xw=ww.hasOwnProperty;function mp(t,e,n,r,a,s){var i=n&bw,o=Ic(t),l=o.length,f=Ic(e),p=f.length;if(l!=p&&!i)return!1;for(var y=l;y--;){var g=o[y];if(!(i?g in e:xw.call(e,g)))return!1}var h=s.get(t),w=s.get(e);if(h&&w)return h==e&&w==t;var P=!0;s.set(t,e),s.set(e,t);for(var B=i;++y<l;){g=o[y];var v=t[g],S=e[g];if(r)var E=i?r(S,v,g,e,t,s):r(v,S,g,t,e,s);if(!(E===void 0?v===S||a(v,S,n,r,s):E)){P=!1;break}B||(B=g=="constructor")}if(P&&!B){var H=t.constructor,K=e.constructor;H!=K&&"constructor"in t&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof K=="function"&&K instanceof K)&&(P=!1)}return s.delete(t),s.delete(e),P}d(mp,"equalObjects");var Pw=mp,Bw=1,Uc="[object Arguments]",$c="[object Array]",pi="[object Object]",Ew=Object.prototype,Zc=Ew.hasOwnProperty;function hp(t,e,n,r,a,s){var i=Lt(t),o=Lt(e),l=i?$c:Nc(t),f=o?$c:Nc(e);l=l==Uc?pi:l,f=f==Uc?pi:f;var p=l==pi,y=f==pi,g=l==f;if(g&&po(t)){if(!po(e))return!1;i=!0,p=!1}if(g&&!p)return s||(s=new yi),i||ld(t)?dp(t,e,n,r,a,s):_w(t,e,l,n,r,a,s);if(!(n&Bw)){var h=p&&Zc.call(t,"__wrapped__"),w=y&&Zc.call(e,"__wrapped__");if(h||w){var P=h?t.value():t,B=w?e.value():e;return s||(s=new yi),a(P,B,n,r,s)}}return g?(s||(s=new yi),Pw(t,e,n,r,a,s)):!1}d(hp,"baseIsEqualDeep");var Sw=hp;function Mo(t,e,n,r,a){return t===e?!0:t==null||e==null||!Pn(t)&&!Pn(e)?t!==t&&e!==e:Sw(t,e,n,r,Mo,a)}d(Mo,"baseIsEqual");var ga=Mo,kw=1,Iw=2;function vp(t,e,n,r){var a=n.length,s=a,i=!r;if(t==null)return!s;for(t=Object(t);a--;){var o=n[a];if(i&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<s;){o=n[a];var l=o[0],f=t[l],p=o[1];if(i&&o[2]){if(f===void 0&&!(l in t))return!1}else{var y=new yi;if(r)var g=r(f,p,l,t,e,y);if(!(g===void 0?ga(p,f,kw|Iw,r,y):g))return!1}}return!0}d(vp,"baseIsMatch");var Aw=vp;function Tp(t){return t===t&&!Yn(t)}d(Tp,"isStrictComparable");var _p=Tp;function bp(t){for(var e=Co(t),n=e.length;n--;){var r=e[n],a=t[r];e[n]=[r,a,_p(a)]}return e}d(bp,"getMatchData");var Cw=bp;function wp(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}d(wp,"matchesStrictComparable");var xp=wp;function Pp(t){var e=Cw(t);return e.length==1&&e[0][2]?xp(e[0][0],e[0][1]):function(n){return n===t||Aw(n,t,e)}}d(Pp,"baseMatches");var Ow=Pp;function Bp(t,e){return t!=null&&e in Object(t)}d(Bp,"baseHasIn");var Rw=Bp;function Ep(t,e,n){e=pa(e,t);for(var r=-1,a=e.length,s=!1;++r<a;){var i=Wr(e[r]);if(!(s=t!=null&&n(t,i)))break;t=t[i]}return s||++r!=a?s:(a=t==null?0:t.length,!!a&&Ao(a)&&ko(i,a)&&(Lt(t)||nd(t)))}d(Ep,"hasPath");var Mw=Ep;function Sp(t,e){return t!=null&&Mw(t,e,Rw)}d(Sp,"hasIn");var Nw=Sp,Dw=1,Hw=2;function kp(t,e){return Oo(t)&&_p(e)?xp(Wr(t),e):function(n){var r=_b(n,t);return r===void 0&&r===e?Nw(n,t):ga(e,r,Dw|Hw)}}d(kp,"baseMatchesProperty");var Uw=kp;function Ip(t){return function(e){return e?.[t]}}d(Ip,"baseProperty");var $w=Ip;function Ap(t){return function(e){return Ro(e,t)}}d(Ap,"basePropertyDeep");var Zw=Ap;function Cp(t){return Oo(t)?$w(Wr(t)):Zw(t)}d(Cp,"property");var jw=Cp;function Op(t){return typeof t=="function"?t:t==null?pT:typeof t=="object"?Lt(t)?Uw(t[0],t[1]):Ow(t):jw(t)}d(Op,"baseIteratee");var No=Op;function Rp(t){return function(e,n,r){for(var a=-1,s=Object(e),i=r(e),o=i.length;o--;){var l=i[t?o:++a];if(n(s[l],l,s)===!1)break}return e}}d(Rp,"createBaseFor");var Kw=Rp,Lw=Kw(),Fw=Lw;function Mp(t,e){return t&&Fw(t,e,Co)}d(Mp,"baseForOwn");var Ww=Mp;function Np(t,e){return ga(t,e)}d(Np,"isEqual");var Xn=Np;function Dp(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?ga(t,e,void 0,n):!!r}d(Dp,"isEqualWith");var zw=Dp;function Hp(t){return t===void 0}d(Hp,"isUndefined");var jc=Hp;function Up(t,e){var n={};return e=No(e,3),Ww(t,function(r,a,s){Wf(n,a,e(r,a,s))}),n}d(Up,"mapValues");var qw=Up,Gw="Expected a function";function $p(t){if(typeof t!="function")throw new TypeError(Gw);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}d($p,"negate");var Vw=$p;function Zp(t,e,n,r){if(!Yn(t))return t;e=pa(e,t);for(var a=-1,s=e.length,i=s-1,o=t;o!=null&&++a<s;){var l=Wr(e[a]),f=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(a!=i){var p=o[l];f=r?r(p,l,o):void 0,f===void 0&&(f=Yn(p)?p:ko(e[a+1])?[]:{})}HT(o,l,f),o=o[l]}return t}d(Zp,"baseSet");var Jw=Zp;function jp(t,e,n){for(var r=-1,a=e.length,s={};++r<a;){var i=e[r],o=Ro(t,i);n(o,i)&&Jw(s,pa(i,t),o)}return s}d(jp,"basePickBy");var Xw=jp;function Kp(t,e){if(t==null)return{};var n=Rf(Zb(t),function(r){return[r]});return e=No(e),Xw(t,n,function(r,a){return e(r,a[0])})}d(Kp,"pickBy");var Yw=Kp;function Lp(t,e){return Yw(t,Vw(No(e)))}d(Lp,"omitBy");var Kc=Lp,Qw=d(t=>{let e=t.checks;return e.length===0?"":e.map(ex).join("")},"generateStringChecks"),ex=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"length":return`.length(${se(t.value)}, ${se(t.message)})`;case"email":return`.email(${se(t.message)})`;case"url":return`.url(${se(t.message)})`;case"emoji":return`.emoji(${se(t.message)})`;case"uuid":return`.uuid(${se(t.message)})`;case"cuid":return`.cuid(${se(t.message)})`;case"cuid2":return`.cuid2(${se(t.message)})`;case"ulid":return`.ulid(${se(t.message)})`;case"includes":let e=Jn({message:t.message,position:t.position});return`.includes(${se(t.value)}, ${e})`;case"startsWith":return`.startsWith(${se(t.value)}, ${se(t.message)})`;case"endsWith":return`.endsWith(${se(t.value)}, ${se(t.message)})`;case"regex":return`.regex(${String(t.regex)}, ${se(t.message)})`;case"trim":return".trim()";case"toLowerCase":return".toLowerCase()";case"toUpperCase":return".toUpperCase()";case"datetime":let r=t.precision===null?void 0:t.precision;return`.datetime(${Jn({message:t.message,precision:r,offset:t.offset})})`;case"ip":return`.ip(${Jn({message:t.message,version:t.version})})`;default:return""}},"_generateStringCheck"),tx=d(t=>{let e=t.checks;return e.length===0?"":e.map(nx).join("")},"generateNumberChecks"),nx=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"int":return`.int(${se(t.message)})`;case"multipleOf":return`.multipleOf(${se(t.value)}, ${se(t.message)})`;case"finite":return`.finite(${se(t.message)})`;default:return""}},"_generateNumberCheck"),rx=d(t=>{let e=t.checks;return e.length===0?"":e.map(ix).join("")},"generateBigIntChecks"),ix=d(t=>{switch(t.kind){case"min":return`.min(${se(t.value)}, ${se(t.message)})`;case"max":return`.max(${se(t.value)}, ${se(t.message)})`;case"multipleOf":return`.multipleOf(${se(t.value)}, ${se(t.message)})`;default:return""}},"_generateBigIntCheck"),ax=d(t=>{let e=t.checks;return e.length===0?"":e.map(ox).join("")},"generateDateChecks"),ox=d(t=>{switch(t.kind){case"min":return`.min(${Lc(t.value)}, ${se(t.message)})`;case"max":return`.max(${Lc(t.value)}, ${se(t.message)})`;default:return""}},"_generateDateCheck"),Lc=d(t=>`new Date(${t})`,"dateTs"),sx=d(t=>{let e=[];if(t.exactLength){let{value:n,message:r}=t.exactLength;e.push(`.length(${se(n)}, ${se(r)})`)}if(t.minLength){let{value:n,message:r}=t.minLength;e.push(`.min(${se(n)}, ${se(r)})`)}if(t.maxLength){let{value:n,message:r}=t.maxLength;e.push(`.max(${se(n)}, ${se(r)})`)}return e.join("")},"generateArrayChecks"),lx=d(t=>{let e=[];if(t.minSize){let{value:n,message:r}=t.minSize;e.push(`.min(${se(n)}, ${se(r)})`)}if(t.maxSize){let{value:n,message:r}=t.maxSize;e.push(`.max(${se(n)}, ${se(r)})`)}return e.join("")},"generateSetChecks");function Do(t){return Fe(t)}d(Do,"toTypescriptSchema");function Fe(t){let n=t._def;switch(n.typeName){case C.ZodFirstPartyTypeKind.ZodString:return`z.string()${Qw(n)}${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodNumber:return`z.number()${tx(n)}${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodNaN:return`z.nan()${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodBigInt:return`z.bigint()${rx(n)}${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodBoolean:return`z.boolean()${Ce(n)}${Ae(t._def)}`.trim();case C.ZodFirstPartyTypeKind.ZodDate:return`z.date()${ax(n)}${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodUndefined:return`z.undefined()${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodNull:return`z.null()${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodAny:return`z.any()${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodUnknown:return`z.unknown()${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodNever:return`z.never()${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodVoid:return`z.void()${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodArray:return`z.array(${Fe(n.type)})${sx(n)}${Ce(n)}${Ae(n)}`;case C.ZodFirstPartyTypeKind.ZodObject:let r=qw(n.shape(),Fe),a=t.additionalProperties(),s=a?`.catchall(${Fe(a)})`:"";return["z.object({",...Object.entries(r).map(([Q,ge])=>` ${Q}: ${ge},`),`})${s}${Ce(n)}${Ae(n)}`].join(`
23
+ `).trim();case C.ZodFirstPartyTypeKind.ZodUnion:return`z.union([${n.options.map(Fe).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let o=n.options.map(Fe);return`z.discriminatedUnion(${se(n.discriminator)}, [${o.join(", ")}])${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodIntersection:let f=Fe(n.left),p=Fe(n.right);return`z.intersection(${f}, ${p})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodTuple:return`z.tuple([${n.items.map(Fe).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodRecord:let g=Fe(n.keyType),h=Fe(n.valueType);return`z.record(${g}, ${h})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodMap:let w=Fe(n.keyType),P=Fe(n.valueType);return`z.map(${w}, ${P})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodSet:return`z.set(${Fe(n.valueType)})${lx(n)}${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodFunction:let B=n.args.items.map(Fe),v=B.length?`.args(${B.join(", ")})`:"",S=Fe(n.returns);return`z.function()${v}.returns(${S})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodLazy:return`z.lazy(() => ${Fe(n.getter())})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodLiteral:return`z.literal(${se(n.value)})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodEnum:return`z.enum([${n.values.map(se).join(", ")}])${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodEffects:throw new vn(C.ZodFirstPartyTypeKind.ZodEffects);case C.ZodFirstPartyTypeKind.ZodNativeEnum:throw new vn(C.ZodFirstPartyTypeKind.ZodNativeEnum);case C.ZodFirstPartyTypeKind.ZodOptional:return`z.optional(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodNullable:return`z.nullable(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodDefault:let K=Jn(n.defaultValue());return`z.default(${Fe(n.innerType)}, ${K})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodCatch:throw new vn(C.ZodFirstPartyTypeKind.ZodCatch);case C.ZodFirstPartyTypeKind.ZodPromise:return`z.promise(${Fe(n.type)})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodBranded:throw new vn(C.ZodFirstPartyTypeKind.ZodBranded);case C.ZodFirstPartyTypeKind.ZodPipeline:throw new vn(C.ZodFirstPartyTypeKind.ZodPipeline);case C.ZodFirstPartyTypeKind.ZodSymbol:throw new vn(C.ZodFirstPartyTypeKind.ZodSymbol);case C.ZodFirstPartyTypeKind.ZodReadonly:return`z.readonly(${Fe(n.innerType)})${Ce(n)}${Ae(n)}`.trim();case C.ZodFirstPartyTypeKind.ZodRef:return`z.ref(${se(n.uri)})${Ce(n)}${Ae(n)}`.trim();default:be.assertNever(n)}}d(Fe,"sUnwrapZod");var Ae=d(t=>t.description?`.describe(${se(t.description)})`:"","_maybeDescribe"),Ce=d(t=>`${ux(t)}${cx(t)}${fx(t)}${dx(t)}${px(t)}${gx(t)}${yx(t)}`,"_addZuiExtensions"),ux=d(t=>{var e;return(e=t[le])!=null&&e.title?`.title(${se(t[le].title)})`:""},"_maybeTitle"),cx=d(t=>{var e;return(e=t[le])!=null&&e.displayAs?`.displayAs(${Qc({id:t[le].displayAs[0],params:t[le].displayAs[1]})})`:""},"_maybeDisplayAs"),fx=d(t=>{var e;return(e=t[le])!=null&&e.disabled?`.disabled(${t[le].disabled})`:""},"_maybeDisabled"),dx=d(t=>{var e;return(e=t[le])!=null&&e.hidden?`.hidden(${t[le].hidden})`:""},"_maybeHidden"),px=d(t=>{var e;return(e=t[le])!=null&&e.placeholder?`.placeholder(${se(t[le].placeholder)})`:""},"_maybePlaceholder"),gx=d(t=>{var e;return(e=t[le])!=null&&e.secret?".secret()":""},"_maybeSecret"),yx=d(t=>{var e;let n=["title","tooltip","displayAs","disabled","hidden","placeholder","secret","coerce"],r=Object.entries((e=t[le])!=null?e:{}).filter(([a])=>!n.includes(a));return r.length>0?`.metadata(${Qc(Object.fromEntries(r))})`:""},"_maybeSetMetadata"),mx=d(t=>{let e={type:"number",description:t.description,"x-zui":t._def["x-zui"]};t._def[le]&&(e[le]=t._def[le]);for(let n of t._def.checks)switch(n.kind){case"min":{let r=n.inclusive?"minimum":"exclusiveMinimum",a=n.inclusive?"exclusiveMinimum":"minimum";e[r]=n.value,delete e[a];break}case"max":{let r=n.inclusive?"maximum":"exclusiveMaximum",a=n.inclusive?"exclusiveMaximum":"maximum";e[r]=n.value,delete e[a];break}case"int":e.type="integer";break;case"finite":{e.format="finite";break}case"multipleOf":e.multipleOf=n.value;break;default:}return e},"zodNumberToJsonNumber"),Fp="\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}",Wp="(([+-]\\d{2}(:?\\d{2})?)|Z)",hx="Z",zp="(\\.\\d+)?",ho="\\.\\d{",vx="}",qp=d(t=>{let e=t.precision?ho+t.precision+vx:t.precision===0?"":zp,n=t.offset?Wp:hx;return new RegExp(`^${Fp}${e}${n}$`)},"generateDatetimeRegex"),Tx=d(t=>({precision:_x(t),offset:t.endsWith(`${Wp}$`)}),"extractPrecisionAndOffset"),_x=d(t=>{let e=t.slice(1+Fp.length);return e.startsWith(zp)?null:e.startsWith(ho)?parseInt(e.slice(ho.length)):0},"_extractPrecision"),Nr={};ia(Nr,{escapeSpecialChars:()=>bx});var bx=d(t=>t.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeSpecialChars");function Ho(t,e,n,r){r?.errorMessages&&n&&(t.errorMessage=N(b({},t.errorMessage),{[e]:n}))}d(Ho,"addErrorMessage");function Re(t,e,n,r,a){t[e]=n,Ho(t,e,r,a)}d(Re,"setResponseValueAndErrors");var Ye={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 Uo(t,e){let n=b({type:"string"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});function r(a){return e.patternStrategy==="escape"?Nr.escapeSpecialChars(a):a}if(d(r,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":Re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e);break;case"max":Re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":hn(n,"email",a.message,e);break;case"format:idn-email":hn(n,"idn-email",a.message,e);break;case"pattern:zod":Zt(n,Ye.email,a.message,e);break}break;case"url":hn(n,"uri",a.message,e);break;case"uuid":hn(n,"uuid",a.message,e);break;case"regex":Zt(n,a.regex.source,a.message,e);break;case"cuid":Zt(n,Ye.cuid,a.message,e);break;case"cuid2":Zt(n,Ye.cuid2,a.message,e);break;case"startsWith":Zt(n,"^"+r(a.value),a.message,e);break;case"endsWith":Zt(n,r(a.value)+"$",a.message,e);break;case"datetime":hn(n,"date-time",a.message,e);break;case"length":Re(n,"minLength",typeof n.minLength=="number"?Math.max(n.minLength,a.value):a.value,a.message,e),Re(n,"maxLength",typeof n.maxLength=="number"?Math.min(n.maxLength,a.value):a.value,a.message,e);break;case"includes":{Zt(n,r(a.value),a.message,e);break}case"ip":{a.version!=="v6"&&hn(n,"ipv4",a.message,e),a.version!=="v4"&&hn(n,"ipv6",a.message,e);break}case"emoji":Zt(n,Ye.emoji,a.message,e);break;case"ulid":{Zt(n,Ye.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}d(Uo,"parseStringDef");var hn=d((t,e,n,r)=>{var a;t.format||(a=t.anyOf)!=null&&a.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(b({format:t.format},t.errorMessage&&r.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(b({format:e},n&&r.errorMessages&&{errorMessage:{format:n}}))):Re(t,"format",e,n,r)},"addFormat"),Zt=d((t,e,n,r)=>{var a;t.pattern||(a=t.allOf)!=null&&a.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(b({pattern:t.pattern},t.errorMessage&&r.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(b({pattern:e},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):Re(t,"pattern",e,n,r)},"addPattern"),wx=d(t=>{let e={type:"string",description:t.description,"x-zui":t._def["x-zui"]};t._def[le]&&(e[le]=t._def[le]);for(let n of t._def.checks)switch(n.kind){case"cuid":e.format="cuid",e.pattern=Ye.cuid;break;case"cuid2":e.format="cuid2",e.pattern=Ye.cuid2;break;case"ulid":e.format="ulid",e.pattern=Ye.ulid;break;case"uuid":e.format="uuid",e.pattern=Ye.uuid;break;case"emoji":e.format="emoji",e.pattern=Ye.emoji;break;case"email":e.format="email",e.pattern=Ye.email;break;case"ip":e.format=n.version==="v6"?"ipv6":"ipv4",e.pattern=n.version==="v6"?Ye.ipv6:Ye.ipv4;break;case"datetime":e.format="date-time",e.pattern=qp(n).source,e[le]=N(b({},e[le]),{precision:n.precision,offset:n.offset});break;case"url":e.format="uri";break;case"endsWith":e.pattern=`${Nr.escapeSpecialChars(n.value)}$`;break;case"startsWith":e.pattern=`^${Nr.escapeSpecialChars(n.value)}`;break;case"includes":let r=n.position&&n.position>=1?`^(?:.{${n.position}}).*`:"";e.pattern=`${r}${Nr.escapeSpecialChars(n.value)}`;break;case"regex":e.pattern=n.regex.source;break;case"length":e.minLength=e.maxLength=Math.max(0,n.value);break;case"min":e.minLength=Math.max(0,n.value);break;case"max":e.maxLength=Math.max(0,n.value);break;default:throw new uf({zodType:C.ZodFirstPartyTypeKind.ZodString,checkKind:n.kind})}return e},"zodStringToJsonString"),xx=d((t,e)=>{let n={type:"array",description:t.description,items:e(t._def.type),"x-zui":t._def["x-zui"]};return t._def[le]&&(n[le]=t._def[le]),t._def.minLength&&(n.minItems=t._def.minLength.value),t._def.maxLength&&(n.maxItems=t._def.maxLength.value),t._def.exactLength&&(n.minItems=t._def.exactLength.value,n.maxItems=t._def.exactLength.value),n},"zodArrayToJsonArray"),Px=d((t,e)=>{let n={type:"array",description:t.description,uniqueItems:!0,items:e(t._def.valueType),"x-zui":t._def["x-zui"]};return t._def[le]&&(n[le]=t._def[le]),t._def.minSize&&(n.minItems=t._def.minSize.value),t._def.maxSize&&(n.maxItems=t._def.maxSize.value),n},"zodSetToJsonSet"),Bx=d((t,e)=>{let n={type:"array",description:t.description,items:t._def.items.map(r=>e(r))};return t._def[le]&&(n[le]=t._def[le]),t._def.rest&&(n.additionalItems=e(t._def.rest)),n},"zodTupleToJsonTuple");function st(t){let e=t,n=e._def;switch(n.typeName){case C.ZodFirstPartyTypeKind.ZodString:return wx(e);case C.ZodFirstPartyTypeKind.ZodNumber:return mx(e);case C.ZodFirstPartyTypeKind.ZodNaN:throw new dt(C.ZodFirstPartyTypeKind.ZodNaN);case C.ZodFirstPartyTypeKind.ZodBigInt:throw new dt(C.ZodFirstPartyTypeKind.ZodBigInt,{suggestedAlternative:"serialize bigint to string"});case C.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean",description:n.description,"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodDate:throw new dt(C.ZodFirstPartyTypeKind.ZodDate,{suggestedAlternative:"use z.string().datetime() instead"});case C.ZodFirstPartyTypeKind.ZodUndefined:return ao(n);case C.ZodFirstPartyTypeKind.ZodNull:return oo(n);case C.ZodFirstPartyTypeKind.ZodAny:return{description:n.description,"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodUnknown:return{description:n.description,"x-zui":N(b({},n["x-zui"]),{def:{typeName:C.ZodFirstPartyTypeKind.ZodUnknown}})};case C.ZodFirstPartyTypeKind.ZodNever:return{not:!0,description:n.description,"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodVoid:throw new dt(C.ZodFirstPartyTypeKind.ZodVoid);case C.ZodFirstPartyTypeKind.ZodArray:return xx(e,st);case C.ZodFirstPartyTypeKind.ZodObject:let r=Object.entries(n.shape()),a=r.filter(([p,y])=>!y.isOptional()),s=a.length?a.map(([p])=>p):void 0,i=r.map(([p,y])=>[p,y.mandatory()]).map(([p,y])=>[p,st(y)]),o=!1;return n.unknownKeys instanceof C.ZodType?o=st(n.unknownKeys):n.unknownKeys==="passthrough"&&(o=!0),{type:"object",description:n.description,properties:Object.fromEntries(i),required:s,additionalProperties:o,"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodUnion:return{description:n.description,anyOf:n.options.map(p=>st(p)),"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return{description:n.description,anyOf:n.options.map(p=>st(p)),"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodIntersection:let l=st(n.left),f=st(n.right);return"additionalProperties"in l&&delete l.additionalProperties,"additionalProperties"in f&&delete f.additionalProperties,{description:n.description,allOf:[l,f],"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodTuple:return Bx(e,st);case C.ZodFirstPartyTypeKind.ZodRecord:return{type:"object",description:n.description,additionalProperties:st(n.valueType),"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodMap:throw new dt(C.ZodFirstPartyTypeKind.ZodMap);case C.ZodFirstPartyTypeKind.ZodSet:return Px(e,st);case C.ZodFirstPartyTypeKind.ZodFunction:throw new dt(C.ZodFirstPartyTypeKind.ZodFunction);case C.ZodFirstPartyTypeKind.ZodLazy:throw new dt(C.ZodFirstPartyTypeKind.ZodLazy);case C.ZodFirstPartyTypeKind.ZodLiteral:if(typeof n.value=="string")return{type:"string",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(typeof n.value=="number")return{type:"number",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(typeof n.value=="boolean")return{type:"boolean",description:n.description,const:n.value,"x-zui":n["x-zui"]};if(n.value===null)return oo(n);if(n.value===void 0)return ao(n);{C.util.assertEqual(!0);let p=typeof n.value;throw new oa(`Unsupported literal type: "${p}"`)}case C.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",description:n.description,enum:n.values,"x-zui":n["x-zui"]};case C.ZodFirstPartyTypeKind.ZodEffects:throw new dt(C.ZodFirstPartyTypeKind.ZodEffects);case C.ZodFirstPartyTypeKind.ZodNativeEnum:throw new dt(C.ZodFirstPartyTypeKind.ZodNativeEnum);case C.ZodFirstPartyTypeKind.ZodOptional:return{description:n.description,anyOf:[st(n.innerType),ao()],"x-zui":N(b({},n["x-zui"]),{def:{typeName:C.ZodFirstPartyTypeKind.ZodOptional}})};case C.ZodFirstPartyTypeKind.ZodNullable:return{anyOf:[st(n.innerType),oo()],"x-zui":N(b({},n["x-zui"]),{def:{typeName:C.ZodFirstPartyTypeKind.ZodNullable}})};case C.ZodFirstPartyTypeKind.ZodDefault:return N(b({},st(n.innerType)),{default:n.defaultValue()});case C.ZodFirstPartyTypeKind.ZodCatch:throw new dt(C.ZodFirstPartyTypeKind.ZodCatch);case C.ZodFirstPartyTypeKind.ZodPromise:throw new dt(C.ZodFirstPartyTypeKind.ZodPromise);case C.ZodFirstPartyTypeKind.ZodBranded:throw new dt(C.ZodFirstPartyTypeKind.ZodBranded);case C.ZodFirstPartyTypeKind.ZodPipeline:throw new dt(C.ZodFirstPartyTypeKind.ZodPipeline);case C.ZodFirstPartyTypeKind.ZodSymbol:throw new dt(C.ZodFirstPartyTypeKind.ZodPipeline);case C.ZodFirstPartyTypeKind.ZodReadonly:return N(b({},st(n.innerType)),{readOnly:!0});case C.ZodFirstPartyTypeKind.ZodRef:return{$ref:n.uri,description:n.description,"x-zui":n["x-zui"]};default:C.util.assertNever(n)}}d(st,"toJSONSchema");var ao=d(t=>({not:!0,description:t?.description,"x-zui":N(b({},t?.["x-zui"]),{def:{typeName:C.ZodFirstPartyTypeKind.ZodUndefined}})}),"undefinedSchema"),oo=d(t=>({type:"null",description:t?.description,"x-zui":t?.["x-zui"]}),"nullSchema"),Gp=class{constructor(e,n,r,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,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}};d(Gp,"ParseInputLazyPath");var It=Gp,Fc=d((t,e)=>{if(jr(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 n=new Kt(t.common.issues);return this._error=n,this._error}}},"handleResult"),Vp=class{constructor(e){this.__type__="ZuiType",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._metadataRoot._def.description}dereference(e){return this}getReferences(){return[]}clone(){let e=this.constructor;return new e(b({},this._def))}_getType(e){return rn(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:rn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:rn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(Ei(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;let a={common:{issues:[],async:(r=n?.async)!=null?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rn(e)},s=this._parseSync({data:e,path:a.path,parent:a});return Fc(a,s)}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rn(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(Ei(a)?a:Promise.resolve(a));return Fc(r,s)}refine(e,n){let r=d(a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n,"getIssueProperties");return this._refinement((a,s)=>{let i=e(a),o=d(()=>s.addIssue(b({code:q.custom},r(a))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,a)=>e(r)?!0:(a.addIssue(typeof n=="function"?n(r,a):n),!1))}_refinement(e){return new Bn({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return an.create(this,this._def)}nullable(){return Qn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lr.create(this,this._def)}promise(){return ha.create(this,this._def)}mandatory(){return this}or(e){return Qo.create([this,e],this._def)}and(e){return zo.create(this,e,this._def)}transform(e){return new Bn(N(b({},me(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let n=typeof e=="function"?e:()=>e;return new ya(N(b({},me(this._def)),{innerType:this,defaultValue:n,typeName:"ZodDefault"}))}brand(){return new Ko(b({typeName:"ZodBranded",type:this},me(this._def)))}catch(e){let n=typeof e=="function"?e:()=>e;return new Lo(N(b({},me(this._def)),{innerType:this,catchValue:n,typeName:"ZodCatch"}))}describe(e){let n=this.clone();return n._metadataRoot._def.description=e,n}pipe(e){return Yo.create(this,e)}readonly(){return va.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){var n,r,a;let s=this.clone(),i=s._metadataRoot;(a=(n=i._def)[r=le])!=null||(n[r]={});for(let[o,l]of Object.entries(e))i._def[le]=N(b({},i._def[le]),{[o]:l});return s}getMetadata(){return b({},this._metadataRoot._def[le])}setMetadata(e){this._metadataRoot._def[le]=b({},e)}get ui(){return b({},this._metadataRoot._def[le])}get _metadataRoot(){return this.naked()}displayAs(e){return this.metadata({displayAs:[e.id,e.params]})}title(e){return this.metadata({title:e})}hidden(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this.metadata({hidden:n})}disabled(e){let n;return e===void 0?n=!0:typeof e=="function"?n=e.toString():n=e,this.metadata({disabled:n})}placeholder(e){return this.metadata({placeholder:e})}toJSONSchema(){return st(this)}toTypescriptType(e){return Bo(this,e)}toTypescriptSchema(){return Do(this)}naked(){return this}};d(Vp,"ZodType");var he=Vp,Jp=(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))(Jp||{}),be;(t=>{t.assertEqual=d(a=>a,"assertEqual");function e(a){}t.assertIs=e,d(e,"assertIs");function n(a){throw new Error("assertNever called")}t.assertNever=n,d(n,"assertNever"),t.arrayToEnum=d(a=>{let s={};for(let i of a)s[i]=i;return s},"arrayToEnum"),t.getValidEnumValues=d(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=d(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=d((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 r(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,d(r,"joinValues"),t.jsonStringifyReplacer=d((a,s)=>typeof s=="bigint"?s.toString():s,"jsonStringifyReplacer"),t.compareFunctions=d((a,s)=>a.toString()===s.toString(),"compareFunctions"),t.mock=d(()=>({}),"mock")})(be||(be={}));var vo;(t=>{t.mergeShapes=d((e,n)=>b(b({},e),n),"mergeShapes")})(vo||(vo={}));var te=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rn=d(t=>{switch(typeof t){case"undefined":return te.undefined;case"string":return te.string;case"number":return isNaN(t)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(t)?te.array:t===null?te.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?te.promise:typeof Map<"u"&&t instanceof Map?te.map:typeof Set<"u"&&t instanceof Set?te.set:typeof Date<"u"&&t instanceof Date?te.date:te.object;default:return te.unknown}},"getParsedType");function me(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:a}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a,[le]:t?.[le]}:{errorMap:d((i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:r??o.defaultError}:{message:n??o.defaultError},"customMap"),description:a,[le]:t?.[le]}}d(me,"processCreateParams");var $o=d((t,e)=>{let n;switch(t.code){case q.invalid_type:t.received===te.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:n=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case q.invalid_union:n="Invalid input";break;case q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case q.invalid_enum_value:n=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case q.invalid_arguments:n="Invalid function arguments";break;case q.invalid_return_type:n="Invalid function return type";break;case q.invalid_date:n="Invalid date";break;case q.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:be.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case q.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case q.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case q.custom:n="Invalid input";break;case q.invalid_intersection_types:n="Intersection results could not be merged";break;case q.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case q.not_finite:n="Number must be finite";break;case q.unresolved_reference:n="Unresolved reference";break;default:n=e.defaultError,be.assertNever(t)}return{message:n}},"errorMap"),Wc=$o,q=be.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"]),Ex=d(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Pi=class Xp extends Error{constructor(e){super(),this.issues=[],this.addIssue=d(r=>{this.issues=[...this.issues,r]},"addIssue"),this.addIssues=d((r=[])=>{this.issues=[...this.issues,...r]},"addIssues");let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let n=e||function(s){return s.message},r={_errors:[]},a=d(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)r._errors.push(n(i));else{let o=r,l=0;for(;l<i.path.length;){let f=i.path[l];l===i.path.length-1?(o[f]=o[f]||{_errors:[]},o[f]._errors.push(n(i))):o[f]=o[f]||{_errors:[]},o=o[f],l++}}},"processError");return a(this),r}static assert(e){if(!(e instanceof Xp))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};d(Pi,"ZodError");Pi.create=d(t=>new Pi(t),"create");var Kt=Pi,Yp=$o;function Qp(t){Yp=t}d(Qp,"setErrorMap");function Zr(){return Yp}d(Zr,"getErrorMap");var Bi=d(t=>{var e;let{data:n,path:r,errorMaps:a,issueData:s}=t,i=[...r,...s.path||[]],o=N(b({},s),{path:i}),l="",f=a.filter(p=>!!p).slice().reverse();for(let p of f)l=p(o,{data:n,defaultError:l}).message;return N(b({},s),{path:i,message:(e=s.message)!=null?e:l})},"makeIssue"),Sx=[];function ee(t,e){let n=Bi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Zr(),$o].filter(r=>!!r)});t.common.issues.push(n)}d(ee,"addIssueToContext");var eg=class tg{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let a of n){if(a.status==="aborted")return pe;a.status==="dirty"&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let a of n)r.push({key:await a.key,value:await a.value});return tg.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let a of n){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return pe;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}};d(eg,"ParseStatus");var vt=eg,pe=Object.freeze({status:"aborted"}),Vn=d(t=>({status:"dirty",value:t}),"DIRTY"),pt=d(t=>({status:"valid",value:t}),"OK"),To=d(t=>t.status==="aborted","isAborted"),_o=d(t=>t.status==="dirty","isDirty"),jr=d(t=>t.status==="valid","isValid"),Ei=d(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),ue;(t=>{t.errToObj=d(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=d(e=>typeof e=="string"?e:e?.message,"toString")})(ue||(ue={}));var Si=class ng extends he{constructor(){super(...arguments),this._any=!0}_parse(e){return pt(e.data)}isEqual(e){return e instanceof ng}};d(Si,"ZodAny");Si.create=d(t=>new Si(b({typeName:"ZodAny"},me(t))),"create");var Kr=Si,ki=class _n extends he{dereference(e){return new _n(N(b({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new _n(N(b({},this._def),{type:this._def.type.clone()}))}isEqual(e){var n,r,a,s,i,o;return e instanceof _n?Xn((n=this._def.exactLength)==null?void 0:n.value,(r=e._def.exactLength)==null?void 0:r.value)&&Xn((a=this._def.maxLength)==null?void 0:a.value,(s=e._def.maxLength)==null?void 0:s.value)&&Xn((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:n,status:r}=this._processInputParams(e),a=this._def;if(n.parsedType!==te.array)return ee(n,{code:q.invalid_type,expected:te.array,received:n.parsedType}),pe;if(a.exactLength!==null){let i=n.data.length>a.exactLength.value,o=n.data.length<a.exactLength.value;(i||o)&&(ee(n,{code:i?q.too_big:q.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}),r.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(ee(n,{code:q.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(ee(n,{code:q.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,o)=>a.type._parseAsync(new It(n,i,n.path,o)))).then(i=>vt.mergeArray(r,i));let s=[...n.data].map((i,o)=>a.type._parseSync(new It(n,i,n.path,o)));return vt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new _n(N(b({},this._def),{minLength:{value:e,message:ue.toString(n)}}))}max(e,n){return new _n(N(b({},this._def),{maxLength:{value:e,message:ue.toString(n)}}))}length(e,n){return new _n(N(b({},this._def),{exactLength:{value:e,message:ue.toString(n)}}))}nonempty(e){return this.min(1,e)}};d(ki,"ZodArray");ki.create=d((t,e)=>new ki(b({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},me(e))),"create");var Lr=ki,kx=d((t,e)=>rg(t,e,new WeakSet),"isEqual"),rg=d((t,e,n)=>zw(t,e,Ix(n)),"_isEqualWithVisitedTracking"),Ix=d(t=>(e,n)=>{if(Sc(e)&&!t.has(e)&&Sc(n)&&!t.has(n)){let r=Kc(e,jc),a=Kc(n,jc);return t.add(r).add(a).add(e).add(n),rg(r,a,t)}},"_customizerWithVisitedTracking"),Ax={compare:kx},ig=class{constructor(e=[],n={}){this._options=b(b({},Ax),n),this._items=[];for(let r of e)this.add(r)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(n=>this._options.compare(n,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(n=>e.has(n))}};d(ig,"CustomSet");var et=ig,Ii=class mi extends he{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)!==te.bigint){let s=this._getOrReturnCtx(e);return ee(s,{code:q.invalid_type,expected:te.bigint,received:s.parsedType}),pe}let r,a=new vt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:q.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)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:q.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:q.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):be.assertNever(s);return{status:a.value,value:e.data}}isEqual(e){if(!(e instanceof mi)||this._def.coerce!==e._def.coerce)return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,a){return new mi(N(b({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(a)}]}))}_addCheck(e){return new mi(N(b({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};d(Ii,"ZodBigInt");Ii.create=d(t=>{var e;return new Ii(b({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},me(t)))},"create");var Zo=Ii,Ai=class ag extends he{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==te.boolean){let r=this._getOrReturnCtx(e);return ee(r,{code:q.invalid_type,expected:te.boolean,received:r.parsedType}),pe}return pt(e.data)}isEqual(e){return e instanceof ag?this._def.coerce===e._def.coerce:!1}};d(Ai,"ZodBoolean");Ai.create=d(t=>new Ai(b({typeName:"ZodBoolean",coerce:t?.coerce||!1},me(t))),"create");var jo=Ai,Cx=Symbol("zod_brand"),og=class wr extends he{dereference(e){return new wr(N(b({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new wr(N(b({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}isEqual(e){return e instanceof wr?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}mandatory(){return new wr(N(b({},this._def),{type:this._def.type.mandatory()}))}};d(og,"ZodBranded");var Ko=og,Ci=class xr extends he{_parse(e){let{ctx:n}=this._processInputParams(e),r=N(b({},n),{common:N(b({},n.common),{issues:[]})}),a=this._def.innerType._parse({data:r.data,path:r.path,parent:b({},r)});return Ei(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Kt(r.common.issues)},input:r.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Kt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof xr?this._def.innerType.isEqual(e._def.innerType)&&be.compareFunctions(this._def.catchValue,e._def.catchValue):!1}dereference(e){return new xr(N(b({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new xr(N(b({},this._def),{innerType:this._def.innerType.clone()}))}naked(){return this._def.innerType.naked()}mandatory(){return new xr(N(b({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Ci,"ZodCatch");Ci.create=d((t,e)=>new Ci(b({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},me(e))),"create");var Lo=Ci,sg=d((t,e={},n)=>t?Kr.create().superRefine((r,a)=>{var s,i;if(!t(r)){let o=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(i=(s=o.fatal)!=null?s:n)!=null?i:!0,f=typeof o=="string"?{message:o}:o;a.addIssue(N(b({code:"custom"},f),{fatal:l}))}}):Kr.create(),"custom"),Oi=class bo extends he{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==te.date){let s=this._getOrReturnCtx(e);return ee(s,{code:q.invalid_type,expected:te.date,received:s.parsedType}),pe}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ee(s,{code:q.invalid_date}),pe}let r=new vt,a;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:q.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:q.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):be.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new bo(N(b({},this._def),{checks:[...this._def.checks,e]}))}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:ue.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:ue.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof bo))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)&&this._def.coerce===e._def.coerce}};d(Oi,"ZodDate");Oi.create=d(t=>new Oi(b({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},me(t))),"create");var Fo=Oi,Ri=class Pr extends he{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===te.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}dereference(e){return new Pr(N(b({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Pr(N(b({},this._def),{innerType:this._def.innerType.clone()}))}isEqual(e){return e instanceof Pr?this._def.innerType.isEqual(e._def.innerType)&&Xn(this._def.defaultValue(),e._def.defaultValue()):!1}unwrap(){return this._def.innerType}naked(){return this._def.innerType.naked()}mandatory(){return new Pr(N(b({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Ri,"ZodDefault");Ri.create=d((t,e,n)=>new Ri(b({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},me(n))),"create");var ya=Ri,Wt=d(t=>Array.from(new Set(t)),"unique"),jt=d(t=>t instanceof qo?jt(t.schema):t instanceof Bn?jt(t.innerType()):t instanceof Go?[t.value]:t instanceof ir?t.options:t instanceof Vo?be.objectValues(t.enum):t instanceof ya?jt(t._def.innerType):t instanceof Ta?[void 0]:t instanceof Jo?[null]:t instanceof an?[void 0,...jt(t.unwrap())]:t instanceof Qn?[null,...jt(t.unwrap())]:t instanceof Ko||t instanceof va?jt(t.unwrap()):t instanceof Lo?jt(t._def.innerType):[],"getDiscriminator"),lg=class bn extends he{dereference(e){let n=this.options.map(a=>a.dereference(e)),r=bn._getOptionsMap(this.discriminator,n);return new bn(N(b({},this._def),{options:n,optionsMap:r}))}getReferences(){return Wt(this.options.flatMap(e=>e.getReferences()))}clone(){let e=this.options.map(n=>n.clone());return new bn(N(b({},this._def),{options:e}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.object)return ee(n,{code:q.invalid_type,expected:te.object,received:n.parsedType}),pe;let r=this.discriminator,a=n.data[r],s=this.optionsMap.get(a);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ee(n,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let a=bn._getOptionsMap(e,n);return new bn(b({typeName:"ZodDiscriminatedUnion",discriminator:e,options:n,optionsMap:a},me(r)))}static _getOptionsMap(e,n){let r=new Map;for(let a of n){let s=jt(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(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,a)}}return r}isEqual(e){if(!(e instanceof bn)||this._def.discriminator!==e._def.discriminator)return!1;let n=d((s,i)=>s.isEqual(i),"compare"),r=new et(this._def.options,{compare:n}),a=new et(e._def.options,{compare:n});return r.isEqual(a)}};d(lg,"ZodDiscriminatedUnion");var ug=lg;function ma(t,e){return new ir(b({values:t,typeName:"ZodEnum"},me(e)))}d(ma,"createZodEnum");var Wo=class hi extends he{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return ee(n,{expected:be.joinValues(r),received:n.parsedType,code:q.invalid_type}),pe}if(this._def.values.indexOf(e.data)===-1){let n=this._getOrReturnCtx(e),r=this._def.values;return ee(n,{received:n.data,code:q.invalid_enum_value,options:r}),pe}return pt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return hi.create(e,b(b({},this._def),n))}exclude(e,n=this._def){return hi.create(this.options.filter(r=>!e.includes(r)),b(b({},this._def),n))}isEqual(e){if(!(e instanceof hi))return!1;let n=new et(this._def.values),r=new et(e._def.values);return n.isEqual(r)}};d(Wo,"ZodEnum");Wo.create=ma;var ir=Wo,cg=class wn extends he{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let n=this._def.args.dereference(e),r=this._def.returns.dereference(e);return new wn(N(b({},this._def),{args:n,returns:r}))}getReferences(){return Wt([...this._def.args.getReferences(),...this._def.returns.getReferences()])}clone(){return new wn(N(b({},this._def),{args:this._def.args.clone(),returns:this._def.returns.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.function)return ee(n,{code:q.invalid_type,expected:te.function,received:n.parsedType}),pe;function r(o,l){return Bi({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zr(),Wc].filter(f=>!!f),issueData:{code:q.invalid_arguments,argumentsError:l}})}d(r,"makeArgsIssue");function a(o,l){return Bi({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zr(),Wc].filter(f=>!!f),issueData:{code:q.invalid_return_type,returnTypeError:l}})}d(a,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof ha){let o=this;return pt(async function(...l){let f=new Kt([]),p=await o._def.args.parseAsync(l,s).catch(h=>{throw f.addIssue(r(l,h)),f}),y=await Reflect.apply(i,this,p);return await o._def.returns._def.type.parseAsync(y,s).catch(h=>{throw f.addIssue(a(y,h)),f})})}else{let o=this;return pt(function(...l){let f=o._def.args.safeParse(l,s);if(!f.success)throw new Kt([r(l,f.error)]);let p=Reflect.apply(i,this,f.data),y=o._def.returns.safeParse(p,s);if(!y.success)throw new Kt([a(p,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new wn(N(b({},this._def),{args:nr.create(e).rest(Dr.create())}))}returns(e){return new wn(N(b({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new wn(b({args:e||nr.create([]).rest(Dr.create()),returns:n||Dr.create(),typeName:"ZodFunction"},me(r)))}isEqual(e){return e instanceof wn&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};d(cg,"ZodFunction");var fg=cg;function Mi(t,e){let n=rn(t),r=rn(e);if(t===e)return{valid:!0,data:t};if(n===te.object&&r===te.object){let a=be.objectKeys(e),s=be.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i=b(b({},t),e);for(let o of s){let l=Mi(t[o],e[o]);if(!l.valid)return{valid:!1};i[o]=l.data}return{valid:!0,data:i}}else if(n===te.array&&r===te.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],l=Mi(i,o);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return n===te.date&&r===te.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}d(Mi,"mergeValues");var Ni=class vi extends he{dereference(e){return new vi(N(b({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Wt([...this._def.left.getReferences(),...this._def.right.getReferences()])}clone(){return new vi(N(b({},this._def),{left:this._def.left.clone(),right:this._def.right.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),a=d((s,i)=>{if(To(s)||To(i))return pe;let o=Mi(s.value,i.value);return o.valid?((_o(s)||_o(i))&&n.dirty(),{status:n.value,value:o.data}):(ee(r,{code:q.invalid_intersection_types}),pe)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}isEqual(e){if(!(e instanceof vi))return!1;let n=d((s,i)=>s.isEqual(i),"compare"),r=new et([this._def.left,this._def.right],{compare:n}),a=new et([e._def.left,e._def.right],{compare:n});return r.isEqual(a)}};d(Ni,"ZodIntersection");Ni.create=d((t,e,n)=>new Ni(b({left:t,right:e,typeName:"ZodIntersection"},me(n))),"create");var zo=Ni,Di=class Br extends he{get schema(){return this._def.getter()}dereference(e){return new Br(N(b({},this._def),{getter:d(()=>this._def.getter().dereference(e),"getter")}))}getReferences(){return this._def.getter().getReferences()}clone(){return new Br(N(b({},this._def),{getter:d(()=>this._def.getter().clone(),"getter")}))}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}isEqual(e){return e instanceof Br?this._def.getter().isEqual(e._def.getter()):!1}naked(){return this._def.getter().naked()}mandatory(){return new Br(N(b({},this._def),{getter:d(()=>this._def.getter().mandatory(),"getter")}))}};d(Di,"ZodLazy");Di.create=d((t,e)=>new Di(b({getter:t,typeName:"ZodLazy"},me(e))),"create");var qo=Di,Hi=class dg extends he{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return ee(n,{received:n.data,code:q.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof dg?Xn(this._def.value,e._def.value):!1}};d(Hi,"ZodLiteral");Hi.create=d((t,e)=>new Hi(b({value:t,typeName:"ZodLiteral"},me(e))),"create");var Go=Hi,Ui=class Ti extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new Ti(N(b({},this._def),{keyType:n,valueType:r}))}getReferences(){return Wt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new Ti(N(b({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.map)return ee(r,{code:q.invalid_type,expected:te.map,received:r.parsedType}),pe;let a=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([o,l],f)=>({key:a._parse(new It(r,o,r.path,[f,"key"])),value:s._parse(new It(r,l,r.path,[f,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let l of i){let f=await l.key,p=await l.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),o.set(f.value,p.value)}return{status:n.value,value:o}})}else{let o=new Map;for(let l of i){let f=l.key,p=l.value;if(f.status==="aborted"||p.status==="aborted")return pe;(f.status==="dirty"||p.status==="dirty")&&n.dirty(),o.set(f.value,p.value)}return{status:n.value,value:o}}}isEqual(e){return!(!(e instanceof Ti)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(Ui,"ZodMap");Ui.create=d((t,e,n)=>new Ui(b({valueType:e,keyType:t,typeName:"ZodMap"},me(n))),"create");var pg=Ui,$i=class gg extends he{_parse(e){if(this._getType(e)!==te.nan){let r=this._getOrReturnCtx(e);return ee(r,{code:q.invalid_type,expected:te.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}isEqual(e){return e instanceof gg}};d($i,"ZodNaN");$i.create=d(t=>new $i(b({typeName:"ZodNaN"},me(t))),"create");var yg=$i,Zi=class mg extends he{_parse(e){let n=be.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==te.string&&r.parsedType!==te.number){let a=be.objectValues(n);return ee(r,{expected:be.joinValues(a),received:r.parsedType,code:q.invalid_type}),pe}if(n.indexOf(e.data)===-1){let a=be.objectValues(n);return ee(r,{received:r.data,code:q.invalid_enum_value,options:a}),pe}return pt(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof mg?Xn(this._def.values,e._def.values):!1}};d(Zi,"ZodNativeEnum");Zi.create=d((t,e)=>new Zi(b({values:t,typeName:"ZodNativeEnum"},me(e))),"create");var Vo=Zi,ji=class hg extends he{_parse(e){let n=this._getOrReturnCtx(e);return ee(n,{code:q.invalid_type,expected:te.never,received:n.parsedType}),pe}isEqual(e){return e instanceof hg}};d(ji,"ZodNever");ji.create=d(t=>new ji(b({typeName:"ZodNever"},me(t))),"create");var zr=ji,Ki=class vg extends he{_parse(e){if(this._getType(e)!==te.null){let r=this._getOrReturnCtx(e);return ee(r,{code:q.invalid_type,expected:te.null,received:r.parsedType}),pe}return pt(e.data)}isEqual(e){return e instanceof vg}};d(Ki,"ZodNull");Ki.create=d(t=>new Ki(b({typeName:"ZodNull"},me(t))),"create");var Jo=Ki,Li=class Er extends he{dereference(e){return new Er(N(b({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new Er(N(b({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===te.null?pt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Er?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new Er(N(b({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(Li,"ZodNullable");Li.create=d((t,e)=>new Li(b({innerType:t,typeName:"ZodNullable"},me(e))),"create");var Qn=Li;function Tg(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,a=n>r?n:r,s=parseInt(t.toFixed(a).replace(".","")),i=parseInt(e.toFixed(a).replace(".",""));return s%i/Math.pow(10,a)}d(Tg,"floatSafeRemainder");var Fi=class _i extends he{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)!==te.number){let s=this._getOrReturnCtx(e);return ee(s,{code:q.invalid_type,expected:te.number,received:s.parsedType}),pe}let r,a=new vt;for(let s of this._def.checks)s.kind==="int"?be.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:q.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:q.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)&&(r=this._getOrReturnCtx(e,r),ee(r,{code:q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Tg(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ee(r,{code:q.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ee(r,{code:q.not_finite,message:s.message}),a.dirty()):be.assertNever(s);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,ue.toString(n))}gt(e,n){return this.setLimit("min",e,!1,ue.toString(n))}lte(e,n){return this.setLimit("max",e,!0,ue.toString(n))}lt(e,n){return this.setLimit("max",e,!1,ue.toString(n))}setLimit(e,n,r,a){return new _i(N(b({},this._def),{checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:ue.toString(a)}]}))}_addCheck(e){return new _i(N(b({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:ue.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ue.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ue.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ue.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ue.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:ue.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:ue.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ue.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ue.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&be.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof _i))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}};d(Fi,"ZodNumber");Fi.create=d(t=>new Fi(b({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},me(t))),"create");var Xo=Fi;function xn(t){if(t instanceof er){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=an.create(xn(r))}return new er(N(b({},t._def),{shape:d(()=>e,"shape")}))}else return t instanceof Lr?new Lr(N(b({},t._def),{type:xn(t.element)})):t instanceof an?an.create(xn(t.unwrap())):t instanceof Qn?Qn.create(xn(t.unwrap())):t instanceof nr?nr.create(t.items.map(e=>xn(e))):t}d(xn,"deepPartialify");var sn=class ht extends he{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(),n=be.objectKeys(e);return this._cached={shape:e,keys:n}}dereference(e){let n=this._def.shape(),r={};for(let a in n)r[a]=n[a].dereference(e);return new ht(N(b({},this._def),{shape:d(()=>r,"shape")}))}getReferences(){let e=this._def.shape(),n=[];for(let r in e)n.push(...e[r].getReferences());return Wt(n)}clone(){let e={},n=this._def.shape();for(let[r,a]of Object.entries(n))e[r]=a.clone();return new ht(N(b({},this._def),{shape:d(()=>e,"shape")}))}_parse(e){if(this._getType(e)!==te.object){let p=this._getOrReturnCtx(e);return ee(p,{code:q.invalid_type,expected:te.object,received:p.parsedType}),pe}let{status:r,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(this._def.unknownKeys!=="strip")for(let p in a.data)i.includes(p)||o.push(p);let l=[];for(let p of i){let y=s[p],g=a.data[p];l.push({key:{status:"valid",value:p},value:y._parse(new It(a,g,a.path,p)),alwaysSet:p in a.data})}let f=this._def.unknownKeys;if(f==="passthrough")for(let p of o)l.push({key:{status:"valid",value:p},value:{status:"valid",value:a.data[p]}});else if(f==="strict")o.length>0&&(ee(a,{code:q.unrecognized_keys,keys:o}),r.dirty());else if(f!=="strip")for(let p of o){let y=a.data[p];l.push({key:{status:"valid",value:p},value:f._parse(new It(a,y,a.path,p)),alwaysSet:p in a.data})}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let y of l){let g=await y.key;p.push({key:g,value:await y.value,alwaysSet:y.alwaysSet})}return p}).then(p=>vt.mergeObjectSync(r,p)):vt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return ue.errToObj,new ht(b(N(b({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:d((n,r)=>{var a,s,i,o;let l=(i=(s=(a=this._def).errorMap)==null?void 0:s.call(a,n,r).message)!=null?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(o=ue.errToObj(e).message)!=null?o:l}:{message:l}},"errorMap")}:{}))}strip(){return new ht(N(b({},this._def),{unknownKeys:"strip"}))}passthrough(){return new ht(N(b({},this._def),{unknownKeys:"passthrough"}))}additionalProperties(){if(this._def.unknownKeys instanceof he)return this._def.unknownKeys;if(this._def.unknownKeys==="passthrough")return Kr.create();if(this._def.unknownKeys==="strict")return zr.create()}extend(e){return new ht(N(b({},this._def),{shape:d(()=>b(b({},this._def.shape()),e),"shape")}))}merge(e){return new ht({unknownKeys:e._def.unknownKeys,shape:d(()=>b(b({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ht(N(b({},this._def),{unknownKeys:e}))}pick(e){let n={};return be.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ht(N(b({},this._def),{shape:d(()=>n,"shape")}))}omit(e){let n={};return be.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ht(N(b({},this._def),{shape:d(()=>n,"shape")}))}deepPartial(){return xn(this)}partial(e){let n={};return be.objectKeys(this.shape).forEach(r=>{let a=this.shape[r];e&&!e[r]?n[r]=a:n[r]=a?.optional()}),new ht(N(b({},this._def),{shape:d(()=>n,"shape")}))}required(e){let n={};return be.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof an;)s=s._def.innerType;n[r]=s}}),new ht(N(b({},this._def),{shape:d(()=>n,"shape")}))}keyof(){return ma(be.objectKeys(this.shape))}isEqual(e){if(!(e instanceof ht)||!this._unknownKeysEqual(e))return!1;let n=this._def.shape(),r=e._def.shape(),a=d((o,l)=>o[0]===l[0]&&o[1].isEqual(l[1]),"compare"),s=new et(Object.entries(n),{compare:a}),i=new et(Object.entries(r),{compare:a});return s.isEqual(i)}_unknownKeysEqual(e){let n=this.additionalProperties(),r=e.additionalProperties();return n===void 0||r===void 0?n===r:n.isEqual(r)}};d(sn,"ZodObject");sn.create=d((t,e)=>new sn(b({shape:d(()=>t,"shape"),unknownKeys:"strip",typeName:"ZodObject"},me(e))),"create");sn.strictCreate=d((t,e)=>new sn(b({shape:d(()=>t,"shape"),unknownKeys:"strict",typeName:"ZodObject"},me(e))),"strictCreate");sn.lazycreate=d((t,e)=>new sn(b({shape:t,unknownKeys:"strip",typeName:"ZodObject"},me(e))),"lazycreate");var er=sn,Wi=class bi extends he{dereference(e){return new bi(N(b({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new bi(N(b({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){return this._getType(e)===te.undefined?pt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof bi?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return this._def.innerType.mandatory()}};d(Wi,"ZodOptional");Wi.create=d((t,e)=>new Wi(b({innerType:t,typeName:"ZodOptional"},me(e))),"create");var an=Wi,_g=class Sr extends he{dereference(e){return new Sr(N(b({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Wt([...this._def.in.getReferences(),...this._def.out.getReferences()])}clone(){return new Sr(N(b({},this._def),{in:this._def.in.clone(),out:this._def.out.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return d(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),Vn(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})},"handleAsync")();{let a=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:r.path,parent:r})}}static create(e,n){return new Sr({in:e,out:n,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof Sr)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};d(_g,"ZodPipeline");var Yo=_g,zi=class wi extends he{unwrap(){return this._def.type}dereference(e){return new wi(N(b({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}clone(){return new wi(N(b({},this._def),{type:this._def.type.clone()}))}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==te.promise&&n.common.async===!1)return ee(n,{code:q.invalid_type,expected:te.promise,received:n.parsedType}),pe;let r=n.parsedType===te.promise?n.data:Promise.resolve(n.data);return pt(r.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}isEqual(e){return e instanceof wi?this._def.type.isEqual(e._def.type):!1}naked(){return this._def.type.naked()}};d(zi,"ZodPromise");zi.create=d((t,e)=>new zi(b({type:t,typeName:"ZodPromise"},me(e))),"create");var ha=zi,qi=class kr extends he{dereference(e){return new kr(N(b({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}clone(){return new kr(N(b({},this._def),{innerType:this._def.innerType.clone()}))}_parse(e){let n=this._def.innerType._parse(e);return jr(n)&&(n.value=Object.freeze(n.value)),n}unwrap(){return this._def.innerType}isEqual(e){return e instanceof kr?this._def.innerType.isEqual(e._def.innerType):!1}naked(){return this._def.innerType.naked()}mandatory(){return new kr(N(b({},this._def),{innerType:this._def.innerType.mandatory()}))}};d(qi,"ZodReadonly");qi.create=d((t,e)=>new qi(b({innerType:t,typeName:"ZodReadonly"},me(e))),"create");var va=qi,bg=class zn extends he{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let n=this._def.keyType.dereference(e),r=this._def.valueType.dereference(e);return new zn(N(b({},this._def),{keyType:n,valueType:r}))}getReferences(){return Wt([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}clone(){return new zn(N(b({},this._def),{keyType:this._def.keyType.clone(),valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.object)return ee(r,{code:q.invalid_type,expected:te.object,received:r.parsedType}),pe;let a=[],s=this._def.keyType,i=this._def.valueType;for(let o in r.data)a.push({key:s._parse(new It(r,o,r.path,o)),value:i._parse(new It(r,r.data[o],r.path,o))});return r.common.async?vt.mergeObjectAsync(n,a):vt.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof he?new zn(b({keyType:e,valueType:n,typeName:"ZodRecord"},me(r))):new zn(b({keyType:gt.create(),valueType:e,typeName:"ZodRecord"},me(n)))}isEqual(e){return!(!(e instanceof zn)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};d(bg,"ZodRecord");var wg=bg,Gi=class xg extends he{dereference(e){let n=e[this._def.uri];return n||this}getReferences(){return[this._def.uri]}_parse(e){let n=this._getOrReturnCtx(e);return ee(n,{code:q.unresolved_reference}),pe}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof xg?this._def.uri===e._def.uri:!1}};d(Gi,"ZodRef");Gi.create=d(t=>new Gi({typeName:"ZodRef",uri:t}),"create");var Pg=Gi,Vi=class qn extends he{dereference(e){return new qn(N(b({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}clone(){return new qn(N(b({},this._def),{valueType:this._def.valueType.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.set)return ee(r,{code:q.invalid_type,expected:te.set,received:r.parsedType}),pe;let a=this._def;a.minSize!==null&&r.data.size<a.minSize.value&&(ee(r,{code:q.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&r.data.size>a.maxSize.value&&(ee(r,{code:q.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());let s=this._def.valueType;function i(l){let f=new Set;for(let p of l){if(p.status==="aborted")return pe;p.status==="dirty"&&n.dirty(),f.add(p.value)}return{status:n.value,value:f}}d(i,"finalizeSet");let o=[...r.data.values()].map((l,f)=>s._parse(new It(r,l,r.path,f)));return r.common.async?Promise.all(o).then(l=>i(l)):i(o)}min(e,n){return new qn(N(b({},this._def),{minSize:{value:e,message:ue.toString(n)}}))}max(e,n){return new qn(N(b({},this._def),{maxSize:{value:e,message:ue.toString(n)}}))}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}isEqual(e){var n,r,a,s;if(!(e instanceof qn))return!1;let i=(n=this._def.minSize)==null?void 0:n.value,o=(r=e._def.minSize)==null?void 0:r.value;if(i!==o)return!1;let l=(a=this._def.maxSize)==null?void 0:a.value,f=(s=e._def.maxSize)==null?void 0:s.value;return l!==f?!1:this._def.valueType.isEqual(e._def.valueType)}};d(Vi,"ZodSet");Vi.create=d((t,e)=>new Vi(b({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},me(e))),"create");var Bg=Vi,Eg=/^c[^\s-]{8,}$/i,Sg=/^[a-z][a-z0-9]*$/,kg=/^[0-9A-HJKMNP-TV-Z]{26}$/,Ig=/^[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,Ag=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ox=d(t=>t===Cg,"isEmojiRegex"),so,Og=/^(((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}))$/,Rg=/^(([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 Mg(t,e){return!!((e==="v4"||!e)&&Og.test(t)||(e==="v6"||!e)&&Rg.test(t))}d(Mg,"isValidIP");var Ji=class Gn extends he{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==te.string){let s=this._getOrReturnCtx(e);return ee(s,{code:q.invalid_type,expected:te.string,received:s.parsedType}),pe}let r=new vt,a;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),ee(a,{code:q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.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?ee(a,{code:q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&ee(a,{code:q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Ag.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"email",code:q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")so||(so=new RegExp(Cg,"u")),so.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"emoji",code:q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Ig.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"uuid",code:q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")Eg.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"cuid",code:q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Sg.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"cuid2",code:q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")kg.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"ulid",code:q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),ee(a,{validation:"url",code:q.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"regex",code:q.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),ee(a,{code:q.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.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),ee(a,{code:q.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),ee(a,{code:q.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?qp(s).test(e.data)||(a=this._getOrReturnCtx(e,a),ee(a,{code:q.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?Mg(e.data,s.version)||(a=this._getOrReturnCtx(e,a),ee(a,{validation:"ip",code:q.invalid_string,message:s.message}),r.dirty()):be.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(a=>e.test(a),b({validation:n,code:q.invalid_string},ue.errToObj(r)))}_addCheck(e){return new Gn(N(b({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(b({kind:"email"},ue.errToObj(e)))}url(e){return this._addCheck(b({kind:"url"},ue.errToObj(e)))}emoji(e){return this._addCheck(b({kind:"emoji"},ue.errToObj(e)))}uuid(e){return this._addCheck(b({kind:"uuid"},ue.errToObj(e)))}cuid(e){return this._addCheck(b({kind:"cuid"},ue.errToObj(e)))}cuid2(e){return this._addCheck(b({kind:"cuid2"},ue.errToObj(e)))}ulid(e){return this._addCheck(b({kind:"ulid"},ue.errToObj(e)))}ip(e){return this._addCheck(b({kind:"ip"},ue.errToObj(e)))}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(b({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!=null?n:!1},ue.errToObj(e?.message)))}regex(e,n){return this._addCheck(b({kind:"regex",regex:e},ue.errToObj(n)))}includes(e,n){return this._addCheck(b({kind:"includes",value:e,position:n?.position},ue.errToObj(n?.message)))}startsWith(e,n){return this._addCheck(b({kind:"startsWith",value:e},ue.errToObj(n)))}endsWith(e,n){return this._addCheck(b({kind:"endsWith",value:e},ue.errToObj(n)))}min(e,n){return this._addCheck(b({kind:"min",value:e},ue.errToObj(n)))}max(e,n){return this._addCheck(b({kind:"max",value:e},ue.errToObj(n)))}length(e,n){return this._addCheck(b({kind:"length",value:e},ue.errToObj(n)))}nonempty(e){return this.min(1,ue.errToObj(e))}trim(){return new Gn(N(b({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[le]=N(b({},this._def[le]),{secret:!0}),this}toLowerCase(){return new Gn(N(b({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Gn(N(b({},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 n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}isEqual(e){if(!(e instanceof Gn))return!1;let n=new et(this._def.checks),r=new et(e._def.checks);return n.isEqual(r)}};d(Ji,"ZodString");Ji.create=d(t=>{var e;return new Ji(b({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},me(t)))},"create");var gt=Ji,Xi=class Ng extends he{_parse(e){if(this._getType(e)!==te.symbol){let r=this._getOrReturnCtx(e);return ee(r,{code:q.invalid_type,expected:te.symbol,received:r.parsedType}),pe}return pt(e.data)}isEqual(e){return e instanceof Ng}};d(Xi,"ZodSymbol");Xi.create=d(t=>new Xi(b({typeName:"ZodSymbol"},me(t))),"create");var Dg=Xi,tr=class Ir extends he{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new Ir(N(b({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}clone(){return new Ir(N(b({},this._def),{schema:this._def.schema.clone()}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:d(i=>{ee(r,i),i.fatal?n.abort():n.dirty()},"addIssue"),get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async o=>{if(n.value==="aborted")return pe;let l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?pe:l.status==="dirty"||n.value==="dirty"?Vn(l.value):l});{if(n.value==="aborted")return pe;let o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"||n.value==="dirty"?Vn(o.value):o}}if(a.type==="refinement"){let i=d(o=>{let l=a.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o},"executeRefinement");if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:(o.status==="dirty"&&n.dirty(),i(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?pe:(o.status==="dirty"&&n.dirty(),i(o.value).then(()=>({status:n.value,value:o.value}))))}if(a.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!jr(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:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>jr(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:n.value,value:o})):i);be.assertNever(a)}isEqual(e){return!(e instanceof Ir)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:be.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:be.compareFunctions(this._def.effect.transform,e._def.effect.transform):!1}naked(){return this._def.schema.naked()}mandatory(){return new Ir(N(b({},this._def),{schema:this._def.schema.mandatory()}))}};d(tr,"ZodEffects");tr.create=d((t,e,n)=>new tr(b({schema:t,typeName:"ZodEffects",effect:e},me(n))),"create");tr.createWithPreprocess=d((t,e,n)=>new tr(b({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},me(n))),"createWithPreprocess");var Bn=tr,Yi=class Ar extends he{dereference(e){let n=this._def.items.map(a=>a.dereference(e)),r=this._def.rest?this._def.rest.dereference(e):null;return new Ar(N(b({},this._def),{items:n,rest:r}))}getReferences(){return Wt([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}clone(){let e=this._def.items.map(r=>r.clone()),n=this._def.rest?this._def.rest.clone():null;return new Ar(N(b({},this._def),{items:e,rest:n}))}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==te.array)return ee(r,{code:q.invalid_type,expected:te.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return ee(r,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(ee(r,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new It(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>vt.mergeArray(n,i)):vt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new Ar(N(b({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof Ar)||!this._restEquals(e))return!1;let n=d((s,i)=>s.isEqual(i),"compare"),r=new et(this._def.items,{compare:n}),a=new et(e._def.items,{compare:n});return r.isEqual(a)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};d(Yi,"ZodTuple");Yi.create=d((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yi(b({items:t,typeName:"ZodTuple",rest:null},me(e)))},"create");var nr=Yi,Qi=class Hg extends he{_parse(e){if(this._getType(e)!==te.undefined){let r=this._getOrReturnCtx(e);return ee(r,{code:q.invalid_type,expected:te.undefined,received:r.parsedType}),pe}return pt(e.data)}isEqual(e){return e instanceof Hg}mandatory(){return zr.create(b({},this._def))}};d(Qi,"ZodUndefined");Qi.create=d(t=>new Qi(b({typeName:"ZodUndefined"},me(t))),"create");var Ta=Qi,ea=class Cr extends he{dereference(e){let n=this._def.options.map(r=>r.dereference(e));return new Cr(N(b({},this._def),{options:n}))}getReferences(){return Wt(this._def.options.reduce((e,n)=>[...e,...n.getReferences()],[]))}clone(){let e=this._def.options.map(n=>n.clone());return new Cr(N(b({},this._def),{options:e}))}_parse(e){let{ctx:n}=this._processInputParams(e),r=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 n.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new Kt(o.ctx.common.issues));return ee(n,{code:q.invalid_union,unionErrors:i}),pe}if(d(a,"handleResults"),n.common.async)return Promise.all(r.map(async s=>{let i=N(b({},n),{common:N(b({},n.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(a);{let s,i=[];for(let l of r){let f=N(b({},n),{common:N(b({},n.common),{issues:[]}),parent:null}),p=l._parseSync({data:n.data,path:n.path,parent:f});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(l=>new Kt(l));return ee(n,{code:q.invalid_union,unionErrors:o}),pe}}get options(){return this._def.options}isEqual(e){if(!(e instanceof Cr))return!1;let n=d((s,i)=>s.isEqual(i),"compare"),r=new et([...this._def.options],{compare:n}),a=new et([...e._def.options],{compare:n});return r.isEqual(a)}mandatory(){let e=this._def.options.filter(s=>!(s instanceof Ta)).map(s=>s.mandatory()),[n,r,...a]=e;return n?r?new Cr(N(b({},this._def),{options:[n,r,...a]})):n:zr.create(b({},this._def))}};d(ea,"ZodUnion");ea.create=d((t,e)=>new ea(b({options:t,typeName:"ZodUnion"},me(e))),"create");var Qo=ea,ta=class Ug extends he{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pt(e.data)}isEqual(e){return e instanceof Ug}};d(ta,"ZodUnknown");ta.create=d(t=>new ta(b({typeName:"ZodUnknown"},me(t))),"create");var Dr=ta,na=class $g extends he{_parse(e){if(this._getType(e)!==te.undefined){let r=this._getOrReturnCtx(e);return ee(r,{code:q.invalid_type,expected:te.void,received:r.parsedType}),pe}return pt(e.data)}isEqual(e){return e instanceof $g}};d(na,"ZodVoid");na.create=d(t=>new na(b({typeName:"ZodVoid"},me(t))),"create");var Zg=na,Rx=["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"],RA=ir.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Mx=d(t=>gt.create().displayAs({id:"variable",params:b({type:t?.type||"any"},t?.params)}),"variable"),Nx=d(t=>gt.create().displayAs({id:"conversation",params:b({},t?.params)}),"conversation"),Dx=d(t=>gt.create().displayAs({id:"user",params:b({},t?.params)}),"user"),Hx=d(t=>gt.create().displayAs({id:"message",params:b({},t?.params)}),"message"),Ux=d(t=>gt.create().displayAs({id:"agent",params:b({},t?.params)}),"agent"),$x=d(t=>gt.create().displayAs({id:"event",params:b({},t?.params)}),"event"),Zx=d(t=>gt.create().displayAs({id:"table",params:b({},t?.params)}),"table"),jx=d(t=>gt.create().displayAs({id:"tablerow",params:b({},t?.params)}),"tablerow"),Kx=d(t=>gt.create().displayAs({id:"intent",params:b({},t?.params)}),"intent"),Lx=d(()=>ir.create(Rx).displayAs({id:"dropdown",params:{}}),"aimodel"),Fx=d(t=>gt.create().displayAs({id:"datasource",params:b({},t)}),"datasource"),Wx=d(t=>gt.create().displayAs({id:"knowledgebase",params:b({},t)}),"knowledgebase"),zx={object:er.lazycreate},qx=d((t,e={message:`Input not instance of ${t.name}`})=>sg(n=>n instanceof t,e),"instanceOfType"),jg=gt.create,Kg=Xo.create,Gx=yg.create,Vx=Zo.create,Lg=jo.create,Jx=Fo.create,Xx=Dg.create,Yx=Ta.create,Qx=Jo.create,eP=Kr.create,tP=Dr.create,nP=zr.create,rP=Zg.create,iP=Lr.create,aP=er.create,oP=er.strictCreate,sP=Qo.create,lP=ug.create,uP=zo.create,cP=nr.create,fP=wg.create,dP=Pg.create,pP=va.create,gP=pg.create,yP=Bg.create,mP=fg.create,hP=qo.create,vP=Go.create,TP=ir.create,_P=Vo.create,bP=ha.create,zc=Bn.create,wP=an.create,xP=Qn.create,PP=ya.create,BP=Bn.createWithPreprocess,EP=Yo.create,SP=d(()=>jg().optional(),"ostring"),kP=d(()=>Kg().optional(),"onumber"),IP=d(()=>Lg().optional(),"oboolean"),AP={string:d(t=>gt.create(N(b({},t),{coerce:!0})),"string"),number:d(t=>Xo.create(N(b({},t),{coerce:!0})),"number"),boolean:d(t=>jo.create(N(b({},t),{coerce:!0})),"boolean"),bigint:d(t=>Zo.create(N(b({},t),{coerce:!0})),"bigint"),date:d(t=>Fo.create(N(b({},t),{coerce:!0})),"date")},CP=pe,C=ne,Fg=d((t,e)=>t.anyOf.length?t.anyOf.length===1?it(t.anyOf[0],N(b({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((n,r)=>it(n,N(b({},e),{path:[...e.path,"anyOf",r]}))).join(", ")}])`:"z.any()","parseAnyOf"),OP=d(t=>{var e;return(e=t[le])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),RP=d(t=>"z.any()","parseDefault"),MP=d((t,e)=>`z.union([${t.type.map(n=>it(N(b({},t),{type:n}),e)).join(", ")}])`,"parseMultipleType"),NP=d((t,e)=>`z.any().refine((value) => !${it(t.not,N(b({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),DP=d(t=>"z.null()","parseNull"),HP=d(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),UP=d((t,...e)=>Object.keys(t).reduce((n,r)=>(e.includes(r)||(n[r]=t[r]),n),{}),"omit");function ut(t,e,n){var r;let a=t[e],s="";if(a!==void 0){let i=n({value:a,json:JSON.stringify(a)});if(i){let o=i[0],l=i.length===3?i[1]:"",f=i.length===3?i[2]:i[1];s+=o,((r=t.errorMessage)==null?void 0:r[e])!==void 0&&(s+=l+JSON.stringify(t.errorMessage[e])),s+=f}}return s}d(ut,"withMessage");var Or=Symbol("Original index"),$P=d(t=>{let e=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="boolean")e.push(r?{[Or]:n}:{[Or]:n,not:{}});else{if(Or in r)return t;e.push(N(b({},r),{[Or]:n}))}}return e},"ensureOriginalIndex");function Fr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let n=t.allOf[0];return it(n,N(b({},e),{path:[...e.path,"allOf",n[Or]]}))}else{let[n,r]=HP($P(t.allOf));return`z.intersection(${Fr({allOf:n},e)}, ${Fr({allOf:r},e)})`}}d(Fr,"parseAllOf");var ZP=d((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((r,a)=>it(r,N(b({},e),{path:[...e.path,"items",a]})))}])`;let n=t.items?`z.array(${it(t.items,N(b({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return n+=ut(t,"minItems",({json:r})=>[`.min(${r}`,", ",")"]),n+=ut(t,"maxItems",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseArray"),jP=d(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),KP=d(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"),LP=d((t,e)=>{let n=it(t.if,N(b({},e),{path:[...e.path,"if"]})),r=it(t.then,N(b({},e),{path:[...e.path,"then"]})),a=it(t.else,N(b({},e),{path:[...e.path,"else"]}));return`z.union([${r}, ${a}]).superRefine((value,ctx) => {
24
24
  const result = ${n}.safeParse(value).success
25
25
  ? ${r}.safeParse(value)
26
- : ${o}.safeParse(value);
26
+ : ${a}.safeParse(value);
27
27
  if (!result.success) {
28
28
  result.error.errors.forEach((error) => ctx.addIssue(error))
29
29
  }
30
- })`},"parseIfThenElse"),qB=p(t=>{var e;let n="z.number()";return(e=t[ke])!=null&&e.coerce&&(n="z.coerce.number()"),t.type==="integer"?n+=at(t,"type",()=>[".int(",")"]):n+=at(t,"format",({value:r})=>{if(r==="int64")return[".int(",")"]}),n+=at(t,"multipleOf",({value:r,json:o})=>r===1?n.startsWith("z.number().int(")?void 0:[".int(",")"]:[`.multipleOf(${o}`,", ",")"]),typeof t.minimum=="number"?t.exclusiveMinimum===!0?n+=at(t,"minimum",({json:r})=>[`.gt(${r}`,", ",")"]):n+=at(t,"minimum",({json:r})=>[`.gte(${r}`,", ",")"]):typeof t.exclusiveMinimum=="number"&&(n+=at(t,"exclusiveMinimum",({json:r})=>[`.gt(${r}`,", ",")"])),typeof t.maximum=="number"?t.exclusiveMaximum===!0?n+=at(t,"maximum",({json:r})=>[`.lt(${r}`,", ",")"]):n+=at(t,"maximum",({json:r})=>[`.lte(${r}`,", ",")"]):typeof t.exclusiveMaximum=="number"&&(n+=at(t,"exclusiveMaximum",({json:r})=>[`.lt(${r}`,", ",")"])),n},"parseNumber"),rs=p((t,e)=>t.oneOf.length?t.oneOf.length===1?nt(t.oneOf[0],H(x({},e),{path:[...e.path,"oneOf",0]})):`z.any().superRefine((x, ctx) => {
31
- const schemas = [${t.oneOf.map((n,r)=>nt(n,H(x({},e),{path:[...e.path,"oneOf",r]}))).join(", ")}];
30
+ })`},"parseIfThenElse"),FP=d(t=>{var e;let n="z.number()";return(e=t[le])!=null&&e.coerce&&(n="z.coerce.number()"),t.type==="integer"?n+=ut(t,"type",()=>[".int(",")"]):n+=ut(t,"format",({value:r})=>{if(r==="int64")return[".int(",")"]}),n+=ut(t,"multipleOf",({value:r,json:a})=>r===1?n.startsWith("z.number().int(")?void 0:[".int(",")"]:[`.multipleOf(${a}`,", ",")"]),typeof t.minimum=="number"?t.exclusiveMinimum===!0?n+=ut(t,"minimum",({json:r})=>[`.gt(${r}`,", ",")"]):n+=ut(t,"minimum",({json:r})=>[`.gte(${r}`,", ",")"]):typeof t.exclusiveMinimum=="number"&&(n+=ut(t,"exclusiveMinimum",({json:r})=>[`.gt(${r}`,", ",")"])),typeof t.maximum=="number"?t.exclusiveMaximum===!0?n+=ut(t,"maximum",({json:r})=>[`.lt(${r}`,", ",")"]):n+=ut(t,"maximum",({json:r})=>[`.lte(${r}`,", ",")"]):typeof t.exclusiveMaximum=="number"&&(n+=ut(t,"exclusiveMaximum",({json:r})=>[`.lt(${r}`,", ",")"])),n},"parseNumber"),es=d((t,e)=>t.oneOf.length?t.oneOf.length===1?it(t.oneOf[0],N(b({},e),{path:[...e.path,"oneOf",0]})):`z.any().superRefine((x, ctx) => {
31
+ const schemas = [${t.oneOf.map((n,r)=>it(n,N(b({},e),{path:[...e.path,"oneOf",r]}))).join(", ")}];
32
32
  const errors = schemas.reduce(
33
33
  (errors: z.ZodError[], schema) =>
34
34
  ((result) => ("error" in result ? [...errors, result.error] : errors))(
@@ -44,15 +44,15 @@ ${T}`.trim();case q.ZodFirstPartyTypeKind.ZodEnum:return a.values.map(jt).join("
44
44
  message: "Invalid input: Should pass single schema",
45
45
  });
46
46
  }
47
- })`:"z.any()","parseOneOf");function vy(t,e){let n;t.properties&&(Object.keys(t.properties).length?(n="z.object({ ",n+=Object.keys(t.properties).map(i=>{let a=t.properties[i],l=`${JSON.stringify(i)}: ${nt(a,H(x({},e),{path:[...e.path,"properties",i]}))}`,c=typeof a=="object"&&a.default!==void 0||typeof t.default=="object"&&t.default!==null&&i in t.default,d=Array.isArray(t.required)?t.required.includes(i):typeof a=="object"&&a.required===!0;return!c&&!d?`${l}.optional()`:l}).join(", "),n+=" })"):n="z.object({})");let r=t.additionalProperties!==void 0?nt(t.additionalProperties,H(x({},e),{path:[...e.path,"additionalProperties"]})):void 0,o;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([a,l])=>[a,nt(l,H(x({},e),{path:[...e.path,"patternProperties",a]}))],{}));o="",n?r?o+=`.catchall(z.union([${[...Object.values(i),r].join(", ")}]))`:Object.keys(i).length>1?o+=`.catchall(z.union([${Object.values(i).join(", ")}]))`:o+=`.catchall(${Object.values(i)})`:r?o+=`z.record(z.union([${[...Object.values(i),r].join(", ")}]))`:Object.keys(i).length>1?o+=`z.record(z.union([${Object.values(i).join(", ")}]))`:o+=`z.record(${Object.values(i)})`,o+=`.superRefine((value, ctx) => {
48
- `,o+=`for (const key in value) {
49
- `,r&&(t.properties?o+=`let evaluated = [${Object.keys(t.properties).map(a=>JSON.stringify(a)).join(", ")}].includes(key)
50
- `:o+=`let evaluated = false
51
- `);for(let a in t.patternProperties)o+="if (key.match(new RegExp("+JSON.stringify(a)+`))) {
52
- `,r&&(o+=`evaluated = true
53
- `),o+="const result = "+i[a]+`.safeParse(value[key])
54
- `,o+=`if (!result.success) {
55
- `,o+=`ctx.addIssue({
47
+ })`:"z.any()","parseOneOf");function Wg(t,e){let n;t.properties&&(Object.keys(t.properties).length?(n="z.object({ ",n+=Object.keys(t.properties).map(i=>{let o=t.properties[i],l=`${JSON.stringify(i)}: ${it(o,N(b({},e),{path:[...e.path,"properties",i]}))}`,f=typeof o=="object"&&o.default!==void 0||typeof t.default=="object"&&t.default!==null&&i in t.default,p=Array.isArray(t.required)?t.required.includes(i):typeof o=="object"&&o.required===!0;return!f&&!p?`${l}.optional()`:l}).join(", "),n+=" })"):n="z.object({})");let r=t.additionalProperties!==void 0?it(t.additionalProperties,N(b({},e),{path:[...e.path,"additionalProperties"]})):void 0,a;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([o,l])=>[o,it(l,N(b({},e),{path:[...e.path,"patternProperties",o]}))],{}));a="",n?r?a+=`.catchall(z.union([${[...Object.values(i),r].join(", ")}]))`:Object.keys(i).length>1?a+=`.catchall(z.union([${Object.values(i).join(", ")}]))`:a+=`.catchall(${Object.values(i)})`:r?a+=`z.record(z.union([${[...Object.values(i),r].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) => {
48
+ `,a+=`for (const key in value) {
49
+ `,r&&(t.properties?a+=`let evaluated = [${Object.keys(t.properties).map(o=>JSON.stringify(o)).join(", ")}].includes(key)
50
+ `:a+=`let evaluated = false
51
+ `);for(let o in t.patternProperties)a+="if (key.match(new RegExp("+JSON.stringify(o)+`))) {
52
+ `,r&&(a+=`evaluated = true
53
+ `),a+="const result = "+i[o]+`.safeParse(value[key])
54
+ `,a+=`if (!result.success) {
55
+ `,a+=`ctx.addIssue({
56
56
  path: [...ctx.path, key],
57
57
  code: 'custom',
58
58
  message: \`Invalid input: Key matching regex /\${key}/ must match schema\`,
@@ -60,12 +60,12 @@ ${T}`.trim();case q.ZodFirstPartyTypeKind.ZodEnum:return a.values.map(jt).join("
60
60
  issues: result.error.issues
61
61
  }
62
62
  })
63
- `,o+=`}
64
- `,o+=`}
65
- `;r&&(o+=`if (!evaluated) {
66
- `,o+="const result = "+r+`.safeParse(value[key])
67
- `,o+=`if (!result.success) {
68
- `,o+=`ctx.addIssue({
63
+ `,a+=`}
64
+ `,a+=`}
65
+ `;r&&(a+=`if (!evaluated) {
66
+ `,a+="const result = "+r+`.safeParse(value[key])
67
+ `,a+=`if (!result.success) {
68
+ `,a+=`ctx.addIssue({
69
69
  path: [...ctx.path, key],
70
70
  code: 'custom',
71
71
  message: \`Invalid input: must match catchall schema\`,
@@ -73,35 +73,24 @@ ${T}`.trim();case q.ZodFirstPartyTypeKind.ZodEnum:return a.values.map(jt).join("
73
73
  issues: result.error.issues
74
74
  }
75
75
  })
76
- `,o+=`}
77
- `,o+=`}
78
- `),o+=`}
79
- `,o+="})"}let s=n?o?n+o:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:o||(r?`z.record(${r})`:"z.record(z.any())");return Qe.an.anyOf(t)&&(s+=`.and(${hy(H(x({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?H(x({},i),{type:"object"}):i)}),e)})`),Qe.a.oneOf(t)&&(s+=`.and(${rs(H(x({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?H(x({},i),{type:"object"}):i)}),e)})`),Qe.an.allOf(t)&&(s+=`.and(${Ur(H(x({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?H(x({},i),{type:"object"}):i)}),e)})`),s}p(vy,"parseObject");var zB=p(t=>{var e;let n="z.string()";if((e=t[ke])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=at(t,"format",({value:r})=>{switch(r){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(",")"]}}),n+=at(t,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=at(t,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=at(t,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),GB=p((t,e)=>`${nt($B(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),VB=p(t=>`z.ref('${t.$ref}')`,"parseRef"),JB=p((t,e)=>{var n,r;if(t.oneOf.length<=1||!((n=t.discriminator)!=null&&n.propertyName))return rs(t,e);let o=t.oneOf.map((s,i)=>nt(s,H(x({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(r=t.discriminator)==null?void 0:r.propertyName}", [${o.join(", ")}])`},"parseDiscriminator"),nt=p((t,e={seen:new Map,path:[]},n)=>{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 r=e.seen.get(t);if(r){if(r.r!==void 0)return r.r;if(e.depth===void 0||r.n>=e.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},e.seen.set(t,r);let o=QB(t,e);return n||(o=YB(t,o),e.withoutDefaults||(o=XB(t,o))),r.r=o,o},"parseSchema"),YB=p((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),XB=p((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),QB=p((t,e)=>Qe.a.nullable(t)?GB(t,e):Qe.an.object(t)?vy(t,e):Qe.an.array(t)?LB(t,e):Qe.an.anyOf(t)?hy(t,e):Qe.an.allOf(t)?Ur(t,e):Qe.a.discriminator(t)?JB(t,e):Qe.a.oneOf(t)?rs(t,e):Qe.a.not(t)?HB(t,e):Qe.an.enum(t)?KB(t):Qe.a.const(t)?FB(t):Qe.a.multipleType(t)?NB(t,e):Qe.a.primitive(t,"string")?zB(t):Qe.a.primitive(t,"number")||Qe.a.primitive(t,"integer")?qB(t):Qe.a.primitive(t,"boolean")?MB(t):Qe.a.primitive(t,"null")?UB(t):Qe.a.conditional(t)?WB(t,e):Qe.a.ref(t)?VB(t):DB(t),"selectParser"),Qe={an:{object:p(t=>t.type==="object","object"),array:p(t=>t.type==="array","array"),anyOf:p(t=>t.anyOf!==void 0,"anyOf"),allOf:p(t=>t.allOf!==void 0,"allOf"),enum:p(t=>t.enum!==void 0,"enum")},a:{nullable:p(t=>t.nullable===!0,"nullable"),multipleType:p(t=>Array.isArray(t.type),"multipleType"),not:p(t=>t.not!==void 0,"not"),const:p(t=>t.const!==void 0,"const"),primitive:p((t,e)=>t.type===e,"primitive"),conditional:p(t=>Boolean("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:p(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:p(t=>t.oneOf!==void 0,"oneOf"),ref:p(t=>t.$ref!==void 0,"ref")}},eP=p(t=>{let e;try{e=new Function("z",`return ${t}`)(q)}catch(n){return{sucess:!1,error:`Failed to evaluate schema: ${(n instanceof Error?n:new Error(String(n))).message}`}}return e instanceof q.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),tP=p(t=>nt(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),nP=p(t=>{let e=tP(t);e=e.replaceAll("errors: z.ZodError[]","errors");let n=eP(e);if(!n.sucess)throw new Af(n.error);return n.value},"jsonSchemaToZod"),Sr=p((t,e)=>{var n,r;if(e[ke]&&t._def&&(t._def[ke]=e[ke]),((n=t._def)==null?void 0:n.typeName)==="ZodObject"&&e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([o,s])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[o]&&Sr(i[o],s)}),((r=t._def)==null?void 0:r.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&Sr(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let o=e.items;if(typeof o=="object"&&!Array.isArray(o)){let s=t._def.type;s&&Sr(s,o)}else Array.isArray(o)&&o.forEach((s,i)=>{let a=t._def;a.typeName===re.ZodFirstPartyTypeKind.ZodTuple&&Sr(a.items[i],s)})}},"applyZuiPropsRecursively"),yo=p(t=>{let e=nP(t);return Sr(e,t),e},"jsonSchemaToZui"),Ty=class extends tr.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("Uncaught error:",e,n)}render(){return this.state.hasError&&this.props.fallback?tr.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};p(Ty,"ErrorBoundary");var Ar=Ty;function rP(t,e){return n=>tr.default.createElement(Ar,{fallback:e,fieldSchema:n.fieldSchema,path:n.path},tr.default.createElement(t,x({},n)))}p(rP,"withErrorBoundary");var hi=p(t=>{var e=t,{components:n,fieldSchema:r,path:o,required:s,fallback:i}=e,a=pf(e,["components","fieldSchema","path","required","fallback"]),l,c;let{formData:d,disabled:y,hidden:g,handlePropertyChange:m,addArrayItem:v,removeArrayItem:B,formErrors:P,formValid:T}=mf(r,o),S=(0,pt.useMemo)(()=>vn(d,o),[d,o]),E=(0,pt.useMemo)(()=>fT(n,r),[r,n]),{discriminator:M,discriminatedSchema:$,discriminatorValue:oe}=lT(r,o);if(!E||g===!0)return null;let{Component:X,type:ue}=E,ee={type:ue,componentID:E.id,scope:o.join("."),context:{path:o,readonly:!1,formData:d,formErrors:P,formValid:T,updateForm:m,updateFormData:p(Ie=>m([],Ie),"updateFormData")},onChange:p(Ie=>m(o,Ie),"onChange"),disabled:y,errors:P?.filter(Ie=>Ie.path===o)||[],label:((l=r[ke])==null?void 0:l.title)||aa(((c=o[o.length-1])==null?void 0:c.toString())||""),params:E.params,schema:r,zuiProps:r[ke]};if(r.type==="array"&&ue==="array"){let Ie=X,$e=ee.schema,Ne=Array.isArray(S)||typeof S=="object"?S:[],Me=x(H(x({},ee),{type:ue,schema:$e,data:Ne,addItem:p(Ve=>v(o,Ve),"addItem"),removeItem:p(Ve=>B(o,Ve),"removeItem")}),a);return Array.isArray(r.items)?null:pt.default.createElement(Ie,H(x({key:ee.scope},Me),{isArrayChild:Me.isArrayChild}),Array.isArray(Me.data)?Me.data.map((Ve,Ae)=>{let he=[...o,Ae.toString()];return pt.default.createElement(Ar,{key:he.join("."),fallback:i,fieldSchema:r.items,path:he},pt.default.createElement(hi,{key:he.join("."),components:n,fieldSchema:r.items,path:he,required:s,isArrayChild:!0,index:Ae,removeSelf:()=>B(o,Ae),fallback:i}))}):[])}if(r.type==="object"&&ue==="object"&&r.properties){let Ie=X,$e=x(H(x({},ee),{type:ue,schema:ee.schema,data:S||{}}),a);return pt.default.createElement(Ie,H(x({key:ee.scope},$e),{isArrayChild:$e.isArrayChild}),Object.entries(r.properties).map(([Ne,Me])=>{var Ve;let Ae=[...o,Ne];return pt.default.createElement(Ar,{key:Ae.join("."),fallback:i,fieldSchema:Me,path:Ae},pt.default.createElement(hi,{key:Ae.join("."),components:n,fieldSchema:Me,path:Ae,required:((Ve=r.required)==null?void 0:Ve.includes(Ne))||!1,isArrayChild:!1,fallback:i}))}))}if(ue==="discriminatedUnion"){let Ie=X,$e=x(H(x({},ee),{type:ue,schema:ee.schema,data:S||{},discriminatorKey:M?.key||null,discriminatorLabel:aa(M?.key||"Unknown"),discriminatorOptions:M?.values||null,discriminatorValue:oe,setDiscriminator:p(Ne=>{if(!M?.key){console.warn("No discriminator key found, cannot set discriminator");return}m(o,{[M.key]:Ne})},"setDiscriminator")}),a);return pt.default.createElement(Ie,H(x({key:ee.scope},$e),{isArrayChild:$e.isArrayChild}),$&&pt.default.createElement(Ar,{key:o.join("."),fallback:i,fieldSchema:$,path:o},pt.default.createElement(hi,{components:n,fieldSchema:$,path:o,required:s,isArrayChild:!1,fallback:i})))}let ie=X,Oe=x(H(x({},ee),{type:ue,schema:ee.schema,config:{},required:s,data:S,description:r.description}),a);return pt.default.createElement(ie,x({},Oe))},"FormElementRenderer"),hA=p(({schema:t,components:e,onChange:n,value:r,disableValidation:o,fallback:s,dataTransform:i,onValidation:a})=>{let[l,c]=(0,Zt.useState)(r);return(0,Zt.useEffect)(()=>{n(l)},[l]),(0,Zt.useEffect)(()=>{let d=Gn(t);c(y=>Ti(d,y))},[JSON.stringify(t),c]),Zt.default.createElement(sT,{formData:l,setFormData:c,formSchema:t,disableValidation:o||!1,dataTransform:i,onValidation:a},Zt.default.createElement(Ar,{fallback:s,fieldSchema:t,path:[]},Zt.default.createElement(hi,{components:e,fieldSchema:t,path:[],fallback:s,required:!0,isArrayChild:!1})))},"ZuiForm"),vA={string:{},number:{slider:{id:"slider",params:q.object({})}},boolean:{switch:{id:"switch",params:q.object({})}},array:{},object:{},discriminatedUnion:{}},TA={errors:Sf,jsonSchemaToZui:yo,zuiToJsonSchema:ns,objectToZui:Hr,toTypescript:_i,toTypescriptSchema:Na};var jr=(t,e)=>{let n=t._def,r=e._def;if(n.typeName===re.ZodFirstPartyTypeKind.ZodObject&&r.typeName===re.ZodFirstPartyTypeKind.ZodObject){let o=n.shape(),s=r.shape();return re.object({...o,...s})}if(n.typeName===re.ZodFirstPartyTypeKind.ZodRecord&&r.typeName===re.ZodFirstPartyTypeKind.ZodRecord)return re.record(re.intersection(n.valueType,r.valueType));throw new Error("Cannot merge object schemas with record schemas")},_y=re;var dt=re.string().min(1),wy=re.object({text:dt}),xy=re.object({markdown:dt}),By=re.object({imageUrl:dt}),Py=re.object({audioUrl:dt}),Ey=re.object({videoUrl:dt}),Sy=re.object({fileUrl:dt,title:dt.optional()}),ky=re.object({latitude:re.number(),longitude:re.number(),address:re.string().optional(),title:re.string().optional()}),Iy=re.object({title:dt,subtitle:dt.optional(),imageUrl:dt.optional(),actions:re.array(re.object({action:re.enum(["postback","url","say"]),label:dt,value:dt}))}),by=re.object({text:dt,options:re.array(re.object({label:dt,value:dt}))}),iP=re.object({items:re.array(Iy)}),oP=re.union([re.object({type:re.literal("text"),payload:wy}),re.object({type:re.literal("markdown"),payload:xy}),re.object({type:re.literal("image"),payload:By}),re.object({type:re.literal("audio"),payload:Py}),re.object({type:re.literal("video"),payload:Ey}),re.object({type:re.literal("file"),payload:Sy}),re.object({type:re.literal("location"),payload:ky})]),aP=re.object({items:re.array(oP)}),sP={schema:xy},lP={text:{schema:wy},image:{schema:By},audio:{schema:Py},video:{schema:Ey},file:{schema:Sy},location:{schema:ky},carousel:{schema:iP},card:{schema:Iy},dropdown:{schema:by},choice:{schema:by},bloc:{schema:aP}};C();O();R();var mo="x-bot-id",Cy="x-bot-user-id",Ry="x-integration-id",Oy="x-webhook-id",My="x-bp-configuration-type",ho="x-bp-configuration",vo="x-bp-operation",Dy="x-bp-type",MA={HIDDEN_IN_STUDIO:{bpActionHiddenInStudio:"true"},AWAIT_RETURN:{bpActionAwaitReturn:"true"}};C();O();R();import{isNode as uk}from"browser-or-node";C();O();R();var is=console;function kt(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function $o(t,e=8072,n=pk){if(!uk)throw new Error("This function can only be called in Node.js");let o=(Oh(),$v(Rh)).createServer(async(s,i)=>{try{let a=await ck(s);if(a.path==="/health"){i.writeHead(200).end("ok");return}let l=await t(a);i.writeHead(l?.status??200,l?.headers??{}).end(l?.body??"{}")}catch(a){is.error("Error while handling request",{error:a?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:a?.message??"Internal error occured"}))}});return o.listen(e,()=>n(e)),o}async function ck(t){let e=await dk(t),n={};for(let o=0;o<t.rawHeaders.length;o+=2){let s=t.rawHeaders[o].toLowerCase(),i=t.rawHeaders[o+1];n[s]=i}let r=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:r.pathname,query:fk(r.search,"?"),headers:n,method:t.method?.toUpperCase()??"GET"}}function fk(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function dk(t){return new Promise((e,n)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let r="";t.on("data",o=>r+=o.toString()),t.on("error",o=>n(o)),t.on("end",()=>e(r))})}function pk(t){is.info(`Listening on port ${t}`)}import{isApiError as wH,RuntimeError as xH}from"@botpress/client";C();O();R();C();O();R();C();O();R();C();O();R();var qe={};jn(qe,{mapKeys:()=>mk,mapValues:()=>yk,mergeRecords:()=>vk,pairs:()=>Zo,stripUndefinedProps:()=>hk,values:()=>gk});C();O();R();var Zo=t=>Object.entries(t),gk=t=>Object.values(t),yk=(t,e)=>Object.fromEntries(Zo(t).map(([n,r])=>[n,e(r,n)])),mk=(t,e)=>Object.fromEntries(Zo(t).map(([n,r])=>[e(n),r])),hk=t=>Object.fromEntries(Zo(t).filter(([,e])=>e!==void 0)),vk=(t,e,n)=>{let r=[...Object.keys(t),...Object.keys(e)],o=[...new Set(r)],s={};for(let i of o){let a=t[i],l=e[i];a&&l?s[i]=n(a,l):a?s[i]=a:l&&(s[i]=l)}return s};var ge={};jn(ge,{safePush:()=>Tk,unique:()=>_k});C();O();R();var Tk=(t,...e)=>t?[...t,...e]:[...e],_k=t=>Array.from(new Set(t));C();O();R();var Xt={};jn(Xt,{setName:()=>bk});C();O();R();var bk=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Mh=t=>{let{name:e,version:n}=t,r={actions:{},events:{},channels:{}},o={name:e,version:n,entities:qe.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},s=qe.mapValues(t.entities,i=>i.schema);for(let[i,a]of Object.entries(t.definition.actions??{})){let l=a.input.schema.dereference(s),c=a.output.schema.dereference(s),d=t.actions?.[i]?.name??i;r.actions[d]={...a,...t.actions?.[i]??{},input:{schema:l},output:{schema:c}},o.actions[i]={name:d}}for(let[i,a]of Object.entries(t.definition.events??{})){let l=a.schema.dereference(s),c=t.events?.[i]?.name??i;r.events[c]={...a,...t.events?.[i]??{},schema:l},o.events[i]={name:c}}for(let[i,a]of Object.entries(t.definition.channels??{})){let l={};for(let[d,y]of Object.entries(a.messages)){let g=y.schema.dereference(s);l[d]={...y,schema:g}}let c=t.channels?.[i]?.name??i;r.channels[c]={...a,...t.channels?.[i]??{},message:{...a.message??{},tags:{...a.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...a.conversation??{},tags:{...a.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:l},o.channels[i]={name:c}}return{resolved:r,statement:o}};C();O();R();var Lo=Symbol("schemaName"),Dh=t=>t?qe.mapValues(t,(n,r)=>({...n,[Lo]:r})):{},Nh=t=>Lo in t&&t[Lo]!==void 0,Hh=t=>t[Lo];C();O();R();var tl=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,this.attributes=e.attributes}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;attributes;extend(e,n){let{entities:r,actions:o,events:s,channels:i}=this._callBuilder(e,n),a=this;a.interfaces??={};let l=Object.values(r).map(g=>g.name),c=l.length===0?e.name:`${e.name}<${l.join(",")}>`,{resolved:d,statement:y}=Mh({...e,entities:r,actions:qe.stripUndefinedProps(o),events:qe.stripUndefinedProps(s),channels:qe.stripUndefinedProps(i)});return a.actions=qe.mergeRecords(a.actions??{},d.actions,this._mergeActions),a.channels=qe.mergeRecords(a.channels??{},d.channels,this._mergeChannels),a.events=qe.mergeRecords(a.events??{},d.events,this._mergeEvents),a.interfaces[c]={id:e.id,...y},this}_callBuilder(e,n){let o={entities:Dh(this.entities)},s=n(o),i=qe.pairs(s.entities).find(([l,c])=>!Nh(c));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:qe.mapValues(s.entities,l=>({name:Hh(l),schema:l.schema})),actions:s.actions??{},events:s.events??{},channels:s.channels??{}}}_mergeActions=(e,n)=>({...e,...n,input:{schema:jr(e.input.schema,n.input.schema)},output:{schema:jr(e.output.schema,n.output.schema)}});_mergeEvents=(e,n)=>({...e,...n,schema:jr(e.schema,n.schema)});_mergeChannels=(e,n)=>{let r=qe.mergeRecords(e.messages,n.messages,this._mergeMessage),o;(e.conversation||n.conversation)&&(o={tags:{...e.conversation?.tags,...n.conversation?.tags}});let s;return(e.message||n.message)&&(s={tags:{...e.message?.tags,...n.message?.tags}}),{...e,...n,messages:r,conversation:o,message:s}};_mergeMessage=(e,n)=>({schema:jr(e.schema,n.schema)})};C();O();R();C();O();R();import{isApiError as Xk,Client as Qk,RuntimeError as wv}from"@botpress/client";C();O();R();import*as Uh from"@botpress/client";var Fo={retries:3,retryCondition:t=>Uh.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:(t,e)=>(wk(e.response?.headers??{})??t)*1e3},wk=t=>{let e=["RateLimit-Reset","X-RateLimit-Reset","Retry-After","ratelimit-reset","x-ratelimit-reset","retry-after"];for(let n of e){let r=t[n];if(r!==void 0)return xk(String(r))}},xk=t=>{let e=Bk(t)?Pk(t):t.length>0?parseInt(t,10):void 0;return e===void 0||isNaN(e)?void 0:e},Bk=t=>t.includes(" "),Pk=t=>{let e=Ek(t);if(!e)return;let n=new Date;return Math.max(0,Math.floor((e.getTime()-n.getTime())/1e3))},Ek=t=>{let e=new Date(t);return isNaN(e.getTime())?void 0:e};C();O();R();C();O();R();var Gr=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)};C();O();R();var Ko=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};C();O();R();C();O();R();var Wo="#";var Sk=re.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),$h=t=>{let e=t[mo],n=t[Cy],r=t[Ry],o=t[Oy],s=t[My],i=t[ho],a=Sk.parse(t[vo]);if(!e)throw new Error("Missing bot headers");if(!n)throw new Error("Missing bot user headers");if(!r)throw new Error("Missing integration headers");if(!o)throw new Error("Missing webhook headers");if(!i)throw new Error("Missing configuration headers");if(!a)throw new Error("Missing operation headers");return{botId:e,botUserId:n,integrationId:r,webhookId:o,operation:a,configurationType:s??null,configuration:i?JSON.parse(z.from(i,"base64").toString("utf-8")):{}}};C();O();R();C();O();R();C();O();R();C();O();R();var nl={},Zh=!1;function wl(){return Zh||(Zh=!0,nl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var o=42;e[n]=o;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(e,n);if(i.value!==o||i.enumerable!==!0)return!1}return!0}),nl}var rl={},Lh=!1;function kk(){return Lh||(Lh=!0,rl=Error),rl}var il={},Fh=!1;function Ik(){return Fh||(Fh=!0,il=EvalError),il}var ol={},Kh=!1;function Ak(){return Kh||(Kh=!0,ol=RangeError),ol}var al={},Wh=!1;function Ck(){return Wh||(Wh=!0,al=ReferenceError),al}var sl={},qh=!1;function lv(){return qh||(qh=!0,sl=SyntaxError),sl}var ll={},zh=!1;function qo(){return zh||(zh=!0,ll=TypeError),ll}var ul={},Gh=!1;function Rk(){return Gh||(Gh=!0,ul=URIError),ul}var cl={},Vh=!1;function Ok(){if(Vh)return cl;Vh=!0;var t=typeof Symbol<"u"&&Symbol,e=wl();return cl=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},cl}var fl={},Jh=!1;function Mk(){if(Jh)return fl;Jh=!0;var t={__proto__:null,foo:{}},e=Object;return fl=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},fl}var dl={},Yh=!1;function Dk(){if(Yh)return dl;Yh=!0;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",o=function(l,c){for(var d=[],y=0;y<l.length;y+=1)d[y]=l[y];for(var g=0;g<c.length;g+=1)d[g+l.length]=c[g];return d},s=function(l,c){for(var d=[],y=c,g=0;y<l.length;y+=1,g+=1)d[g]=l[y];return d},i=function(a,l){for(var c="",d=0;d<a.length;d+=1)c+=a[d],d+1<a.length&&(c+=l);return c};return dl=function(l){var c=this;if(typeof c!="function"||e.apply(c)!==r)throw new TypeError(t+c);for(var d=s(arguments,1),y,g=function(){if(this instanceof y){var T=c.apply(this,o(d,arguments));return Object(T)===T?T:this}return c.apply(l,o(d,arguments))},m=n(0,c.length-d.length),v=[],B=0;B<m;B++)v[B]="$"+B;if(y=Function("binder","return function ("+i(v,",")+"){ return binder.apply(this,arguments); }")(g),c.prototype){var P=function(){};P.prototype=c.prototype,y.prototype=new P,P.prototype=null}return y},dl}var pl={},Xh=!1;function xl(){if(Xh)return pl;Xh=!0;var t=Dk();return pl=Function.prototype.bind||t,pl}var gl={},Qh=!1;function Nk(){if(Qh)return gl;Qh=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=xl();return gl=n.call(t,e),gl}var yl={},ev=!1;function Jr(){if(ev)return yl;ev=!0;var t,e=kk(),n=Ik(),r=Ak(),o=Ck(),s=lv(),i=qo(),a=Rk(),l=Function,c=function(Ae){try{return l('"use strict"; return ('+Ae+").constructor;")()}catch{}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch{d=null}var y=function(){throw new i},g=d?function(){try{return arguments.callee,y}catch{try{return d(arguments,"callee").get}catch{return y}}}():y,m=Ok()(),v=Mk()(),B=Object.getPrototypeOf||(v?function(Ae){return Ae.__proto__}:null),P={},T=typeof Uint8Array>"u"||!B?t:B(Uint8Array),S={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":m&&B?B([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":P,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&B?B(B([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!B?t:B(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":r,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m||!B?t:B(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&B?B(""[Symbol.iterator]()):t,"%Symbol%":m?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":g,"%TypedArray%":T,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(B)try{null.error}catch(Ae){var E=B(B(Ae));S["%Error.prototype%"]=E}var M=function Ae(he){var Se;if(he==="%AsyncFunction%")Se=c("async function () {}");else if(he==="%GeneratorFunction%")Se=c("function* () {}");else if(he==="%AsyncGeneratorFunction%")Se=c("async function* () {}");else if(he==="%AsyncGenerator%"){var ce=Ae("%AsyncGeneratorFunction%");ce&&(Se=ce.prototype)}else if(he==="%AsyncIteratorPrototype%"){var ve=Ae("%AsyncGenerator%");ve&&B&&(Se=B(ve.prototype))}return S[he]=Se,Se},$={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},oe=xl(),X=Nk(),ue=oe.call(Function.call,Array.prototype.concat),ee=oe.call(Function.apply,Array.prototype.splice),ie=oe.call(Function.call,String.prototype.replace),Oe=oe.call(Function.call,String.prototype.slice),Ie=oe.call(Function.call,RegExp.prototype.exec),$e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ne=/\\(\\)?/g,Me=function(he){var Se=Oe(he,0,1),ce=Oe(he,-1);if(Se==="%"&&ce!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(ce==="%"&&Se!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ve=[];return ie(he,$e,function(D,Z,F,fe){ve[ve.length]=F?ie(fe,Ne,"$1"):Z||D}),ve},Ve=function(he,Se){var ce=he,ve;if(X($,ce)&&(ve=$[ce],ce="%"+ve[0]+"%"),X(S,ce)){var D=S[ce];if(D===P&&(D=M(ce)),typeof D>"u"&&!Se)throw new i("intrinsic "+he+" exists, but is not available. Please file an issue!");return{alias:ve,name:ce,value:D}}throw new s("intrinsic "+he+" does not exist!")};return yl=function(he,Se){if(typeof he!="string"||he.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Se!="boolean")throw new i('"allowMissing" argument must be a boolean');if(Ie(/^%?[^%]*%?$/,he)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ce=Me(he),ve=ce.length>0?ce[0]:"",D=Ve("%"+ve+"%",Se),Z=D.name,F=D.value,fe=!1,Te=D.alias;Te&&(ve=Te[0],ee(ce,ue([0,1],Te)));for(var A=1,k=!0;A<ce.length;A+=1){var j=ce[A],Y=Oe(j,0,1),ae=Oe(j,-1);if((Y==='"'||Y==="'"||Y==="`"||ae==='"'||ae==="'"||ae==="`")&&Y!==ae)throw new s("property names with quotes must have matching quotes");if((j==="constructor"||!k)&&(fe=!0),ve+="."+j,Z="%"+ve+"%",X(S,Z))F=S[Z];else if(F!=null){if(!(j in F)){if(!Se)throw new i("base intrinsic for "+he+" exists, but the property is not available.");return}if(d&&A+1>=ce.length){var b=d(F,j);k=!!b,k&&"get"in b&&!("originalValue"in b.get)?F=b.get:F=F[j]}else k=X(F,j),F=F[j];k&&!fe&&(S[Z]=F)}}return F},yl}var ml={},tv=!1;function Bl(){if(tv)return ml;tv=!0;var t=Jr(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return ml=e,ml}var hl={},nv=!1;function zo(){if(nv)return hl;nv=!0;var t=Jr(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return hl=e,hl}var vl={},rv=!1;function Hk(){if(rv)return vl;rv=!0;var t=Bl(),e=lv(),n=qo(),r=zo();return vl=function(s,i,a){if(!s||typeof s!="object"&&typeof s!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,d=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,g=!!r&&r(s,i);if(t)t(s,i,{configurable:d===null&&g?g.configurable:!d,enumerable:l===null&&g?g.enumerable:!l,value:a,writable:c===null&&g?g.writable:!c});else if(y||!l&&!c&&!d)s[i]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},vl}var Tl={},iv=!1;function Uk(){if(iv)return Tl;iv=!0;var t=Bl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Tl=e,Tl}var _l={},ov=!1;function jk(){if(ov)return _l;ov=!0;var t=Jr(),e=Hk(),n=Uk()(),r=zo(),o=qo(),s=t("%Math.floor%");return _l=function(a,l){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||s(l)!==l)throw new o("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],d=!0,y=!0;if("length"in a&&r){var g=r(a,"length");g&&!g.configurable&&(d=!1),g&&!g.writable&&(y=!1)}return(d||y||!c)&&(n?e(a,"length",l,!0,!0):e(a,"length",l)),a},_l}var Vr={},av=!1;function Pl(){if(av)return Vr;av=!0;var t=xl(),e=Jr(),n=jk(),r=qo(),o=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),i=e("%Reflect.apply%",!0)||t.call(s,o),a=Bl(),l=e("%Math.max%");Vr=function(y){if(typeof y!="function")throw new r("a function is required");var g=i(t,s,arguments);return n(g,1+l(0,y.length-(arguments.length-1)),!0)};var c=function(){return i(t,o,arguments)};return a?a(Vr,"apply",{value:c}):Vr.apply=c,Vr}var bl={},sv=!1;function El(){if(sv)return bl;sv=!0;var t=Jr(),e=Pl(),n=e(t("String.prototype.indexOf"));return bl=function(o,s){var i=t(o,!!s);return typeof i=="function"&&n(o,".prototype.")>-1?e(i):i},bl}os();ws();var Sl={},uv=!1;function Hl(){if(uv)return Sl;uv=!0;var t=wl();return Sl=function(){return t()&&!!Symbol.toStringTag},Sl}var kl={},cv=!1;function $k(){if(cv)return kl;cv=!0;var t=Hl()(),e=El(),n=e("Object.prototype.toString"),r=function(a){return t&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:n(a)==="[object Arguments]"},o=function(a){return r(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&n(a)!=="[object Array]"&&n(a.callee)==="[object Function]"},s=function(){return r(arguments)}();return r.isLegacyArguments=o,kl=s?r:o,kl}var Il={},fv=!1;function Zk(){if(fv)return Il;fv=!0;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=Hl()(),o=Object.getPrototypeOf,s=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},i;return Il=function(l){if(typeof l!="function")return!1;if(n.test(e.call(l)))return!0;if(!r){var c=t.call(l);return c==="[object GeneratorFunction]"}if(!o)return!1;if(typeof i>"u"){var d=s();i=d?o(d):!1}return o(l)===i},Il}var Al={},dv=!1;function Lk(){if(dv)return Al;dv=!0;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(S){S!==r&&(e=null)}else e=null;var o=/^\s*class\b/,s=function(E){try{var M=t.call(E);return o.test(M)}catch{return!1}},i=function(E){try{return s(E)?!1:(t.call(E),!0)}catch{return!1}},a=Object.prototype.toString,l="[object Object]",c="[object Function]",d="[object GeneratorFunction]",y="[object HTMLAllCollection]",g="[object HTML document.all class]",m="[object HTMLCollection]",v=typeof Symbol=="function"&&!!Symbol.toStringTag,B=!(0 in[,]),P=function(){return!1};if(typeof document=="object"){var T=document.all;a.call(T)===a.call(document.all)&&(P=function(E){if((B||!E)&&(typeof E>"u"||typeof E=="object"))try{var M=a.call(E);return(M===y||M===g||M===m||M===l)&&E("")==null}catch{}return!1})}return Al=e?function(E){if(P(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{e(E,null,n)}catch(M){if(M!==r)return!1}return!s(E)&&i(E)}:function(E){if(P(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(v)return i(E);if(s(E))return!1;var M=a.call(E);return M!==c&&M!==d&&!/^\[object HTML/.test(M)?!1:i(E)},Al}var Cl={},pv=!1;function Fk(){if(pv)return Cl;pv=!0;var t=Lk(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,c,d){for(var y=0,g=l.length;y<g;y++)n.call(l,y)&&(d==null?c(l[y],y,l):c.call(d,l[y],y,l))},o=function(l,c,d){for(var y=0,g=l.length;y<g;y++)d==null?c(l.charAt(y),y,l):c.call(d,l.charAt(y),y,l)},s=function(l,c,d){for(var y in l)n.call(l,y)&&(d==null?c(l[y],y,l):c.call(d,l[y],y,l))},i=function(l,c,d){if(!t(c))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=d),e.call(l)==="[object Array]"?r(l,c,y):typeof l=="string"?o(l,c,y):s(l,c,y)};return Cl=i,Cl}var Rl={},gv=!1;function Kk(){return gv||(gv=!0,Rl=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Rl}var Ol={},yv=!1,Wk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function qk(){if(yv)return Ol;yv=!0;var t=Kk(),e=typeof globalThis>"u"?Wk:globalThis;return Ol=function(){for(var r=[],o=0;o<t.length;o++)typeof e[t[o]]=="function"&&(r[r.length]=t[o]);return r},Ol}var Ml={},mv=!1,zk=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function bv(){if(mv)return Ml;mv=!0;var t=Fk(),e=qk(),n=Pl(),r=El(),o=zo(),s=r("Object.prototype.toString"),i=Hl()(),a=typeof globalThis>"u"?zk:globalThis,l=e(),c=r("String.prototype.slice"),d=Object.getPrototypeOf,y=r("Array.prototype.indexOf",!0)||function(P,T){for(var S=0;S<P.length;S+=1)if(P[S]===T)return S;return-1},g={__proto__:null};i&&o&&d?t(l,function(B){var P=new a[B];if(Symbol.toStringTag in P){var T=d(P),S=o(T,Symbol.toStringTag);if(!S){var E=d(T);S=o(E,Symbol.toStringTag)}g["$"+B]=n(S.get)}}):t(l,function(B){var P=new a[B],T=P.slice||P.set;T&&(g["$"+B]=n(T))});var m=function(P){var T=!1;return t(g,function(S,E){if(!T)try{"$"+S(P)===E&&(T=c(E,1))}catch{}}),T},v=function(P){var T=!1;return t(g,function(S,E){if(!T)try{S(P),T=c(E,1)}catch{}}),T};return Ml=function(P){if(!P||typeof P!="object")return!1;if(!i){var T=c(s(P),8,-1);return y(l,T)>-1?T:T!=="Object"?!1:v(P)}return o?m(P):null},Ml}var Dl={},hv=!1;function Gk(){if(hv)return Dl;hv=!0;var t=bv();return Dl=function(n){return!!t(n)},Dl}var we={},vv=!1;function Vk(){if(vv)return we;vv=!0;var t=$k(),e=Zk(),n=bv(),r=Gk();function o(U){return U.call.bind(U)}var s=typeof BigInt<"u",i=typeof Symbol<"u",a=o(Object.prototype.toString),l=o(Number.prototype.valueOf),c=o(String.prototype.valueOf),d=o(Boolean.prototype.valueOf);if(s)var y=o(BigInt.prototype.valueOf);if(i)var g=o(Symbol.prototype.valueOf);function m(U,Pt){if(typeof U!="object")return!1;try{return Pt(U),!0}catch{return!1}}we.isArgumentsObject=t,we.isGeneratorFunction=e,we.isTypedArray=r;function v(U){return typeof Promise<"u"&&U instanceof Promise||U!==null&&typeof U=="object"&&typeof U.then=="function"&&typeof U.catch=="function"}we.isPromise=v;function B(U){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(U):r(U)||D(U)}we.isArrayBufferView=B;function P(U){return n(U)==="Uint8Array"}we.isUint8Array=P;function T(U){return n(U)==="Uint8ClampedArray"}we.isUint8ClampedArray=T;function S(U){return n(U)==="Uint16Array"}we.isUint16Array=S;function E(U){return n(U)==="Uint32Array"}we.isUint32Array=E;function M(U){return n(U)==="Int8Array"}we.isInt8Array=M;function $(U){return n(U)==="Int16Array"}we.isInt16Array=$;function oe(U){return n(U)==="Int32Array"}we.isInt32Array=oe;function X(U){return n(U)==="Float32Array"}we.isFloat32Array=X;function ue(U){return n(U)==="Float64Array"}we.isFloat64Array=ue;function ee(U){return n(U)==="BigInt64Array"}we.isBigInt64Array=ee;function ie(U){return n(U)==="BigUint64Array"}we.isBigUint64Array=ie;function Oe(U){return a(U)==="[object Map]"}Oe.working=typeof Map<"u"&&Oe(new Map);function Ie(U){return typeof Map>"u"?!1:Oe.working?Oe(U):U instanceof Map}we.isMap=Ie;function $e(U){return a(U)==="[object Set]"}$e.working=typeof Set<"u"&&$e(new Set);function Ne(U){return typeof Set>"u"?!1:$e.working?$e(U):U instanceof Set}we.isSet=Ne;function Me(U){return a(U)==="[object WeakMap]"}Me.working=typeof WeakMap<"u"&&Me(new WeakMap);function Ve(U){return typeof WeakMap>"u"?!1:Me.working?Me(U):U instanceof WeakMap}we.isWeakMap=Ve;function Ae(U){return a(U)==="[object WeakSet]"}Ae.working=typeof WeakSet<"u"&&Ae(new WeakSet);function he(U){return Ae(U)}we.isWeakSet=he;function Se(U){return a(U)==="[object ArrayBuffer]"}Se.working=typeof ArrayBuffer<"u"&&Se(new ArrayBuffer);function ce(U){return typeof ArrayBuffer>"u"?!1:Se.working?Se(U):U instanceof ArrayBuffer}we.isArrayBuffer=ce;function ve(U){return a(U)==="[object DataView]"}ve.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ve(new DataView(new ArrayBuffer(1),0,1));function D(U){return typeof DataView>"u"?!1:ve.working?ve(U):U instanceof DataView}we.isDataView=D;var Z=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function F(U){return a(U)==="[object SharedArrayBuffer]"}function fe(U){return typeof Z>"u"?!1:(typeof F.working>"u"&&(F.working=F(new Z)),F.working?F(U):U instanceof Z)}we.isSharedArrayBuffer=fe;function Te(U){return a(U)==="[object AsyncFunction]"}we.isAsyncFunction=Te;function A(U){return a(U)==="[object Map Iterator]"}we.isMapIterator=A;function k(U){return a(U)==="[object Set Iterator]"}we.isSetIterator=k;function j(U){return a(U)==="[object Generator]"}we.isGeneratorObject=j;function Y(U){return a(U)==="[object WebAssembly.Module]"}we.isWebAssemblyCompiledModule=Y;function ae(U){return m(U,l)}we.isNumberObject=ae;function b(U){return m(U,c)}we.isStringObject=b;function w(U){return m(U,d)}we.isBooleanObject=w;function W(U){return s&&m(U,y)}we.isBigIntObject=W;function Q(U){return i&&m(U,g)}we.isSymbolObject=Q;function He(U){return ae(U)||b(U)||w(U)||W(U)||Q(U)}we.isBoxedPrimitive=He;function _e(U){return typeof Uint8Array<"u"&&(ce(U)||fe(U))}return we.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(U){Object.defineProperty(we,U,{enumerable:!1,value:function(){throw new Error(U+" is not supported in userland")}})}),we}var Nl={},Tv=!1;function Jk(){return Tv||(Tv=!0,Nl=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Nl}var xe={},_v=!1,Yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function Yk(){if(_v)return xe;_v=!0;var t=St,e=Object.getOwnPropertyDescriptors||function(Z){for(var F=Object.keys(Z),fe={},Te=0;Te<F.length;Te++)fe[F[Te]]=Object.getOwnPropertyDescriptor(Z,F[Te]);return fe},n=/%[sdj%]/g;xe.format=function(D){if(!$(D)){for(var Z=[],F=0;F<arguments.length;F++)Z.push(i(arguments[F]));return Z.join(" ")}for(var F=1,fe=arguments,Te=fe.length,A=String(D).replace(n,function(j){if(j==="%%")return"%";if(F>=Te)return j;switch(j){case"%s":return String(fe[F++]);case"%d":return Number(fe[F++]);case"%j":try{return JSON.stringify(fe[F++])}catch{return"[Circular]"}default:return j}}),k=fe[F];F<Te;k=fe[++F])S(k)||!ee(k)?A+=" "+k:A+=" "+i(k);return A},xe.deprecate=function(D,Z){if(typeof t<"u"&&t.noDeprecation===!0)return D;if(typeof t>"u")return function(){return xe.deprecate(D,Z).apply(this||Yr,arguments)};var F=!1;function fe(){if(!F){if(t.throwDeprecation)throw new Error(Z);t.traceDeprecation?console.trace(Z):console.error(Z),F=!0}return D.apply(this||Yr,arguments)}return fe};var r={},o=/^$/;if(t.env.NODE_DEBUG){var s=t.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+s+"$","i")}xe.debuglog=function(D){if(D=D.toUpperCase(),!r[D])if(o.test(D)){var Z=t.pid;r[D]=function(){var F=xe.format.apply(xe,arguments);console.error("%s %d: %s",D,Z,F)}}else r[D]=function(){};return r[D]};function i(D,Z){var F={seen:[],stylize:l};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),T(Z)?F.showHidden=Z:Z&&xe._extend(F,Z),X(F.showHidden)&&(F.showHidden=!1),X(F.depth)&&(F.depth=2),X(F.colors)&&(F.colors=!1),X(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=a),d(F,D,F.depth)}xe.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(D,Z){var F=i.styles[Z];return F?"\x1B["+i.colors[F][0]+"m"+D+"\x1B["+i.colors[F][1]+"m":D}function l(D,Z){return D}function c(D){var Z={};return D.forEach(function(F,fe){Z[F]=!0}),Z}function d(D,Z,F){if(D.customInspect&&Z&&Ie(Z.inspect)&&Z.inspect!==xe.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var fe=Z.inspect(F,D);return $(fe)||(fe=d(D,fe,F)),fe}var Te=y(D,Z);if(Te)return Te;var A=Object.keys(Z),k=c(A);if(D.showHidden&&(A=Object.getOwnPropertyNames(Z)),Oe(Z)&&(A.indexOf("message")>=0||A.indexOf("description")>=0))return g(Z);if(A.length===0){if(Ie(Z)){var j=Z.name?": "+Z.name:"";return D.stylize("[Function"+j+"]","special")}if(ue(Z))return D.stylize(RegExp.prototype.toString.call(Z),"regexp");if(ie(Z))return D.stylize(Date.prototype.toString.call(Z),"date");if(Oe(Z))return g(Z)}var Y="",ae=!1,b=["{","}"];if(P(Z)&&(ae=!0,b=["[","]"]),Ie(Z)){var w=Z.name?": "+Z.name:"";Y=" [Function"+w+"]"}if(ue(Z)&&(Y=" "+RegExp.prototype.toString.call(Z)),ie(Z)&&(Y=" "+Date.prototype.toUTCString.call(Z)),Oe(Z)&&(Y=" "+g(Z)),A.length===0&&(!ae||Z.length==0))return b[0]+Y+b[1];if(F<0)return ue(Z)?D.stylize(RegExp.prototype.toString.call(Z),"regexp"):D.stylize("[Object]","special");D.seen.push(Z);var W;return ae?W=m(D,Z,F,k,A):W=A.map(function(Q){return v(D,Z,F,k,Q,ae)}),D.seen.pop(),B(W,Y,b)}function y(D,Z){if(X(Z))return D.stylize("undefined","undefined");if($(Z)){var F="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return D.stylize(F,"string")}if(M(Z))return D.stylize(""+Z,"number");if(T(Z))return D.stylize(""+Z,"boolean");if(S(Z))return D.stylize("null","null")}function g(D){return"["+Error.prototype.toString.call(D)+"]"}function m(D,Z,F,fe,Te){for(var A=[],k=0,j=Z.length;k<j;++k)he(Z,String(k))?A.push(v(D,Z,F,fe,String(k),!0)):A.push("");return Te.forEach(function(Y){Y.match(/^\d+$/)||A.push(v(D,Z,F,fe,Y,!0))}),A}function v(D,Z,F,fe,Te,A){var k,j,Y;if(Y=Object.getOwnPropertyDescriptor(Z,Te)||{value:Z[Te]},Y.get?Y.set?j=D.stylize("[Getter/Setter]","special"):j=D.stylize("[Getter]","special"):Y.set&&(j=D.stylize("[Setter]","special")),he(fe,Te)||(k="["+Te+"]"),j||(D.seen.indexOf(Y.value)<0?(S(F)?j=d(D,Y.value,null):j=d(D,Y.value,F-1),j.indexOf(`
80
- `)>-1&&(A?j=j.split(`
81
- `).map(function(ae){return" "+ae}).join(`
82
- `).slice(2):j=`
83
- `+j.split(`
84
- `).map(function(ae){return" "+ae}).join(`
85
- `))):j=D.stylize("[Circular]","special")),X(k)){if(A&&Te.match(/^\d+$/))return j;k=JSON.stringify(""+Te),k.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(k=k.slice(1,-1),k=D.stylize(k,"name")):(k=k.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),k=D.stylize(k,"string"))}return k+": "+j}function B(D,Z,F){var fe=D.reduce(function(Te,A){return A.indexOf(`
86
- `)>=0,Te+A.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?F[0]+(Z===""?"":Z+`
76
+ `,a+=`}
77
+ `,a+=`}
78
+ `),a+=`}
79
+ `,a+="})"}let s=n?a?n+a:r?r==="z.never()"?n+".strict()":n+`.catchall(${r})`:n:a||(r?`z.record(${r})`:"z.record(z.any())");return Xe.an.anyOf(t)&&(s+=`.and(${Fg(N(b({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(b({},i),{type:"object"}):i)}),e)})`),Xe.a.oneOf(t)&&(s+=`.and(${es(N(b({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(b({},i),{type:"object"}):i)}),e)})`),Xe.an.allOf(t)&&(s+=`.and(${Fr(N(b({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?N(b({},i),{type:"object"}):i)}),e)})`),s}d(Wg,"parseObject");var WP=d(t=>{var e;let n="z.string()";if((e=t[le])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";n="z.coerce.string()"}return n+=ut(t,"format",({value:r})=>{switch(r){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(",")"]}}),n+=ut(t,"pattern",({json:r})=>[`.regex(new RegExp(${r})`,", ",")"]),n+=ut(t,"minLength",({json:r})=>[`.min(${r}`,", ",")"]),n+=ut(t,"maxLength",({json:r})=>[`.max(${r}`,", ",")"]),n},"parseString"),zP=d((t,e)=>`${it(UP(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),qP=d(t=>`z.ref('${t.$ref}')`,"parseRef"),GP=d((t,e)=>{var n,r;if(t.oneOf.length<=1||!((n=t.discriminator)!=null&&n.propertyName))return es(t,e);let a=t.oneOf.map((s,i)=>it(s,N(b({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(r=t.discriminator)==null?void 0:r.propertyName}", [${a.join(", ")}])`},"parseDiscriminator"),it=d((t,e={seen:new Map,path:[]},n)=>{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 r=e.seen.get(t);if(r){if(r.r!==void 0)return r.r;if(e.depth===void 0||r.n>=e.depth)return"z.any()";r.n+=1}else r={r:void 0,n:0},e.seen.set(t,r);let a=XP(t,e);return n||(a=VP(t,a),e.withoutDefaults||(a=JP(t,a))),r.r=a,a},"parseSchema"),VP=d((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),JP=d((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),XP=d((t,e)=>Xe.a.nullable(t)?zP(t,e):Xe.an.object(t)?Wg(t,e):Xe.an.array(t)?ZP(t,e):Xe.an.anyOf(t)?Fg(t,e):Xe.an.allOf(t)?Fr(t,e):Xe.a.discriminator(t)?GP(t,e):Xe.a.oneOf(t)?es(t,e):Xe.a.not(t)?NP(t,e):Xe.an.enum(t)?KP(t):Xe.a.const(t)?jP(t):Xe.a.multipleType(t)?MP(t,e):Xe.a.primitive(t,"string")?WP(t):Xe.a.primitive(t,"number")||Xe.a.primitive(t,"integer")?FP(t):Xe.a.primitive(t,"boolean")?OP(t):Xe.a.primitive(t,"null")?DP(t):Xe.a.conditional(t)?LP(t,e):Xe.a.ref(t)?qP(t):RP(t),"selectParser"),Xe={an:{object:d(t=>t.type==="object","object"),array:d(t=>t.type==="array","array"),anyOf:d(t=>t.anyOf!==void 0,"anyOf"),allOf:d(t=>t.allOf!==void 0,"allOf"),enum:d(t=>t.enum!==void 0,"enum")},a:{nullable:d(t=>t.nullable===!0,"nullable"),multipleType:d(t=>Array.isArray(t.type),"multipleType"),not:d(t=>t.not!==void 0,"not"),const:d(t=>t.const!==void 0,"const"),primitive:d((t,e)=>t.type===e,"primitive"),conditional:d(t=>Boolean("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:d(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:d(t=>t.oneOf!==void 0,"oneOf"),ref:d(t=>t.$ref!==void 0,"ref")}},YP=d(t=>{let e;try{e=new Function("z",`return ${t}`)(C)}catch(n){return{sucess:!1,error:`Failed to evaluate schema: ${(n instanceof Error?n:new Error(String(n))).message}`}}return e instanceof C.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),QP=d(t=>it(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),eB=d(t=>{let e=QP(t);e=e.replaceAll("errors: z.ZodError[]","errors");let n=YP(e);if(!n.sucess)throw new aa(n.error);return n.value},"jsonSchemaToZod"),Rr=d((t,e)=>{var n,r;if(e[le]&&t._def&&(t._def[le]=e[le]),((n=t._def)==null?void 0:n.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]&&Rr(i[a],s)}),((r=t._def)==null?void 0:r.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&Rr(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&&Rr(s,a)}else Array.isArray(a)&&a.forEach((s,i)=>{let o=t._def;o.typeName===ne.ZodFirstPartyTypeKind.ZodTuple&&Rr(o.items[i],s)})}},"applyZuiPropsRecursively"),tB=d(t=>{let e=eB(t);return Rr(e,t),e},"fromJSONSchemaLegacy"),nB=d(t=>{var e,n;return t.anyOf!==void 0&&t.anyOf.length===2&&t.anyOf.some(r=>typeof r!="boolean"&&zg(r))&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===C.ZodFirstPartyTypeKind.ZodOptional},"isOptionalSchema"),rB=d(t=>{var e,n;return t.anyOf!==void 0&&t.anyOf.length===2&&t.anyOf.some(r=>typeof r!="boolean"&&r.type==="null")&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===C.ZodFirstPartyTypeKind.ZodNullable},"isNullableSchema"),zg=d(t=>{var e,n;return t.not===!0&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===C.ZodFirstPartyTypeKind.ZodUndefined},"isUndefinedSchema"),iB=d(t=>{var e,n;return!t.not&&((n=(e=t["x-zui"])==null?void 0:e.def)==null?void 0:n.typeName)===C.ZodFirstPartyTypeKind.ZodUnknown},"isUnknownSchema"),aB=d(({type:t,minimum:e,exclusiveMinimum:n,maximum:r,exclusiveMaximum:a,multipleOf:s,format:i})=>{let o=C.number();return t==="integer"&&(o=o.int()),i==="finite"&&(o=o.finite()),n!==void 0?o=o.gt(n):e!==void 0&&(o=o.gte(e)),a!==void 0?o=o.lt(a):r!==void 0&&(o=o.lte(r)),s!==void 0&&(o=o.multipleOf(s)),o},"numberJSONSchemaToZuiNumber"),oB=d(({format:t,pattern:e,minLength:n,maxLength:r})=>{let a=C.string();if(n&&r&&n===r?a=a.length(n):(n&&(a=a.min(n)),r&&(a=a.max(r))),t==="cuid"||e===Ye.cuid)a=a.cuid();else if(t==="cuid2"||e===Ye.cuid2)a=a.cuid2();else if(t==="emoji"||e===Ye.emoji)a=a.emoji();else if(t==="ulid"||e===Ye.ulid)a=a.ulid();else if(t==="date-time"){let{precision:s,offset:i}=e?Tx(e):{};a=a.datetime({precision:s,offset:i})}else t==="email"||e===Ye.email?a=a.email():t==="ipv4"||e===Ye.ipv4?a=a.ip():t==="ipv6"||e===Ye.ipv6?a=a.ip("v6"):t==="uri"?a=a.url():t==="uuid"||e===Ye.uuid?a=a.uuid():e&&(a=a.regex(new RegExp(e)));return a},"stringJSONSchemaToZuiString"),br=d((t,e)=>{let n=[];e.enum!==void 0&&n.push(...e.enum),e.const!==void 0&&n.push(e.const);let r=n.filter(i=>typeof i===t),[a]=r;if(!a){if(t==="string"&&e.type==="string")return oB(e);if(t==="number"&&(e.type==="number"||e.type==="integer"))return aB(e);if(t==="boolean")return C.boolean();if(t==="null")return C.null();throw new aa(`Unknown primitive type: "${t}"`)}if(r.length===1)return C.literal(a);let s=r.map(i=>C.literal(i));return C.union(s)},"toZuiPrimitive"),sB=d((t,e)=>lB(t)?cB(t,e):uB(t)?fB(t,e):dB(t,e),"arrayJSONSchemaToZuiArray"),lB=d(t=>Array.isArray(t.items),"_isTuple"),uB=d(t=>t.items!==void 0&&t.uniqueItems,"_isSet"),cB=d(({items:t,additionalItems:e},n)=>{let r=t.map(n),a=C.tuple(r);return e!==void 0&&(a=a.rest(n(e))),a},"_handleTuple"),fB=d(({items:t,minItems:e,maxItems:n},r)=>{let a=C.set(r(t));return e&&(a=a.min(e)),n&&(a=a.max(n)),a},"_handleSet"),dB=d(({minItems:t,maxItems:e,items:n},r)=>{let a=C.array(r(n));return t&&t===e?a.length(t):(t&&(a=a.min(t)),e&&(a=a.max(e)),a)},"_handleArray"),Wn=C.any();function qg(t){return rt(t)}d(qg,"fromJSONSchema");function rt(t){var e;if(t===void 0)return Wn;if(t===!0)return C.any();if(t===!1)return C.never();if(t.default!==void 0)return rt(N(b({},t),{default:void 0})).default(t.default);if(t.readOnly)return rt(N(b({},t),{readOnly:void 0})).readonly();if(t.oneOf!==void 0)throw new nn({oneOf:t.oneOf});if(t.patternProperties!==void 0)throw new nn({patternProperties:t.patternProperties});if(t.propertyNames!==void 0)throw new nn({propertyNames:t.propertyNames});if(t.if!==void 0)throw new nn({if:t.if});if(t.then!==void 0)throw new nn({then:t.then});if(t.else!==void 0)throw new nn({else:t.else});if(t.$ref!==void 0)return C.ref(t.$ref);if(t.not!==void 0){if(zg(t))return C.undefined();if(t.not===!0)return C.never();throw new nn({not:t.not})}if(Array.isArray(t.type)){if(t.type.length===0)return Wn;if(t.type.length===1)return rt(N(b({},t),{type:t.type[0]}));let n=t,{type:r}=n,a=Xc(n,["type"]),s=t.type.map(i=>rt(N(b({},a),{type:i})));return C.union(s)}if(t.type==="string")return t.enum&&t.enum.length>0?C.enum(t.enum):br("string",t);if(t.type==="integer"){let n=br("number",t);return n instanceof C.ZodNumber?n.int():n}if(t.type==="number")return br("number",t);if(t.type==="boolean")return br("boolean",t);if(t.type==="null")return br("null",t);if(t.type==="array")return sB(t,rt);if(t.type==="object"){if(t.additionalProperties!==void 0&&t.properties!==void 0){let n=rt(t.additionalProperties);return rt(N(b({},t),{additionalProperties:void 0})).catchall(n)}if(t.properties!==void 0){let n={};for(let[r,a]of Object.entries(t.properties)){let s=rt(a),i=(e=t.required)!=null?e:[];n[r]=i.includes(r)?s:s.optional()}return C.object(n)}if(t.additionalProperties!==void 0){let n=rt(t.additionalProperties);return C.record(n)}return C.record(Wn)}if(t.anyOf!==void 0){if(t.anyOf.length===0)return Wn;if(t.anyOf.length===1)return rt(t.anyOf[0]);if(nB(t))return rt(t.anyOf[0]).optional();if(rB(t))return rt(t.anyOf[0]).nullable();let n=t.anyOf.map(rt);return C.union(n)}if(t.allOf!==void 0){if(t.allOf.length===0)return Wn;if(t.allOf.length===1)return rt(t.allOf[0]);let[n,...r]=t.allOf,a=rt(n),s=rt({allOf:r});return C.intersection(a,s)}return iB(t)?C.unknown():Wn}d(rt,"_fromJSONSchema");var pB=/^\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))?$/,wo=d((t,e,n=!0)=>{if(typeof t!="object")throw new uo("Input must be an object");let r=d(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,l])=>{if(l===null)i[o]=r(ne.null());else switch(typeof l){case"string":i[o]=pB.test(l)?r(ne.string().datetime()):r(ne.string());break;case"number":i[o]=r(ne.number());break;case"boolean":i[o]=r(ne.boolean());break;case"object":Array.isArray(l)?l.length===0?i[o]=r(ne.array(ne.unknown())):typeof l[0]=="object"?i[o]=r(ne.array(wo(l[0],e,!1))):["string","number","boolean"].includes(typeof l[0])&&(i[o]=r(ne.array(ne[typeof l[0]]()))):i[o]=r(wo(l,e,!1));break;default:throw new uo(`Unsupported type for key ${o}`)}return i},{}),s=Object.keys(a).length>0;return e?.passtrough||!n&&!s?ne.object(a).passthrough():ne.object(a)},"fromObject");function Gg(){return{}}d(Gg,"parseAnyDef");function Vg(t,e){var n,r;let a={type:"array"};return((r=(n=t.type)==null?void 0:n._def)==null?void 0:r.typeName)!=="ZodAny"&&(a.items=Ie(t.type._def,N(b({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&Re(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Re(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Re(a,"minItems",t.exactLength.value,t.exactLength.message,e),Re(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}d(Vg,"parseArrayDef");function Jg(t,e){let n=b({type:"integer",format:"int64"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"?r.inclusive?Re(n,"minimum",r.value,r.message,e):Re(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Re(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Re(n,"maximum",r.value,r.message,e):Re(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Re(n,"maximum",r.value,r.message,e));break;case"multipleOf":Re(n,"multipleOf",r.value,r.message,e);break}return n}d(Jg,"parseBigintDef");function Xg(t){return b({type:"boolean"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{})}d(Xg,"parseBooleanDef");function Yg(t,e){return Ie(t.type._def,e)}d(Yg,"parseBrandedDef");var gB=d((t,e)=>Ie(t.innerType._def,e),"parseCatchDef");function Qg(t,e){return e.dateStrategy=="integer"?yB(t,e):b({type:"string",format:"date-time"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{})}d(Qg,"parseDateDef");var yB=d((t,e)=>{let n=b({type:"integer",format:"unix-time"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});for(let r of t.checks)switch(r.kind){case"min":e.target==="jsonSchema7"&&Re(n,"minimum",r.value,r.message,e);break;case"max":e.target==="jsonSchema7"&&Re(n,"maximum",r.value,r.message,e);break}return n},"integerDateParser");function ey(t,e){return N(b({},Ie(t.innerType._def,e)),{default:t.defaultValue()})}d(ey,"parseDefaultDef");function ty(t,e){return e.effectStrategy==="input"?Ie(t.schema._def,e):{}}d(ty,"parseEffectsDef");function ny(t){return{type:"string",enum:t.values}}d(ny,"parseEnumDef");var mB=d(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function ry(t,e){let n=[Ie(t.left._def,N(b({},e),{currentPath:[...e.currentPath,"allOf","0"]})),Ie(t.right._def,N(b({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(s=>!!s),r=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return n.forEach(s=>{if(mB(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(r=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let o=s,{additionalProperties:l}=o;i=Xc(o,["additionalProperties"])}else r=void 0;a.push(i)}}),a.length?b({allOf:a},r):void 0}d(ry,"parseIntersectionDef");function iy(t,e){let n=typeof t.value;return n!=="bigint"&&n!=="number"&&n!=="boolean"&&n!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:n==="bigint"?"integer":n,enum:[t.value]}:{type:n==="bigint"?"integer":n,const:t.value}}d(iy,"parseLiteralDef");function ts(t,e){var n,r,a,s,i;if(e.target==="openApi3"&&((n=t.keyType)==null?void 0:n._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((l,f)=>{var p;return N(b({},l),{[f]:(p=Ie(t.valueType._def,N(b({},e),{currentPath:[...e.currentPath,"properties",f]})))!=null?p:{}})},{}),additionalProperties:!1};let o={type:"object",additionalProperties:(r=Ie(t.valueType._def,N(b({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:{}};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 l=Object.entries(Uo(t.keyType._def,e)).reduce((f,[p,y])=>p==="type"?f:N(b({},f),{[p]:y}),{});return N(b({},o),{propertyNames:l})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return N(b({},o),{propertyNames:{enum:t.keyType._def.values}});return o}d(ts,"parseRecordDef");function ay(t,e){if(e.mapStrategy==="record")return ts(t,e);let n=Ie(t.keyType._def,N(b({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},r=Ie(t.valueType._def,N(b({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}d(ay,"parseMapDef");function oy(t){let e=t.values,r=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),a=Array.from(new Set(r.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:r.filter(s=>typeof s=="string"||typeof s=="number")}}d(oy,"parseNativeEnumDef");function sy(){return{not:{}}}d(sy,"parseNeverDef");function ly(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}d(ly,"parseNullDef");var ra={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function uy(t,e){if(e.target==="openApi3")return qc(t,e);let n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in ra&&(!r._def.checks||!r._def.checks.length))){let r=n.reduce((a,s)=>{let i=ra[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=n.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(r.length===n.length){let a=r.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:n.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,a)=>[...r,...a._def.values.filter(s=>!r.includes(s))],[])};return qc(t,e)}d(uy,"parseUnionDef");var qc=d((t,e)=>{let n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,s)=>Ie(a._def,N(b({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${s}`]}))).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0)),r=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(n.length)return e.unionStrategy==="anyOf"?b({anyOf:n},r):b({oneOf:n},r)},"asUnionOf");function cy(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length)){let r=t.innerType;if(e.target==="openApi3"){let s={type:ra[r._def.typeName],nullable:!0};return xo(r._def,e,s)}let a={type:[ra[r._def.typeName],"null"]};return xo(r._def,e,a)}if(e.target==="openApi3"){let r=Ie(t.innerType._def,N(b({},e),{currentPath:[...e.currentPath]}));return r&&N(b({},r),{nullable:!0})}let n=Ie(t.innerType._def,N(b({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return n&&{anyOf:[n,{type:"null"}]}}d(cy,"parseNullableDef");function fy(t,e){let n=b({type:"number"},t.coerce?{[le]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return n;for(let r of t.checks)switch(r.kind){case"int":n.type="integer",Ho(n,"type",r.message,e);break;case"min":e.target==="jsonSchema7"?r.inclusive?Re(n,"minimum",r.value,r.message,e):Re(n,"exclusiveMinimum",r.value,r.message,e):(r.inclusive||(n.exclusiveMinimum=!0),Re(n,"minimum",r.value,r.message,e));break;case"max":e.target==="jsonSchema7"?r.inclusive?Re(n,"maximum",r.value,r.message,e):Re(n,"exclusiveMaximum",r.value,r.message,e):(r.inclusive||(n.exclusiveMaximum=!0),Re(n,"maximum",r.value,r.message,e));break;case"multipleOf":Re(n,"multipleOf",r.value,r.message,e);break}return n}d(fy,"parseNumberDef");var hB=d((t,e)=>{var n;return t.unknownKeys instanceof he?(n=Ie(t.unknownKeys._def,N(b({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:!0:t.unknownKeys==="passthrough"},"getAdditionalProperties");function dy(t,e){let n=N(b({type:"object"},Object.entries(t.shape()).reduce((r,[a,s])=>{if(s===void 0||s._def===void 0)return r;let i=Ie(s._def,N(b({},e),{currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]}));return i===void 0?r:{properties:N(b({},r.properties),{[a]:i}),required:s.isOptional()?r.required:[...r.required,a]}},{properties:{},required:[]})),{additionalProperties:hB(t,e)});return n.required.length||delete n.required,n}d(dy,"parseObjectDef");var vB=d((t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ie(t.innerType._def,e);let r=Ie(t.innerType._def,N(b({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return r?{anyOf:[{not:{}},r]}:{}},"parseOptionalDef"),TB=d((t,e)=>{if(e.pipeStrategy==="input")return Ie(t.in._def,e);if(e.pipeStrategy==="output")return Ie(t.out._def,e);let n=Ie(t.in._def,N(b({},e),{currentPath:[...e.currentPath,"allOf","0"]})),r=Ie(t.out._def,N(b({},e),{currentPath:[...e.currentPath,"allOf",n?"1":"0"]}));return{allOf:[n,r].filter(a=>a!==void 0)}},"parsePipelineDef");function py(t,e){return Ie(t.type._def,e)}d(py,"parsePromiseDef");function gy(t,e){let r={type:"array",uniqueItems:!0,items:Ie(t.valueType._def,N(b({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&Re(r,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Re(r,"maxItems",t.maxSize.value,t.maxSize.message,e),r}d(gy,"parseSetDef");function yy(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,N(b({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ie(t.rest._def,N(b({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ie(n._def,N(b({},e),{currentPath:[...e.currentPath,"items",`${r}`]}))).reduce((n,r)=>r===void 0?n:[...n,r],[])}}d(yy,"parseTupleDef");function my(){return{not:{}}}d(my,"parseUndefinedDef");function hy(){return{}}d(hy,"parseUnknownDef");var _B=d((t,e)=>Ie(t.innerType._def,e),"parseReadonlyDef");function vy(t){return{$ref:t.uri}}d(vy,"parseRefDef");function Ie(t,e,n=!1){let r=e.seen.get(t);if(r&&!n){let i=bB(r,e);if(i!==void 0)return i}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let s=xB(t,t.typeName,e);return s&&xo(t,e,s),a.jsonSchema=s,s}d(Ie,"parseDef");var bB=d((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:wB(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),wB=d((t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")},"getRelativePath"),xB=d((t,e,n)=>{switch(e){case"ZodString":return Uo(t,n);case"ZodNumber":return fy(t,n);case"ZodObject":return dy(t,n);case"ZodBigInt":return Jg(t,n);case"ZodBoolean":return Xg(t);case"ZodDate":return Qg(t,n);case"ZodUndefined":return my();case"ZodNull":return ly(n);case"ZodArray":return Vg(t,n);case"ZodUnion":case"ZodDiscriminatedUnion":return uy(t,n);case"ZodIntersection":return ry(t,n);case"ZodTuple":return yy(t,n);case"ZodRecord":return ts(t,n);case"ZodRef":return vy(t);case"ZodLiteral":return iy(t,n);case"ZodEnum":return ny(t);case"ZodNativeEnum":return oy(t);case"ZodNullable":return cy(t,n);case"ZodOptional":return vB(t,n);case"ZodMap":return ay(t,n);case"ZodSet":return gy(t,n);case"ZodLazy":return Ie(t.getter()._def,n);case"ZodPromise":return py(t,n);case"ZodNaN":case"ZodNever":return sy();case"ZodEffects":return ty(t,n);case"ZodAny":return Gg();case"ZodUnknown":return hy();case"ZodDefault":return ey(t,n);case"ZodBranded":return Yg(t,n);case"ZodReadonly":return _B(t,n);case"ZodCatch":return gB(t,n);case"ZodPipeline":return TB(t,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})(e)}},"selectParser"),xo=d((t,e,n)=>(t.description&&(n.description=t.description,e.markdownDescription&&(n.markdownDescription=t.description)),Object.assign(n,{[le]:b(b({},t[le]),n[le])}),n),"addMeta"),Gc={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"},PB=d(t=>typeof t=="string"?N(b({},Gc),{name:t}):b(b({},Gc),t),"getDefaultOptions"),BB=d(t=>{let e=PB(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return N(b({},e),{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,a])=>[a._def,{def:a._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))})},"getRefs"),EB=d((t,e)=>{var n;let r=BB(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[f,p])=>{var y;return N(b({},l),{[f]:(y=Ie(p._def,N(b({},r),{currentPath:[...r.basePath,r.definitionPath,f]}),!0))!=null?y:{}})},{}):void 0,s=typeof e=="string"?e:e?.name,i=(n=Ie(t._def,s===void 0?r:N(b({},r),{currentPath:[...r.basePath,r.definitionPath,s]}),!1))!=null?n:{},o=s===void 0?a?N(b({},i),{[r.definitionPath]:a}):i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:N(b({},a),{[s]:i})};return r.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o},"zodToJsonSchema"),SB=d((t,e={target:"openApi3"})=>{let n=EB(t,e);return e.$schemaUrl===!1?delete n.$schema:typeof e.$schemaUrl=="string"&&(n.$schema=e.$schemaUrl),n},"toJSONSchemaLegacy");var qr=(t,e)=>{let n=t._def,r=e._def;if(n.typeName===ne.ZodFirstPartyTypeKind.ZodObject&&r.typeName===ne.ZodFirstPartyTypeKind.ZodObject){let a=n.shape(),s=r.shape();return ne.object({...a,...s})}if(n.typeName===ne.ZodFirstPartyTypeKind.ZodRecord&&r.typeName===ne.ZodFirstPartyTypeKind.ZodRecord)return ne.record(ne.intersection(n.valueType,r.valueType));throw new Error("Cannot merge object schemas with record schemas")},Ty=ne;var yt=ne.string().min(1),by=ne.object({text:yt}),wy=ne.object({markdown:yt}),xy=ne.object({imageUrl:yt}),Py=ne.object({audioUrl:yt}),By=ne.object({videoUrl:yt}),Ey=ne.object({fileUrl:yt,title:yt.optional()}),Sy=ne.object({latitude:ne.number(),longitude:ne.number(),address:ne.string().optional(),title:ne.string().optional()}),ky=ne.object({title:yt,subtitle:yt.optional(),imageUrl:yt.optional(),actions:ne.array(ne.object({action:ne.enum(["postback","url","say"]),label:yt,value:yt}))}),_y=ne.object({text:yt,options:ne.array(ne.object({label:yt,value:yt}))}),kB=ne.object({items:ne.array(ky)}),IB=ne.union([ne.object({type:ne.literal("text"),payload:by}),ne.object({type:ne.literal("markdown"),payload:wy}),ne.object({type:ne.literal("image"),payload:xy}),ne.object({type:ne.literal("audio"),payload:Py}),ne.object({type:ne.literal("video"),payload:By}),ne.object({type:ne.literal("file"),payload:Ey}),ne.object({type:ne.literal("location"),payload:Sy})]),AB=ne.object({items:ne.array(IB)}),CB={schema:wy},OB={text:{schema:by},image:{schema:xy},audio:{schema:Py},video:{schema:By},file:{schema:Ey},location:{schema:Sy},carousel:{schema:kB},card:{schema:ky},dropdown:{schema:_y},choice:{schema:_y},bloc:{schema:AB}};O();M();R();var _a="x-bot-id",Ay="x-bot-user-id",Cy="x-integration-id",Oy="x-webhook-id",Ry="x-bp-configuration-type",ba="x-bp-configuration",wa="x-bp-operation",My="x-bp-type",GA={HIDDEN_IN_STUDIO:{bpActionHiddenInStudio:"true"},AWAIT_RETURN:{bpActionAwaitReturn:"true"}};O();M();R();import{isNode as Rk}from"browser-or-node";O();M();R();var ns=console;function Ct(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function Fa(t,e=8072,n=Hk){if(!Rk)throw new Error("This function can only be called in Node.js");let a=(Oh(),Uv(Ch)).createServer(async(s,i)=>{try{let o=await Mk(s);if(o.path==="/health"){i.writeHead(200).end("ok");return}let l=await t(o);i.writeHead(l?.status??200,l?.headers??{}).end(l?.body??"{}")}catch(o){ns.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,()=>n(e)),a}async function Mk(t){let e=await Dk(t),n={};for(let a=0;a<t.rawHeaders.length;a+=2){let s=t.rawHeaders[a].toLowerCase(),i=t.rawHeaders[a+1];n[s]=i}let r=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:r.pathname,query:Nk(r.search,"?"),headers:n,method:t.method?.toUpperCase()??"GET"}}function Nk(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function Dk(t){return new Promise((e,n)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let r="";t.on("data",a=>r+=a.toString()),t.on("error",a=>n(a)),t.on("end",()=>e(r))})}function Hk(t){ns.info(`Listening on port ${t}`)}import{isApiError as DH,RuntimeError as HH}from"@botpress/client";O();M();R();O();M();R();O();M();R();O();M();R();var Le={};Ln(Le,{mapKeys:()=>Zk,mapValues:()=>$k,mergeRecords:()=>Kk,pairs:()=>Wa,stripUndefinedProps:()=>jk,values:()=>Uk});O();M();R();var Wa=t=>Object.entries(t),Uk=t=>Object.values(t),$k=(t,e)=>Object.fromEntries(Wa(t).map(([n,r])=>[n,e(r,n)])),Zk=(t,e)=>Object.fromEntries(Wa(t).map(([n,r])=>[e(n),r])),jk=t=>Object.fromEntries(Wa(t).filter(([,e])=>e!==void 0)),Kk=(t,e,n)=>{let r=[...Object.keys(t),...Object.keys(e)],a=[...new Set(r)],s={};for(let i of a){let o=t[i],l=e[i];o&&l?s[i]=n(o,l):o?s[i]=o:l&&(s[i]=l)}return s};var ye={};Ln(ye,{safePush:()=>Lk,unique:()=>Fk});O();M();R();var Lk=(t,...e)=>t?[...t,...e]:[...e],Fk=t=>Array.from(new Set(t));O();M();R();var Qt={};Ln(Qt,{setName:()=>Wk});O();M();R();var Wk=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Rh=t=>{let{name:e,version:n}=t,r={actions:{},events:{},channels:{}},a={name:e,version:n,entities:Le.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},s=Le.mapValues(t.entities,i=>i.schema);for(let[i,o]of Object.entries(t.definition.actions??{})){let l=o.input.schema.dereference(s),f=o.output.schema.dereference(s),p=t.actions?.[i]?.name??i;r.actions[p]={...o,...t.actions?.[i]??{},input:{schema:l},output:{schema:f}},a.actions[i]={name:p}}for(let[i,o]of Object.entries(t.definition.events??{})){let l=o.schema.dereference(s),f=t.events?.[i]?.name??i;r.events[f]={...o,...t.events?.[i]??{},schema:l},a.events[i]={name:f}}for(let[i,o]of Object.entries(t.definition.channels??{})){let l={};for(let[p,y]of Object.entries(o.messages)){let g=y.schema.dereference(s);l[p]={...y,schema:g}}let f=t.channels?.[i]?.name??i;r.channels[f]={...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:l},a.channels[i]={name:f}}return{resolved:r,statement:a}};O();M();R();var za=Symbol("schemaName"),Mh=t=>t?Le.mapValues(t,(n,r)=>({...n,[za]:r})):{},Nh=t=>za in t&&t[za]!==void 0,Dh=t=>t[za];O();M();R();var Qs=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,this.attributes=e.attributes}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;attributes;extend(e,n){let{entities:r,actions:a,events:s,channels:i}=this._callBuilder(e,n),o=this;o.interfaces??={};let l=Object.values(r).map(g=>g.name),f=l.length===0?e.name:`${e.name}<${l.join(",")}>`,{resolved:p,statement:y}=Rh({...e,entities:r,actions:Le.stripUndefinedProps(a),events:Le.stripUndefinedProps(s),channels:Le.stripUndefinedProps(i)});return o.actions=Le.mergeRecords(o.actions??{},p.actions,this._mergeActions),o.channels=Le.mergeRecords(o.channels??{},p.channels,this._mergeChannels),o.events=Le.mergeRecords(o.events??{},p.events,this._mergeEvents),o.interfaces[f]={id:e.id,...y},this}_callBuilder(e,n){let a={entities:Mh(this.entities)},s=n(a),i=Le.pairs(s.entities).find(([l,f])=>!Nh(f));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:Le.mapValues(s.entities,l=>({name:Dh(l),schema:l.schema})),actions:s.actions??{},events:s.events??{},channels:s.channels??{}}}_mergeActions=(e,n)=>({...e,...n,input:{schema:qr(e.input.schema,n.input.schema)},output:{schema:qr(e.output.schema,n.output.schema)}});_mergeEvents=(e,n)=>({...e,...n,schema:qr(e.schema,n.schema)});_mergeChannels=(e,n)=>{let r=Le.mergeRecords(e.messages,n.messages,this._mergeMessage),a;(e.conversation||n.conversation)&&(a={tags:{...e.conversation?.tags,...n.conversation?.tags}});let s;return(e.message||n.message)&&(s={tags:{...e.message?.tags,...n.message?.tags}}),{...e,...n,messages:r,conversation:a,message:s}};_mergeMessage=(e,n)=>({schema:qr(e.schema,n.schema)})};O();M();R();O();M();R();import{isApiError as wI,Client as xI,RuntimeError as bv}from"@botpress/client";O();M();R();import*as Hh from"@botpress/client";var qa={retries:3,retryCondition:t=>Hh.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:(t,e)=>(zk(e.response?.headers??{})??t)*1e3},zk=t=>{let e=["RateLimit-Reset","X-RateLimit-Reset","Retry-After","ratelimit-reset","x-ratelimit-reset","retry-after"];for(let n of e){let r=t[n];if(r!==void 0)return qk(String(r))}},qk=t=>{let e=Gk(t)?Vk(t):t.length>0?parseInt(t,10):void 0;return e===void 0||isNaN(e)?void 0:e},Gk=t=>t.includes(" "),Vk=t=>{let e=Jk(t);if(!e)return;let n=new Date;return Math.max(0,Math.floor((e.getTime()-n.getTime())/1e3))},Jk=t=>{let e=new Date(t);return isNaN(e.getTime())?void 0:e};O();M();R();O();M();R();var ni=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);trackAnalytics=e=>this._client.trackAnalytics(e)};O();M();R();var Ga=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};O();M();R();O();M();R();var Va="#";var Xk=ne.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),$h=t=>{let e=t[_a],n=t[Ay],r=t[Cy],a=t[Oy],s=t[Ry],i=t[ba],o=Xk.parse(t[wa]);if(!e)throw new Error("Missing bot headers");if(!n)throw new Error("Missing bot user headers");if(!r)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:n,integrationId:r,webhookId:a,operation:o,configurationType:s??null,configuration:i?JSON.parse(G.from(i,"base64").toString("utf-8")):{}}};O();M();R();O();M();R();O();M();R();O();M();R();var el={},Zh=!1;function _l(){return Zh||(Zh=!0,el=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var a=42;e[n]=a;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(e,n);if(i.value!==a||i.enumerable!==!0)return!1}return!0}),el}var tl={},jh=!1;function Yk(){return jh||(jh=!0,tl=Error),tl}var nl={},Kh=!1;function Qk(){return Kh||(Kh=!0,nl=EvalError),nl}var rl={},Lh=!1;function eI(){return Lh||(Lh=!0,rl=RangeError),rl}var il={},Fh=!1;function tI(){return Fh||(Fh=!0,il=ReferenceError),il}var al={},Wh=!1;function sv(){return Wh||(Wh=!0,al=SyntaxError),al}var ol={},zh=!1;function Ja(){return zh||(zh=!0,ol=TypeError),ol}var sl={},qh=!1;function nI(){return qh||(qh=!0,sl=URIError),sl}var ll={},Gh=!1;function rI(){if(Gh)return ll;Gh=!0;var t=typeof Symbol<"u"&&Symbol,e=_l();return ll=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},ll}var ul={},Vh=!1;function iI(){if(Vh)return ul;Vh=!0;var t={__proto__:null,foo:{}},e=Object;return ul=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof e)},ul}var cl={},Jh=!1;function aI(){if(Jh)return cl;Jh=!0;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,n=Math.max,r="[object Function]",a=function(l,f){for(var p=[],y=0;y<l.length;y+=1)p[y]=l[y];for(var g=0;g<f.length;g+=1)p[g+l.length]=f[g];return p},s=function(l,f){for(var p=[],y=f,g=0;y<l.length;y+=1,g+=1)p[g]=l[y];return p},i=function(o,l){for(var f="",p=0;p<o.length;p+=1)f+=o[p],p+1<o.length&&(f+=l);return f};return cl=function(l){var f=this;if(typeof f!="function"||e.apply(f)!==r)throw new TypeError(t+f);for(var p=s(arguments,1),y,g=function(){if(this instanceof y){var v=f.apply(this,a(p,arguments));return Object(v)===v?v:this}return f.apply(l,a(p,arguments))},h=n(0,f.length-p.length),w=[],P=0;P<h;P++)w[P]="$"+P;if(y=Function("binder","return function ("+i(w,",")+"){ return binder.apply(this,arguments); }")(g),f.prototype){var B=function(){};B.prototype=f.prototype,y.prototype=new B,B.prototype=null}return y},cl}var fl={},Xh=!1;function bl(){if(Xh)return fl;Xh=!0;var t=aI();return fl=Function.prototype.bind||t,fl}var dl={},Yh=!1;function oI(){if(Yh)return dl;Yh=!0;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,n=bl();return dl=n.call(t,e),dl}var pl={},Qh=!1;function ii(){if(Qh)return pl;Qh=!0;var t,e=Yk(),n=Qk(),r=eI(),a=tI(),s=sv(),i=Ja(),o=nI(),l=Function,f=function(Ue){try{return l('"use strict"; return ('+Ue+").constructor;")()}catch{}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch{p=null}var y=function(){throw new i},g=p?function(){try{return arguments.callee,y}catch{try{return p(arguments,"callee").get}catch{return y}}}():y,h=rI()(),w=iI()(),P=Object.getPrototypeOf||(w?function(Ue){return Ue.__proto__}:null),B={},v=typeof Uint8Array>"u"||!P?t:P(Uint8Array),S={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":h&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":B,"%AsyncGenerator%":B,"%AsyncGeneratorFunction%":B,"%AsyncIteratorPrototype%":B,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":B,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!h||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":r,"%ReferenceError%":a,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!h||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&P?P(""[Symbol.iterator]()):t,"%Symbol%":h?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":g,"%TypedArray%":v,"%TypeError%":i,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet};if(P)try{null.error}catch(Ue){var E=P(P(Ue));S["%Error.prototype%"]=E}var H=function Ue(Pe){var Se;if(Pe==="%AsyncFunction%")Se=f("async function () {}");else if(Pe==="%GeneratorFunction%")Se=f("function* () {}");else if(Pe==="%AsyncGeneratorFunction%")Se=f("async function* () {}");else if(Pe==="%AsyncGenerator%"){var fe=Ue("%AsyncGeneratorFunction%");fe&&(Se=fe.prototype)}else if(Pe==="%AsyncIteratorPrototype%"){var ve=Ue("%AsyncGenerator%");ve&&P&&(Se=P(ve.prototype))}return S[Pe]=Se,Se},K={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ae=bl(),Q=oI(),ge=ae.call(Function.call,Array.prototype.concat),oe=ae.call(Function.apply,Array.prototype.splice),re=ae.call(Function.call,String.prototype.replace),Oe=ae.call(Function.call,String.prototype.slice),ze=ae.call(Function.call,RegExp.prototype.exec),tt=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ve=/\\(\\)?/g,Je=function(Pe){var Se=Oe(Pe,0,1),fe=Oe(Pe,-1);if(Se==="%"&&fe!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(fe==="%"&&Se!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var ve=[];return re(Pe,tt,function(D,j,F,de){ve[ve.length]=F?re(de,Ve,"$1"):j||D}),ve},mt=function(Pe,Se){var fe=Pe,ve;if(Q(K,fe)&&(ve=K[fe],fe="%"+ve[0]+"%"),Q(S,fe)){var D=S[fe];if(D===B&&(D=H(fe)),typeof D>"u"&&!Se)throw new i("intrinsic "+Pe+" exists, but is not available. Please file an issue!");return{alias:ve,name:fe,value:D}}throw new s("intrinsic "+Pe+" does not exist!")};return pl=function(Pe,Se){if(typeof Pe!="string"||Pe.length===0)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof Se!="boolean")throw new i('"allowMissing" argument must be a boolean');if(ze(/^%?[^%]*%?$/,Pe)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var fe=Je(Pe),ve=fe.length>0?fe[0]:"",D=mt("%"+ve+"%",Se),j=D.name,F=D.value,de=!1,Te=D.alias;Te&&(ve=Te[0],oe(fe,ge([0,1],Te)));for(var A=1,k=!0;A<fe.length;A+=1){var Z=fe[A],J=Oe(Z,0,1),ie=Oe(Z,-1);if((J==='"'||J==="'"||J==="`"||ie==='"'||ie==="'"||ie==="`")&&J!==ie)throw new s("property names with quotes must have matching quotes");if((Z==="constructor"||!k)&&(de=!0),ve+="."+Z,j="%"+ve+"%",Q(S,j))F=S[j];else if(F!=null){if(!(Z in F)){if(!Se)throw new i("base intrinsic for "+Pe+" exists, but the property is not available.");return}if(p&&A+1>=fe.length){var _=p(F,Z);k=!!_,k&&"get"in _&&!("originalValue"in _.get)?F=_.get:F=F[Z]}else k=Q(F,Z),F=F[Z];k&&!de&&(S[j]=F)}}return F},pl}var gl={},ev=!1;function wl(){if(ev)return gl;ev=!0;var t=ii(),e=t("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return gl=e,gl}var yl={},tv=!1;function Xa(){if(tv)return yl;tv=!0;var t=ii(),e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return yl=e,yl}var ml={},nv=!1;function sI(){if(nv)return ml;nv=!0;var t=wl(),e=sv(),n=Ja(),r=Xa();return ml=function(s,i,o){if(!s||typeof s!="object"&&typeof s!="function")throw new n("`obj` must be an object or a function`");if(typeof i!="string"&&typeof i!="symbol")throw new n("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new n("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new n("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new n("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new n("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,p=arguments.length>5?arguments[5]:null,y=arguments.length>6?arguments[6]:!1,g=!!r&&r(s,i);if(t)t(s,i,{configurable:p===null&&g?g.configurable:!p,enumerable:l===null&&g?g.enumerable:!l,value:o,writable:f===null&&g?g.writable:!f});else if(y||!l&&!f&&!p)s[i]=o;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},ml}var hl={},rv=!1;function lI(){if(rv)return hl;rv=!0;var t=wl(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},hl=e,hl}var vl={},iv=!1;function uI(){if(iv)return vl;iv=!0;var t=ii(),e=sI(),n=lI()(),r=Xa(),a=Ja(),s=t("%Math.floor%");return vl=function(o,l){if(typeof o!="function")throw new a("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||s(l)!==l)throw new a("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],p=!0,y=!0;if("length"in o&&r){var g=r(o,"length");g&&!g.configurable&&(p=!1),g&&!g.writable&&(y=!1)}return(p||y||!f)&&(n?e(o,"length",l,!0,!0):e(o,"length",l)),o},vl}var ri={},av=!1;function xl(){if(av)return ri;av=!0;var t=bl(),e=ii(),n=uI(),r=Ja(),a=e("%Function.prototype.apply%"),s=e("%Function.prototype.call%"),i=e("%Reflect.apply%",!0)||t.call(s,a),o=wl(),l=e("%Math.max%");ri=function(y){if(typeof y!="function")throw new r("a function is required");var g=i(t,s,arguments);return n(g,1+l(0,y.length-(arguments.length-1)),!0)};var f=function(){return i(t,a,arguments)};return o?o(ri,"apply",{value:f}):ri.apply=f,ri}var Tl={},ov=!1;function Pl(){if(ov)return Tl;ov=!0;var t=ii(),e=xl(),n=e(t("String.prototype.indexOf"));return Tl=function(a,s){var i=t(a,!!s);return typeof i=="function"&&n(a,".prototype.")>-1?e(i):i},Tl}rs();_s();var Bl={},lv=!1;function Nl(){if(lv)return Bl;lv=!0;var t=_l();return Bl=function(){return t()&&!!Symbol.toStringTag},Bl}var El={},uv=!1;function cI(){if(uv)return El;uv=!0;var t=Nl()(),e=Pl(),n=e("Object.prototype.toString"),r=function(o){return t&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:n(o)==="[object Arguments]"},a=function(o){return r(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&n(o)!=="[object Array]"&&n(o.callee)==="[object Function]"},s=function(){return r(arguments)}();return r.isLegacyArguments=a,El=s?r:a,El}var Sl={},cv=!1;function fI(){if(cv)return Sl;cv=!0;var t=Object.prototype.toString,e=Function.prototype.toString,n=/^\s*(?:function)?\*/,r=Nl()(),a=Object.getPrototypeOf,s=function(){if(!r)return!1;try{return Function("return function*() {}")()}catch{}},i;return Sl=function(l){if(typeof l!="function")return!1;if(n.test(e.call(l)))return!0;if(!r){var f=t.call(l);return f==="[object GeneratorFunction]"}if(!a)return!1;if(typeof i>"u"){var p=s();i=p?a(p):!1}return a(l)===i},Sl}var kl={},fv=!1;function dI(){if(fv)return kl;fv=!0;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,n,r;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},e(function(){throw 42},null,n)}catch(S){S!==r&&(e=null)}else e=null;var a=/^\s*class\b/,s=function(E){try{var H=t.call(E);return a.test(H)}catch{return!1}},i=function(E){try{return s(E)?!1:(t.call(E),!0)}catch{return!1}},o=Object.prototype.toString,l="[object Object]",f="[object Function]",p="[object GeneratorFunction]",y="[object HTMLAllCollection]",g="[object HTML document.all class]",h="[object HTMLCollection]",w=typeof Symbol=="function"&&!!Symbol.toStringTag,P=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var v=document.all;o.call(v)===o.call(document.all)&&(B=function(E){if((P||!E)&&(typeof E>"u"||typeof E=="object"))try{var H=o.call(E);return(H===y||H===g||H===h||H===l)&&E("")==null}catch{}return!1})}return kl=e?function(E){if(B(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{e(E,null,n)}catch(H){if(H!==r)return!1}return!s(E)&&i(E)}:function(E){if(B(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(w)return i(E);if(s(E))return!1;var H=o.call(E);return H!==f&&H!==p&&!/^\[object HTML/.test(H)?!1:i(E)},kl}var Il={},dv=!1;function pI(){if(dv)return Il;dv=!0;var t=dI(),e=Object.prototype.toString,n=Object.prototype.hasOwnProperty,r=function(l,f,p){for(var y=0,g=l.length;y<g;y++)n.call(l,y)&&(p==null?f(l[y],y,l):f.call(p,l[y],y,l))},a=function(l,f,p){for(var y=0,g=l.length;y<g;y++)p==null?f(l.charAt(y),y,l):f.call(p,l.charAt(y),y,l)},s=function(l,f,p){for(var y in l)n.call(l,y)&&(p==null?f(l[y],y,l):f.call(p,l[y],y,l))},i=function(l,f,p){if(!t(f))throw new TypeError("iterator must be a function");var y;arguments.length>=3&&(y=p),e.call(l)==="[object Array]"?r(l,f,y):typeof l=="string"?a(l,f,y):s(l,f,y)};return Il=i,Il}var Al={},pv=!1;function gI(){return pv||(pv=!0,Al=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Al}var Cl={},gv=!1,yI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function mI(){if(gv)return Cl;gv=!0;var t=gI(),e=typeof globalThis>"u"?yI:globalThis;return Cl=function(){for(var r=[],a=0;a<t.length;a++)typeof e[t[a]]=="function"&&(r[r.length]=t[a]);return r},Cl}var Ol={},yv=!1,hI=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function _v(){if(yv)return Ol;yv=!0;var t=pI(),e=mI(),n=xl(),r=Pl(),a=Xa(),s=r("Object.prototype.toString"),i=Nl()(),o=typeof globalThis>"u"?hI:globalThis,l=e(),f=r("String.prototype.slice"),p=Object.getPrototypeOf,y=r("Array.prototype.indexOf",!0)||function(B,v){for(var S=0;S<B.length;S+=1)if(B[S]===v)return S;return-1},g={__proto__:null};i&&a&&p?t(l,function(P){var B=new o[P];if(Symbol.toStringTag in B){var v=p(B),S=a(v,Symbol.toStringTag);if(!S){var E=p(v);S=a(E,Symbol.toStringTag)}g["$"+P]=n(S.get)}}):t(l,function(P){var B=new o[P],v=B.slice||B.set;v&&(g["$"+P]=n(v))});var h=function(B){var v=!1;return t(g,function(S,E){if(!v)try{"$"+S(B)===E&&(v=f(E,1))}catch{}}),v},w=function(B){var v=!1;return t(g,function(S,E){if(!v)try{S(B),v=f(E,1)}catch{}}),v};return Ol=function(B){if(!B||typeof B!="object")return!1;if(!i){var v=f(s(B),8,-1);return y(l,v)>-1?v:v!=="Object"?!1:w(B)}return a?h(B):null},Ol}var Rl={},mv=!1;function vI(){if(mv)return Rl;mv=!0;var t=_v();return Rl=function(n){return!!t(n)},Rl}var we={},hv=!1;function TI(){if(hv)return we;hv=!0;var t=cI(),e=fI(),n=_v(),r=vI();function a($){return $.call.bind($)}var s=typeof BigInt<"u",i=typeof Symbol<"u",o=a(Object.prototype.toString),l=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(s)var y=a(BigInt.prototype.valueOf);if(i)var g=a(Symbol.prototype.valueOf);function h($,kt){if(typeof $!="object")return!1;try{return kt($),!0}catch{return!1}}we.isArgumentsObject=t,we.isGeneratorFunction=e,we.isTypedArray=r;function w($){return typeof Promise<"u"&&$ instanceof Promise||$!==null&&typeof $=="object"&&typeof $.then=="function"&&typeof $.catch=="function"}we.isPromise=w;function P($){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView($):r($)||D($)}we.isArrayBufferView=P;function B($){return n($)==="Uint8Array"}we.isUint8Array=B;function v($){return n($)==="Uint8ClampedArray"}we.isUint8ClampedArray=v;function S($){return n($)==="Uint16Array"}we.isUint16Array=S;function E($){return n($)==="Uint32Array"}we.isUint32Array=E;function H($){return n($)==="Int8Array"}we.isInt8Array=H;function K($){return n($)==="Int16Array"}we.isInt16Array=K;function ae($){return n($)==="Int32Array"}we.isInt32Array=ae;function Q($){return n($)==="Float32Array"}we.isFloat32Array=Q;function ge($){return n($)==="Float64Array"}we.isFloat64Array=ge;function oe($){return n($)==="BigInt64Array"}we.isBigInt64Array=oe;function re($){return n($)==="BigUint64Array"}we.isBigUint64Array=re;function Oe($){return o($)==="[object Map]"}Oe.working=typeof Map<"u"&&Oe(new Map);function ze($){return typeof Map>"u"?!1:Oe.working?Oe($):$ instanceof Map}we.isMap=ze;function tt($){return o($)==="[object Set]"}tt.working=typeof Set<"u"&&tt(new Set);function Ve($){return typeof Set>"u"?!1:tt.working?tt($):$ instanceof Set}we.isSet=Ve;function Je($){return o($)==="[object WeakMap]"}Je.working=typeof WeakMap<"u"&&Je(new WeakMap);function mt($){return typeof WeakMap>"u"?!1:Je.working?Je($):$ instanceof WeakMap}we.isWeakMap=mt;function Ue($){return o($)==="[object WeakSet]"}Ue.working=typeof WeakSet<"u"&&Ue(new WeakSet);function Pe($){return Ue($)}we.isWeakSet=Pe;function Se($){return o($)==="[object ArrayBuffer]"}Se.working=typeof ArrayBuffer<"u"&&Se(new ArrayBuffer);function fe($){return typeof ArrayBuffer>"u"?!1:Se.working?Se($):$ instanceof ArrayBuffer}we.isArrayBuffer=fe;function ve($){return o($)==="[object DataView]"}ve.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&ve(new DataView(new ArrayBuffer(1),0,1));function D($){return typeof DataView>"u"?!1:ve.working?ve($):$ instanceof DataView}we.isDataView=D;var j=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function F($){return o($)==="[object SharedArrayBuffer]"}function de($){return typeof j>"u"?!1:(typeof F.working>"u"&&(F.working=F(new j)),F.working?F($):$ instanceof j)}we.isSharedArrayBuffer=de;function Te($){return o($)==="[object AsyncFunction]"}we.isAsyncFunction=Te;function A($){return o($)==="[object Map Iterator]"}we.isMapIterator=A;function k($){return o($)==="[object Set Iterator]"}we.isSetIterator=k;function Z($){return o($)==="[object Generator]"}we.isGeneratorObject=Z;function J($){return o($)==="[object WebAssembly.Module]"}we.isWebAssemblyCompiledModule=J;function ie($){return h($,l)}we.isNumberObject=ie;function _($){return h($,f)}we.isStringObject=_;function x($){return h($,p)}we.isBooleanObject=x;function z($){return s&&h($,y)}we.isBigIntObject=z;function Y($){return i&&h($,g)}we.isSymbolObject=Y;function Me($){return ie($)||_($)||x($)||z($)||Y($)}we.isBoxedPrimitive=Me;function _e($){return typeof Uint8Array<"u"&&(fe($)||de($))}return we.isAnyArrayBuffer=_e,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function($){Object.defineProperty(we,$,{enumerable:!1,value:function(){throw new Error($+" is not supported in userland")}})}),we}var Ml={},vv=!1;function _I(){return vv||(vv=!0,Ml=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),Ml}var xe={},Tv=!1,ai=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;function bI(){if(Tv)return xe;Tv=!0;var t=At,e=Object.getOwnPropertyDescriptors||function(j){for(var F=Object.keys(j),de={},Te=0;Te<F.length;Te++)de[F[Te]]=Object.getOwnPropertyDescriptor(j,F[Te]);return de},n=/%[sdj%]/g;xe.format=function(D){if(!K(D)){for(var j=[],F=0;F<arguments.length;F++)j.push(i(arguments[F]));return j.join(" ")}for(var F=1,de=arguments,Te=de.length,A=String(D).replace(n,function(Z){if(Z==="%%")return"%";if(F>=Te)return Z;switch(Z){case"%s":return String(de[F++]);case"%d":return Number(de[F++]);case"%j":try{return JSON.stringify(de[F++])}catch{return"[Circular]"}default:return Z}}),k=de[F];F<Te;k=de[++F])S(k)||!oe(k)?A+=" "+k:A+=" "+i(k);return A},xe.deprecate=function(D,j){if(typeof t<"u"&&t.noDeprecation===!0)return D;if(typeof t>"u")return function(){return xe.deprecate(D,j).apply(this||ai,arguments)};var F=!1;function de(){if(!F){if(t.throwDeprecation)throw new Error(j);t.traceDeprecation?console.trace(j):console.error(j),F=!0}return D.apply(this||ai,arguments)}return de};var r={},a=/^$/;if(t.env.NODE_DEBUG){var s=t.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+s+"$","i")}xe.debuglog=function(D){if(D=D.toUpperCase(),!r[D])if(a.test(D)){var j=t.pid;r[D]=function(){var F=xe.format.apply(xe,arguments);console.error("%s %d: %s",D,j,F)}}else r[D]=function(){};return r[D]};function i(D,j){var F={seen:[],stylize:l};return arguments.length>=3&&(F.depth=arguments[2]),arguments.length>=4&&(F.colors=arguments[3]),v(j)?F.showHidden=j:j&&xe._extend(F,j),Q(F.showHidden)&&(F.showHidden=!1),Q(F.depth)&&(F.depth=2),Q(F.colors)&&(F.colors=!1),Q(F.customInspect)&&(F.customInspect=!0),F.colors&&(F.stylize=o),p(F,D,F.depth)}xe.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function o(D,j){var F=i.styles[j];return F?"\x1B["+i.colors[F][0]+"m"+D+"\x1B["+i.colors[F][1]+"m":D}function l(D,j){return D}function f(D){var j={};return D.forEach(function(F,de){j[F]=!0}),j}function p(D,j,F){if(D.customInspect&&j&&ze(j.inspect)&&j.inspect!==xe.inspect&&!(j.constructor&&j.constructor.prototype===j)){var de=j.inspect(F,D);return K(de)||(de=p(D,de,F)),de}var Te=y(D,j);if(Te)return Te;var A=Object.keys(j),k=f(A);if(D.showHidden&&(A=Object.getOwnPropertyNames(j)),Oe(j)&&(A.indexOf("message")>=0||A.indexOf("description")>=0))return g(j);if(A.length===0){if(ze(j)){var Z=j.name?": "+j.name:"";return D.stylize("[Function"+Z+"]","special")}if(ge(j))return D.stylize(RegExp.prototype.toString.call(j),"regexp");if(re(j))return D.stylize(Date.prototype.toString.call(j),"date");if(Oe(j))return g(j)}var J="",ie=!1,_=["{","}"];if(B(j)&&(ie=!0,_=["[","]"]),ze(j)){var x=j.name?": "+j.name:"";J=" [Function"+x+"]"}if(ge(j)&&(J=" "+RegExp.prototype.toString.call(j)),re(j)&&(J=" "+Date.prototype.toUTCString.call(j)),Oe(j)&&(J=" "+g(j)),A.length===0&&(!ie||j.length==0))return _[0]+J+_[1];if(F<0)return ge(j)?D.stylize(RegExp.prototype.toString.call(j),"regexp"):D.stylize("[Object]","special");D.seen.push(j);var z;return ie?z=h(D,j,F,k,A):z=A.map(function(Y){return w(D,j,F,k,Y,ie)}),D.seen.pop(),P(z,J,_)}function y(D,j){if(Q(j))return D.stylize("undefined","undefined");if(K(j)){var F="'"+JSON.stringify(j).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return D.stylize(F,"string")}if(H(j))return D.stylize(""+j,"number");if(v(j))return D.stylize(""+j,"boolean");if(S(j))return D.stylize("null","null")}function g(D){return"["+Error.prototype.toString.call(D)+"]"}function h(D,j,F,de,Te){for(var A=[],k=0,Z=j.length;k<Z;++k)Pe(j,String(k))?A.push(w(D,j,F,de,String(k),!0)):A.push("");return Te.forEach(function(J){J.match(/^\d+$/)||A.push(w(D,j,F,de,J,!0))}),A}function w(D,j,F,de,Te,A){var k,Z,J;if(J=Object.getOwnPropertyDescriptor(j,Te)||{value:j[Te]},J.get?J.set?Z=D.stylize("[Getter/Setter]","special"):Z=D.stylize("[Getter]","special"):J.set&&(Z=D.stylize("[Setter]","special")),Pe(de,Te)||(k="["+Te+"]"),Z||(D.seen.indexOf(J.value)<0?(S(F)?Z=p(D,J.value,null):Z=p(D,J.value,F-1),Z.indexOf(`
80
+ `)>-1&&(A?Z=Z.split(`
81
+ `).map(function(ie){return" "+ie}).join(`
82
+ `).slice(2):Z=`
83
+ `+Z.split(`
84
+ `).map(function(ie){return" "+ie}).join(`
85
+ `))):Z=D.stylize("[Circular]","special")),Q(k)){if(A&&Te.match(/^\d+$/))return Z;k=JSON.stringify(""+Te),k.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(k=k.slice(1,-1),k=D.stylize(k,"name")):(k=k.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),k=D.stylize(k,"string"))}return k+": "+Z}function P(D,j,F){var de=D.reduce(function(Te,A){return A.indexOf(`
86
+ `)>=0,Te+A.replace(/\u001b\[\d\d?m/g,"").length+1},0);return de>60?F[0]+(j===""?"":j+`
87
87
  `)+" "+D.join(`,
88
- `)+" "+F[1]:F[0]+Z+" "+D.join(", ")+" "+F[1]}xe.types=Vk();function P(D){return Array.isArray(D)}xe.isArray=P;function T(D){return typeof D=="boolean"}xe.isBoolean=T;function S(D){return D===null}xe.isNull=S;function E(D){return D==null}xe.isNullOrUndefined=E;function M(D){return typeof D=="number"}xe.isNumber=M;function $(D){return typeof D=="string"}xe.isString=$;function oe(D){return typeof D=="symbol"}xe.isSymbol=oe;function X(D){return D===void 0}xe.isUndefined=X;function ue(D){return ee(D)&&Ne(D)==="[object RegExp]"}xe.isRegExp=ue,xe.types.isRegExp=ue;function ee(D){return typeof D=="object"&&D!==null}xe.isObject=ee;function ie(D){return ee(D)&&Ne(D)==="[object Date]"}xe.isDate=ie,xe.types.isDate=ie;function Oe(D){return ee(D)&&(Ne(D)==="[object Error]"||D instanceof Error)}xe.isError=Oe,xe.types.isNativeError=Oe;function Ie(D){return typeof D=="function"}xe.isFunction=Ie;function $e(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D>"u"}xe.isPrimitive=$e,xe.isBuffer=Jk();function Ne(D){return Object.prototype.toString.call(D)}function Me(D){return D<10?"0"+D.toString(10):D.toString(10)}var Ve=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ae(){var D=new Date,Z=[Me(D.getHours()),Me(D.getMinutes()),Me(D.getSeconds())].join(":");return[D.getDate(),Ve[D.getMonth()],Z].join(" ")}xe.log=function(){console.log("%s - %s",Ae(),xe.format.apply(xe,arguments))},xe.inherits=Ct(),xe._extend=function(D,Z){if(!Z||!ee(Z))return D;for(var F=Object.keys(Z),fe=F.length;fe--;)D[F[fe]]=Z[F[fe]];return D};function he(D,Z){return Object.prototype.hasOwnProperty.call(D,Z)}var Se=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;xe.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(Se&&Z[Se]){if(F=Z[Se],typeof F!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(F,Se,{value:F,enumerable:!1,writable:!1,configurable:!0}),F}function F(){for(var fe,Te,A=new Promise(function(Y,ae){fe=Y,Te=ae}),k=[],j=0;j<arguments.length;j++)k.push(arguments[j]);k.push(function(Y,ae){Y?Te(Y):fe(ae)});try{Z.apply(this||Yr,k)}catch(Y){Te(Y)}return A}return Object.setPrototypeOf(F,Object.getPrototypeOf(Z)),Se&&Object.defineProperty(F,Se,{value:F,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(F,e(Z))},xe.promisify.custom=Se;function ce(D,Z){if(!D){var F=new Error("Promise was rejected with a falsy value");F.reason=D,D=F}return Z(D)}function ve(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function Z(){for(var F=[],fe=0;fe<arguments.length;fe++)F.push(arguments[fe]);var Te=F.pop();if(typeof Te!="function")throw new TypeError("The last argument must be of type Function");var A=this||Yr,k=function(){return Te.apply(A,arguments)};D.apply(this||Yr,F).then(function(j){t.nextTick(k.bind(null,null,j))},function(j){t.nextTick(ce.bind(null,j,k))})}return Object.setPrototypeOf(Z,Object.getPrototypeOf(D)),Object.defineProperties(Z,e(D)),Z}return xe.callbackify=ve,xe}var le=Yk();le.format;le.deprecate;le.debuglog;le.inspect;le.types;le.isArray;le.isBoolean;le.isNull;le.isNullOrUndefined;le.isNumber;le.isString;le.isSymbol;le.isUndefined;le.isRegExp;le.isObject;le.isDate;le.isError;le.isFunction;le.isPrimitive;le.isBuffer;le.log;le.inherits;le._extend;le.promisify;le.callbackify;var TR=le._extend,_R=le.callbackify,bR=le.debuglog,wR=le.deprecate,xR=le.format,BR=le.inherits,PR=le.inspect,ER=le.isArray,SR=le.isBoolean,kR=le.isBuffer,IR=le.isDate,AR=le.isError,CR=le.isFunction,RR=le.isNull,OR=le.isNullOrUndefined,MR=le.isNumber,DR=le.isObject,NR=le.isPrimitive,HR=le.isRegExp,UR=le.isString,jR=le.isSymbol,$R=le.isUndefined,ZR=le.log,LR=le.promisify,FR=le.types,KR=le.TextEncoder=globalThis.TextEncoder,WR=le.TextDecoder=globalThis.TextDecoder;var yr=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,n){this._getConsoleMethod(e)(this._serializeMessage(n))}_serializeMessage(e){let n=le.format(...e);return J.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(n):n}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 Hn=class extends yr{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new Hn({...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})}};C();O();R();var eI=t=>["traceparent","tracestate","sentry-trace"].reduce((e,n)=>(t[n]&&(e[n]=t[n]),e),{}),xv=t=>async e=>{let n=$h(e.headers),[,r]=(e.headers.traceparent||"").split("-"),o=new Qk({botId:n.botId,integrationId:n.integrationId,retry:Fo,headers:eI(e.headers)}),s=new Gr(o),i=new Hn({traceId:r}),a={ctx:n,req:e,client:s,logger:i,instance:t};try{let l;switch(n.operation){case"webhook_received":l=await nI(a);break;case"register":l=await rI(a);break;case"unregister":l=await iI(a);break;case"message_created":l=await sI(a);break;case"action_triggered":l=await lI(a);break;case"ping":l=await tI(a);break;case"create_user":l=await oI(a);break;case"create_conversation":l=await aI(a);break;default:throw new Error(`Unknown operation ${n.operation}`)}return l?{...l,status:l.status??200}:{status:200}}catch(l){if(Xk(l)){let d=l.type==="Runtime"?l:new wv(l.message,l);return i.forBot().error(d.message),{status:d.code,body:JSON.stringify(d.toJSON())}}console.error(l);let c=new wv("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(c.message),{status:c.code,body:JSON.stringify(c.toJSON())}}},tI=async t=>{},nI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{let{req:s}=kt(n);return o.webhook({client:t,ctx:e,req:s,logger:r})},rI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.register)return;let{webhookUrl:s}=kt(n);await o.register({client:t,ctx:e,webhookUrl:s,logger:r})},iI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.unregister)return;let{webhookUrl:s}=kt(n);await o.unregister({ctx:e,webhookUrl:s,client:t,logger:r})},oI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.createUser)return;let{tags:s}=kt(n);return await o.createUser({ctx:e,client:t,tags:s,logger:r})},aI=async({client:t,ctx:e,req:n,logger:r,instance:o})=>{if(!o.createConversation)return;let{channel:s,tags:i}=kt(n);return await o.createConversation({ctx:e,client:t,channel:s,tags:i,logger:r})},sI=async({ctx:t,req:e,client:n,logger:r,instance:o})=>{let{conversation:s,user:i,type:a,payload:l,message:c}=kt(e),d=o.channels[s.channel];if(!d)throw new Error(`Channel ${s.channel} not found`);let y=d.messages[a];if(!y)throw new Error(`Message of type ${a} not found in channel ${s.channel}`);await y({ctx:t,conversation:s,message:c,user:i,type:a,client:n,payload:l,ack:async({tags:m})=>{await n.updateMessage({id:c.id,tags:m})},logger:r})},lI=async({req:t,ctx:e,client:n,logger:r,instance:o})=>{let{input:s,type:i}=kt(t);if(!i)throw new Error("Missing action type");let a=o.actions[i];if(!a)throw new Error(`Action ${i} not found`);let l=new Ko,d={output:await a({ctx:e,input:s,client:n,type:i,logger:r,metadata:l}),meta:l.toJSON()};return{body:JSON.stringify(d)}};var Ul=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=xv(this);start=e=>$o(this.handler,e)};C();O();R();C();O();R();C();O();R();C();O();R();C();O();R();var jl=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,this.attributes=e.attributes}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;attributes;addIntegration(e,n){let r=this;return r.integrations||(r.integrations={}),r.integrations[e.name]={enabled:n.enabled,...e,configurationType:n.configurationType,configuration:n.configuration,disabledChannels:n.disabledChannels},this}addPlugin(e,n){let r=this;r.plugins||(r.plugins={});let o=n.alias??e.name;return r.plugins[o]={...e,alias:n.alias,configuration:n.configuration,interfaces:n.interfaces},r.user=this._mergeUser(r.user,e.definition.user),r.conversation=this._mergeConversation(r.conversation,e.definition.conversation),r.message=this._mergeMessage(r.message,e.definition.message),r.recurringEvents=this._mergeRecurringEvents(r.recurringEvents,e.definition.recurringEvents),r.tables=this._mergeTables(r.tables,e.definition.tables),r.workflows=this._mergeWorkflows(r.workflows,e.definition.workflows),r.states=this._mergeStates(r.states,this._prefixKeys(e.definition.states,n.alias)),r.events=this._mergeEvents(r.events,this._prefixKeys(e.definition.events,n.alias)),r.actions=this._mergeActions(r.actions,this._prefixKeys(e.definition.actions,n.alias)),this}_mergeUser=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeConversation=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeMessage=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeStates=(e,n)=>({...e,...n});_mergeEvents=(e,n)=>({...e,...n});_mergeRecurringEvents=(e,n)=>({...e,...n});_mergeActions=(e,n)=>({...e,...n});_mergeTables=(e,n)=>({...e,...n});_mergeWorkflows=(e,n)=>({...e,...n});_prefixKeys=(e,n)=>!e||!n?e:qe.mapKeys(e,r=>`${n}${Wo}${r}`)};C();O();R();C();O();R();import{isApiError as yI,Client as mI,RuntimeError as Ev}from"@botpress/client";C();O();R();var Un=class extends yr{constructor(e){super({...e})}with(e){return new Un({...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})}};C();O();R();C();O();R();var Qt=class{constructor(e,n={before:{},after:{}}){this._client=e;this._hooks=n}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,n)=>{let r=this._hooks.before[e];r&&(n=await r(n));let o=await this._client[e](n),s=this._hooks.after[e];return s&&(o=await s(o,n)),o}};C();O();R();C();O();R();var mr=t=>new Proxy({},{get:(e,n)=>({listInstances:{all:r=>un({workflowName:n,client:t,input:r}),running:r=>un({workflowName:n,client:t,input:r,statuses:["in_progress"]}),scheduled:r=>un({workflowName:n,client:t,input:r,statuses:["pending","listening"]}),allFinished:r=>un({workflowName:n,client:t,input:r,statuses:["completed","cancelled","failed","timedout"]}),cancelled:r=>un({workflowName:n,client:t,input:r,statuses:["cancelled"]}),failed:r=>un({workflowName:n,client:t,input:r,statuses:["failed"]}),succeeded:r=>un({workflowName:n,client:t,input:r,statuses:["completed"]}),timedOut:r=>un({workflowName:n,client:t,input:r,statuses:["timedout"]})},startNewInstance:async r=>{let{workflow:o}=await t.createWorkflow({name:n,status:"pending",...r});return{workflow:cn({client:t,workflow:o})}}})}),un=async t=>{let e=await t.client.listWorkflows({name:t.workflowName,statuses:t.statuses,...t.input});return{...e,workflows:e.workflows.map(n=>cn({client:t.client,workflow:n}))}},cn=t=>({...t.workflow,async update(e){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,...e});return{workflow:cn({client:t.client,workflow:n})}},async setFailed({failureReason:e}){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"failed",failureReason:e});return{workflow:cn({client:t.client,workflow:n})}},async setCompleted({output:e}={}){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"completed",output:e});return{workflow:cn({client:t.client,workflow:n})}},async cancel(){let{workflow:e}=await t.client.updateWorkflow({id:t.workflow.id,status:"cancelled"});return{workflow:cn({client:t.client,workflow:e})}}});C();O();R();C();O();R();var uI=re.enum(["event_received","register","unregister","ping","action_triggered"]),Bv=t=>{let e=t[mo],n=t[ho],r=t[Dy],o=uI.parse(t[vo]);if(!e)throw new Error("Missing bot headers");if(!r)throw new Error("Missing type headers");if(!n)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:e,operation:o,type:r,configuration:n?JSON.parse(z.from(n,"base64").toString("utf-8")):{}}};C();O();R();var lt={status:200};C();O();R();C();O();R();var $l=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 cI=["child_workflow_deleted","child_workflow_finished","workflow_timedout","workflow_started","workflow_continued"],Pv=async(t,e)=>{if(t.ctx.type!=="workflow_update"||!cI.includes(e.payload.type))throw new Error("Unexpected event type");let n={...t,logger:fI(t,e)};if(!e.payload.workflow.name)return n.logger.warn("Received workflow update event without a workflow name. Assuming this workflow was not defined by the bot.",e.payload.workflow),lt;switch(e.payload.type){case"child_workflow_deleted":case"child_workflow_finished":n.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 dI(n,e);default:e.payload.type}return lt},fI=(t,e)=>t.logger.with({eventId:e.id,workflowId:e.payload.workflow.id,conversationId:e.payload.conversation?.id,userId:e.payload.user?.id}),dI=async(t,e)=>{let n=$l(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];return!r||r.length===0?(t.logger.warn(`No ${n} handler found for workflow "${e.payload.workflow.name}"`),lt):(await pI(t,e),await gI(t,e),lt)},pI=async(t,e)=>{e.payload.workflow.status==="pending"&&await t.client.updateWorkflow({id:e.payload.workflow.id,status:"in_progress",eventId:e.id})},gI=async(t,e)=>{let n=$l(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];for(let o of r)await o({...t,conversation:e.payload.conversation,user:e.payload.user,workflow:cn({...t,workflow:e.payload.workflow}),workflows:mr(t.client)})};C();O();R();var Sv=t=>async e=>{let n=Bv(e.headers),r=new Un,o=new mI({botId:n.botId,retry:Fo}),s=new Qt(o,{before:{createMessage:async a=>{let l=t.hookHandlers.before_outgoing_message[a.type]??[];for(let c of l){let d=new Qt(o);a=(await c({client:d,ctx:n,logger:r.with({conversationId:a.conversationId,userId:a.userId}),data:a,...fn({client:d})}))?.data??a}return a},callAction:async a=>{let l=t.hookHandlers.before_outgoing_call_action[a.type]??[];for(let c of l){let d=new Qt(o);a=(await c({client:d,ctx:n,logger:r,data:a,...fn({client:d})}))?.data??a}return a}},after:{createMessage:async a=>{let l=t.hookHandlers.after_outgoing_message[a.message.type]??[];for(let c of l){let d=new Qt(o);a=(await c({client:d,ctx:n,logger:r.with({messageId:a.message.id,conversationId:a.message.conversationId,userId:a.message.userId}),data:a,...fn({client:d})}))?.data??a}return a},callAction:async(a,l)=>{let{type:c}=l,d=t.hookHandlers.after_outgoing_call_action[c]??[];for(let y of d){let g=new Qt(o);a=(await y({client:g,ctx:n,logger:r,data:{type:c,...a},...fn({client:g})}))?.data??a}return a}}}),i={req:e,ctx:n,logger:r,client:s,self:t};try{switch(n.operation){case"action_triggered":return await bI(i);case"event_received":return await _I(i);case"register":return await vI(i);case"unregister":return await TI(i);case"ping":return await hI(i);default:throw new Error(`Unknown operation ${n.operation}`)}}catch(a){if(yI(a)){let c=a.type==="Runtime"?a:new Ev(a.message,a);return r.error(c.message),{status:c.code,body:JSON.stringify(c.toJSON())}}let l=new Ev("An unexpected error occurred in the bot.");return r.error(l.message),{status:l.code,body:JSON.stringify(l.toJSON())}}},hI=async t=>lt,vI=async t=>lt,TI=async t=>lt,_I=async t=>{let{ctx:e,logger:n,req:r,client:o,self:s}=t,i={client:o,ctx:e,logger:n,...fn({client:o})},a=kt(r);if(i.logger=i.logger.with({eventId:a.event.id,messageId:a.event.messageId,conversationId:a.event.conversationId,userId:a.event.userId}),e.type==="workflow_update")return await Pv(t,a.event);if(e.type==="message_created"){let m=a.event,v=m.payload.message;i.logger=i.logger.with({messageId:v.id,conversationId:v.conversationId,userId:v.userId});let B=s.hookHandlers.before_incoming_message[v.type]??[];for(let E of B){let M=await E({...i,data:v});if(v=M?.data??v,M?.stop)return lt}let P={...i,user:m.payload.user,conversation:m.payload.conversation,message:v,event:m},T=s.messageHandlers[v.type]??[];for(let E of T)await E(P);let S=s.hookHandlers.after_incoming_message[v.type]??[];for(let E of S){let M=await E({...i,data:v});if(v=M?.data??v,M?.stop)return lt}return lt}if(e.type==="state_expired"){let v=a.event.payload.state,B={...i,state:v},P=s.stateExpiredHandlers["*"]??[];for(let T of P)await T(B);return lt}let l=a.event,c=s.hookHandlers.before_incoming_event[l.type]??[];for(let m of c){let v=await m({...i,data:l});if(l=v?.data??l,v?.stop)return lt}let d={...i,event:l},y=s.eventHandlers[l.type]??[];for(let m of y)await m(d);let g=s.hookHandlers.after_incoming_event[l.type]??[];for(let m of g){let v=await m({...i,data:l});if(l=v?.data??l,v?.stop)return lt}return lt},bI=async({ctx:t,logger:e,req:n,client:r,self:o})=>{let{input:s,type:i}=kt(n);if(!i)throw new Error("Missing action type");let a=o.hookHandlers.before_incoming_call_action[i]??[];for(let g of a){let m=await g({ctx:t,logger:e,client:r,data:{type:i,input:s},...fn({client:r})});s=m?.data?.input??s,i=m?.data?.type??i}let l=o.actionHandlers[i];if(!l)throw new Error(`Action ${i} not found`);let c=await l({ctx:t,logger:e,input:s,client:r,type:i,...fn({client:r})}),d=o.hookHandlers.after_incoming_call_action[i]??[];for(let g of d){let m=await g({ctx:t,logger:e,client:r,data:{type:i,output:c},...fn({client:r})});i=m?.data?.type??i,c=m?.data?.output??c}return{status:200,body:JSON.stringify({output:c})}},fn=t=>({workflows:mr(t.client)});var Zl=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,n)=>{let r=this._actionHandlers[n];if(r)return r;for(let o of Object.values(this._plugins))if(r=o.actionHandlers[n],r)return r}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(a=>a.messageHandlers[n]??[]),o=this._messageHandlers[n]??[],s=this._messageHandlers["*"]??[],i=[...o,...s].sort((a,l)=>a.order-l.order).map(({handler:a})=>a);return ge.unique([...r,...i])}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(a=>a.eventHandlers[n]??[]),o=this._eventHandlers[n]??[],s=this._eventHandlers["*"]??[],i=[...o,...s].sort((a,l)=>a.order-l.order).map(({handler:a})=>a);return ge.unique([...r,...i])}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(a=>a.stateExpiredHandlers[n]??[]),o=this._stateExpiredHandlers[n]??[],s=this._stateExpiredHandlers["*"]??[],i=[...o,...s].sort((a,l)=>a.order-l.order).map(({handler:a})=>a);return ge.unique([...r,...i])}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{if(this._hookHandlers[n])return new Proxy({},{get:(o,s)=>{let i=Object.values(this._plugins).flatMap(y=>y.hookHandlers[n]?.[s]??[]),a=this._hookHandlers[n]??{},l=a[s]??[],c=a["*"]??[],d=[...l,...c].sort((y,g)=>y.order-g.order).map(({handler:y})=>y);return ge.unique([...i,...d])}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(o,s)=>{let i=r[s]?.sort((l,c)=>l.order-c.order).map(({handler:l})=>l)??[],a=Object.values(this._plugins).flatMap(l=>l.workflowHandlers[n]?.[s]??[]);return ge.unique([...i,...a])}})}})}on={message:(e,n)=>{this._messageHandlers[e]=ge.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ge.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ge.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ge.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ge.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ge.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ge.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ge.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ge.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ge.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ge.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ge.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ge.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ge.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ge.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ge.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};handler=Sv(this);start=e=>$o(this.handler,e)};C();O();R();C();O();R();C();O();R();C();O();R();C();O();R();var Ll=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??{},this.attributes=e.attributes;let n=this._getEntityReference(this.entities),r=e.events===void 0?{}:qe.mapValues(e.events,i=>({...i,schema:i.schema(n)})),o=e.actions===void 0?{}:qe.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(n)},output:{...i.output,schema:i.output.schema(n)}})),s=e.channels===void 0?{}:qe.mapValues(e.channels,i=>({...i,messages:qe.mapValues(i.messages,a=>({...a,schema:a.schema(n)}))}));this.events=r,this.actions=o,this.channels=s}name;version;title;description;icon;readme;attributes;entities;events;actions;channels;_getEntityReference=e=>{let n={};for(let[r,o]of Object.entries(e)){let s=o.schema._def["x-zui"]?.title,i=o.schema._def.description,a=_y.ref(r);s&&a.title(s),i&&a.describe(i),n[r]=a}return n}};C();O();R();C();O();R();C();O();R();C();O();R();var Fl=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,this.attributes=e.attributes}name;version;title;description;icon;readme;attributes;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows};C();O();R();C();O();R();C();O();R();C();O();R();var Kl=":";var kv=t=>{let[e,n]=t.split(Kl);return!e||!n?null:{namespace:e,eventName:n}},Iv=t=>`${t.namespace}${Kl}${t.actionName}`,Av=t=>`${t.namespace}${Kl}${t.eventName}`,Cv=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,o=n.actions[t.actionName]?.name??t.actionName;return{namespace:r,actionName:o}},Rv=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,o=n.events[t.eventName]?.name??t.eventName;return{namespace:r,eventName:o}};var Ov=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(o,s)=>i=>wI({client:t,interfaces:e.interfaces,integrationOrInterfaceName:r,methodName:s,input:i})})}),wI=async({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:r,input:o})=>{let s=Cv({namespace:n,actionName:r},e),i=Iv(s);return(await t.callAction({type:i,input:o})).output};C();O();R();C();O();R();C();O();R();var Wl=class{constructor(e,n,r){this._client=e;this._stateType=n;this._stateName=r}async get(e){return await this._client.getState({type:this._stateType,name:this._stateName,id:e}).then(n=>n.state.payload)}async set(e,n){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:n})}async getOrSet(e,n){return await this._client.getOrSetState({type:this._stateType,name:this._stateName,id:e,payload:n}).then(r=>r.state.payload)}async delete(e){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:null})}async patch(e,n){await this._client.patchState({type:this._stateType,name:this._stateName,id:e,payload:n})}},Mv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(o,s)=>{let i=e.alias!==void 0?`${e.alias}${Wo}${s}`:s;return new Wl(t,r,i)}})});C();O();R();var ql=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:n,interfaces:r,alias:o}=this._runtime,s=Ov(e,this._runtime),i=Mv(e,this._runtime),a=mr(e);return{configuration:n,interfaces:r,actions:s,states:i,alias:o,workflows:a}}get actionHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._actionHandlers[n];if(r)return Xt.setName(o=>r({...o,...this._getTools(o.client)}),r.name)}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._messageHandlers[n]??[],o=this._messageHandlers["*"]??[];return ge.unique([...r,...o]).sort((i,a)=>i.order-a.order).map(({handler:i})=>Xt.setName(a=>i({...a,...this._getTools(a.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._eventHandlers[n]??[],o=Object.entries(this._eventHandlers).filter(([a])=>this._eventResolvesTo(a,n)).flatMap(([,a])=>a??[]),s=this._eventHandlers["*"]??[];return ge.unique([...r,...o,...s]).sort((a,l)=>a.order-l.order).map(({handler:a})=>Xt.setName(l=>a({...l,...this._getTools(l.client)}),a.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._stateExpiredHandlers[n]??[],o=this._stateExpiredHandlers["*"]??[];return ge.unique([...r,...o]).sort((i,a)=>i.order-a.order).map(({handler:i})=>Xt.setName(a=>i({...a,...this._getTools(a.client)}),i.name))}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._hookHandlers[n];if(r)return new Proxy({},{get:(o,s)=>{s=this._stripAliasPrefix(s);let i=r[s]??[],a=Object.entries(r).filter(([d])=>this._eventResolvesTo(d,s)).flatMap(([,d])=>d??[]),l=r["*"]??[];return ge.unique([...i,...a,...l]).sort((d,y)=>d.order-y.order).map(({handler:d})=>Xt.setName(y=>d({...y,...this._getTools(y.client)}),d.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(o,s)=>(r[s]?.sort((a,l)=>a.order-l.order)??[]).map(({handler:a})=>Xt.setName(l=>a({...l,...this._getTools(l.client)}),a.name))})}})}on={message:(e,n)=>{this._messageHandlers[e]=ge.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ge.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ge.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ge.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ge.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ge.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ge.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ge.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ge.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ge.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ge.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ge.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ge.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ge.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ge.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ge.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};_eventResolvesTo=(e,n)=>{let r=kv(e);if(!r)return!1;let o=Rv(r,this._runtime.interfaces);return Av(o)===n};_stripAliasPrefix=e=>{let{alias:n}=this._runtime;if(!n)return e;let r=`${n}:`;return e.startsWith(r)?e.slice(r.length):e}};C();O();R();C();O();R();C();O();R();C();O();R();C();O();R();C();O();R();export{mx as BRAND,Zl as Bot,jl as BotDefinition,Un as BotLogger,Qt as BotSpecificClient,Vn as DIRTY,gx as EMPTY_PATH,Ar as ErrorBoundary,de as INVALID,Ul as Integration,tl as IntegrationDefinition,Hn as IntegrationLogger,Gr as IntegrationSpecificClient,Ll as InterfaceDefinition,OB as NEVER,ct as OK,Et as ParseInputLazyPath,gt as ParseStatus,ql as Plugin,Fl as PluginDefinition,xH as RuntimeError,me as Schema,MA as WELL_KNOWN_ATTRIBUTES,Pi as ZodAny,Nr as ZodArray,Ua as ZodBigInt,ja as ZodBoolean,$a as ZodBranded,Za as ZodCatch,La as ZodDate,co as ZodDefault,ug as ZodDiscriminatedUnion,wn as ZodEffects,ir as ZodEnum,$t as ZodError,Vp as ZodFirstPartyTypeKind,fg as ZodFunction,Ka as ZodIntersection,G as ZodIssueCode,Wa as ZodLazy,qa as ZodLiteral,gg as ZodMap,mg as ZodNaN,za as ZodNativeEnum,bn as ZodNever,Ga as ZodNull,Yn as ZodNullable,Va as ZodNumber,Xn as ZodObject,nn as ZodOptional,ne as ZodParsedType,Ja as ZodPipeline,po as ZodPromise,go as ZodReadonly,xg as ZodRecord,Pg as ZodRef,me as ZodSchema,Eg as ZodSet,ft as ZodString,Ug as ZodSymbol,wn as ZodTransformer,er as ZodTuple,me as ZodType,Ya as ZodUndefined,Xa as ZodUnion,Ir as ZodUnknown,Lg as ZodVoid,hA as ZuiForm,te as addIssueToContext,Ux as agent,Fx as aimodel,eB as any,iB as array,Vx as bigint,my as boolean,mo as botIdHeader,Cy as botUserIdHeader,RB as coerce,ho as configurationHeader,My as configurationTypeHeader,Dx as conversation,fo as createZodEnum,kg as cuid2Regex,Sg as cuidRegex,sg as custom,Kx as datasource,Jx as date,Dg as datetimeRegex,vA as defaultComponentDefinitions,lB as discriminatedUnion,cf as effect,Cg as emailRegex,TB as enum,se as errorUtil,jx as event,AB as fromJsonSchema,CB as fromObject,mB as function,Mr as getErrorMap,tn as getParsedType,zx as instanceof,Ry as integrationIdHeader,Lx as intent,uB as intersection,Og as ipv4Regex,Mg as ipv6Regex,ya as isAborted,wH as isApiError,xi as isAsync,ma as isDirty,hx as isEmojiRegex,Dr as isValid,yo as jsonSchemaToZui,Wx as knowledgebase,qx as late,hB as lazy,vB as literal,wi as makeIssue,gB as map,jr as mergeObjectSchemas,Hx as message,Ay as messages,Gx as nan,_B as nativeEnum,nB as never,Qx as null,xB as nullable,yy as number,oB as object,Hr as objectToZui,ga as objectUtil,IB as oboolean,kB as onumber,vo as operationHeader,wB as optional,SB as ostring,kt as parseBody,EB as pipeline,PB as preprocess,ye as processCreateParams,bB as promise,px as quotelessJson,pB as readonly,fB as record,dB as ref,$o as serve,yB as set,Xp as setErrorMap,aB as strictObject,gy as string,Yx as symbol,$x as table,Zx as tablerow,cf as transformer,TA as transforms,cB as tuple,Dy as typeHeader,Ig as ulidRegex,Xx as undefined,sB as union,tB as unknown,Nx as user,be as util,Ag as uuidRegex,Mx as variable,rB as void,Oy as webhookIdHeader,rP as withErrorBoundary,re as z,ns as zuiToJsonSchema};
88
+ `)+" "+F[1]:F[0]+j+" "+D.join(", ")+" "+F[1]}xe.types=TI();function B(D){return Array.isArray(D)}xe.isArray=B;function v(D){return typeof D=="boolean"}xe.isBoolean=v;function S(D){return D===null}xe.isNull=S;function E(D){return D==null}xe.isNullOrUndefined=E;function H(D){return typeof D=="number"}xe.isNumber=H;function K(D){return typeof D=="string"}xe.isString=K;function ae(D){return typeof D=="symbol"}xe.isSymbol=ae;function Q(D){return D===void 0}xe.isUndefined=Q;function ge(D){return oe(D)&&Ve(D)==="[object RegExp]"}xe.isRegExp=ge,xe.types.isRegExp=ge;function oe(D){return typeof D=="object"&&D!==null}xe.isObject=oe;function re(D){return oe(D)&&Ve(D)==="[object Date]"}xe.isDate=re,xe.types.isDate=re;function Oe(D){return oe(D)&&(Ve(D)==="[object Error]"||D instanceof Error)}xe.isError=Oe,xe.types.isNativeError=Oe;function ze(D){return typeof D=="function"}xe.isFunction=ze;function tt(D){return D===null||typeof D=="boolean"||typeof D=="number"||typeof D=="string"||typeof D=="symbol"||typeof D>"u"}xe.isPrimitive=tt,xe.isBuffer=_I();function Ve(D){return Object.prototype.toString.call(D)}function Je(D){return D<10?"0"+D.toString(10):D.toString(10)}var mt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ue(){var D=new Date,j=[Je(D.getHours()),Je(D.getMinutes()),Je(D.getSeconds())].join(":");return[D.getDate(),mt[D.getMonth()],j].join(" ")}xe.log=function(){console.log("%s - %s",Ue(),xe.format.apply(xe,arguments))},xe.inherits=Mt(),xe._extend=function(D,j){if(!j||!oe(j))return D;for(var F=Object.keys(j),de=F.length;de--;)D[F[de]]=j[F[de]];return D};function Pe(D,j){return Object.prototype.hasOwnProperty.call(D,j)}var Se=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;xe.promisify=function(j){if(typeof j!="function")throw new TypeError('The "original" argument must be of type Function');if(Se&&j[Se]){if(F=j[Se],typeof F!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(F,Se,{value:F,enumerable:!1,writable:!1,configurable:!0}),F}function F(){for(var de,Te,A=new Promise(function(J,ie){de=J,Te=ie}),k=[],Z=0;Z<arguments.length;Z++)k.push(arguments[Z]);k.push(function(J,ie){J?Te(J):de(ie)});try{j.apply(this||ai,k)}catch(J){Te(J)}return A}return Object.setPrototypeOf(F,Object.getPrototypeOf(j)),Se&&Object.defineProperty(F,Se,{value:F,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(F,e(j))},xe.promisify.custom=Se;function fe(D,j){if(!D){var F=new Error("Promise was rejected with a falsy value");F.reason=D,D=F}return j(D)}function ve(D){if(typeof D!="function")throw new TypeError('The "original" argument must be of type Function');function j(){for(var F=[],de=0;de<arguments.length;de++)F.push(arguments[de]);var Te=F.pop();if(typeof Te!="function")throw new TypeError("The last argument must be of type Function");var A=this||ai,k=function(){return Te.apply(A,arguments)};D.apply(this||ai,F).then(function(Z){t.nextTick(k.bind(null,null,Z))},function(Z){t.nextTick(fe.bind(null,Z,k))})}return Object.setPrototypeOf(j,Object.getPrototypeOf(D)),Object.defineProperties(j,e(D)),j}return xe.callbackify=ve,xe}var ce=bI();ce.format;ce.deprecate;ce.debuglog;ce.inspect;ce.types;ce.isArray;ce.isBoolean;ce.isNull;ce.isNullOrUndefined;ce.isNumber;ce.isString;ce.isSymbol;ce.isUndefined;ce.isRegExp;ce.isObject;ce.isDate;ce.isError;ce.isFunction;ce.isPrimitive;ce.isBuffer;ce.log;ce.inherits;ce._extend;ce.promisify;ce.callbackify;var R0=ce._extend,M0=ce.callbackify,N0=ce.debuglog,D0=ce.deprecate,H0=ce.format,U0=ce.inherits,$0=ce.inspect,Z0=ce.isArray,j0=ce.isBoolean,K0=ce.isBuffer,L0=ce.isDate,F0=ce.isError,W0=ce.isFunction,z0=ce.isNull,q0=ce.isNullOrUndefined,G0=ce.isNumber,V0=ce.isObject,J0=ce.isPrimitive,X0=ce.isRegExp,Y0=ce.isString,Q0=ce.isSymbol,eR=ce.isUndefined,tR=ce.log,nR=ce.promisify,rR=ce.types,iR=ce.TextEncoder=globalThis.TextEncoder,aR=ce.TextDecoder=globalThis.TextDecoder;var yr=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,n){this._getConsoleMethod(e)(this._serializeMessage(n))}_serializeMessage(e){let n=ce.format(...e);return X.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(n):n}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 jn=class extends yr{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new jn({...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})}};O();M();R();var PI=t=>["traceparent","tracestate","sentry-trace"].reduce((e,n)=>(t[n]&&(e[n]=t[n]),e),{}),wv=t=>async e=>{let n=$h(e.headers),[,r]=(e.headers.traceparent||"").split("-"),a=new xI({botId:n.botId,integrationId:n.integrationId,retry:qa,headers:PI(e.headers)}),s=new ni(a),i=new jn({traceId:r}),o={ctx:n,req:e,client:s,logger:i,instance:t};try{let l;switch(n.operation){case"webhook_received":l=await EI(o);break;case"register":l=await SI(o);break;case"unregister":l=await kI(o);break;case"message_created":l=await CI(o);break;case"action_triggered":l=await OI(o);break;case"ping":l=await BI(o);break;case"create_user":l=await II(o);break;case"create_conversation":l=await AI(o);break;default:throw new Error(`Unknown operation ${n.operation}`)}return l?{...l,status:l.status??200}:{status:200}}catch(l){if(wI(l)){let p=l.type==="Runtime"?l:new bv(l.message,l);return i.forBot().error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}console.error(l);let f=new bv("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(f.message),{status:f.code,body:JSON.stringify(f.toJSON())}}},BI=async t=>{},EI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{let{req:s}=Ct(n);return a.webhook({client:t,ctx:e,req:s,logger:r})},SI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.register)return;let{webhookUrl:s}=Ct(n);await a.register({client:t,ctx:e,webhookUrl:s,logger:r})},kI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.unregister)return;let{webhookUrl:s}=Ct(n);await a.unregister({ctx:e,webhookUrl:s,client:t,logger:r})},II=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createUser)return;let{tags:s}=Ct(n);return await a.createUser({ctx:e,client:t,tags:s,logger:r})},AI=async({client:t,ctx:e,req:n,logger:r,instance:a})=>{if(!a.createConversation)return;let{channel:s,tags:i}=Ct(n);return await a.createConversation({ctx:e,client:t,channel:s,tags:i,logger:r})},CI=async({ctx:t,req:e,client:n,logger:r,instance:a})=>{let{conversation:s,user:i,type:o,payload:l,message:f}=Ct(e),p=a.channels[s.channel];if(!p)throw new Error(`Channel ${s.channel} not found`);let y=p.messages[o];if(!y)throw new Error(`Message of type ${o} not found in channel ${s.channel}`);await y({ctx:t,conversation:s,message:f,user:i,type:o,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:f.id,tags:h})},logger:r})},OI=async({req:t,ctx:e,client:n,logger:r,instance:a})=>{let{input:s,type:i}=Ct(t);if(!i)throw new Error("Missing action type");let o=a.actions[i];if(!o)throw new Error(`Action ${i} not found`);let l=new Ga,p={output:await o({ctx:e,input:s,client:n,type:i,logger:r,metadata:l}),meta:l.toJSON()};return{body:JSON.stringify(p)}};var Dl=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=wv(this);start=e=>Fa(this.handler,e)};O();M();R();O();M();R();O();M();R();O();M();R();O();M();R();var Hl=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,this.attributes=e.attributes}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows;attributes;addIntegration(e,n){let r=this;return r.integrations||(r.integrations={}),r.integrations[e.name]={enabled:n.enabled,...e,configurationType:n.configurationType,configuration:n.configuration,disabledChannels:n.disabledChannels},this}addPlugin(e,n){let r=this;r.plugins||(r.plugins={});let a=n.alias??e.name;return r.plugins[a]={...e,alias:n.alias,configuration:n.configuration,interfaces:n.interfaces},r.user=this._mergeUser(r.user,e.definition.user),r.conversation=this._mergeConversation(r.conversation,e.definition.conversation),r.message=this._mergeMessage(r.message,e.definition.message),r.recurringEvents=this._mergeRecurringEvents(r.recurringEvents,e.definition.recurringEvents),r.tables=this._mergeTables(r.tables,e.definition.tables),r.workflows=this._mergeWorkflows(r.workflows,e.definition.workflows),r.states=this._mergeStates(r.states,this._prefixKeys(e.definition.states,n.alias)),r.events=this._mergeEvents(r.events,this._prefixKeys(e.definition.events,n.alias)),r.actions=this._mergeActions(r.actions,this._prefixKeys(e.definition.actions,n.alias)),this}_mergeUser=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeConversation=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeMessage=(e,n)=>({tags:{...e?.tags,...n?.tags}});_mergeStates=(e,n)=>({...e,...n});_mergeEvents=(e,n)=>({...e,...n});_mergeRecurringEvents=(e,n)=>({...e,...n});_mergeActions=(e,n)=>({...e,...n});_mergeTables=(e,n)=>({...e,...n});_mergeWorkflows=(e,n)=>({...e,...n});_prefixKeys=(e,n)=>!e||!n?e:Le.mapKeys(e,r=>`${n}${Va}${r}`)};O();M();R();O();M();R();import{isApiError as $I,Client as ZI,RuntimeError as Bv}from"@botpress/client";O();M();R();var Kn=class extends yr{constructor(e){super({...e})}with(e){return new Kn({...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})}};O();M();R();O();M();R();var en=class{constructor(e,n={before:{},after:{}}){this._client=e;this._hooks=n}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,n)=>{let r=this._hooks.before[e];r&&(n=await r(n));let a=await this._client[e](n),s=this._hooks.after[e];return s&&(a=await s(a,n)),a}};O();M();R();O();M();R();var mr=t=>new Proxy({},{get:(e,n)=>({listInstances:{all:r=>fn({workflowName:n,client:t,input:r}),running:r=>fn({workflowName:n,client:t,input:r,statuses:["in_progress"]}),scheduled:r=>fn({workflowName:n,client:t,input:r,statuses:["pending","listening"]}),allFinished:r=>fn({workflowName:n,client:t,input:r,statuses:["completed","cancelled","failed","timedout"]}),cancelled:r=>fn({workflowName:n,client:t,input:r,statuses:["cancelled"]}),failed:r=>fn({workflowName:n,client:t,input:r,statuses:["failed"]}),succeeded:r=>fn({workflowName:n,client:t,input:r,statuses:["completed"]}),timedOut:r=>fn({workflowName:n,client:t,input:r,statuses:["timedout"]})},startNewInstance:async r=>{let{workflow:a}=await t.createWorkflow({name:n,status:"pending",...r});return{workflow:dn({client:t,workflow:a})}}})}),fn=async t=>{let e=await t.client.listWorkflows({name:t.workflowName,statuses:t.statuses,...t.input});return{...e,workflows:e.workflows.map(n=>dn({client:t.client,workflow:n}))}},dn=t=>({...t.workflow,async update(e){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,...e});return{workflow:dn({client:t.client,workflow:n})}},async setFailed({failureReason:e}){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"failed",failureReason:e});return{workflow:dn({client:t.client,workflow:n})}},async setCompleted({output:e}={}){let{workflow:n}=await t.client.updateWorkflow({id:t.workflow.id,status:"completed",output:e});return{workflow:dn({client:t.client,workflow:n})}},async cancel(){let{workflow:e}=await t.client.updateWorkflow({id:t.workflow.id,status:"cancelled"});return{workflow:dn({client:t.client,workflow:e})}}});O();M();R();O();M();R();var RI=ne.enum(["event_received","register","unregister","ping","action_triggered"]),xv=t=>{let e=t[_a],n=t[ba],r=t[My],a=RI.parse(t[wa]);if(!e)throw new Error("Missing bot headers");if(!r)throw new Error("Missing type headers");if(!n)throw new Error("Missing configuration headers");if(!a)throw new Error("Missing operation headers");return{botId:e,operation:a,type:r,configuration:n?JSON.parse(G.from(n,"base64").toString("utf-8")):{}}};O();M();R();var ft={status:200};O();M();R();O();M();R();var Ul=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 MI=["child_workflow_deleted","child_workflow_finished","workflow_timedout","workflow_started","workflow_continued"],Pv=async(t,e)=>{if(t.ctx.type!=="workflow_update"||!MI.includes(e.payload.type))throw new Error("Unexpected event type");let n={...t,logger:NI(t,e)};if(!e.payload.workflow.name)return n.logger.warn("Received workflow update event without a workflow name. Assuming this workflow was not defined by the bot.",e.payload.workflow),ft;switch(e.payload.type){case"child_workflow_deleted":case"child_workflow_finished":n.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 DI(n,e);default:e.payload.type}return ft},NI=(t,e)=>t.logger.with({eventId:e.id,workflowId:e.payload.workflow.id,conversationId:e.payload.conversation?.id,userId:e.payload.user?.id}),DI=async(t,e)=>{let n=Ul(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];return!r||r.length===0?(t.logger.warn(`No ${n} handler found for workflow "${e.payload.workflow.name}"`),ft):(await HI(t,e),await UI(t,e),ft)},HI=async(t,e)=>{e.payload.workflow.status==="pending"&&await t.client.updateWorkflow({id:e.payload.workflow.id,status:"in_progress",eventId:e.id})},UI=async(t,e)=>{let n=Ul(e.payload.type),r=t.self.workflowHandlers[n]?.[e.payload.workflow.name];for(let a of r)await a({...t,conversation:e.payload.conversation,user:e.payload.user,workflow:dn({...t,workflow:e.payload.workflow}),workflows:mr(t.client)})};O();M();R();var Ev=t=>async e=>{let n=xv(e.headers),r=new Kn,a=new ZI({botId:n.botId,retry:qa}),s=new en(a,{before:{createMessage:async o=>{let l=t.hookHandlers.before_outgoing_message[o.type]??[];for(let f of l){let p=new en(a);o=(await f({client:p,ctx:n,logger:r.with({conversationId:o.conversationId,userId:o.userId}),data:o,...pn({client:p})}))?.data??o}return o},callAction:async o=>{let l=t.hookHandlers.before_outgoing_call_action[o.type]??[];for(let f of l){let p=new en(a);o=(await f({client:p,ctx:n,logger:r,data:o,...pn({client:p})}))?.data??o}return o}},after:{createMessage:async o=>{let l=t.hookHandlers.after_outgoing_message[o.message.type]??[];for(let f of l){let p=new en(a);o=(await f({client:p,ctx:n,logger:r.with({messageId:o.message.id,conversationId:o.message.conversationId,userId:o.message.userId}),data:o,...pn({client:p})}))?.data??o}return o},callAction:async(o,l)=>{let{type:f}=l,p=t.hookHandlers.after_outgoing_call_action[f]??[];for(let y of p){let g=new en(a);o=(await y({client:g,ctx:n,logger:r,data:{type:f,...o},...pn({client:g})}))?.data??o}return o}}}),i={req:e,ctx:n,logger:r,client:s,self:t};try{switch(n.operation){case"action_triggered":return await WI(i);case"event_received":return await FI(i);case"register":return await KI(i);case"unregister":return await LI(i);case"ping":return await jI(i);default:throw new Error(`Unknown operation ${n.operation}`)}}catch(o){if($I(o)){let f=o.type==="Runtime"?o:new Bv(o.message,o);return r.error(f.message),{status:f.code,body:JSON.stringify(f.toJSON())}}let l=new Bv("An unexpected error occurred in the bot.");return r.error(l.message),{status:l.code,body:JSON.stringify(l.toJSON())}}},jI=async t=>ft,KI=async t=>ft,LI=async t=>ft,FI=async t=>{let{ctx:e,logger:n,req:r,client:a,self:s}=t,i={client:a,ctx:e,logger:n,...pn({client:a})},o=Ct(r);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 Pv(t,o.event);if(e.type==="message_created"){let h=o.event,w=h.payload.message;i.logger=i.logger.with({messageId:w.id,conversationId:w.conversationId,userId:w.userId});let P=s.hookHandlers.before_incoming_message[w.type]??[];for(let E of P){let H=await E({...i,data:w});if(w=H?.data??w,H?.stop)return ft}let B={...i,user:h.payload.user,conversation:h.payload.conversation,message:w,event:h},v=s.messageHandlers[w.type]??[];for(let E of v)await E(B);let S=s.hookHandlers.after_incoming_message[w.type]??[];for(let E of S){let H=await E({...i,data:w});if(w=H?.data??w,H?.stop)return ft}return ft}if(e.type==="state_expired"){let w=o.event.payload.state,P={...i,state:w},B=s.stateExpiredHandlers["*"]??[];for(let v of B)await v(P);return ft}let l=o.event,f=s.hookHandlers.before_incoming_event[l.type]??[];for(let h of f){let w=await h({...i,data:l});if(l=w?.data??l,w?.stop)return ft}let p={...i,event:l},y=s.eventHandlers[l.type]??[];for(let h of y)await h(p);let g=s.hookHandlers.after_incoming_event[l.type]??[];for(let h of g){let w=await h({...i,data:l});if(l=w?.data??l,w?.stop)return ft}return ft},WI=async({ctx:t,logger:e,req:n,client:r,self:a})=>{let{input:s,type:i}=Ct(n);if(!i)throw new Error("Missing action type");let o=a.hookHandlers.before_incoming_call_action[i]??[];for(let g of o){let h=await g({ctx:t,logger:e,client:r,data:{type:i,input:s},...pn({client:r})});s=h?.data?.input??s,i=h?.data?.type??i}let l=a.actionHandlers[i];if(!l)throw new Error(`Action ${i} not found`);let f=await l({ctx:t,logger:e,input:s,client:r,type:i,...pn({client:r})}),p=a.hookHandlers.after_incoming_call_action[i]??[];for(let g of p){let h=await g({ctx:t,logger:e,client:r,data:{type:i,output:f},...pn({client:r})});i=h?.data?.type??i,f=h?.data?.output??f}return{status:200,body:JSON.stringify({output:f})}},pn=t=>({workflows:mr(t.client)});var $l=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,n)=>{let r=this._actionHandlers[n];if(r)return r;for(let a of Object.values(this._plugins))if(r=a.actionHandlers[n],r)return r}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(o=>o.messageHandlers[n]??[]),a=this._messageHandlers[n]??[],s=this._messageHandlers["*"]??[],i=[...a,...s].sort((o,l)=>o.order-l.order).map(({handler:o})=>o);return ye.unique([...r,...i])}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(o=>o.eventHandlers[n]??[]),a=this._eventHandlers[n]??[],s=this._eventHandlers["*"]??[],i=[...a,...s].sort((o,l)=>o.order-l.order).map(({handler:o})=>o);return ye.unique([...r,...i])}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{let r=Object.values(this._plugins).flatMap(o=>o.stateExpiredHandlers[n]??[]),a=this._stateExpiredHandlers[n]??[],s=this._stateExpiredHandlers["*"]??[],i=[...a,...s].sort((o,l)=>o.order-l.order).map(({handler:o})=>o);return ye.unique([...r,...i])}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{if(this._hookHandlers[n])return new Proxy({},{get:(a,s)=>{let i=Object.values(this._plugins).flatMap(y=>y.hookHandlers[n]?.[s]??[]),o=this._hookHandlers[n]??{},l=o[s]??[],f=o["*"]??[],p=[...l,...f].sort((y,g)=>y.order-g.order).map(({handler:y})=>y);return ye.unique([...i,...p])}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(a,s)=>{let i=r[s]?.sort((l,f)=>l.order-f.order).map(({handler:l})=>l)??[],o=Object.values(this._plugins).flatMap(l=>l.workflowHandlers[n]?.[s]??[]);return ye.unique([...i,...o])}})}})}on={message:(e,n)=>{this._messageHandlers[e]=ye.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ye.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ye.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ye.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ye.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ye.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ye.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ye.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ye.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ye.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ye.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ye.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ye.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ye.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ye.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ye.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};handler=Ev(this);start=e=>Fa(this.handler,e)};O();M();R();O();M();R();O();M();R();O();M();R();O();M();R();var Zl=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??{},this.attributes=e.attributes;let n=this._getEntityReference(this.entities),r=e.events===void 0?{}:Le.mapValues(e.events,i=>({...i,schema:i.schema(n)})),a=e.actions===void 0?{}:Le.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(n)},output:{...i.output,schema:i.output.schema(n)}})),s=e.channels===void 0?{}:Le.mapValues(e.channels,i=>({...i,messages:Le.mapValues(i.messages,o=>({...o,schema:o.schema(n)}))}));this.events=r,this.actions=a,this.channels=s}name;version;title;description;icon;readme;attributes;entities;events;actions;channels;_getEntityReference=e=>{let n={};for(let[r,a]of Object.entries(e)){let s=a.schema._def["x-zui"]?.title,i=a.schema._def.description,o=Ty.ref(r);s&&o.title(s),i&&o.describe(i),n[r]=o}return n}};O();M();R();O();M();R();O();M();R();O();M();R();var jl=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,this.attributes=e.attributes}name;version;title;description;icon;readme;attributes;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;workflows};O();M();R();O();M();R();O();M();R();O();M();R();var Kl=":";var Sv=t=>{let[e,n]=t.split(Kl);return!e||!n?null:{namespace:e,eventName:n}},kv=t=>`${t.namespace}${Kl}${t.actionName}`,Iv=t=>`${t.namespace}${Kl}${t.eventName}`,Av=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,a=n.actions[t.actionName]?.name??t.actionName;return{namespace:r,actionName:a}},Cv=(t,e)=>{let n=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},r=n.name,a=n.events[t.eventName]?.name??t.eventName;return{namespace:r,eventName:a}};var Ov=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(a,s)=>i=>zI({client:t,interfaces:e.interfaces,integrationOrInterfaceName:r,methodName:s,input:i})})}),zI=async({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:r,input:a})=>{let s=Av({namespace:n,actionName:r},e),i=kv(s);return(await t.callAction({type:i,input:a})).output};O();M();R();O();M();R();O();M();R();var Ll=class{constructor(e,n,r){this._client=e;this._stateType=n;this._stateName=r}async get(e){return await this._client.getState({type:this._stateType,name:this._stateName,id:e}).then(n=>n.state.payload)}async set(e,n){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:n})}async getOrSet(e,n){return await this._client.getOrSetState({type:this._stateType,name:this._stateName,id:e,payload:n}).then(r=>r.state.payload)}async delete(e){await this._client.setState({type:this._stateType,name:this._stateName,id:e,payload:null})}async patch(e,n){await this._client.patchState({type:this._stateType,name:this._stateName,id:e,payload:n})}},Rv=(t,e)=>new Proxy({},{get:(n,r)=>new Proxy({},{get:(a,s)=>{let i=e.alias!==void 0?`${e.alias}${Va}${s}`:s;return new Ll(t,r,i)}})});O();M();R();var Fl=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:n,interfaces:r,alias:a}=this._runtime,s=Ov(e,this._runtime),i=Rv(e,this._runtime),o=mr(e);return{configuration:n,interfaces:r,actions:s,states:i,alias:a,workflows:o}}get actionHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._actionHandlers[n];if(r)return Qt.setName(a=>r({...a,...this._getTools(a.client)}),r.name)}})}get messageHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._messageHandlers[n]??[],a=this._messageHandlers["*"]??[];return ye.unique([...r,...a]).sort((i,o)=>i.order-o.order).map(({handler:i})=>Qt.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._eventHandlers[n]??[],a=Object.entries(this._eventHandlers).filter(([o])=>this._eventResolvesTo(o,n)).flatMap(([,o])=>o??[]),s=this._eventHandlers["*"]??[];return ye.unique([...r,...a,...s]).sort((o,l)=>o.order-l.order).map(({handler:o})=>Qt.setName(l=>o({...l,...this._getTools(l.client)}),o.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,n)=>{n=this._stripAliasPrefix(n);let r=this._stateExpiredHandlers[n]??[],a=this._stateExpiredHandlers["*"]??[];return ye.unique([...r,...a]).sort((i,o)=>i.order-o.order).map(({handler:i})=>Qt.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get hookHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._hookHandlers[n];if(r)return new Proxy({},{get:(a,s)=>{s=this._stripAliasPrefix(s);let i=r[s]??[],o=Object.entries(r).filter(([p])=>this._eventResolvesTo(p,s)).flatMap(([,p])=>p??[]),l=r["*"]??[];return ye.unique([...i,...o,...l]).sort((p,y)=>p.order-y.order).map(({handler:p})=>Qt.setName(y=>p({...y,...this._getTools(y.client)}),p.name))}})}})}get workflowHandlers(){return new Proxy({},{get:(e,n)=>{let r=this._workflowHandlers[n];if(r)return new Proxy({},{get:(a,s)=>(r[s]?.sort((o,l)=>o.order-l.order)??[]).map(({handler:o})=>Qt.setName(l=>o({...l,...this._getTools(l.client)}),o.name))})}})}on={message:(e,n)=>{this._messageHandlers[e]=ye.safePush(this._messageHandlers[e],{handler:n,order:this._registerOrder++})},event:(e,n)=>{this._eventHandlers[e]=ye.safePush(this._eventHandlers[e],{handler:n,order:this._registerOrder++})},stateExpired:(e,n)=>{this._stateExpiredHandlers[e]=ye.safePush(this._stateExpiredHandlers[e],{handler:n,order:this._registerOrder++})},beforeIncomingEvent:(e,n)=>{this._hookHandlers.before_incoming_event[e]=ye.safePush(this._hookHandlers.before_incoming_event[e],{handler:n,order:this._registerOrder++})},beforeIncomingMessage:(e,n)=>{this._hookHandlers.before_incoming_message[e]=ye.safePush(this._hookHandlers.before_incoming_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingMessage:(e,n)=>{this._hookHandlers.before_outgoing_message[e]=ye.safePush(this._hookHandlers.before_outgoing_message[e],{handler:n,order:this._registerOrder++})},beforeOutgoingCallAction:(e,n)=>{this._hookHandlers.before_outgoing_call_action[e]=ye.safePush(this._hookHandlers.before_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},beforeIncomingCallAction:(e,n)=>{this._hookHandlers.before_incoming_call_action[e]=ye.safePush(this._hookHandlers.before_incoming_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingEvent:(e,n)=>{this._hookHandlers.after_incoming_event[e]=ye.safePush(this._hookHandlers.after_incoming_event[e],{handler:n,order:this._registerOrder++})},afterIncomingMessage:(e,n)=>{this._hookHandlers.after_incoming_message[e]=ye.safePush(this._hookHandlers.after_incoming_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingMessage:(e,n)=>{this._hookHandlers.after_outgoing_message[e]=ye.safePush(this._hookHandlers.after_outgoing_message[e],{handler:n,order:this._registerOrder++})},afterOutgoingCallAction:(e,n)=>{this._hookHandlers.after_outgoing_call_action[e]=ye.safePush(this._hookHandlers.after_outgoing_call_action[e],{handler:n,order:this._registerOrder++})},afterIncomingCallAction:(e,n)=>{this._hookHandlers.after_incoming_call_action[e]=ye.safePush(this._hookHandlers.after_incoming_call_action[e],{handler:n,order:this._registerOrder++})},workflowStart:(e,n)=>{this._workflowHandlers.started[e]=ye.safePush(this._workflowHandlers.started[e],{handler:n,order:this._registerOrder++})},workflowContinue:(e,n)=>{this._workflowHandlers.continued[e]=ye.safePush(this._workflowHandlers.continued[e],{handler:n,order:this._registerOrder++})},workflowTimeout:(e,n)=>{this._workflowHandlers.timed_out[e]=ye.safePush(this._workflowHandlers.timed_out[e],{handler:n,order:this._registerOrder++})}};_eventResolvesTo=(e,n)=>{let r=Sv(e);if(!r)return!1;let a=Cv(r,this._runtime.interfaces);return Iv(a)===n};_stripAliasPrefix=e=>{let{alias:n}=this._runtime;if(!n)return e;let r=`${n}:`;return e.startsWith(r)?e.slice(r.length):e}};O();M();R();O();M();R();O();M();R();O();M();R();O();M();R();O();M();R();export{Cx as BRAND,$l as Bot,Hl as BotDefinition,Kn as BotLogger,en as BotSpecificClient,Vn as DIRTY,Sx as EMPTY_PATH,pe as INVALID,Dl as Integration,Qs as IntegrationDefinition,jn as IntegrationLogger,ni as IntegrationSpecificClient,Zl as InterfaceDefinition,CP as NEVER,pt as OK,It as ParseInputLazyPath,vt as ParseStatus,Fl as Plugin,jl as PluginDefinition,HH as RuntimeError,he as Schema,GA as WELL_KNOWN_ATTRIBUTES,Kr as ZodAny,Lr as ZodArray,Zo as ZodBigInt,jo as ZodBoolean,Ko as ZodBranded,Lo as ZodCatch,Fo as ZodDate,ya as ZodDefault,ug as ZodDiscriminatedUnion,Bn as ZodEffects,ir as ZodEnum,Kt as ZodError,Jp as ZodFirstPartyTypeKind,fg as ZodFunction,zo as ZodIntersection,q as ZodIssueCode,qo as ZodLazy,Go as ZodLiteral,pg as ZodMap,yg as ZodNaN,Vo as ZodNativeEnum,zr as ZodNever,Jo as ZodNull,Qn as ZodNullable,Xo as ZodNumber,er as ZodObject,an as ZodOptional,te as ZodParsedType,Yo as ZodPipeline,ha as ZodPromise,va as ZodReadonly,wg as ZodRecord,Pg as ZodRef,he as ZodSchema,Bg as ZodSet,gt as ZodString,Dg as ZodSymbol,Bn as ZodTransformer,nr as ZodTuple,he as ZodType,Ta as ZodUndefined,Qo as ZodUnion,Dr as ZodUnknown,Zg as ZodVoid,ee as addIssueToContext,Ux as agent,Lx as aimodel,eP as any,iP as array,Vx as bigint,Lg as boolean,_a as botIdHeader,Ay as botUserIdHeader,AP as coerce,ba as configurationHeader,Ry as configurationTypeHeader,Nx as conversation,ma as createZodEnum,Sg as cuid2Regex,Eg as cuidRegex,sg as custom,Fx as datasource,Jx as date,lP as discriminatedUnion,zc as effect,Ag as emailRegex,TP as enum,ue as errorUtil,$x as event,mP as function,Zr as getErrorMap,rn as getParsedType,qx as instanceof,Cy as integrationIdHeader,Kx as intent,uP as intersection,Og as ipv4Regex,Rg as ipv6Regex,To as isAborted,DH as isApiError,Ei as isAsync,_o as isDirty,Ox as isEmojiRegex,jr as isValid,Wx as knowledgebase,zx as late,hP as lazy,vP as literal,Bi as makeIssue,gP as map,qr as mergeObjectSchemas,Hx as message,Iy as messages,Gx as nan,_P as nativeEnum,nP as never,Qx as null,xP as nullable,Kg as number,aP as object,vo as objectUtil,IP as oboolean,kP as onumber,wa as operationHeader,wP as optional,SP as ostring,Ct as parseBody,EP as pipeline,BP as preprocess,me as processCreateParams,bP as promise,Ex as quotelessJson,pP as readonly,fP as record,dP as ref,Fa as serve,yP as set,Qp as setErrorMap,oP as strictObject,jg as string,Xx as symbol,Zx as table,jx as tablerow,zc as transformer,Fv as transforms,cP as tuple,My as typeHeader,kg as ulidRegex,Yx as undefined,sP as union,tP as unknown,Dx as user,be as util,Ig as uuidRegex,Mx as variable,rP as void,Oy as webhookIdHeader,ne as z};
89
89
  /*! Bundled license information:
90
90
 
91
91
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
92
92
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
93
93
 
94
- react/cjs/react.production.min.js:
95
- (**
96
- * @license React
97
- * react.production.min.js
98
- *
99
- * Copyright (c) Facebook, Inc. and its affiliates.
100
- *
101
- * This source code is licensed under the MIT license found in the
102
- * LICENSE file in the root directory of this source tree.
103
- *)
104
-
105
94
  @jspm/core/nodelibs/browser/chunk-CcCWfKp1.js:
106
95
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
107
96