zion-mcp 2.0.12 → 2.0.13
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/{chunk-5FUUZSHD.js → chunk-HV43RGJH.js} +1 -1
- package/dist/{chunk-RJNXUKIQ.js → chunk-S3IBAFUJ.js} +1 -1
- package/dist/{chunk-IPNYIX3L.js → chunk-WTYJMJGG.js} +1 -1
- package/dist/{corpus-3F2UACTF.js → corpus-V7LMU55G.js} +1 -1
- package/dist/{index.cjs-7TU65RA5.js → index.cjs-IO4RHHMH.js} +1 -1
- package/dist/{json-crdt-FDAMHL72.js → json-crdt-HSI3KAUZ.js} +1 -1
- package/dist/{json-crdt-patch-OT6AZTRT.js → json-crdt-patch-I6FZC3KI.js} +1 -1
- package/dist/server.js +3 -3
- package/dist/{ztype-FPBSFRVF.js → ztype-SNC455HR.js} +1 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __nodeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __nodeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as H,c as v,d as vy,e as Rt,g as p,h as g}from"./chunk-
|
|
3
|
+
import{a as H,c as v,d as vy,e as Rt,g as p,h as g}from"./chunk-S3IBAFUJ.js";var ca=v((by,Fx)=>{p();var rd=H("buffer"),Vn=rd.Buffer;function qx(e,t){for(var r in e)t[r]=e[r]}Vn.from&&Vn.alloc&&Vn.allocUnsafe&&Vn.allocUnsafeSlow?Fx.exports=rd:(qx(rd,by),by.Buffer=qo);function qo(e,t,r){return Vn(e,t,r)}qo.prototype=Object.create(Vn.prototype);qx(Vn,qo);qo.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return Vn(e,t,r)};qo.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=Vn(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};qo.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Vn(e)};qo.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return rd.SlowBuffer(e)}});var Sy=v((fTe,Ux)=>{p();var nd=ca().Buffer,ZZ=H("stream"),KZ=H("util");function id(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=nd.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=nd.alloc(0),e.pipe(this),this;if(e.length||typeof e=="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}KZ.inherits(id,ZZ);id.prototype.write=function(t){this.buffer=nd.concat([this.buffer,nd.from(t)]),this.emit("data",t)};id.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};Ux.exports=id});var Gx=v((mTe,zx)=>{"use strict";p();function Oy(e){var t=(e/8|0)+(e%8===0?0:1);return t}var HZ={ES256:Oy(256),ES384:Oy(384),ES512:Oy(521)};function QZ(e){var t=HZ[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}zx.exports=QZ});var Wx=v((yTe,Qx)=>{"use strict";p();var od=ca().Buffer,Bx=Gx(),sd=128,Zx=0,WZ=32,JZ=16,YZ=2,Kx=JZ|WZ|Zx<<6,ad=YZ|Zx<<6;function XZ(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Hx(e){if(od.isBuffer(e))return e;if(typeof e=="string")return od.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function eK(e,t){e=Hx(e);var r=Bx(t),n=r+1,i=e.length,o=0;if(e[o++]!==Kx)throw new Error('Could not find expected "seq"');var s=e[o++];if(s===(sd|1)&&(s=e[o++]),i-o<s)throw new Error('"seq" specified length of "'+s+'", only "'+(i-o)+'" remaining');if(e[o++]!==ad)throw new Error('Could not find expected "int" for "r"');var a=e[o++];if(i-o-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-o-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=o;if(o+=a,e[o++]!==ad)throw new Error('Could not find expected "int" for "s"');var u=e[o++];if(i-o!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-o)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var l=o;if(o+=u,o!==i)throw new Error('Expected to consume entire buffer, but "'+(i-o)+'" bytes remain');var d=r-a,f=r-u,h=od.allocUnsafe(d+a+f+u);for(o=0;o<d;++o)h[o]=0;e.copy(h,o,c+Math.max(-d,0),c+a),o=r;for(var m=o;o<m+f;++o)h[o]=0;return e.copy(h,o,l+Math.max(-f,0),l+u),h=h.toString("base64"),h=XZ(h),h}function Vx(e,t,r){for(var n=0;t+n<r&&e[t+n]===0;)++n;var i=e[t+n]>=sd;return i&&--n,n}function tK(e,t){e=Hx(e);var r=Bx(t),n=e.length;if(n!==r*2)throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=Vx(e,0,r),o=Vx(e,r,e.length),s=r-i,a=r-o,c=2+s+1+1+a,u=c<sd,l=od.allocUnsafe((u?2:3)+c),d=0;return l[d++]=Kx,u?l[d++]=c:(l[d++]=sd|1,l[d++]=c&255),l[d++]=ad,l[d++]=s,i<0?(l[d++]=0,d+=e.copy(l,d,0,r)):d+=e.copy(l,d,i,r),l[d++]=ad,l[d++]=a,o<0?(l[d++]=0,e.copy(l,d,r)):e.copy(l,d,r+o),l}Qx.exports={derToJose:eK,joseToDer:tK}});var Yx=v((vTe,Jx)=>{"use strict";p();var iu=H("buffer").Buffer,Iy=H("buffer").SlowBuffer;Jx.exports=cd;function cd(e,t){if(!iu.isBuffer(e)||!iu.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}cd.install=function(){iu.prototype.equal=Iy.prototype.equal=function(t){return cd(this,t)}};var rK=iu.prototype.equal,nK=Iy.prototype.equal;cd.restore=function(){iu.prototype.equal=rK,Iy.prototype.equal=nK}});var Ny=v((TTe,aA)=>{p();var la=ca().Buffer,Wr=H("crypto"),eA=Wx(),Xx=H("util"),iK=`"%s" is not a valid algorithm.
|
|
4
4
|
Supported algorithms are:
|
|
5
5
|
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ou="secret must be a string or buffer",ua="key must be a string or a buffer",oK="key must be a string, a buffer or an object",xy=typeof Wr.createPublicKey=="function";xy&&(ua+=" or a KeyObject",ou+="or a KeyObject");function tA(e){if(!la.isBuffer(e)&&typeof e!="string"&&(!xy||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw En(ua)}function rA(e){if(!la.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw En(oK)}function sK(e){if(!la.isBuffer(e)){if(typeof e=="string")return e;if(!xy||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw En(ou)}}function Ay(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function nA(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function En(e){var t=[].slice.call(arguments,1),r=Xx.format.bind(Xx,e).apply(null,t);return new TypeError(r)}function aK(e){return la.isBuffer(e)||typeof e=="string"}function su(e){return aK(e)||(e=JSON.stringify(e)),e}function iA(e){return function(r,n){sK(n),r=su(r);var i=Wr.createHmac("sha"+e,n),o=(i.update(r),i.digest("base64"));return Ay(o)}}var wy,cK="timingSafeEqual"in Wr?function(t,r){return t.byteLength!==r.byteLength?!1:Wr.timingSafeEqual(t,r)}:function(t,r){return wy||(wy=Yx()),wy(t,r)};function uK(e){return function(r,n,i){var o=iA(e)(r,i);return cK(la.from(n),la.from(o))}}function oA(e){return function(r,n){rA(n),r=su(r);var i=Wr.createSign("RSA-SHA"+e),o=(i.update(r),i.sign(n,"base64"));return Ay(o)}}function sA(e){return function(r,n,i){tA(i),r=su(r),n=nA(n);var o=Wr.createVerify("RSA-SHA"+e);return o.update(r),o.verify(i,n,"base64")}}function lK(e){return function(r,n){rA(n),r=su(r);var i=Wr.createSign("RSA-SHA"+e),o=(i.update(r),i.sign({key:n,padding:Wr.constants.RSA_PKCS1_PSS_PADDING,saltLength:Wr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Ay(o)}}function pK(e){return function(r,n,i){tA(i),r=su(r),n=nA(n);var o=Wr.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:i,padding:Wr.constants.RSA_PKCS1_PSS_PADDING,saltLength:Wr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function dK(e){var t=oA(e);return function(){var n=t.apply(null,arguments);return n=eA.derToJose(n,"ES"+e),n}}function fK(e){var t=sA(e);return function(n,i,o){i=eA.joseToDer(i,"ES"+e).toString("base64");var s=t(n,i,o);return s}}function hK(){return function(){return""}}function mK(){return function(t,r){return r===""}}aA.exports=function(t){var r={hs:iA,rs:oA,ps:lK,es:dK,none:hK},n={hs:uK,rs:sA,ps:pK,es:fK,none:mK},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw En(iK,t);var o=(i[1]||i[3]).toLowerCase(),s=i[2];return{sign:r[o](s),verify:n[o](s)}}});var Py=v((STe,cA)=>{p();var gK=H("buffer").Buffer;cA.exports=function(t){return typeof t=="string"?t:typeof t=="number"||gK.isBuffer(t)?t.toString():JSON.stringify(t)}});var hA=v((ITe,fA)=>{p();var yK=ca().Buffer,uA=Sy(),_K=Ny(),vK=H("stream"),lA=Py(),Ry=H("util");function pA(e,t){return yK.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function EK(e,t,r){r=r||"utf8";var n=pA(lA(e),"binary"),i=pA(lA(t),r);return Ry.format("%s.%s",n,i)}function dA(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,o=_K(t.alg),s=EK(t,r,i),a=o.sign(s,n);return Ry.format("%s.%s",s,a)}function ud(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new uA(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new uA(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}Ry.inherits(ud,vK);ud.prototype.sign=function(){try{var t=dA({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};ud.sign=dA;fA.exports=ud});var OA=v((xTe,SA)=>{p();var gA=ca().Buffer,mA=Sy(),TK=Ny(),bK=H("stream"),yA=Py(),SK=H("util"),OK=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function IK(e){return Object.prototype.toString.call(e)==="[object Object]"}function wK(e){if(IK(e))return e;try{return JSON.parse(e)}catch{return}}function _A(e){var t=e.split(".",1)[0];return wK(gA.from(t,"base64").toString("binary"))}function xK(e){return e.split(".",2).join(".")}function vA(e){return e.split(".")[2]}function AK(e,t){t=t||"utf8";var r=e.split(".")[1];return gA.from(r,"base64").toString(t)}function EA(e){return OK.test(e)&&!!_A(e)}function TA(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=yA(e);var i=vA(e),o=xK(e),s=TK(t);return s.verify(o,i,r)}function bA(e,t){if(t=t||{},e=yA(e),!EA(e))return null;var r=_A(e);if(!r)return null;var n=AK(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:vA(e)}}function pa(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new mA(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new mA(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}SK.inherits(pa,bK);pa.prototype.verify=function(){try{var t=TA(this.signature.buffer,this.algorithm,this.key.buffer),r=bA(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};pa.decode=bA;pa.isValid=EA;pa.verify=TA;SA.exports=pa});var pd=v(Zi=>{p();var IA=hA(),ld=OA(),NK=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Zi.ALGORITHMS=NK;Zi.sign=IA.sign;Zi.verify=ld.verify;Zi.decode=ld.decode;Zi.isValid=ld.isValid;Zi.createSign=function(t){return new IA(t)};Zi.createVerify=function(t){return new ld(t)}});var Dy=v((RTe,wA)=>{p();var PK=pd();wA.exports=function(e,t){t=t||{};var r=PK.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var au=v((CTe,xA)=>{p();var dd=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};dd.prototype=Object.create(Error.prototype);dd.prototype.constructor=dd;xA.exports=dd});var Cy=v((LTe,NA)=>{p();var AA=au(),fd=function(e,t){AA.call(this,e),this.name="NotBeforeError",this.date=t};fd.prototype=Object.create(AA.prototype);fd.prototype.constructor=fd;NA.exports=fd});var ky=v(($Te,RA)=>{p();var PA=au(),hd=function(e,t){PA.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};hd.prototype=Object.create(PA.prototype);hd.prototype.constructor=hd;RA.exports=hd});var CA=v((qTe,DA)=>{p();var da=1e3,fa=da*60,ha=fa*60,Fo=ha*24,RK=Fo*7,DK=Fo*365.25;DA.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return CK(e);if(r==="number"&&isFinite(e))return t.long?LK(e):kK(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function CK(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*DK;case"weeks":case"week":case"w":return r*RK;case"days":case"day":case"d":return r*Fo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*ha;case"minutes":case"minute":case"mins":case"min":case"m":return r*fa;case"seconds":case"second":case"secs":case"sec":case"s":return r*da;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function kK(e){var t=Math.abs(e);return t>=Fo?Math.round(e/Fo)+"d":t>=ha?Math.round(e/ha)+"h":t>=fa?Math.round(e/fa)+"m":t>=da?Math.round(e/da)+"s":e+"ms"}function LK(e){var t=Math.abs(e);return t>=Fo?md(e,t,Fo,"day"):t>=ha?md(e,t,ha,"hour"):t>=fa?md(e,t,fa,"minute"):t>=da?md(e,t,da,"second"):e+" ms"}function md(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Ly=v((UTe,kA)=>{p();var jK=CA();kA.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=jK(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0}});var ma=v((GTe,LA)=>{"use strict";p();var $K="2.0.0",MK=Number.MAX_SAFE_INTEGER||9007199254740991,qK=16,FK=250,UK=["major","premajor","minor","preminor","patch","prepatch","prerelease"];LA.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:qK,MAX_SAFE_BUILD_LENGTH:FK,MAX_SAFE_INTEGER:MK,RELEASE_TYPES:UK,SEMVER_SPEC_VERSION:$K,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var cu=v((BTe,jA)=>{"use strict";p();var zK=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};jA.exports=zK});var ga=v((Bn,$A)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:jy,MAX_SAFE_BUILD_LENGTH:GK,MAX_LENGTH:VK}=ma(),BK=cu();Bn=$A.exports={};var ZK=Bn.re=[],KK=Bn.safeRe=[],z=Bn.src=[],HK=Bn.safeSrc=[],G=Bn.t={},QK=0,$y="[a-zA-Z0-9-]",WK=[["\\s",1],["\\d",VK],[$y,GK]],JK=e=>{for(let[t,r]of WK)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},pe=(e,t,r)=>{let n=JK(t),i=QK++;BK(e,i,t),G[e]=i,z[i]=t,HK[i]=n,ZK[i]=new RegExp(t,r?"g":void 0),KK[i]=new RegExp(n,r?"g":void 0)};pe("NUMERICIDENTIFIER","0|[1-9]\\d*");pe("NUMERICIDENTIFIERLOOSE","\\d+");pe("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${$y}*`);pe("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);pe("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);pe("PRERELEASEIDENTIFIER",`(?:${z[G.NONNUMERICIDENTIFIER]}|${z[G.NUMERICIDENTIFIER]})`);pe("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NONNUMERICIDENTIFIER]}|${z[G.NUMERICIDENTIFIERLOOSE]})`);pe("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);pe("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);pe("BUILDIDENTIFIER",`${$y}+`);pe("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);pe("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);pe("FULL",`^${z[G.FULLPLAIN]}$`);pe("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);pe("LOOSE",`^${z[G.LOOSEPLAIN]}$`);pe("GTLT","((?:<|>)?=?)");pe("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);pe("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);pe("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);pe("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);pe("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);pe("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);pe("COERCEPLAIN",`(^|[^\\d])(\\d{1,${jy}})(?:\\.(\\d{1,${jy}}))?(?:\\.(\\d{1,${jy}}))?`);pe("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);pe("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);pe("COERCERTL",z[G.COERCE],!0);pe("COERCERTLFULL",z[G.COERCEFULL],!0);pe("LONETILDE","(?:~>?)");pe("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);Bn.tildeTrimReplace="$1~";pe("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);pe("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);pe("LONECARET","(?:\\^)");pe("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);Bn.caretTrimReplace="$1^";pe("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);pe("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);pe("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);pe("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);pe("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);Bn.comparatorTrimReplace="$1$2$3";pe("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);pe("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);pe("STAR","(<|>)?=?\\s*\\*");pe("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");pe("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var gd=v((HTe,MA)=>{"use strict";p();var YK=Object.freeze({loose:!0}),XK=Object.freeze({}),eH=e=>e?typeof e!="object"?YK:e:XK;MA.exports=eH});var My=v((WTe,UA)=>{"use strict";p();var qA=/^[0-9]+$/,FA=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=qA.test(e),n=qA.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},tH=(e,t)=>FA(t,e);UA.exports={compareIdentifiers:FA,rcompareIdentifiers:tH}});var Gt=v((YTe,GA)=>{"use strict";p();var yd=cu(),{MAX_LENGTH:zA,MAX_SAFE_INTEGER:_d}=ma(),{safeRe:vd,t:Ed}=ga(),rH=gd(),{compareIdentifiers:qy}=My(),Fy=class e{constructor(t,r){if(r=rH(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>zA)throw new TypeError(`version is longer than ${zA} characters`);yd("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?vd[Ed.LOOSE]:vd[Ed.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>_d||this.major<0)throw new TypeError("Invalid major version");if(this.minor>_d||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>_d||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<_d)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(yd("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(yd("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qy(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(yd("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return qy(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?vd[Ed.PRERELEASELOOSE]:vd[Ed.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),qy(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};GA.exports=Fy});var Ki=v((ebe,BA)=>{"use strict";p();var VA=Gt(),nH=(e,t,r=!1)=>{if(e instanceof VA)return e;try{return new VA(e,t)}catch(n){if(!r)return null;throw n}};BA.exports=nH});var KA=v((rbe,ZA)=>{"use strict";p();var iH=Ki(),oH=(e,t)=>{let r=iH(e,t);return r?r.version:null};ZA.exports=oH});var QA=v((ibe,HA)=>{"use strict";p();var sH=Ki(),aH=(e,t)=>{let r=sH(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};HA.exports=aH});var YA=v((sbe,JA)=>{"use strict";p();var WA=Gt(),cH=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new WA(e instanceof WA?e.version:e,r).inc(t,n,i).version}catch{return null}};JA.exports=cH});var tN=v((cbe,eN)=>{"use strict";p();var XA=Ki(),uH=(e,t)=>{let r=XA(e,null,!0),n=XA(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};eN.exports=uH});var nN=v((lbe,rN)=>{"use strict";p();var lH=Gt(),pH=(e,t)=>new lH(e,t).major;rN.exports=pH});var oN=v((dbe,iN)=>{"use strict";p();var dH=Gt(),fH=(e,t)=>new dH(e,t).minor;iN.exports=fH});var aN=v((hbe,sN)=>{"use strict";p();var hH=Gt(),mH=(e,t)=>new hH(e,t).patch;sN.exports=mH});var uN=v((gbe,cN)=>{"use strict";p();var gH=Ki(),yH=(e,t)=>{let r=gH(e,t);return r&&r.prerelease.length?r.prerelease:null};cN.exports=yH});var Jr=v((_be,pN)=>{"use strict";p();var lN=Gt(),_H=(e,t,r)=>new lN(e,r).compare(new lN(t,r));pN.exports=_H});var fN=v((Ebe,dN)=>{"use strict";p();var vH=Jr(),EH=(e,t,r)=>vH(t,e,r);dN.exports=EH});var mN=v((bbe,hN)=>{"use strict";p();var TH=Jr(),bH=(e,t)=>TH(e,t,!0);hN.exports=bH});var Td=v((Obe,yN)=>{"use strict";p();var gN=Gt(),SH=(e,t,r)=>{let n=new gN(e,r),i=new gN(t,r);return n.compare(i)||n.compareBuild(i)};yN.exports=SH});var vN=v((wbe,_N)=>{"use strict";p();var OH=Td(),IH=(e,t)=>e.sort((r,n)=>OH(r,n,t));_N.exports=IH});var TN=v((Abe,EN)=>{"use strict";p();var wH=Td(),xH=(e,t)=>e.sort((r,n)=>wH(n,r,t));EN.exports=xH});var uu=v((Pbe,bN)=>{"use strict";p();var AH=Jr(),NH=(e,t,r)=>AH(e,t,r)>0;bN.exports=NH});var bd=v((Dbe,SN)=>{"use strict";p();var PH=Jr(),RH=(e,t,r)=>PH(e,t,r)<0;SN.exports=RH});var Uy=v((kbe,ON)=>{"use strict";p();var DH=Jr(),CH=(e,t,r)=>DH(e,t,r)===0;ON.exports=CH});var zy=v((jbe,IN)=>{"use strict";p();var kH=Jr(),LH=(e,t,r)=>kH(e,t,r)!==0;IN.exports=LH});var Sd=v((Mbe,wN)=>{"use strict";p();var jH=Jr(),$H=(e,t,r)=>jH(e,t,r)>=0;wN.exports=$H});var Od=v((Fbe,xN)=>{"use strict";p();var MH=Jr(),qH=(e,t,r)=>MH(e,t,r)<=0;xN.exports=qH});var Gy=v((zbe,AN)=>{"use strict";p();var FH=Uy(),UH=zy(),zH=uu(),GH=Sd(),VH=bd(),BH=Od(),ZH=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return FH(e,r,n);case"!=":return UH(e,r,n);case">":return zH(e,r,n);case">=":return GH(e,r,n);case"<":return VH(e,r,n);case"<=":return BH(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};AN.exports=ZH});var PN=v((Vbe,NN)=>{"use strict";p();var KH=Gt(),HH=Ki(),{safeRe:Id,t:wd}=ga(),QH=(e,t)=>{if(e instanceof KH)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Id[wd.COERCEFULL]:Id[wd.COERCE]);else{let c=t.includePrerelease?Id[wd.COERCERTLFULL]:Id[wd.COERCERTL],u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return HH(`${n}.${i}.${o}${s}${a}`,t)};NN.exports=QH});var DN=v((Zbe,RN)=>{"use strict";p();var WH=Ki(),JH=ma(),YH=Gt(),XH=(e,t,r)=>{if(!JH.RELEASE_TYPES.includes(t))return null;let n=eQ(e,r);return n&&tQ(n,t)},eQ=(e,t)=>{let r=e instanceof YH?e.version:e;return WH(r,t)},tQ=(e,t)=>{if(rQ(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},rQ=e=>e.startsWith("pre");RN.exports=XH});var kN=v((Hbe,CN)=>{"use strict";p();var Vy=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};CN.exports=Vy});var Yr=v((Wbe,MN)=>{"use strict";p();var nQ=/\s+/g,By=class e{constructor(t,r){if(r=oQ(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Zy)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(nQ," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!jN(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hQ(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(fQ,"");let n=((this.options.includePrerelease&&pQ)|(this.options.loose&&dQ))+":"+t,i=LN.get(n);if(i)return i;let o=this.options.loose,s=o?dr[Vt.HYPHENRANGELOOSE]:dr[Vt.HYPHENRANGE];t=t.replace(s,OQ(this.options.includePrerelease)),st("hyphen replace",t),t=t.replace(dr[Vt.COMPARATORTRIM],cQ),st("comparator trim",t),t=t.replace(dr[Vt.TILDETRIM],uQ),st("tilde trim",t),t=t.replace(dr[Vt.CARETTRIM],lQ),st("caret trim",t);let a=t.split(" ").map(d=>mQ(d,this.options)).join(" ").split(/\s+/).map(d=>SQ(d,this.options));o&&(a=a.filter(d=>(st("loose invalid filter",d,this.options),!!d.match(dr[Vt.COMPARATORLOOSE])))),st("range list",a);let c=new Map,u=a.map(d=>new Zy(d,this.options));for(let d of u){if(jN(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return LN.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>$N(n,r)&&t.set.some(i=>$N(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new sQ(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(IQ(this.set[r],t,this.options))return!0;return!1}};MN.exports=By;var iQ=kN(),LN=new iQ,oQ=gd(),Zy=lu(),st=cu(),sQ=Gt(),{safeRe:dr,src:aQ,t:Vt,comparatorTrimReplace:cQ,tildeTrimReplace:uQ,caretTrimReplace:lQ}=ga(),{FLAG_INCLUDE_PRERELEASE:pQ,FLAG_LOOSE:dQ}=ma(),fQ=new RegExp(aQ[Vt.BUILD],"g"),jN=e=>e.value==="<0.0.0-0",hQ=e=>e.value==="",$N=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},mQ=(e,t)=>(e=e.replace(dr[Vt.BUILD],""),st("comp",e,t),e=_Q(e,t),st("caret",e),e=gQ(e,t),st("tildes",e),e=EQ(e,t),st("xrange",e),e=bQ(e,t),st("stars",e),e),fr=e=>!e||e.toLowerCase()==="x"||e==="*",gQ=(e,t)=>e.trim().split(/\s+/).map(r=>yQ(r,t)).join(" "),yQ=(e,t)=>{let r=t.loose?dr[Vt.TILDELOOSE]:dr[Vt.TILDE];return e.replace(r,(n,i,o,s,a)=>{st("tilde",e,n,i,o,s,a);let c;return fr(i)?c="":fr(o)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:fr(s)?c=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(st("replaceTilde pr",a),c=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):c=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,st("tilde return",c),c})},_Q=(e,t)=>e.trim().split(/\s+/).map(r=>vQ(r,t)).join(" "),vQ=(e,t)=>{st("caret",e,t);let r=t.loose?dr[Vt.CARETLOOSE]:dr[Vt.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{st("caret",e,i,o,s,a,c);let u;return fr(o)?u="":fr(s)?u=`>=${o}.0.0${n} <${+o+1}.0.0-0`:fr(a)?o==="0"?u=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(st("replaceCaret pr",c),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(st("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),st("caret return",u),u})},EQ=(e,t)=>(st("replaceXRanges",e,t),e.split(/\s+/).map(r=>TQ(r,t)).join(" ")),TQ=(e,t)=>{e=e.trim();let r=t.loose?dr[Vt.XRANGELOOSE]:dr[Vt.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{st("xRange",e,n,i,o,s,a,c);let u=fr(o),l=u||fr(s),d=l||fr(a),f=d;return i==="="&&f&&(i=""),c=t.includePrerelease?"-0":"",u?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):l?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:d&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),st("xRange return",n),n})},bQ=(e,t)=>(st("replaceStars",e,t),e.trim().replace(dr[Vt.STAR],"")),SQ=(e,t)=>(st("replaceGTE0",e,t),e.trim().replace(dr[t.includePrerelease?Vt.GTE0PRE:Vt.GTE0],"")),OQ=e=>(t,r,n,i,o,s,a,c,u,l,d,f)=>(fr(n)?r="":fr(i)?r=`>=${n}.0.0${e?"-0":""}`:fr(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,fr(u)?c="":fr(l)?c=`<${+u+1}.0.0-0`:fr(d)?c=`<${u}.${+l+1}.0-0`:f?c=`<=${u}.${l}.${d}-${f}`:e?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),IQ=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(st(e[n].semver),e[n].semver!==Zy.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var lu=v((Ybe,VN)=>{"use strict";p();var pu=Symbol("SemVer ANY"),Qy=class e{static get ANY(){return pu}constructor(t,r){if(r=qN(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Hy("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===pu?this.value="":this.value=this.operator+this.semver.version,Hy("comp",this)}parse(t){let r=this.options.loose?FN[UN.COMPARATORLOOSE]:FN[UN.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new zN(n[2],this.options.loose):this.semver=pu}toString(){return this.value}test(t){if(Hy("Comparator.test",t,this.options.loose),this.semver===pu||t===pu)return!0;if(typeof t=="string")try{t=new zN(t,this.options)}catch{return!1}return Ky(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new GN(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new GN(this.value,r).test(t.semver):(r=qN(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Ky(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Ky(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};VN.exports=Qy;var qN=gd(),{safeRe:FN,t:UN}=ga(),Ky=Gy(),Hy=cu(),zN=Gt(),GN=Yr()});var du=v((eSe,BN)=>{"use strict";p();var wQ=Yr(),xQ=(e,t,r)=>{try{t=new wQ(t,r)}catch{return!1}return t.test(e)};BN.exports=xQ});var KN=v((rSe,ZN)=>{"use strict";p();var AQ=Yr(),NQ=(e,t)=>new AQ(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));ZN.exports=NQ});var QN=v((iSe,HN)=>{"use strict";p();var PQ=Gt(),RQ=Yr(),DQ=(e,t,r)=>{let n=null,i=null,o=null;try{o=new RQ(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new PQ(n,r))}),n};HN.exports=DQ});var JN=v((sSe,WN)=>{"use strict";p();var CQ=Gt(),kQ=Yr(),LQ=(e,t,r)=>{let n=null,i=null,o=null;try{o=new kQ(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new CQ(n,r))}),n};WN.exports=LQ});var eP=v((cSe,XN)=>{"use strict";p();var Wy=Gt(),jQ=Yr(),YN=uu(),$Q=(e,t)=>{e=new jQ(e,t);let r=new Wy("0.0.0");if(e.test(r)||(r=new Wy("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new Wy(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||YN(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||YN(r,o))&&(r=o)}return r&&e.test(r)?r:null};XN.exports=$Q});var rP=v((lSe,tP)=>{"use strict";p();var MQ=Yr(),qQ=(e,t)=>{try{return new MQ(e,t).range||"*"}catch{return null}};tP.exports=qQ});var xd=v((dSe,sP)=>{"use strict";p();var FQ=Gt(),oP=lu(),{ANY:UQ}=oP,zQ=Yr(),GQ=du(),nP=uu(),iP=bd(),VQ=Od(),BQ=Sd(),ZQ=(e,t,r,n)=>{e=new FQ(e,n),t=new zQ(t,n);let i,o,s,a,c;switch(r){case">":i=nP,o=VQ,s=iP,a=">",c=">=";break;case"<":i=iP,o=BQ,s=nP,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(GQ(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],d=null,f=null;if(l.forEach(h=>{h.semver===UQ&&(h=new oP(">=0.0.0")),d=d||h,f=f||h,i(h.semver,d.semver,n)?d=h:s(h.semver,f.semver,n)&&(f=h)}),d.operator===a||d.operator===c||(!f.operator||f.operator===a)&&o(e,f.semver))return!1;if(f.operator===c&&s(e,f.semver))return!1}return!0};sP.exports=ZQ});var cP=v((hSe,aP)=>{"use strict";p();var KQ=xd(),HQ=(e,t,r)=>KQ(e,t,">",r);aP.exports=HQ});var lP=v((gSe,uP)=>{"use strict";p();var QQ=xd(),WQ=(e,t,r)=>QQ(e,t,"<",r);uP.exports=WQ});var fP=v((_Se,dP)=>{"use strict";p();var pP=Yr(),JQ=(e,t,r)=>(e=new pP(e,r),t=new pP(t,r),e.intersects(t,r));dP.exports=JQ});var mP=v((ESe,hP)=>{"use strict";p();var YQ=du(),XQ=Jr();hP.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((l,d)=>XQ(l,d,r));for(let l of s)YQ(l,t,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return c.length<u.length?c:t}});var TP=v((bSe,EP)=>{"use strict";p();var gP=Yr(),Xy=lu(),{ANY:Jy}=Xy,Yy=du(),e_=Jr(),e2=(e,t,r={})=>{if(e===t)return!0;e=new gP(e,r),t=new gP(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=r2(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},t2=[new Xy(">=0.0.0-0")],yP=[new Xy(">=0.0.0")],r2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Jy){if(t.length===1&&t[0].semver===Jy)return!0;r.includePrerelease?e=t2:e=yP}if(t.length===1&&t[0].semver===Jy){if(r.includePrerelease)return!0;t=yP}let n=new Set,i,o;for(let h of e)h.operator===">"||h.operator===">="?i=_P(i,h,r):h.operator==="<"||h.operator==="<="?o=vP(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=e_(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let h of n){if(i&&!Yy(h,String(i),r)||o&&!Yy(h,String(o),r))return null;for(let m of t)if(!Yy(h,String(m),r))return!1;return!0}let a,c,u,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of t){if(l=l||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=_P(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(o){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(c=vP(o,h,r),c===h&&c!==o)return!1}else if(o.operator==="<="&&!h.test(o.semver))return!1}if(!h.operator&&(o||i)&&s!==0)return!1}return!(i&&u&&!o&&s!==0||o&&l&&!i&&s!==0||f||d)},_P=(e,t,r)=>{if(!e)return t;let n=e_(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},vP=(e,t,r)=>{if(!e)return t;let n=e_(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};EP.exports=e2});var Ad=v((OSe,OP)=>{"use strict";p();var t_=ga(),bP=ma(),n2=Gt(),SP=My(),i2=Ki(),o2=KA(),s2=QA(),a2=YA(),c2=tN(),u2=nN(),l2=oN(),p2=aN(),d2=uN(),f2=Jr(),h2=fN(),m2=mN(),g2=Td(),y2=vN(),_2=TN(),v2=uu(),E2=bd(),T2=Uy(),b2=zy(),S2=Sd(),O2=Od(),I2=Gy(),w2=PN(),x2=DN(),A2=lu(),N2=Yr(),P2=du(),R2=KN(),D2=QN(),C2=JN(),k2=eP(),L2=rP(),j2=xd(),$2=cP(),M2=lP(),q2=fP(),F2=mP(),U2=TP();OP.exports={parse:i2,valid:o2,clean:s2,inc:a2,diff:c2,major:u2,minor:l2,patch:p2,prerelease:d2,compare:f2,rcompare:h2,compareLoose:m2,compareBuild:g2,sort:y2,rsort:_2,gt:v2,lt:E2,eq:T2,neq:b2,gte:S2,lte:O2,cmp:I2,coerce:w2,truncate:x2,Comparator:A2,Range:N2,satisfies:P2,toComparators:R2,maxSatisfying:D2,minSatisfying:C2,minVersion:k2,validRange:L2,outside:j2,gtr:$2,ltr:M2,intersects:q2,simplifyRange:F2,subset:U2,SemVer:n2,re:t_.re,src:t_.src,tokens:t_.t,SEMVER_SPEC_VERSION:bP.SEMVER_SPEC_VERSION,RELEASE_TYPES:bP.RELEASE_TYPES,compareIdentifiers:SP.compareIdentifiers,rcompareIdentifiers:SP.rcompareIdentifiers}});var wP=v((wSe,IP)=>{p();var z2=Ad();IP.exports=z2.satisfies(process.version,">=15.7.0")});var AP=v((ASe,xP)=>{p();var G2=Ad();xP.exports=G2.satisfies(process.version,">=16.9.0")});var r_=v((PSe,NP)=>{p();var V2=wP(),B2=AP(),Z2={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},K2={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};NP.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=Z2[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(V2)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,o=K2[e];if(i!==o)throw new Error(`"alg" parameter "${e}" requires curve "${o}".`);break;case"rsa-pss":if(B2){let s=parseInt(e.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:c,saltLength:u}=t.asymmetricKeyDetails;if(a!==`sha${s}`||c!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(u!==void 0&&u>s>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var n_=v((DSe,PP)=>{p();var H2=Ad();PP.exports=H2.satisfies(process.version,"^6.12.0 || >=8.0.0")});var CP=v((kSe,DP)=>{p();var tt=au(),Q2=Cy(),RP=ky(),W2=Dy(),J2=Ly(),Y2=r_(),X2=n_(),e4=pd(),{KeyObject:t4,createSecretKey:r4,createPublicKey:n4}=H("crypto"),i_=["RS256","RS384","RS512"],i4=["ES256","ES384","ES512"],o_=["RS256","RS384","RS512"],o4=["HS256","HS384","HS512"];X2&&(i_.splice(i_.length,0,"PS256","PS384","PS512"),o_.splice(o_.length,0,"PS256","PS384","PS512"));DP.exports=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let i;if(n?i=n:i=function(l,d){if(l)throw l;return d},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new tt("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new tt("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new tt("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new tt("jwt must be provided"));if(typeof e!="string")return i(new tt("jwt must be a string"));let s=e.split(".");if(s.length!==3)return i(new tt("jwt malformed"));let a;try{a=W2(e,{complete:!0})}catch(l){return i(l)}if(!a)return i(new tt("invalid token"));let c=a.header,u;if(typeof t=="function"){if(!n)return i(new tt("verify must be called asynchronous if secret or public key is provided as a callback"));u=t}else u=function(l,d){return d(null,t)};return u(c,function(l,d){if(l)return i(new tt("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&d)return i(new tt("jwt signature is required"));if(f&&!d)return i(new tt("secret or public key must be provided"));if(!f&&!r.algorithms)return i(new tt('please specify "none" in "algorithms" to verify unsigned tokens'));if(d!=null&&!(d instanceof t4))try{d=n4(d)}catch{try{d=r4(typeof d=="string"?Buffer.from(d):d)}catch{return i(new tt("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(d.type==="secret"?r.algorithms=o4:["rsa","rsa-pss"].includes(d.asymmetricKeyType)?r.algorithms=o_:d.asymmetricKeyType==="ec"?r.algorithms=i4:r.algorithms=i_),r.algorithms.indexOf(a.header.alg)===-1)return i(new tt("invalid algorithm"));if(c.alg.startsWith("HS")&&d.type!=="secret")return i(new tt(`secretOrPublicKey must be a symmetric key when using ${c.alg}`));if(/^(?:RS|PS|ES)/.test(c.alg)&&d.type!=="public")return i(new tt(`secretOrPublicKey must be an asymmetric key when using ${c.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{Y2(c.alg,d)}catch(y){return i(y)}let h;try{h=e4.verify(e,a.header.alg,d)}catch(y){return i(y)}if(!h)return i(new tt("invalid signature"));let m=a.payload;if(typeof m.nbf<"u"&&!r.ignoreNotBefore){if(typeof m.nbf!="number")return i(new tt("invalid nbf value"));if(m.nbf>o+(r.clockTolerance||0))return i(new Q2("jwt not active",new Date(m.nbf*1e3)))}if(typeof m.exp<"u"&&!r.ignoreExpiration){if(typeof m.exp!="number")return i(new tt("invalid exp value"));if(o>=m.exp+(r.clockTolerance||0))return i(new RP("jwt expired",new Date(m.exp*1e3)))}if(r.audience){let y=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(m.aud)?m.aud:[m.aud]).some(function(b){return y.some(function(O){return O instanceof RegExp?O.test(b):O===b})}))return i(new tt("jwt audience invalid. expected: "+y.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&m.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(m.iss)===-1))return i(new tt("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&m.sub!==r.subject)return i(new tt("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&m.jti!==r.jwtid)return i(new tt("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&m.nonce!==r.nonce)return i(new tt("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof m.iat!="number")return i(new tt("iat required when maxAge is specified"));let y=J2(r.maxAge,m.iat);if(typeof y>"u")return i(new tt('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=y+(r.clockTolerance||0))return i(new RP("maxAge exceeded",new Date(y*1e3)))}if(r.complete===!0){let y=a.signature;return i(null,{header:c,payload:m,signature:y})}return i(null,m)})}});var qP=v((jSe,MP)=>{p();var kP=1/0,jP=9007199254740991,s4=17976931348623157e292,LP=NaN,a4="[object Arguments]",c4="[object Function]",u4="[object GeneratorFunction]",l4="[object String]",p4="[object Symbol]",d4=/^\s+|\s+$/g,f4=/^[-+]0x[0-9a-f]+$/i,h4=/^0b[01]+$/i,m4=/^0o[0-7]+$/i,g4=/^(?:0|[1-9]\d*)$/,y4=parseInt;function _4(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function v4(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function E4(e,t,r){if(t!==t)return v4(e,T4,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function T4(e){return e!==e}function b4(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function S4(e,t){return _4(t,function(r){return e[r]})}function O4(e,t){return function(r){return e(t(r))}}var Nd=Object.prototype,a_=Nd.hasOwnProperty,Pd=Nd.toString,I4=Nd.propertyIsEnumerable,w4=O4(Object.keys,Object),x4=Math.max;function A4(e,t){var r=$P(e)||C4(e)?b4(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||a_.call(e,o))&&!(i&&(o=="length"||P4(o,n)))&&r.push(o);return r}function N4(e){if(!R4(e))return w4(e);var t=[];for(var r in Object(e))a_.call(e,r)&&r!="constructor"&&t.push(r);return t}function P4(e,t){return t=t??jP,!!t&&(typeof e=="number"||g4.test(e))&&e>-1&&e%1==0&&e<t}function R4(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Nd;return e===r}function D4(e,t,r,n){e=c_(e)?e:G4(e),r=r&&!n?F4(r):0;var i=e.length;return r<0&&(r=x4(i+r,0)),$4(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&E4(e,t,r)>-1}function C4(e){return k4(e)&&a_.call(e,"callee")&&(!I4.call(e,"callee")||Pd.call(e)==a4)}var $P=Array.isArray;function c_(e){return e!=null&&j4(e.length)&&!L4(e)}function k4(e){return u_(e)&&c_(e)}function L4(e){var t=s_(e)?Pd.call(e):"";return t==c4||t==u4}function j4(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jP}function s_(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function u_(e){return!!e&&typeof e=="object"}function $4(e){return typeof e=="string"||!$P(e)&&u_(e)&&Pd.call(e)==l4}function M4(e){return typeof e=="symbol"||u_(e)&&Pd.call(e)==p4}function q4(e){if(!e)return e===0?e:0;if(e=U4(e),e===kP||e===-kP){var t=e<0?-1:1;return t*s4}return e===e?e:0}function F4(e){var t=q4(e),r=t%1;return t===t?r?t-r:t:0}function U4(e){if(typeof e=="number")return e;if(M4(e))return LP;if(s_(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=s_(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(d4,"");var r=h4.test(e);return r||m4.test(e)?y4(e.slice(2),r?2:8):f4.test(e)?LP:+e}function z4(e){return c_(e)?A4(e):N4(e)}function G4(e){return e?S4(e,z4(e)):[]}MP.exports=D4});var UP=v((MSe,FP)=>{p();var V4="[object Boolean]",B4=Object.prototype,Z4=B4.toString;function K4(e){return e===!0||e===!1||H4(e)&&Z4.call(e)==V4}function H4(e){return!!e&&typeof e=="object"}FP.exports=K4});var ZP=v((FSe,BP)=>{p();var zP=1/0,Q4=17976931348623157e292,GP=NaN,W4="[object Symbol]",J4=/^\s+|\s+$/g,Y4=/^[-+]0x[0-9a-f]+$/i,X4=/^0b[01]+$/i,eW=/^0o[0-7]+$/i,tW=parseInt,rW=Object.prototype,nW=rW.toString;function iW(e){return typeof e=="number"&&e==cW(e)}function VP(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function oW(e){return!!e&&typeof e=="object"}function sW(e){return typeof e=="symbol"||oW(e)&&nW.call(e)==W4}function aW(e){if(!e)return e===0?e:0;if(e=uW(e),e===zP||e===-zP){var t=e<0?-1:1;return t*Q4}return e===e?e:0}function cW(e){var t=aW(e),r=t%1;return t===t?r?t-r:t:0}function uW(e){if(typeof e=="number")return e;if(sW(e))return GP;if(VP(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=VP(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(J4,"");var r=X4.test(e);return r||eW.test(e)?tW(e.slice(2),r?2:8):Y4.test(e)?GP:+e}BP.exports=iW});var HP=v((zSe,KP)=>{p();var lW="[object Number]",pW=Object.prototype,dW=pW.toString;function fW(e){return!!e&&typeof e=="object"}function hW(e){return typeof e=="number"||fW(e)&&dW.call(e)==lW}KP.exports=hW});var YP=v((VSe,JP)=>{p();var mW="[object Object]";function gW(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function yW(e,t){return function(r){return e(t(r))}}var _W=Function.prototype,QP=Object.prototype,WP=_W.toString,vW=QP.hasOwnProperty,EW=WP.call(Object),TW=QP.toString,bW=yW(Object.getPrototypeOf,Object);function SW(e){return!!e&&typeof e=="object"}function OW(e){if(!SW(e)||TW.call(e)!=mW||gW(e))return!1;var t=bW(e);if(t===null)return!0;var r=vW.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&WP.call(r)==EW}JP.exports=OW});var eR=v((ZSe,XP)=>{p();var IW="[object String]",wW=Object.prototype,xW=wW.toString,AW=Array.isArray;function NW(e){return!!e&&typeof e=="object"}function PW(e){return typeof e=="string"||!AW(e)&&NW(e)&&xW.call(e)==IW}XP.exports=PW});var oR=v((HSe,iR)=>{p();var RW="Expected a function",tR=1/0,DW=17976931348623157e292,rR=NaN,CW="[object Symbol]",kW=/^\s+|\s+$/g,LW=/^[-+]0x[0-9a-f]+$/i,jW=/^0b[01]+$/i,$W=/^0o[0-7]+$/i,MW=parseInt,qW=Object.prototype,FW=qW.toString;function UW(e,t){var r;if(typeof t!="function")throw new TypeError(RW);return e=ZW(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function zW(e){return UW(2,e)}function nR(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function GW(e){return!!e&&typeof e=="object"}function VW(e){return typeof e=="symbol"||GW(e)&&FW.call(e)==CW}function BW(e){if(!e)return e===0?e:0;if(e=KW(e),e===tR||e===-tR){var t=e<0?-1:1;return t*DW}return e===e?e:0}function ZW(e){var t=BW(e),r=t%1;return t===t?r?t-r:t:0}function KW(e){if(typeof e=="number")return e;if(VW(e))return rR;if(nR(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=nR(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(kW,"");var r=jW.test(e);return r||$W.test(e)?MW(e.slice(2),r?2:8):LW.test(e)?rR:+e}iR.exports=zW});var hR=v((WSe,fR)=>{p();var sR=Ly(),HW=n_(),QW=r_(),aR=pd(),WW=qP(),Rd=UP(),cR=ZP(),l_=HP(),lR=YP(),Hi=eR(),JW=oR(),{KeyObject:YW,createSecretKey:XW,createPrivateKey:e9}=H("crypto"),pR=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];HW&&pR.splice(3,0,"PS256","PS384","PS512");var t9={expiresIn:{isValid:function(e){return cR(e)||Hi(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return cR(e)||Hi(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return Hi(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:WW.bind(null,pR),message:'"algorithm" must be a valid string enum value'},header:{isValid:lR,message:'"header" must be an object'},encoding:{isValid:Hi,message:'"encoding" must be a string'},issuer:{isValid:Hi,message:'"issuer" must be a string'},subject:{isValid:Hi,message:'"subject" must be a string'},jwtid:{isValid:Hi,message:'"jwtid" must be a string'},noTimestamp:{isValid:Rd,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Hi,message:'"keyid" must be a string'},mutatePayload:{isValid:Rd,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Rd,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Rd,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},r9={iat:{isValid:l_,message:'"iat" should be a number of seconds'},exp:{isValid:l_,message:'"exp" should be a number of seconds'},nbf:{isValid:l_,message:'"nbf" should be a number of seconds'}};function dR(e,t,r,n){if(!lR(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=e[i];if(!o){if(!t)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw new Error(o.message)})}function n9(e){return dR(t9,!1,e,"options")}function i9(e){return dR(r9,!0,e,"payload")}var uR={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},o9=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];fR.exports=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let i=typeof e=="object"&&!Buffer.isBuffer(e),o=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function s(u){if(n)return n(u);throw u}if(!t&&r.algorithm!=="none")return s(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof YW))try{t=e9(t)}catch{try{t=XW(typeof t=="string"?Buffer.from(t):t)}catch{return s(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&t.type!=="secret")return s(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(t.type!=="private")return s(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!r.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return s(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof e>"u")return s(new Error("payload is required"));if(i){try{i9(e)}catch(u){return s(u)}r.mutatePayload||(e=Object.assign({},e))}else{let u=o9.filter(function(l){return typeof r[l]<"u"});if(u.length>0)return s(new Error("invalid "+u.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return s(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return s(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{n9(r)}catch(u){return s(u)}if(!r.allowInvalidAsymmetricKeyTypes)try{QW(o.alg,t)}catch(u){return s(u)}let a=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:i&&(e.iat=a),typeof r.notBefore<"u"){try{e.nbf=sR(r.notBefore,a)}catch(u){return s(u)}if(typeof e.nbf>"u")return s(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=sR(r.expiresIn,a)}catch(u){return s(u)}if(typeof e.exp>"u")return s(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(uR).forEach(function(u){let l=uR[u];if(typeof r[u]<"u"){if(typeof e[l]<"u")return s(new Error('Bad "options.'+u+'" option. The payload already has an "'+l+'" property.'));e[l]=r[u]}});let c=r.encoding||"utf8";if(typeof n=="function")n=n&&JW(n),aR.createSign({header:o,privateKey:t,payload:e,encoding:c}).once("error",n).once("done",function(u){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&u.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));n(null,u)});else{let u=aR.sign({header:o,payload:e,secret:t,encoding:c});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&u.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return u}}});var fu=v((YSe,mR)=>{p();mR.exports={decode:Dy(),verify:CP(),sign:hR(),JsonWebTokenError:au(),NotBeforeError:Cy(),TokenExpiredError:ky()}});var xR=v(_a=>{"use strict";p();Object.defineProperty(_a,"__esModule",{value:!0});_a.versionInfo=_a.version=void 0;var x9="15.10.2";_a.version=x9;var A9=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});_a.versionInfo=A9});var qd=v(__=>{"use strict";p();Object.defineProperty(__,"__esModule",{value:!0});__.default=N9;function N9(e){return typeof e?.then=="function"}});var Xr=v(v_=>{"use strict";p();Object.defineProperty(v_,"__esModule",{value:!0});v_.default=P9;function P9(e,t){var r=!!e;if(!r)throw new Error(t)}});var Kn=v(E_=>{"use strict";p();Object.defineProperty(E_,"__esModule",{value:!0});E_.default=R9;function Fd(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fd=function(r){return typeof r}:Fd=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fd(e)}function R9(e){return Fd(e)=="object"&&e!==null}});var Hn=v(Qi=>{"use strict";p();Object.defineProperty(Qi,"__esModule",{value:!0});Qi.SYMBOL_TO_STRING_TAG=Qi.SYMBOL_ASYNC_ITERATOR=Qi.SYMBOL_ITERATOR=void 0;var D9=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";Qi.SYMBOL_ITERATOR=D9;var C9=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";Qi.SYMBOL_ASYNC_ITERATOR=C9;var k9=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";Qi.SYMBOL_TO_STRING_TAG=k9});var Ud=v(T_=>{"use strict";p();Object.defineProperty(T_,"__esModule",{value:!0});T_.getLocation=L9;function L9(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,o;(o=r.exec(e.body))&&o.index<t;)n+=1,i=t+1-(o.index+o[0].length);return{line:n,column:i}}});var b_=v(Gd=>{"use strict";p();Object.defineProperty(Gd,"__esModule",{value:!0});Gd.printLocation=$9;Gd.printSourceLocation=NR;var j9=Ud();function $9(e){return NR(e.source,(0,j9.getLocation)(e.source,e.start))}function NR(e,t){var r=e.locationOffset.column-1,n=zd(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?r:0,c=t.column+a,u="".concat(e.name,":").concat(s,":").concat(c,`
|
|
6
6
|
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(c/80),h=c%80,m=[],y=0;y<d.length;y+=80)m.push(d.slice(y,y+80));return u+AR([["".concat(s),m[0]]].concat(m.slice(1,f+1).map(function(E){return["",E]}),[[" ",zd(h-1)+"^"],["",m[f+1]]]))}return u+AR([["".concat(s-1),l[i-1]],["".concat(s),d],["",zd(c-1)+"^"],["".concat(s+1),l[i+1]]])}function AR(e){var t=e.filter(function(n){var i=n[0],o=n[1];return o!==void 0}),r=Math.max.apply(Math,t.map(function(n){var i=n[0];return i.length}));return t.map(function(n){var i=n[0],o=n[1];return M9(r,i)+(o?" | "+o:" |")}).join(`
|
|
@@ -1100,7 +1100,7 @@ ${String(e)}`)}catch(t){return t}},bj=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
`;p();import{randomUUID as xse}from"crypto";var Yq=Rt(RM(),1);p();var vse=Rt(wq(),1),Ese=Rt(Uh(),1),Tse=Rt(cc(),1),bse=Rt(uS(),1),Sse=Rt(dS(),1),Ose=Rt(_S(),1),Lq=Rt(Bh(),1),Ise=Rt(kq(),1);var jq=Lq.default;p();var $q=100*1024*1024,Kh=class{current=Promise.resolve();async run(t){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await t()}finally{n()}}},Gq=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`Failed to download CRDT model: ${t.status} ${t.statusText}`);let r=t.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:c}=await r.read();if(a)break;if(i+=c.length,i>$q)throw new Error(`CRDT model is larger than ${$q} bytes`);n.push(c)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},Ll=async(e,t)=>{try{return await t()}catch(r){return V.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},Mq=null,oi=async()=>(Mq??=Ll("@functorz/ztype",()=>import("./ztype-FPBSFRVF.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),Mq),qq=null,Vq=async()=>(qq??=Ll("@functorz/ztype",()=>import("./ztype-FPBSFRVF.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),qq),Fq=null,Bq=async()=>(Fq??=oi().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),Fq),Uq=null,Hh=async()=>(Uq??=Ll("@functorz/crdt-helper",()=>import("./index.cjs-7TU65RA5.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),Uq),zq=null,Zq=async()=>(zq??=Ll("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-OT6AZTRT.js")).then(e=>e??Ll("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-FDAMHL72.js"))).then(e=>e?.Patch??e?.default?.Patch??null),zq),ES=e=>e?.lastUploadedSchema??null,TS=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,bS=e=>e==null?e:structuredClone(e),Kq=(e,t)=>e?.appExId?e.appExId:t?.name??"",Hq=(e,t)=>{let r=e?.typesystem?.schema?.ClientType;if(r)return t==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:t==="MOBILE"?r.MOBILE??r.WEB:r.WEB},Qq=e=>{let t=e?.typesystem?.schema?.Product?.[Uo];if(!t)throw new Error(`ztype runtime has no Product enum member for ${Uo}`);return t},wse=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},Qh=e=>({componentId:e?.componentId??null,message:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("EN"):e?.message??String(e),zhMessage:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("ZH"):void 0,platform:e?.platform??null,isBackendError:!!e?.isBackendError,fullPath:wse(e?.fullPath??[])}),Wh=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),Wq=e=>Wh(e).length,Jq=(e,t)=>{if(t.__typename==="DiffItem"){let r=t.pathComponents?.at(-1)?.key??"";if(t.operation==="delete"){delete e[r];return}e[r]=structuredClone(t.newValue);return}if(t.__typename==="ArrayDiffItem"){let r=t.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(e)||r<0)throw new Error("Invalid array diff target");if(t.operation==="delete"){e.splice(r,1);return}if(t.operation==="insert"){e.splice(r,0,structuredClone(t.newValue));return}e[r]=structuredClone(t.newValue)}};var Xq=xse(),Ase=e=>{if(!e)return e;if(Array.isArray(e))return e.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof e=="object"&&"forEach"in e&&typeof e.forEach=="function"){let r={};return e.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let t={};for(let[r,n]of Object.entries(e))t[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return t};function SS(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return t.length>0?t.join("; "):null}var Nse=e=>{if(typeof e=="string")return e;if(e instanceof Uint8Array)return Buffer.from(e).toString("utf8");try{return String(e)}catch{return"<unserializable body>"}},jl=async(e,t)=>{let r=jd();V.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&V.debug(`[HTTP] Request Headers: ${JSON.stringify(Ase(t.headers))}`),r&&t?.body!=null&&V.debug(`[GQL] Request Body: ${Nse(t.body)}`);let n=await fetch(e,t),i=null;try{i=await n.clone().text()}catch(o){V.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&V.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=SS(o);s&&V.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function OS(e,t){let r=await e.getValidToken(),n=await An(t),i={Authorization:`Bearer ${r}`,"User-Locale":"en_US","X-SESSION-ID":Xq},o=await Bq();return o&&(i["X-ZED-VERSION"]=o),process.env.REACT_APP_VERSION&&(i["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new tr(`${n.apiBaseUrl}/api/graphql`,{headers:i,fetch:jl})}async function eF(e,t){let r=await e.getValidToken(),i=`${(await An(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(o,s,a)=>{let c=jd(),u={authToken:r,"X-SESSION-ID":Xq};V.debug(`[SUB] connecting ${i} params=${JSON.stringify({...u,authToken:"Bearer <redacted>"})}`);let l=new Yq.SubscriptionClient(i,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:u},jq);l.onConnected(()=>V.debug("[SUB] connected")),l.onReconnected(()=>V.debug("[SUB] reconnected")),l.onDisconnected(()=>V.debug("[SUB] disconnected")),l.onError(h=>V.debug(`[SUB] error ${h?.message??String(h)}`));let f=[{name:"onNewCrdtPatchV2",query:t$,variables:{projectExId:o.projectExId,appExId:o.appExId??null,versionExId:o.appVersionExId??null,latestPatchExIdInClient:s}},{name:"onSchemaUploadV3",query:r$,variables:{projectExId:o.projectExId,appExId:o.appExId??null,appVersionExId:o.appVersionExId??null}}].map(h=>(V.debug(`[SUB] subscribe ${h.name} vars=${JSON.stringify(h.variables)}`),l.request({query:h.query,variables:h.variables}).subscribe({next:m=>{c&&V.debug(`[SUB] ${h.name} event: ${JSON.stringify(m)}`),a()},error:m=>{V.warn("Schema subscription event failed",String(m)),a()}})));return{unsubscribe(){for(let h of f)h.unsubscribe();l.close(!1,!1)}}}}async function Jh(e,t){if(t.projectExId)return await e.saveProjectContext(t.projectExId),t.projectExId;let r=await e.loadProjectContext();if(!r?.projectExId)throw new Error("No projectExId provided and no current project is set");return r.projectExId}p();p();p();import{createHash as Pse}from"crypto";var Rse=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),IS=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:IS(r));if(!Rse(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=IS(n))}return t},Dse=e=>JSON.stringify(IS(e)),Cse=e=>Pse("sha256").update(Dse(e)).digest("hex"),tF=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:Cse(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),rF=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,Yh=e=>e.changes.length>0;var nF=null,kse=()=>(nF??=oi().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),nF),wS=async(e,t)=>{let r=await kse();return r?r(e,t):{changes:[]}};p();var Lse="Functorz";function iF(e,t,r,n){let i=e?.typesystem?.settings,o=e?.typesystem?.schema,s=e?.api?.ZTypeCoreApi,a=t?.KtList,c=t?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!s||!a||!c)return null;try{let{ExtraContext:u,AIModelDescriptors:l,ActionFlowTemplateCodeDescriptor:d}=i,{CustomChatModelDescriptor:f,CustomEmbeddingModelDescriptor:h,ModelCustomParamDescriptor:m,CustomModelParam:y,CustomChatCompletionFeatures:E,Identifier:T,MediaOutputCardinality:b,Variable:O}=o,x=R=>c.fromJsMap(new Map(Object.entries(R??{}))),I=R=>typeof R=="string"?R==="single"?b.SINGLE:R==="multiple"?b.MULTIPLE:b.NONE:typeof R=="boolean"&&R?b.MULTIPLE:b.NONE,k=R=>new m(R.name,x(R.displayName),R.type,x(R.description)),B=R=>new y(k(R.serverUrl),k(R.apiToken),a.fromJsArray((R.extensionParams??[]).map(Se=>new m(Se.name,x(Se.displayName),Se.type,x(Se.displayName))))),te=R=>R.provider===Lse&&R.customModelIdentifier?new T(R.customModelIdentifier.id,R.customModelIdentifier.namespace):null,Ue=R=>c.fromJsMap(new Map((R??[]).filter(Se=>Se!=null).map(Se=>[Se.name,new O(Se.type,null,!Se.required,null,null,null,null,Se.defaultValue==null?null:s.parseDataBindingFromJsObject(Se.defaultValue))]))),je=(r?.chatModelDescriptors??[]).map(R=>new f(R.provider,R.name,B(R.paramToConfigure),R.delisted,new E(R.features.streamResponse,R.features.multiModal,R.features.imageInput??!1,!1,R.features.videoInput??!1,R.features.imageMessageInput??!1,!1,R.features.videoMessageInput??!1,R.features.tools,R.features.reasoningContent,R.features.imageOutput,R.features.videoOutput,I(R.features.imageOutput),I(R.features.videoOutput),null,R.features.structuredOutput),te(R))),ot=(r?.embeddingModelDescriptors??[]).map(R=>new h(R.provider,R.name,B(R.paramToConfigure),te(R),R.delisted)),N=c.fromJsMap(new Map((n??[]).map(R=>[R.exId,new d(R.exId,R.async,Ue(R.inputType),Ue(R.outputType))])));return new u(new l(a.fromJsArray(je),a.fromJsArray(ot)),N)}catch{return null}}p();var Es=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};p();function Xh(e,t,r){let n=Hq(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,Qq(e),n,Kq(r,n),e?.utils?.Locale?.EN,null)}p();var Rn=e=>e==null,jse=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),oF=e=>{if(jse(e)){if(!Rn(e.id))return{key:"id",value:e.id};if(!Rn(e.uniqueId))return{key:"uniqueId",value:e.uniqueId};if(!Rn(e.mRef))return{key:"mRef",value:e.mRef}}},xS=(e,t)=>{if(Rn(e)&&Rn(t)||e===t)return!0;if(Rn(e)||Rn(t)||typeof e!="object"||typeof t!="object")return!1;let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!xS(r[o],n[o]))return!1;return!0},sF=e=>{if(e.__typename==="DiffItem")switch(e.operation){case"add":return{__typename:"DiffItem",oldValue:e.newValue,newValue:null,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:e.oldValue,operation:"add",pathComponents:e.pathComponents};case"update":return{__typename:"DiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}else switch(e.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:null,previousValue:e.previousValue,nextValue:e.nextValue,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:e.oldValue,previousValue:e.previousValue,nextValue:e.nextValue,operation:"insert",pathComponents:e.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(e)}`)},$se=e=>e.key??e.index??"",Mse=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},qse=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=oF(e[r]),i=n===void 0?xS(e[r],t.oldValue):n.value===t.oldValue?.[n.key];switch(t.operation){case"add":e[r]=t.newValue;break;case"update":if(!i)return null;e[r]=t.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(e,r)||!i)return null;delete e[r];break;default:return null}return t},Fse=(e,t)=>{if(t.__typename!=="ArrayDiffItem")return null;let r=t.pathComponents.at(-1)?.index;if(r===void 0||r>e.length)return null;let n=()=>{let i=oF(e[r]);return i===void 0?xS(e[r],t.oldValue):i.value===t.oldValue?.[i.key]};switch(t.operation){case"insert":e.splice(r,0,t.newValue);break;case"delete":if(!n())return null;e.splice(r,1);break;case"update":if(!n())return null;e.splice(r,1,t.newValue);break;default:return null}return t},aF=(e,t)=>{let r=e,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let c of s){let u=a[c];if(u!==null&&typeof u=="object"){if(!n.has(u)){let l=Array.isArray(u)?[...u]:{...u};n.add(l),a[c]=l}a=a[c]}else a=u}return a},o=[];for(let s of t)try{let c=s.pathComponents.map($se).slice(0,-1);if(Rn(Mse(r,c)))continue;let u=i(c);if(Array.isArray(u)){let l=Fse(u,s);l&&o.push(l)}else if(u!==null&&typeof u=="object"){let l=qse(u,s);l&&o.push(l)}}catch{continue}return o};p();var Use=3e4,em=class{constructor(t){this.options=t}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(t=>{this.subscriptionHandle=t}).catch(t=>{V.warn("Schema subscription failed; falling back to polling",t.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},Use),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};p();p();var _={};vy(_,{BRAND:()=>fae,DIRTY:()=>Ts,EMPTY_PATH:()=>Bse,INVALID:()=>oe,NEVER:()=>Wae,OK:()=>ar,ParseStatus:()=>Ht,Schema:()=>ge,ZodAny:()=>Eo,ZodArray:()=>$i,ZodBigInt:()=>Ss,ZodBoolean:()=>Os,ZodBranded:()=>Ml,ZodCatch:()=>Ls,ZodDate:()=>Is,ZodDefault:()=>ks,ZodDiscriminatedUnion:()=>nm,ZodEffects:()=>pn,ZodEnum:()=>Ds,ZodError:()=>Nr,ZodFirstPartyTypeKind:()=>C,ZodFunction:()=>om,ZodIntersection:()=>Ns,ZodIssueCode:()=>D,ZodLazy:()=>Ps,ZodLiteral:()=>Rs,ZodMap:()=>vc,ZodNaN:()=>Tc,ZodNativeEnum:()=>Cs,ZodNever:()=>Dn,ZodNull:()=>xs,ZodNullable:()=>ci,ZodNumber:()=>bs,ZodObject:()=>Rr,ZodOptional:()=>Pr,ZodParsedType:()=>q,ZodPipeline:()=>ql,ZodPromise:()=>To,ZodReadonly:()=>js,ZodRecord:()=>im,ZodSchema:()=>ge,ZodSet:()=>Ec,ZodString:()=>vo,ZodSymbol:()=>yc,ZodTransformer:()=>pn,ZodTuple:()=>ai,ZodType:()=>ge,ZodUndefined:()=>ws,ZodUnion:()=>As,ZodUnknown:()=>ji,ZodVoid:()=>_c,addIssueToContext:()=>M,any:()=>bae,array:()=>wae,bigint:()=>yae,boolean:()=>_F,coerce:()=>Qae,custom:()=>mF,date:()=>_ae,datetimeRegex:()=>fF,defaultErrorMap:()=>ki,discriminatedUnion:()=>Nae,effect:()=>Uae,enum:()=>Mae,function:()=>Lae,getErrorMap:()=>hc,getParsedType:()=>si,instanceof:()=>mae,intersection:()=>Pae,isAborted:()=>tm,isAsync:()=>mc,isDirty:()=>rm,isValid:()=>_o,late:()=>hae,lazy:()=>jae,literal:()=>$ae,makeIssue:()=>$l,map:()=>Cae,nan:()=>gae,nativeEnum:()=>qae,never:()=>Oae,null:()=>Tae,nullable:()=>Gae,number:()=>yF,object:()=>RS,objectUtil:()=>AS,oboolean:()=>Hae,onumber:()=>Kae,optional:()=>zae,ostring:()=>Zae,pipeline:()=>Bae,preprocess:()=>Vae,promise:()=>Fae,quotelessJson:()=>zse,record:()=>Dae,set:()=>kae,setErrorMap:()=>Vse,strictObject:()=>xae,string:()=>gF,symbol:()=>vae,transformer:()=>Uae,tuple:()=>Rae,undefined:()=>Eae,union:()=>Aae,unknown:()=>Sae,util:()=>be,void:()=>Iae});p();p();p();p();p();var be;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(let s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(be||(be={}));var AS;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(AS||(AS={}));var q=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=e=>{switch(typeof e){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(e)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(e)?q.array:e===null?q.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?q.promise:typeof Map<"u"&&e instanceof Map?q.map:typeof Set<"u"&&e instanceof Set?q.set:typeof Date<"u"&&e instanceof Date?q.date:q.object;default:return q.unknown}};var D=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"]),zse=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Nr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Nr.create=e=>new Nr(e);var Gse=(e,t)=>{let r;switch(e.code){case D.invalid_type:e.received===q.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case D.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,be.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:r=`Unrecognized key(s) in object: ${be.joinValues(e.keys,", ")}`;break;case D.invalid_union:r="Invalid input";break;case D.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${be.joinValues(e.options)}`;break;case D.invalid_enum_value:r=`Invalid enum value. Expected ${be.joinValues(e.options)}, received '${e.received}'`;break;case D.invalid_arguments:r="Invalid function arguments";break;case D.invalid_return_type:r="Invalid function return type";break;case D.invalid_date:r="Invalid date";break;case D.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:be.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case D.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case D.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case D.custom:r="Invalid input";break;case D.invalid_intersection_types:r="Intersection results could not be merged";break;case D.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case D.not_finite:r="Number must be finite";break;default:r=t.defaultError,be.assertNever(e)}return{message:r}},ki=Gse;var cF=ki;function Vse(e){cF=e}function hc(){return cF}p();var $l=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},Bse=[];function M(e,t){let r=hc(),n=$l({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ki?void 0:ki].filter(i=>!!i)});e.common.issues.push(n)}var Ht=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return oe;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return oe;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:t.value,value:n}}},oe=Object.freeze({status:"aborted"}),Ts=e=>({status:"dirty",value:e}),ar=e=>({status:"valid",value:e}),tm=e=>e.status==="aborted",rm=e=>e.status==="dirty",_o=e=>e.status==="valid",mc=e=>typeof Promise<"u"&&e instanceof Promise;p();p();var Q;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Q||(Q={}));var ln=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},uF=(e,t)=>{if(_o(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Nr(e.common.issues);return this._error=r,this._error}}};function fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:i}}var ge=class{get description(){return this._def.description}_getType(t){return si(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ht,ctx:{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(mc(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)},i=this._parseSync({data:t,path:n.path,parent:n});return uF(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return _o(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>_o(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(mc(i)?i:Promise.resolve(i));return uF(n,o)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=t(i),a=()=>o.addIssue({code:D.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new pn({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Pr.create(this,this._def)}nullable(){return ci.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $i.create(this)}promise(){return To.create(this,this._def)}or(t){return As.create([this,t],this._def)}and(t){return Ns.create(this,t,this._def)}transform(t){return new pn({...fe(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ks({...fe(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new Ml({typeName:C.ZodBranded,type:this,...fe(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ls({...fe(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ql.create(this,t)}readonly(){return js.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Zse=/^c[^\s-]{8,}$/i,Kse=/^[0-9a-z]+$/,Hse=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qse=/^[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,Wse=/^[a-z0-9_-]{21}$/i,Jse=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Yse=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xse=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",NS,tae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,iae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",aae=new RegExp(`^${pF}$`);function dF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function cae(e){return new RegExp(`^${dF(e)}$`)}function fF(e){let t=`${pF}T${dF(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function uae(e,t){return!!((t==="v4"||!t)&&tae.test(e)||(t==="v6"||!t)&&nae.test(e))}function lae(e,t){if(!Jse.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function pae(e,t){return!!((t==="v4"||!t)&&rae.test(e)||(t==="v6"||!t)&&iae.test(e))}var vo=class e extends ge{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==q.string){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_type,expected:q.string,received:o.parsedType}),oe}let n=new Ht,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?M(i,{code:D.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&M(i,{code:D.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Xse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"email",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")NS||(NS=new RegExp(eae,"u")),NS.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"emoji",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Qse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"uuid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Wse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"nanoid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Zse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cuid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Kse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cuid2",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Hse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"ulid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),M(i,{validation:"url",code:D.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"regex",code:D.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?fF(o).test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?aae.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?cae(o).test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Yse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"duration",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?uae(t.data,o.version)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"ip",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?lae(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"jwt",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?pae(t.data,o.version)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cidr",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?oae.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"base64",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?sae.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"base64url",code:D.invalid_string,message:o.message}),n.dirty()):be.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:D.invalid_string,...Q.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Q.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Q.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Q.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Q.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Q.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Q.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Q.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Q.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Q.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Q.errToObj(r)})}nonempty(t){return this.min(1,Q.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};vo.create=e=>new vo({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...fe(e)});function dae(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}var bs=class e extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==q.number){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_type,expected:q.number,received:o.parsedType}),oe}let n,i=new Ht;for(let o of this._def.checks)o.kind==="int"?be.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:D.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?dae(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:D.not_finite,message:o.message}),i.dirty()):be.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Q.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&be.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};bs.create=e=>new bs({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...fe(e)});var Ss=class e extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==q.bigint)return this._getInvalidInput(t);let n,i=new Ht;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):be.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return M(r,{code:D.invalid_type,expected:q.bigint,received:r.parsedType}),oe}gte(t,r){return this.setLimit("min",t,!0,Q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Q.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ss.create=e=>new Ss({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...fe(e)});var Os=class extends ge{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==q.boolean){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.boolean,received:n.parsedType}),oe}return ar(t.data)}};Os.create=e=>new Os({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...fe(e)});var Is=class e extends ge{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==q.date){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_type,expected:q.date,received:o.parsedType}),oe}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_date}),oe}let n=new Ht,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):be.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Q.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Q.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Is.create=e=>new Is({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...fe(e)});var yc=class extends ge{_parse(t){if(this._getType(t)!==q.symbol){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.symbol,received:n.parsedType}),oe}return ar(t.data)}};yc.create=e=>new yc({typeName:C.ZodSymbol,...fe(e)});var ws=class extends ge{_parse(t){if(this._getType(t)!==q.undefined){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.undefined,received:n.parsedType}),oe}return ar(t.data)}};ws.create=e=>new ws({typeName:C.ZodUndefined,...fe(e)});var xs=class extends ge{_parse(t){if(this._getType(t)!==q.null){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.null,received:n.parsedType}),oe}return ar(t.data)}};xs.create=e=>new xs({typeName:C.ZodNull,...fe(e)});var Eo=class extends ge{constructor(){super(...arguments),this._any=!0}_parse(t){return ar(t.data)}};Eo.create=e=>new Eo({typeName:C.ZodAny,...fe(e)});var ji=class extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ar(t.data)}};ji.create=e=>new ji({typeName:C.ZodUnknown,...fe(e)});var Dn=class extends ge{_parse(t){let r=this._getOrReturnCtx(t);return M(r,{code:D.invalid_type,expected:q.never,received:r.parsedType}),oe}};Dn.create=e=>new Dn({typeName:C.ZodNever,...fe(e)});var _c=class extends ge{_parse(t){if(this._getType(t)!==q.undefined){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.void,received:n.parsedType}),oe}return ar(t.data)}};_c.create=e=>new _c({typeName:C.ZodVoid,...fe(e)});var $i=class e extends ge{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==q.array)return M(r,{code:D.invalid_type,expected:q.array,received:r.parsedType}),oe;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(M(r,{code:s?D.too_big:D.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(M(r,{code:D.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(M(r,{code:D.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new ln(r,s,r.path,a)))).then(s=>Ht.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new ln(r,s,r.path,a)));return Ht.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Q.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Q.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Q.toString(r)}})}nonempty(t){return this.min(1,t)}};$i.create=(e,t)=>new $i({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...fe(t)});function gc(e){if(e instanceof Rr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Pr.create(gc(n))}return new Rr({...e._def,shape:()=>t})}else return e instanceof $i?new $i({...e._def,type:gc(e.element)}):e instanceof Pr?Pr.create(gc(e.unwrap())):e instanceof ci?ci.create(gc(e.unwrap())):e instanceof ai?ai.create(e.items.map(t=>gc(t))):e}var Rr=class e extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=be.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==q.object){let u=this._getOrReturnCtx(t);return M(u,{code:D.invalid_type,expected:q.object,received:u.parsedType}),oe}let{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Dn&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let l=o[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ln(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Dn){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(M(i,{code:D.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ln(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>Ht.mergeObjectSync(n,u)):Ht.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return Q.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Q.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:C.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of be.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of be.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return gc(this)}partial(t){let r={};for(let n of be.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of be.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Pr;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return hF(be.objectKeys(this.shape))}};Rr.create=(e,t)=>new Rr({shape:()=>e,unknownKeys:"strip",catchall:Dn.create(),typeName:C.ZodObject,...fe(t)});Rr.strictCreate=(e,t)=>new Rr({shape:()=>e,unknownKeys:"strict",catchall:Dn.create(),typeName:C.ZodObject,...fe(t)});Rr.lazycreate=(e,t)=>new Rr({shape:e,unknownKeys:"strip",catchall:Dn.create(),typeName:C.ZodObject,...fe(t)});var As=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Nr(a.ctx.common.issues));return M(r,{code:D.invalid_union,unionErrors:s}),oe}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new Nr(c));return M(r,{code:D.invalid_union,unionErrors:a}),oe}}get options(){return this._def.options}};As.create=(e,t)=>new As({options:e,typeName:C.ZodUnion,...fe(t)});var Li=e=>e instanceof Ps?Li(e.schema):e instanceof pn?Li(e.innerType()):e instanceof Rs?[e.value]:e instanceof Ds?e.options:e instanceof Cs?be.objectValues(e.enum):e instanceof ks?Li(e._def.innerType):e instanceof ws?[void 0]:e instanceof xs?[null]:e instanceof Pr?[void 0,...Li(e.unwrap())]:e instanceof ci?[null,...Li(e.unwrap())]:e instanceof Ml||e instanceof js?Li(e.unwrap()):e instanceof Ls?Li(e._def.innerType):[],nm=class e extends ge{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.object)return M(r,{code:D.invalid_type,expected:q.object,received:r.parsedType}),oe;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let o of r){let s=Li(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new e({typeName:C.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...fe(n)})}};function PS(e,t){let r=si(e),n=si(t);if(e===t)return{valid:!0,data:e};if(r===q.object&&n===q.object){let i=be.objectKeys(t),o=be.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(let a of o){let c=PS(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===q.array&&n===q.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],c=PS(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===q.date&&n===q.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ns=class extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(o,s)=>{if(tm(o)||tm(s))return oe;let a=PS(o.value,s.value);return a.valid?((rm(o)||rm(s))&&r.dirty(),{status:r.value,value:a.data}):(M(n,{code:D.invalid_intersection_types}),oe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ns.create=(e,t,r)=>new Ns({left:e,right:t,typeName:C.ZodIntersection,...fe(r)});var ai=class e extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.array)return M(n,{code:D.invalid_type,expected:q.array,received:n.parsedType}),oe;if(n.data.length<this._def.items.length)return M(n,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oe;!this._def.rest&&n.data.length>this._def.items.length&&(M(n,{code:D.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ln(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Ht.mergeArray(r,s)):Ht.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ai.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ai({items:e,typeName:C.ZodTuple,rest:null,...fe(t)})};var im=class e extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.object)return M(n,{code:D.invalid_type,expected:q.object,received:n.parsedType}),oe;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new ln(n,a,n.path,a)),value:s._parse(new ln(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Ht.mergeObjectAsync(r,i):Ht.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ge?new e({keyType:t,valueType:r,typeName:C.ZodRecord,...fe(n)}):new e({keyType:vo.create(),valueType:t,typeName:C.ZodRecord,...fe(r)})}},vc=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.map)return M(n,{code:D.invalid_type,expected:q.map,received:n.parsedType}),oe;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new ln(n,a,n.path,[u,"key"])),value:o._parse(new ln(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return oe;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return oe;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};vc.create=(e,t,r)=>new vc({valueType:t,keyType:e,typeName:C.ZodMap,...fe(r)});var Ec=class e extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.set)return M(n,{code:D.invalid_type,expected:q.set,received:n.parsedType}),oe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(M(n,{code:D.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(M(n,{code:D.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let u=new Set;for(let l of c){if(l.status==="aborted")return oe;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new ln(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:Q.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Q.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ec.create=(e,t)=>new Ec({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...fe(t)});var om=class e extends ge{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.function)return M(r,{code:D.invalid_type,expected:q.function,received:r.parsedType}),oe;function n(a,c){return $l({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hc(),ki].filter(u=>!!u),issueData:{code:D.invalid_arguments,argumentsError:c}})}function i(a,c){return $l({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hc(),ki].filter(u=>!!u),issueData:{code:D.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof To){let a=this;return ar(async function(...c){let u=new Nr([]),l=await a._def.args.parseAsync(c,o).catch(h=>{throw u.addIssue(n(c,h)),u}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{let a=this;return ar(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new Nr([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new Nr([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ai.create(t).rest(ji.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ai.create([]).rest(ji.create()),returns:r||ji.create(),typeName:C.ZodFunction,...fe(n)})}},Ps=class extends ge{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ps.create=(e,t)=>new Ps({getter:e,typeName:C.ZodLazy,...fe(t)});var Rs=class extends ge{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return M(r,{received:r.data,code:D.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:t.data}}get value(){return this._def.value}};Rs.create=(e,t)=>new Rs({value:e,typeName:C.ZodLiteral,...fe(t)});function hF(e,t){return new Ds({values:e,typeName:C.ZodEnum,...fe(t)})}var Ds=class e extends ge{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return M(r,{expected:be.joinValues(n),received:r.parsedType,code:D.invalid_type}),oe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return M(r,{received:r.data,code:D.invalid_enum_value,options:n}),oe}return ar(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ds.create=hF;var Cs=class extends ge{_parse(t){let r=be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==q.string&&n.parsedType!==q.number){let i=be.objectValues(r);return M(n,{expected:be.joinValues(i),received:n.parsedType,code:D.invalid_type}),oe}if(this._cache||(this._cache=new Set(be.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=be.objectValues(r);return M(n,{received:n.data,code:D.invalid_enum_value,options:i}),oe}return ar(t.data)}get enum(){return this._def.values}};Cs.create=(e,t)=>new Cs({values:e,typeName:C.ZodNativeEnum,...fe(t)});var To=class extends ge{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.promise&&r.common.async===!1)return M(r,{code:D.invalid_type,expected:q.promise,received:r.parsedType}),oe;let n=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return ar(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};To.create=(e,t)=>new To({type:e,typeName:C.ZodPromise,...fe(t)});var pn=class extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{M(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return oe;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?oe:c.status==="dirty"?Ts(c.value):r.value==="dirty"?Ts(c.value):c});{if(r.value==="aborted")return oe;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?oe:a.status==="dirty"?Ts(a.value):r.value==="dirty"?Ts(a.value):a}}if(i.type==="refinement"){let s=a=>{let c=i.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!_o(s))return oe;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>_o(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):oe);be.assertNever(i)}};pn.create=(e,t,r)=>new pn({schema:e,typeName:C.ZodEffects,effect:t,...fe(r)});pn.createWithPreprocess=(e,t,r)=>new pn({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...fe(r)});var Pr=class extends ge{_parse(t){return this._getType(t)===q.undefined?ar(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pr.create=(e,t)=>new Pr({innerType:e,typeName:C.ZodOptional,...fe(t)});var ci=class extends ge{_parse(t){return this._getType(t)===q.null?ar(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ci.create=(e,t)=>new ci({innerType:e,typeName:C.ZodNullable,...fe(t)});var ks=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ks.create=(e,t)=>new ks({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...fe(t)});var Ls=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return mc(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Nr(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Nr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ls.create=(e,t)=>new Ls({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...fe(t)});var Tc=class extends ge{_parse(t){if(this._getType(t)!==q.nan){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.nan,received:n.parsedType}),oe}return{status:"valid",value:t.data}}};Tc.create=e=>new Tc({typeName:C.ZodNaN,...fe(e)});var fae=Symbol("zod_brand"),Ml=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ql=class e extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?oe:o.status==="dirty"?(r.dirty(),Ts(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?oe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:C.ZodPipeline})}},js=class extends ge{_parse(t){let r=this._def.innerType._parse(t),n=i=>(_o(i)&&(i.value=Object.freeze(i.value)),i);return mc(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};js.create=(e,t)=>new js({innerType:e,typeName:C.ZodReadonly,...fe(t)});function lF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function mF(e,t={},r){return e?Eo.create().superRefine((n,i)=>{let o=e(n);if(o instanceof Promise)return o.then(s=>{if(!s){let a=lF(t,n),c=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:c})}});if(!o){let s=lF(t,n),a=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:a})}}):Eo.create()}var hae={object:Rr.lazycreate},C;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(C||(C={}));var mae=(e,t={message:`Input not instance of ${e.name}`})=>mF(r=>r instanceof e,t),gF=vo.create,yF=bs.create,gae=Tc.create,yae=Ss.create,_F=Os.create,_ae=Is.create,vae=yc.create,Eae=ws.create,Tae=xs.create,bae=Eo.create,Sae=ji.create,Oae=Dn.create,Iae=_c.create,wae=$i.create,RS=Rr.create,xae=Rr.strictCreate,Aae=As.create,Nae=nm.create,Pae=Ns.create,Rae=ai.create,Dae=im.create,Cae=vc.create,kae=Ec.create,Lae=om.create,jae=Ps.create,$ae=Rs.create,Mae=Ds.create,qae=Cs.create,Fae=To.create,Uae=pn.create,zae=Pr.create,Gae=ci.create,Vae=pn.createWithPreprocess,Bae=ql.create,Zae=()=>gF().optional(),Kae=()=>yF().optional(),Hae=()=>_F().optional(),Qae={string:(e=>vo.create({...e,coerce:!0})),number:(e=>bs.create({...e,coerce:!0})),boolean:(e=>Os.create({...e,coerce:!0})),bigint:(e=>Ss.create({...e,coerce:!0})),date:(e=>Is.create({...e,coerce:!0}))};var Wae=oe;var DS=[{name:"schema_actionflow",description:`Action flows \u2014 flow-level (addressed by actionFlowId). Discover types via op=SELECTABLE_TYPES and ids via op=GET_DETAIL. AI nodes require isAsync=true.
|
|
1103
|
+
`;p();import{randomUUID as xse}from"crypto";var Yq=Rt(RM(),1);p();var vse=Rt(wq(),1),Ese=Rt(Uh(),1),Tse=Rt(cc(),1),bse=Rt(uS(),1),Sse=Rt(dS(),1),Ose=Rt(_S(),1),Lq=Rt(Bh(),1),Ise=Rt(kq(),1);var jq=Lq.default;p();var $q=100*1024*1024,Kh=class{current=Promise.resolve();async run(t){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await t()}finally{n()}}},Gq=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`Failed to download CRDT model: ${t.status} ${t.statusText}`);let r=t.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:c}=await r.read();if(a)break;if(i+=c.length,i>$q)throw new Error(`CRDT model is larger than ${$q} bytes`);n.push(c)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},Ll=async(e,t)=>{try{return await t()}catch(r){return V.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},Mq=null,oi=async()=>(Mq??=Ll("@functorz/ztype",()=>import("./ztype-SNC455HR.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),Mq),qq=null,Vq=async()=>(qq??=Ll("@functorz/ztype",()=>import("./ztype-SNC455HR.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),qq),Fq=null,Bq=async()=>(Fq??=oi().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),Fq),Uq=null,Hh=async()=>(Uq??=Ll("@functorz/crdt-helper",()=>import("./index.cjs-IO4RHHMH.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),Uq),zq=null,Zq=async()=>(zq??=Ll("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-I6FZC3KI.js")).then(e=>e??Ll("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-HSI3KAUZ.js"))).then(e=>e?.Patch??e?.default?.Patch??null),zq),ES=e=>e?.lastUploadedSchema??null,TS=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,bS=e=>e==null?e:structuredClone(e),Kq=(e,t)=>e?.appExId?e.appExId:t?.name??"",Hq=(e,t)=>{let r=e?.typesystem?.schema?.ClientType;if(r)return t==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:t==="MOBILE"?r.MOBILE??r.WEB:r.WEB},Qq=e=>{let t=e?.typesystem?.schema?.Product?.[Uo];if(!t)throw new Error(`ztype runtime has no Product enum member for ${Uo}`);return t},wse=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},Qh=e=>({componentId:e?.componentId??null,message:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("EN"):e?.message??String(e),zhMessage:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("ZH"):void 0,platform:e?.platform??null,isBackendError:!!e?.isBackendError,fullPath:wse(e?.fullPath??[])}),Wh=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),Wq=e=>Wh(e).length,Jq=(e,t)=>{if(t.__typename==="DiffItem"){let r=t.pathComponents?.at(-1)?.key??"";if(t.operation==="delete"){delete e[r];return}e[r]=structuredClone(t.newValue);return}if(t.__typename==="ArrayDiffItem"){let r=t.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(e)||r<0)throw new Error("Invalid array diff target");if(t.operation==="delete"){e.splice(r,1);return}if(t.operation==="insert"){e.splice(r,0,structuredClone(t.newValue));return}e[r]=structuredClone(t.newValue)}};var Xq=xse(),Ase=e=>{if(!e)return e;if(Array.isArray(e))return e.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof e=="object"&&"forEach"in e&&typeof e.forEach=="function"){let r={};return e.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let t={};for(let[r,n]of Object.entries(e))t[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return t};function SS(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return t.length>0?t.join("; "):null}var Nse=e=>{if(typeof e=="string")return e;if(e instanceof Uint8Array)return Buffer.from(e).toString("utf8");try{return String(e)}catch{return"<unserializable body>"}},jl=async(e,t)=>{let r=jd();V.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&V.debug(`[HTTP] Request Headers: ${JSON.stringify(Ase(t.headers))}`),r&&t?.body!=null&&V.debug(`[GQL] Request Body: ${Nse(t.body)}`);let n=await fetch(e,t),i=null;try{i=await n.clone().text()}catch(o){V.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&V.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=SS(o);s&&V.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function OS(e,t){let r=await e.getValidToken(),n=await An(t),i={Authorization:`Bearer ${r}`,"User-Locale":"en_US","X-SESSION-ID":Xq},o=await Bq();return o&&(i["X-ZED-VERSION"]=o),process.env.REACT_APP_VERSION&&(i["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new tr(`${n.apiBaseUrl}/api/graphql`,{headers:i,fetch:jl})}async function eF(e,t){let r=await e.getValidToken(),i=`${(await An(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(o,s,a)=>{let c=jd(),u={authToken:r,"X-SESSION-ID":Xq};V.debug(`[SUB] connecting ${i} params=${JSON.stringify({...u,authToken:"Bearer <redacted>"})}`);let l=new Yq.SubscriptionClient(i,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:u},jq);l.onConnected(()=>V.debug("[SUB] connected")),l.onReconnected(()=>V.debug("[SUB] reconnected")),l.onDisconnected(()=>V.debug("[SUB] disconnected")),l.onError(h=>V.debug(`[SUB] error ${h?.message??String(h)}`));let f=[{name:"onNewCrdtPatchV2",query:t$,variables:{projectExId:o.projectExId,appExId:o.appExId??null,versionExId:o.appVersionExId??null,latestPatchExIdInClient:s}},{name:"onSchemaUploadV3",query:r$,variables:{projectExId:o.projectExId,appExId:o.appExId??null,appVersionExId:o.appVersionExId??null}}].map(h=>(V.debug(`[SUB] subscribe ${h.name} vars=${JSON.stringify(h.variables)}`),l.request({query:h.query,variables:h.variables}).subscribe({next:m=>{c&&V.debug(`[SUB] ${h.name} event: ${JSON.stringify(m)}`),a()},error:m=>{V.warn("Schema subscription event failed",String(m)),a()}})));return{unsubscribe(){for(let h of f)h.unsubscribe();l.close(!1,!1)}}}}async function Jh(e,t){if(t.projectExId)return await e.saveProjectContext(t.projectExId),t.projectExId;let r=await e.loadProjectContext();if(!r?.projectExId)throw new Error("No projectExId provided and no current project is set");return r.projectExId}p();p();p();import{createHash as Pse}from"crypto";var Rse=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),IS=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:IS(r));if(!Rse(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=IS(n))}return t},Dse=e=>JSON.stringify(IS(e)),Cse=e=>Pse("sha256").update(Dse(e)).digest("hex"),tF=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:Cse(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),rF=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,Yh=e=>e.changes.length>0;var nF=null,kse=()=>(nF??=oi().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),nF),wS=async(e,t)=>{let r=await kse();return r?r(e,t):{changes:[]}};p();var Lse="Functorz";function iF(e,t,r,n){let i=e?.typesystem?.settings,o=e?.typesystem?.schema,s=e?.api?.ZTypeCoreApi,a=t?.KtList,c=t?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!s||!a||!c)return null;try{let{ExtraContext:u,AIModelDescriptors:l,ActionFlowTemplateCodeDescriptor:d}=i,{CustomChatModelDescriptor:f,CustomEmbeddingModelDescriptor:h,ModelCustomParamDescriptor:m,CustomModelParam:y,CustomChatCompletionFeatures:E,Identifier:T,MediaOutputCardinality:b,Variable:O}=o,x=R=>c.fromJsMap(new Map(Object.entries(R??{}))),I=R=>typeof R=="string"?R==="single"?b.SINGLE:R==="multiple"?b.MULTIPLE:b.NONE:typeof R=="boolean"&&R?b.MULTIPLE:b.NONE,k=R=>new m(R.name,x(R.displayName),R.type,x(R.description)),B=R=>new y(k(R.serverUrl),k(R.apiToken),a.fromJsArray((R.extensionParams??[]).map(Se=>new m(Se.name,x(Se.displayName),Se.type,x(Se.displayName))))),te=R=>R.provider===Lse&&R.customModelIdentifier?new T(R.customModelIdentifier.id,R.customModelIdentifier.namespace):null,Ue=R=>c.fromJsMap(new Map((R??[]).filter(Se=>Se!=null).map(Se=>[Se.name,new O(Se.type,null,!Se.required,null,null,null,null,Se.defaultValue==null?null:s.parseDataBindingFromJsObject(Se.defaultValue))]))),je=(r?.chatModelDescriptors??[]).map(R=>new f(R.provider,R.name,B(R.paramToConfigure),R.delisted,new E(R.features.streamResponse,R.features.multiModal,R.features.imageInput??!1,!1,R.features.videoInput??!1,R.features.imageMessageInput??!1,!1,R.features.videoMessageInput??!1,R.features.tools,R.features.reasoningContent,R.features.imageOutput,R.features.videoOutput,I(R.features.imageOutput),I(R.features.videoOutput),null,R.features.structuredOutput),te(R))),ot=(r?.embeddingModelDescriptors??[]).map(R=>new h(R.provider,R.name,B(R.paramToConfigure),te(R),R.delisted)),N=c.fromJsMap(new Map((n??[]).map(R=>[R.exId,new d(R.exId,R.async,Ue(R.inputType),Ue(R.outputType))])));return new u(new l(a.fromJsArray(je),a.fromJsArray(ot)),N)}catch{return null}}p();var Es=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};p();function Xh(e,t,r){let n=Hq(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,Qq(e),n,Kq(r,n),e?.utils?.Locale?.EN,null)}p();var Rn=e=>e==null,jse=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),oF=e=>{if(jse(e)){if(!Rn(e.id))return{key:"id",value:e.id};if(!Rn(e.uniqueId))return{key:"uniqueId",value:e.uniqueId};if(!Rn(e.mRef))return{key:"mRef",value:e.mRef}}},xS=(e,t)=>{if(Rn(e)&&Rn(t)||e===t)return!0;if(Rn(e)||Rn(t)||typeof e!="object"||typeof t!="object")return!1;let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!xS(r[o],n[o]))return!1;return!0},sF=e=>{if(e.__typename==="DiffItem")switch(e.operation){case"add":return{__typename:"DiffItem",oldValue:e.newValue,newValue:null,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:e.oldValue,operation:"add",pathComponents:e.pathComponents};case"update":return{__typename:"DiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}else switch(e.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:null,previousValue:e.previousValue,nextValue:e.nextValue,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:e.oldValue,previousValue:e.previousValue,nextValue:e.nextValue,operation:"insert",pathComponents:e.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(e)}`)},$se=e=>e.key??e.index??"",Mse=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},qse=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=oF(e[r]),i=n===void 0?xS(e[r],t.oldValue):n.value===t.oldValue?.[n.key];switch(t.operation){case"add":e[r]=t.newValue;break;case"update":if(!i)return null;e[r]=t.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(e,r)||!i)return null;delete e[r];break;default:return null}return t},Fse=(e,t)=>{if(t.__typename!=="ArrayDiffItem")return null;let r=t.pathComponents.at(-1)?.index;if(r===void 0||r>e.length)return null;let n=()=>{let i=oF(e[r]);return i===void 0?xS(e[r],t.oldValue):i.value===t.oldValue?.[i.key]};switch(t.operation){case"insert":e.splice(r,0,t.newValue);break;case"delete":if(!n())return null;e.splice(r,1);break;case"update":if(!n())return null;e.splice(r,1,t.newValue);break;default:return null}return t},aF=(e,t)=>{let r=e,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let c of s){let u=a[c];if(u!==null&&typeof u=="object"){if(!n.has(u)){let l=Array.isArray(u)?[...u]:{...u};n.add(l),a[c]=l}a=a[c]}else a=u}return a},o=[];for(let s of t)try{let c=s.pathComponents.map($se).slice(0,-1);if(Rn(Mse(r,c)))continue;let u=i(c);if(Array.isArray(u)){let l=Fse(u,s);l&&o.push(l)}else if(u!==null&&typeof u=="object"){let l=qse(u,s);l&&o.push(l)}}catch{continue}return o};p();var Use=3e4,em=class{constructor(t){this.options=t}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(t=>{this.subscriptionHandle=t}).catch(t=>{V.warn("Schema subscription failed; falling back to polling",t.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},Use),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};p();p();var _={};vy(_,{BRAND:()=>fae,DIRTY:()=>Ts,EMPTY_PATH:()=>Bse,INVALID:()=>oe,NEVER:()=>Wae,OK:()=>ar,ParseStatus:()=>Ht,Schema:()=>ge,ZodAny:()=>Eo,ZodArray:()=>$i,ZodBigInt:()=>Ss,ZodBoolean:()=>Os,ZodBranded:()=>Ml,ZodCatch:()=>Ls,ZodDate:()=>Is,ZodDefault:()=>ks,ZodDiscriminatedUnion:()=>nm,ZodEffects:()=>pn,ZodEnum:()=>Ds,ZodError:()=>Nr,ZodFirstPartyTypeKind:()=>C,ZodFunction:()=>om,ZodIntersection:()=>Ns,ZodIssueCode:()=>D,ZodLazy:()=>Ps,ZodLiteral:()=>Rs,ZodMap:()=>vc,ZodNaN:()=>Tc,ZodNativeEnum:()=>Cs,ZodNever:()=>Dn,ZodNull:()=>xs,ZodNullable:()=>ci,ZodNumber:()=>bs,ZodObject:()=>Rr,ZodOptional:()=>Pr,ZodParsedType:()=>q,ZodPipeline:()=>ql,ZodPromise:()=>To,ZodReadonly:()=>js,ZodRecord:()=>im,ZodSchema:()=>ge,ZodSet:()=>Ec,ZodString:()=>vo,ZodSymbol:()=>yc,ZodTransformer:()=>pn,ZodTuple:()=>ai,ZodType:()=>ge,ZodUndefined:()=>ws,ZodUnion:()=>As,ZodUnknown:()=>ji,ZodVoid:()=>_c,addIssueToContext:()=>M,any:()=>bae,array:()=>wae,bigint:()=>yae,boolean:()=>_F,coerce:()=>Qae,custom:()=>mF,date:()=>_ae,datetimeRegex:()=>fF,defaultErrorMap:()=>ki,discriminatedUnion:()=>Nae,effect:()=>Uae,enum:()=>Mae,function:()=>Lae,getErrorMap:()=>hc,getParsedType:()=>si,instanceof:()=>mae,intersection:()=>Pae,isAborted:()=>tm,isAsync:()=>mc,isDirty:()=>rm,isValid:()=>_o,late:()=>hae,lazy:()=>jae,literal:()=>$ae,makeIssue:()=>$l,map:()=>Cae,nan:()=>gae,nativeEnum:()=>qae,never:()=>Oae,null:()=>Tae,nullable:()=>Gae,number:()=>yF,object:()=>RS,objectUtil:()=>AS,oboolean:()=>Hae,onumber:()=>Kae,optional:()=>zae,ostring:()=>Zae,pipeline:()=>Bae,preprocess:()=>Vae,promise:()=>Fae,quotelessJson:()=>zse,record:()=>Dae,set:()=>kae,setErrorMap:()=>Vse,strictObject:()=>xae,string:()=>gF,symbol:()=>vae,transformer:()=>Uae,tuple:()=>Rae,undefined:()=>Eae,union:()=>Aae,unknown:()=>Sae,util:()=>be,void:()=>Iae});p();p();p();p();p();var be;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},e.getValidEnumValues=i=>{let o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(let s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(be||(be={}));var AS;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(AS||(AS={}));var q=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),si=e=>{switch(typeof e){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(e)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(e)?q.array:e===null?q.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?q.promise:typeof Map<"u"&&e instanceof Map?q.map:typeof Set<"u"&&e instanceof Set?q.set:typeof Date<"u"&&e instanceof Date?q.date:q.object;default:return q.unknown}};var D=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"]),zse=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Nr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Nr.create=e=>new Nr(e);var Gse=(e,t)=>{let r;switch(e.code){case D.invalid_type:e.received===q.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case D.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,be.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:r=`Unrecognized key(s) in object: ${be.joinValues(e.keys,", ")}`;break;case D.invalid_union:r="Invalid input";break;case D.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${be.joinValues(e.options)}`;break;case D.invalid_enum_value:r=`Invalid enum value. Expected ${be.joinValues(e.options)}, received '${e.received}'`;break;case D.invalid_arguments:r="Invalid function arguments";break;case D.invalid_return_type:r="Invalid function return type";break;case D.invalid_date:r="Invalid date";break;case D.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:be.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case D.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case D.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case D.custom:r="Invalid input";break;case D.invalid_intersection_types:r="Intersection results could not be merged";break;case D.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case D.not_finite:r="Number must be finite";break;default:r=t.defaultError,be.assertNever(e)}return{message:r}},ki=Gse;var cF=ki;function Vse(e){cF=e}function hc(){return cF}p();var $l=e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...i,path:o,message:a}},Bse=[];function M(e,t){let r=hc(),n=$l({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ki?void 0:ki].filter(i=>!!i)});e.common.issues.push(n)}var Ht=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return oe;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return oe;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:t.value,value:n}}},oe=Object.freeze({status:"aborted"}),Ts=e=>({status:"dirty",value:e}),ar=e=>({status:"valid",value:e}),tm=e=>e.status==="aborted",rm=e=>e.status==="dirty",_o=e=>e.status==="valid",mc=e=>typeof Promise<"u"&&e instanceof Promise;p();p();var Q;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Q||(Q={}));var ln=class{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},uF=(e,t)=>{if(_o(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Nr(e.common.issues);return this._error=r,this._error}}};function fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>{let{message:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:i}}var ge=class{get description(){return this._def.description}_getType(t){return si(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ht,ctx:{common:t.parent.common,data:t.data,parsedType:si(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(mc(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)},i=this._parseSync({data:t,path:n.path,parent:n});return uF(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return _o(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>_o(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:si(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(mc(i)?i:Promise.resolve(i));return uF(n,o)}refine(t,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=t(i),a=()=>o.addIssue({code:D.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new pn({schema:this,typeName:C.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Pr.create(this,this._def)}nullable(){return ci.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return $i.create(this)}promise(){return To.create(this,this._def)}or(t){return As.create([this,t],this._def)}and(t){return Ns.create(this,t,this._def)}transform(t){return new pn({...fe(this._def),schema:this,typeName:C.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ks({...fe(this._def),innerType:this,defaultValue:r,typeName:C.ZodDefault})}brand(){return new Ml({typeName:C.ZodBranded,type:this,...fe(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ls({...fe(this._def),innerType:this,catchValue:r,typeName:C.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ql.create(this,t)}readonly(){return js.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Zse=/^c[^\s-]{8,}$/i,Kse=/^[0-9a-z]+$/,Hse=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Qse=/^[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,Wse=/^[a-z0-9_-]{21}$/i,Jse=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Yse=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Xse=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",NS,tae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rae=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,iae=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",aae=new RegExp(`^${pF}$`);function dF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function cae(e){return new RegExp(`^${dF(e)}$`)}function fF(e){let t=`${pF}T${dF(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function uae(e,t){return!!((t==="v4"||!t)&&tae.test(e)||(t==="v6"||!t)&&nae.test(e))}function lae(e,t){if(!Jse.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function pae(e,t){return!!((t==="v4"||!t)&&rae.test(e)||(t==="v6"||!t)&&iae.test(e))}var vo=class e extends ge{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==q.string){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_type,expected:q.string,received:o.parsedType}),oe}let n=new Ht,i;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?M(i,{code:D.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&M(i,{code:D.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Xse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"email",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")NS||(NS=new RegExp(eae,"u")),NS.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"emoji",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Qse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"uuid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Wse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"nanoid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Zse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cuid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Kse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cuid2",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Hse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"ulid",code:D.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),M(i,{validation:"url",code:D.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"regex",code:D.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?fF(o).test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?aae.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?cae(o).test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{code:D.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Yse.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"duration",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?uae(t.data,o.version)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"ip",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?lae(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"jwt",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?pae(t.data,o.version)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"cidr",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?oae.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"base64",code:D.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?sae.test(t.data)||(i=this._getOrReturnCtx(t,i),M(i,{validation:"base64url",code:D.invalid_string,message:o.message}),n.dirty()):be.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:D.invalid_string,...Q.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Q.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Q.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Q.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Q.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Q.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Q.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Q.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Q.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Q.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Q.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Q.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Q.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Q.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Q.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Q.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Q.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Q.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Q.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Q.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Q.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Q.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Q.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Q.errToObj(r)})}nonempty(t){return this.min(1,Q.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};vo.create=e=>new vo({checks:[],typeName:C.ZodString,coerce:e?.coerce??!1,...fe(e)});function dae(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}var bs=class e extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==q.number){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_type,expected:q.number,received:o.parsedType}),oe}let n,i=new Ht;for(let o of this._def.checks)o.kind==="int"?be.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:D.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?dae(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),M(n,{code:D.not_finite,message:o.message}),i.dirty()):be.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Q.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Q.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Q.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&be.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};bs.create=e=>new bs({checks:[],typeName:C.ZodNumber,coerce:e?.coerce||!1,...fe(e)});var Ss=class e extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==q.bigint)return this._getInvalidInput(t);let n,i=new Ht;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),M(n,{code:D.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):be.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return M(r,{code:D.invalid_type,expected:q.bigint,received:r.parsedType}),oe}gte(t,r){return this.setLimit("min",t,!0,Q.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Q.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Q.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Q.toString(r))}setLimit(t,r,n,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Q.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Ss.create=e=>new Ss({checks:[],typeName:C.ZodBigInt,coerce:e?.coerce??!1,...fe(e)});var Os=class extends ge{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==q.boolean){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.boolean,received:n.parsedType}),oe}return ar(t.data)}};Os.create=e=>new Os({typeName:C.ZodBoolean,coerce:e?.coerce||!1,...fe(e)});var Is=class e extends ge{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==q.date){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_type,expected:q.date,received:o.parsedType}),oe}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return M(o,{code:D.invalid_date}),oe}let n=new Ht,i;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),M(i,{code:D.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):be.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Q.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Q.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Is.create=e=>new Is({checks:[],coerce:e?.coerce||!1,typeName:C.ZodDate,...fe(e)});var yc=class extends ge{_parse(t){if(this._getType(t)!==q.symbol){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.symbol,received:n.parsedType}),oe}return ar(t.data)}};yc.create=e=>new yc({typeName:C.ZodSymbol,...fe(e)});var ws=class extends ge{_parse(t){if(this._getType(t)!==q.undefined){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.undefined,received:n.parsedType}),oe}return ar(t.data)}};ws.create=e=>new ws({typeName:C.ZodUndefined,...fe(e)});var xs=class extends ge{_parse(t){if(this._getType(t)!==q.null){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.null,received:n.parsedType}),oe}return ar(t.data)}};xs.create=e=>new xs({typeName:C.ZodNull,...fe(e)});var Eo=class extends ge{constructor(){super(...arguments),this._any=!0}_parse(t){return ar(t.data)}};Eo.create=e=>new Eo({typeName:C.ZodAny,...fe(e)});var ji=class extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(t){return ar(t.data)}};ji.create=e=>new ji({typeName:C.ZodUnknown,...fe(e)});var Dn=class extends ge{_parse(t){let r=this._getOrReturnCtx(t);return M(r,{code:D.invalid_type,expected:q.never,received:r.parsedType}),oe}};Dn.create=e=>new Dn({typeName:C.ZodNever,...fe(e)});var _c=class extends ge{_parse(t){if(this._getType(t)!==q.undefined){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.void,received:n.parsedType}),oe}return ar(t.data)}};_c.create=e=>new _c({typeName:C.ZodVoid,...fe(e)});var $i=class e extends ge{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==q.array)return M(r,{code:D.invalid_type,expected:q.array,received:r.parsedType}),oe;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(M(r,{code:s?D.too_big:D.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(M(r,{code:D.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(M(r,{code:D.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new ln(r,s,r.path,a)))).then(s=>Ht.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new ln(r,s,r.path,a)));return Ht.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Q.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Q.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Q.toString(r)}})}nonempty(t){return this.min(1,t)}};$i.create=(e,t)=>new $i({type:e,minLength:null,maxLength:null,exactLength:null,typeName:C.ZodArray,...fe(t)});function gc(e){if(e instanceof Rr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Pr.create(gc(n))}return new Rr({...e._def,shape:()=>t})}else return e instanceof $i?new $i({...e._def,type:gc(e.element)}):e instanceof Pr?Pr.create(gc(e.unwrap())):e instanceof ci?ci.create(gc(e.unwrap())):e instanceof ai?ai.create(e.items.map(t=>gc(t))):e}var Rr=class e extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=be.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==q.object){let u=this._getOrReturnCtx(t);return M(u,{code:D.invalid_type,expected:q.object,received:u.parsedType}),oe}let{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof Dn&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let l=o[u],d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ln(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Dn){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(u==="strict")a.length>0&&(M(i,{code:D.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ln(i,d,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,f=await l.value;u.push({key:d,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>Ht.mergeObjectSync(n,u)):Ht.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return Q.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Q.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:C.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of be.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of be.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return gc(this)}partial(t){let r={};for(let n of be.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of be.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Pr;)o=o._def.innerType;r[n]=o}return new e({...this._def,shape:()=>r})}keyof(){return hF(be.objectKeys(this.shape))}};Rr.create=(e,t)=>new Rr({shape:()=>e,unknownKeys:"strip",catchall:Dn.create(),typeName:C.ZodObject,...fe(t)});Rr.strictCreate=(e,t)=>new Rr({shape:()=>e,unknownKeys:"strict",catchall:Dn.create(),typeName:C.ZodObject,...fe(t)});Rr.lazycreate=(e,t)=>new Rr({shape:e,unknownKeys:"strip",catchall:Dn.create(),typeName:C.ZodObject,...fe(t)});var As=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Nr(a.ctx.common.issues));return M(r,{code:D.invalid_union,unionErrors:s}),oe}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new Nr(c));return M(r,{code:D.invalid_union,unionErrors:a}),oe}}get options(){return this._def.options}};As.create=(e,t)=>new As({options:e,typeName:C.ZodUnion,...fe(t)});var Li=e=>e instanceof Ps?Li(e.schema):e instanceof pn?Li(e.innerType()):e instanceof Rs?[e.value]:e instanceof Ds?e.options:e instanceof Cs?be.objectValues(e.enum):e instanceof ks?Li(e._def.innerType):e instanceof ws?[void 0]:e instanceof xs?[null]:e instanceof Pr?[void 0,...Li(e.unwrap())]:e instanceof ci?[null,...Li(e.unwrap())]:e instanceof Ml||e instanceof js?Li(e.unwrap()):e instanceof Ls?Li(e._def.innerType):[],nm=class e extends ge{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.object)return M(r,{code:D.invalid_type,expected:q.object,received:r.parsedType}),oe;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(M(r,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let o of r){let s=Li(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new e({typeName:C.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...fe(n)})}};function PS(e,t){let r=si(e),n=si(t);if(e===t)return{valid:!0,data:e};if(r===q.object&&n===q.object){let i=be.objectKeys(t),o=be.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(let a of o){let c=PS(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===q.array&&n===q.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],c=PS(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===q.date&&n===q.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ns=class extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=(o,s)=>{if(tm(o)||tm(s))return oe;let a=PS(o.value,s.value);return a.valid?((rm(o)||rm(s))&&r.dirty(),{status:r.value,value:a.data}):(M(n,{code:D.invalid_intersection_types}),oe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ns.create=(e,t,r)=>new Ns({left:e,right:t,typeName:C.ZodIntersection,...fe(r)});var ai=class e extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.array)return M(n,{code:D.invalid_type,expected:q.array,received:n.parsedType}),oe;if(n.data.length<this._def.items.length)return M(n,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oe;!this._def.rest&&n.data.length>this._def.items.length&&(M(n,{code:D.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ln(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Ht.mergeArray(r,s)):Ht.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ai.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ai({items:e,typeName:C.ZodTuple,rest:null,...fe(t)})};var im=class e extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.object)return M(n,{code:D.invalid_type,expected:q.object,received:n.parsedType}),oe;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new ln(n,a,n.path,a)),value:s._parse(new ln(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Ht.mergeObjectAsync(r,i):Ht.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ge?new e({keyType:t,valueType:r,typeName:C.ZodRecord,...fe(n)}):new e({keyType:vo.create(),valueType:t,typeName:C.ZodRecord,...fe(r)})}},vc=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.map)return M(n,{code:D.invalid_type,expected:q.map,received:n.parsedType}),oe;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new ln(n,a,n.path,[u,"key"])),value:o._parse(new ln(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return oe;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return oe;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};vc.create=(e,t,r)=>new vc({valueType:t,keyType:e,typeName:C.ZodMap,...fe(r)});var Ec=class e extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==q.set)return M(n,{code:D.invalid_type,expected:q.set,received:n.parsedType}),oe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(M(n,{code:D.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(M(n,{code:D.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let u=new Set;for(let l of c){if(l.status==="aborted")return oe;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new ln(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:Q.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Q.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Ec.create=(e,t)=>new Ec({valueType:e,minSize:null,maxSize:null,typeName:C.ZodSet,...fe(t)});var om=class e extends ge{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.function)return M(r,{code:D.invalid_type,expected:q.function,received:r.parsedType}),oe;function n(a,c){return $l({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hc(),ki].filter(u=>!!u),issueData:{code:D.invalid_arguments,argumentsError:c}})}function i(a,c){return $l({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,hc(),ki].filter(u=>!!u),issueData:{code:D.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof To){let a=this;return ar(async function(...c){let u=new Nr([]),l=await a._def.args.parseAsync(c,o).catch(h=>{throw u.addIssue(n(c,h)),u}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{let a=this;return ar(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new Nr([n(c,u.error)]);let l=Reflect.apply(s,this,u.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new Nr([i(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ai.create(t).rest(ji.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ai.create([]).rest(ji.create()),returns:r||ji.create(),typeName:C.ZodFunction,...fe(n)})}},Ps=class extends ge{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Ps.create=(e,t)=>new Ps({getter:e,typeName:C.ZodLazy,...fe(t)});var Rs=class extends ge{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return M(r,{received:r.data,code:D.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:t.data}}get value(){return this._def.value}};Rs.create=(e,t)=>new Rs({value:e,typeName:C.ZodLiteral,...fe(t)});function hF(e,t){return new Ds({values:e,typeName:C.ZodEnum,...fe(t)})}var Ds=class e extends ge{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return M(r,{expected:be.joinValues(n),received:r.parsedType,code:D.invalid_type}),oe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return M(r,{received:r.data,code:D.invalid_enum_value,options:n}),oe}return ar(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ds.create=hF;var Cs=class extends ge{_parse(t){let r=be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==q.string&&n.parsedType!==q.number){let i=be.objectValues(r);return M(n,{expected:be.joinValues(i),received:n.parsedType,code:D.invalid_type}),oe}if(this._cache||(this._cache=new Set(be.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=be.objectValues(r);return M(n,{received:n.data,code:D.invalid_enum_value,options:i}),oe}return ar(t.data)}get enum(){return this._def.values}};Cs.create=(e,t)=>new Cs({values:e,typeName:C.ZodNativeEnum,...fe(t)});var To=class extends ge{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==q.promise&&r.common.async===!1)return M(r,{code:D.invalid_type,expected:q.promise,received:r.parsedType}),oe;let n=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return ar(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};To.create=(e,t)=>new To({type:e,typeName:C.ZodPromise,...fe(t)});var pn=class extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===C.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{M(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return oe;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?oe:c.status==="dirty"?Ts(c.value):r.value==="dirty"?Ts(c.value):c});{if(r.value==="aborted")return oe;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?oe:a.status==="dirty"?Ts(a.value):r.value==="dirty"?Ts(a.value):a}}if(i.type==="refinement"){let s=a=>{let c=i.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!_o(s))return oe;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>_o(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):oe);be.assertNever(i)}};pn.create=(e,t,r)=>new pn({schema:e,typeName:C.ZodEffects,effect:t,...fe(r)});pn.createWithPreprocess=(e,t,r)=>new pn({schema:t,effect:{type:"preprocess",transform:e},typeName:C.ZodEffects,...fe(r)});var Pr=class extends ge{_parse(t){return this._getType(t)===q.undefined?ar(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pr.create=(e,t)=>new Pr({innerType:e,typeName:C.ZodOptional,...fe(t)});var ci=class extends ge{_parse(t){return this._getType(t)===q.null?ar(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ci.create=(e,t)=>new ci({innerType:e,typeName:C.ZodNullable,...fe(t)});var ks=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ks.create=(e,t)=>new ks({innerType:e,typeName:C.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...fe(t)});var Ls=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return mc(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Nr(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Nr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ls.create=(e,t)=>new Ls({innerType:e,typeName:C.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...fe(t)});var Tc=class extends ge{_parse(t){if(this._getType(t)!==q.nan){let n=this._getOrReturnCtx(t);return M(n,{code:D.invalid_type,expected:q.nan,received:n.parsedType}),oe}return{status:"valid",value:t.data}}};Tc.create=e=>new Tc({typeName:C.ZodNaN,...fe(e)});var fae=Symbol("zod_brand"),Ml=class extends ge{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ql=class e extends ge{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?oe:o.status==="dirty"?(r.dirty(),Ts(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?oe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:C.ZodPipeline})}},js=class extends ge{_parse(t){let r=this._def.innerType._parse(t),n=i=>(_o(i)&&(i.value=Object.freeze(i.value)),i);return mc(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};js.create=(e,t)=>new js({innerType:e,typeName:C.ZodReadonly,...fe(t)});function lF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function mF(e,t={},r){return e?Eo.create().superRefine((n,i)=>{let o=e(n);if(o instanceof Promise)return o.then(s=>{if(!s){let a=lF(t,n),c=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:c})}});if(!o){let s=lF(t,n),a=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:a})}}):Eo.create()}var hae={object:Rr.lazycreate},C;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(C||(C={}));var mae=(e,t={message:`Input not instance of ${e.name}`})=>mF(r=>r instanceof e,t),gF=vo.create,yF=bs.create,gae=Tc.create,yae=Ss.create,_F=Os.create,_ae=Is.create,vae=yc.create,Eae=ws.create,Tae=xs.create,bae=Eo.create,Sae=ji.create,Oae=Dn.create,Iae=_c.create,wae=$i.create,RS=Rr.create,xae=Rr.strictCreate,Aae=As.create,Nae=nm.create,Pae=Ns.create,Rae=ai.create,Dae=im.create,Cae=vc.create,kae=Ec.create,Lae=om.create,jae=Ps.create,$ae=Rs.create,Mae=Ds.create,qae=Cs.create,Fae=To.create,Uae=pn.create,zae=Pr.create,Gae=ci.create,Vae=pn.createWithPreprocess,Bae=ql.create,Zae=()=>gF().optional(),Kae=()=>yF().optional(),Hae=()=>_F().optional(),Qae={string:(e=>vo.create({...e,coerce:!0})),number:(e=>bs.create({...e,coerce:!0})),boolean:(e=>Os.create({...e,coerce:!0})),bigint:(e=>Ss.create({...e,coerce:!0})),date:(e=>Is.create({...e,coerce:!0}))};var Wae=oe;var DS=[{name:"schema_actionflow",description:`Action flows \u2014 flow-level (addressed by actionFlowId). Discover types via op=SELECTABLE_TYPES and ids via op=GET_DETAIL. AI nodes require isAsync=true.
|
|
1104
1104
|
Changes apply immediately; use schema_undo to revert the last change. Ops:
|
|
1105
1105
|
- op=ADD \u2192 ADD_ACTION_FLOWS (req: items)
|
|
1106
1106
|
- op=ADD_GLOBAL_VARS \u2192 ADD_ACTION_FLOW_GLOBAL_VARIABLES (req: actionFlowId, items)
|
|
@@ -1313,7 +1313,7 @@ ${Gl(o)}
|
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
1315
|
`;return t.ok(Br(FS(await n.dataClient.request(s,{where:e.where??{}})),r))},UF={"support.graphql":tue,"support.query":rue,"support.insert":nue,"support.update":iue,"support.delete":oue};p();var sue=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],aue=["INFO","WARNING","ERROR"],cue=50,uue=100,zF=5,GF=e=>`${e.toISOString().slice(0,19)}Z`,lue=e=>{if(!e)return new Date;let t=new Date(e);return Number.isNaN(t.getTime())?new Date:t},VF=(e,t)=>{if(!e)return;let r=e.map(n=>n.toUpperCase()).filter(n=>t.includes(n));return r.length>0?r:void 0},pue=async(e,t)=>{let r=await t.getProjectArgs(e),i=(await Vl(t.client,r)).dataVisualizer.token;if(!i)throw new Error(`Log admin token is missing for project ${r.projectExId}`);let o=lue(Re(e.requestCreatedAt)),s={start:GF(new Date(o.getTime()-zF*6e4)),end:GF(new Date(o.getTime()+zF*6e4)),desc:!0},a=VF($s(e.types),sue);a&&(s.type=a);let c=VF($s(e.levels),aue);c&&(s.level=c);let u=Re(e.customQueryCondition);u&&(s.customQueryCondition=u);let l=Math.min(uue,dn(e.limit,cue)),d=xr().logApiUrlTemplate.replace("{projectExId}",r.projectExId),m=((await new tr(d,{headers:{authorization:`Bearer ${i}`},fetch:jl}).request(f$,{queryCreation:s,paginator:{first:l}}))?.fetchLogsByPaginator?.edges??[]).map(y=>y?.node).filter(y=>!!y);return t.ok({entries:m})},BF={"logs.search":pue};p();p();p();p();import{readFileSync as Eue}from"node:fs";import{dirname as Tue,join as bue}from"node:path";import{fileURLToPath as Sue}from"node:url";p();var $t,Zl=null;function dm(){return(Zl===null||Zl.byteLength===0)&&(Zl=new Uint8Array($t.memory.buffer)),Zl}var fm=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&fm.decode();var due=2146435072,US=0;function fue(e,t){return US+=t,US>=due&&(fm=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}},fm.decode(),US=t),fm.decode(dm().subarray(e,e+t))}function zS(e,t){return e=e>>>0,fue(e,t)}function GS(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let i=e.description;return i==null?"Symbol":`Symbol(${i})`}if(t=="function"){let i=e.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(e)){let i=e.length,o="[";i>0&&(o+=GS(e[0]));for(let s=1;s<i;s++)o+=", "+GS(e[s]);return o+="]",o}let r=/\[object ([^\]]+)\]/.exec(toString.call(e)),n;if(r&&r.length>1)n=r[1];else return toString.call(e);if(n=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
|
|
1316
|
-
${e.stack}`:n}var mm=0,hm=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},hue=typeof hm.encodeInto=="function"?function(e,t){return hm.encodeInto(e,t)}:function(e,t){let r=hm.encode(e);return t.set(r),{read:e.length,written:r.length}};function ZF(e,t,r){if(r===void 0){let a=hm.encode(e),c=t(a.length,1)>>>0;return dm().subarray(c,c+a.length).set(a),mm=a.length,c}let n=e.length,i=t(n,1)>>>0,o=dm(),s=0;for(;s<n;s++){let a=e.charCodeAt(s);if(a>127)break;o[i+s]=a}if(s!==n){s!==0&&(e=e.slice(s)),i=r(i,n,n=s+e.length*3,1)>>>0;let a=dm().subarray(i+s,i+n),c=hue(e,a);s+=c.written,i=r(i,n,s,1)>>>0}return mm=s,i}var Ms=null;function VS(){return(Ms===null||Ms.buffer.detached===!0||Ms.buffer.detached===void 0&&Ms.buffer!==$t.memory.buffer)&&(Ms=new DataView($t.memory.buffer)),Ms}function mue(e){return e==null}function gue(e,t){e=e>>>0;let r=VS(),n=[];for(let i=e;i<e+4*t;i+=4)n.push($t.__wbindgen_export_2.get(r.getUint32(i,!0)));return $t.__externref_drop_slice(e,t),n}function KF(e,t){let r=ZF(e,$t.__wbindgen_malloc,$t.__wbindgen_realloc),n=mm,i=$t.cut(r,n,mue(t)?16777215:t?1:0);var o=gue(i[0],i[1]).slice();return $t.__wbindgen_free(i[0],i[1]*4,4),o}var yue=new Set(["basic","cors","default"]);async function _ue(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(n){if(e.ok&&yue.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}function HF(){let e={};return e.wbg={},e.wbg.__wbg_Error_0497d5bdba9362e5=function(t,r){return Error(zS(t,r))},e.wbg.__wbg_new_07b483f72211fd66=function(){return new Object},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,r,n){t[r]=n},e.wbg.__wbindgen_bigint_from_u64=function(t){return BigInt.asUintN(64,t)},e.wbg.__wbindgen_debug_string=function(t,r){let n=GS(r),i=ZF(n,$t.__wbindgen_malloc,$t.__wbindgen_realloc),o=mm;VS().setInt32(t+4,o,!0),VS().setInt32(t+0,i,!0)},e.wbg.__wbindgen_init_externref_table=function(){let t=$t.__wbindgen_export_2,r=t.grow(4);t.set(0,void 0),t.set(r+0,void 0),t.set(r+1,null),t.set(r+2,!0),t.set(r+3,!1)},e.wbg.__wbindgen_number_new=function(t){return t},e.wbg.__wbindgen_string_new=function(t,r){return zS(t,r)},e.wbg.__wbindgen_throw=function(t,r){throw new Error(zS(t,r))},e}function QF(e,t){return $t=e.exports,vue.__wbindgen_wasm_module=t,Ms=null,Zl=null,$t.__wbindgen_start(),$t}function WF(e){if($t!==void 0)return $t;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=HF();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let r=new WebAssembly.Instance(e,t);return QF(r,e)}async function vue(e){if($t!==void 0)return $t;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("jieba_rs_wasm_bg.wasm",import.meta.url));let t=HF();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:n}=await _ue(await e,t);return QF(r,n)}var JF=!1,YF=(e,t)=>{if(!JF){let r=bue(Tue(Sue(import.meta.url)),"jieba-engine.wasm");WF({module:Eue(r)}),JF=!0}return KF(e,t)};var Oue=new Set(["a","an","and","are","as","at","be","but","by","for","if","in","into","is","it","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]),Iue=/[a-z0-9]+/g,wue=e=>{let t=e.toLowerCase().replace(/'s\b/g,""),r=[];for(let n of t.matchAll(Iue)){let i=n[0];Oue.has(i)||r.push(Nue(i))}return r},xue=/[㐀-鿿豈--ヿ가-]|[a-z0-9]/i,Aue=e=>YF(e.toLowerCase(),!0).filter(t=>xue.test(t)),ym=e=>Uo==="ZION"?Aue(e):wue(e),qs=(e,t)=>{let r=e[t];return r==="a"||r==="e"||r==="i"||r==="o"||r==="u"?!1:r==="y"?t===0?!0:!qs(e,t-1):!0},bo=e=>{let t=0,r=!1;for(let n=0;n<e.length;n+=1){let i=!qs(e,n);r&&!i&&(t+=1),r=i}return t},BS=e=>{for(let t=0;t<e.length;t+=1)if(!qs(e,t))return!0;return!1},XF=e=>{let t=e.length;return t>=2&&e[t-1]===e[t-2]&&qs(e,t-1)},e1=e=>{let t=e.length;if(t<3||!qs(e,t-1)||qs(e,t-2)||!qs(e,t-3))return!1;let r=e[t-1];return r!=="w"&&r!=="x"&&r!=="y"},gm=(e,t,r)=>e.slice(0,e.length-t.length)+r;function Nue(e){let t=e;if(t.length<=2)return t;t.endsWith("sses")?t=gm(t,"sses","ss"):t.endsWith("ies")?t=gm(t,"ies","i"):t.endsWith("ss")||t.endsWith("s")&&(t=t.slice(0,-1));let r=!1;t.endsWith("eed")?bo(t.slice(0,-3))>0&&(t=t.slice(0,-1)):t.endsWith("ed")&&BS(t.slice(0,-2))?(t=t.slice(0,-2),r=!0):t.endsWith("ing")&&BS(t.slice(0,-3))&&(t=t.slice(0,-3),r=!0),r&&(t.endsWith("at")||t.endsWith("bl")||t.endsWith("iz")?t+="e":XF(t)&&!/[lsz]$/.test(t)?t=t.slice(0,-1):bo(t)===1&&e1(t)&&(t+="e")),t.endsWith("y")&&BS(t.slice(0,-1))&&(t=`${t.slice(0,-1)}i`);let n=[["ational","ate"],["tional","tion"],["enci","ence"],["anci","ance"],["izer","ize"],["bli","ble"],["alli","al"],["entli","ent"],["eli","e"],["ousli","ous"],["ization","ize"],["ation","ate"],["ator","ate"],["alism","al"],["iveness","ive"],["fulness","ful"],["ousness","ous"],["aliti","al"],["iviti","ive"],["biliti","ble"],["logi","log"]];for(let[a,c]of n)if(t.endsWith(a)){bo(t.slice(0,t.length-a.length))>0&&(t=gm(t,a,c));break}let i=[["icate","ic"],["ative",""],["alize","al"],["iciti","ic"],["ical","ic"],["ful",""],["ness",""]];for(let[a,c]of i)if(t.endsWith(a)){bo(t.slice(0,t.length-a.length))>0&&(t=gm(t,a,c));break}let o=["al","ance","ence","er","ic","able","ible","ant","ement","ment","ent","ou","ism","ate","iti","ous","ive","ize"],s=!1;for(let a of o)if(t.endsWith(a)){let c=t.slice(0,t.length-a.length);bo(c)>1&&(t=c),s=!0;break}if(!s&&t.endsWith("ion")){let a=t.slice(0,-3);bo(a)>1&&/[st]$/.test(a)&&(t=a)}if(t.endsWith("e")){let a=t.slice(0,-1),c=bo(a);(c>1||c===1&&!e1(a))&&(t=a)}return bo(t)>1&&XF(t)&&t.endsWith("l")&&(t=t.slice(0,-1)),t}var Pue=async()=>(await import("./corpus-3F2UACTF.js")).DOCS_CORPUS,t1=1.5,r1=.75,Rue=3,n1=null,Due=e=>{let t=[],r=new Map,n=new Map,i=0;for(let o of e){n.set(o.path,o);let s=ym(o.content),a=ym(o.title);for(let u=0;u<Rue;u+=1)s.push(...a);let c=new Map;for(let u of s)c.set(u,(c.get(u)??0)+1);for(let u of c.keys())r.set(u,(r.get(u)??0)+1);t.push({page:o,tf:c,length:s.length}),i+=s.length}return{docs:t,df:r,avgdl:t.length>0?i/t.length:0,byPath:n}},i1=async()=>(n1??=Due(await Pue()),n1),o1=async(e,t=10)=>{let r=await i1(),n=[...new Set(ym(e))];if(n.length===0||r.docs.length===0)return[];let i=r.docs.length;return r.docs.map(s=>{let a=0;for(let c of n){let u=s.tf.get(c);if(!u)continue;let l=r.df.get(c)??0,d=Math.log(1+(i-l+.5)/(l+.5)),f=u+t1*(1-r1+r1*s.length/(r.avgdl||1));a+=d*(u*(t1+1)/f)}return{page:s.page,score:a}}).filter(s=>s.score>0).sort((s,a)=>a.score-s.score).slice(0,Math.max(1,t)).map(s=>({path:s.page.path,title:s.page.title,url:s.page.url}))},s1=async e=>{let t=e.replace(/\.mdx$/,""),r=t.startsWith("/")?t:`/${t}`;return(await i1()).byPath.get(r)??null};var Cue=async(e,t)=>{let r=Re(e.query);if(!r)throw new Error("query is required");let n=dn(e.limit,10);return t.ok({results:await o1(r,n)})},kue=async(e,t)=>{let r=Re(e.path);if(!r)throw new Error("path is required");let n=await s1(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},a1={"docs.search":Cue,"docs.get_page":kue};p();var Lue=async(e,t)=>{let r=Re(e.query);if(!r)throw new Error("query is required");let n=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,n))},c1={"zb.graphql":Lue};p();var u1={...AF,...LF,...qF,...FF,...UF,...BF,...a1,...c1};var jue=new Set(["docs.search","docs.get_page"]),$ue=e=>new Proxy({},{get(){throw new Error(`${e} is a local-only command and has no authenticated client`)}});function Mue(e){if(!(e instanceof Error))return String(e);let t=SS(e.response?.errors);return t||e.message||String(e)}function _m(e,t={}){let r=new gi(e),n=new Ya(r),i=new sm(()=>OS(n,r),t.watchSchemaChanges?async(...c)=>(await eF(n,r))(...c):void 0),o=(c,u)=>({ok:!0,data:c,message:u}),s=c=>({ok:!1,error:Mue(c),data:c instanceof Es?{ztypeDiagnostics:c.diagnostics}:void 0});return{execute:async(c,u)=>{let l=TF(c.args);try{let d=u1[c.name];if(!d)throw new Error(`Unknown command: ${c.name}`);let f=jue.has(c.name)?$ue(c.name):await OS(n,r),h=null,m=async T=>(h??=await OF(r,T),h);return await d(l,{credentialStore:r,tokenManager:n,schemaManager:i,client:f,signal:u,getProjectArgs:m,checkSchema:async T=>{let b=await m(T);return i.checkRemoteAndSync(am(b.projectExId,b))},ok:o,fail:s})}catch(d){return s(d)}},schemaManager:i,setWorkspaceRoot(c){r.setWorkspaceRoot(c),i.clear()},stop(){i.clear()}}}p();var p1=Rt(fu(),1);import{createRequire as que}from"module";import{fileURLToPath as Fue}from"url";import l1 from"path";var d1=que(import.meta.url),qi=typeof g>"u"?void 0:g,Uue=()=>{if(qi)return{version:qi.agent};try{let e=l1.resolve(l1.dirname(Fue(import.meta.url)),"../../package.json");return d1(e)}catch{return{}}},vm=e=>{if(qi){if(e==="@functorz/ztype")return qi.ztype;if(e==="@functorz/crdt-helper")return qi.crdtHelper;if(e==="json-joy")return qi.jsonJoy}try{return d1(`${e}/package.json`).version??"unknown"}catch{return"unavailable"}},zue=async()=>{if(qi)return{ztypeVersion:qi.ztype,ztypeSchemaVersion:qi.ztypeSchemaVersion};try{let e=await oi();return{ztypeVersion:e?.ZTypeSystem?.getZTypeVersion?.()??vm("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:vm("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function ZS(){let e=Uue(),t=await zue();return{agentVersion:e.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:t.ztypeVersion,ztypeSchemaVersion:t.ztypeSchemaVersion,crdtHelperVersion:vm("@functorz/crdt-helper"),jsonJoyVersion:vm("json-joy")}}async function Sc(e,t){let[r,n,i]=await Promise.all([ZS(),An(e),e.loadCredentials()]),o=i?p1.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:er,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:e.getWorkspaceRoot(),startupFlags:[...t].sort()}}function f1(e,t){return JSON.stringify(e)===JSON.stringify(t)}p();import Em from"net";var Gue=600*1e3;async function Dr(e,t,r){let{socketPath:n,token:i}=e,o=`${Date.now()}-${Math.random().toString(16).slice(2)}`,s={id:o,token:i,command:t};return new Promise((a,c)=>{let u=n.startsWith("tcp://")?Em.createConnection(m1(n)):Em.createConnection(n),l="",d=setTimeout(()=>{u.destroy(),c(new Error(`Timed out waiting for daemon response to ${t.name}`))},Gue),f=()=>{r&&r.removeEventListener("abort",h)},h=()=>{clearTimeout(d),u.destroy(),c(new Error(`Request aborted: ${t.name}`))};if(r){if(r.aborted){h();return}r.addEventListener("abort",h)}u.on("connect",()=>{u.write(`${JSON.stringify(s)}
|
|
1316
|
+
${e.stack}`:n}var mm=0,hm=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},hue=typeof hm.encodeInto=="function"?function(e,t){return hm.encodeInto(e,t)}:function(e,t){let r=hm.encode(e);return t.set(r),{read:e.length,written:r.length}};function ZF(e,t,r){if(r===void 0){let a=hm.encode(e),c=t(a.length,1)>>>0;return dm().subarray(c,c+a.length).set(a),mm=a.length,c}let n=e.length,i=t(n,1)>>>0,o=dm(),s=0;for(;s<n;s++){let a=e.charCodeAt(s);if(a>127)break;o[i+s]=a}if(s!==n){s!==0&&(e=e.slice(s)),i=r(i,n,n=s+e.length*3,1)>>>0;let a=dm().subarray(i+s,i+n),c=hue(e,a);s+=c.written,i=r(i,n,s,1)>>>0}return mm=s,i}var Ms=null;function VS(){return(Ms===null||Ms.buffer.detached===!0||Ms.buffer.detached===void 0&&Ms.buffer!==$t.memory.buffer)&&(Ms=new DataView($t.memory.buffer)),Ms}function mue(e){return e==null}function gue(e,t){e=e>>>0;let r=VS(),n=[];for(let i=e;i<e+4*t;i+=4)n.push($t.__wbindgen_export_2.get(r.getUint32(i,!0)));return $t.__externref_drop_slice(e,t),n}function KF(e,t){let r=ZF(e,$t.__wbindgen_malloc,$t.__wbindgen_realloc),n=mm,i=$t.cut(r,n,mue(t)?16777215:t?1:0);var o=gue(i[0],i[1]).slice();return $t.__wbindgen_free(i[0],i[1]*4,4),o}var yue=new Set(["basic","cors","default"]);async function _ue(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(n){if(e.ok&&yue.has(e.type)&&e.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}else{let r=await WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}function HF(){let e={};return e.wbg={},e.wbg.__wbg_Error_0497d5bdba9362e5=function(t,r){return Error(zS(t,r))},e.wbg.__wbg_new_07b483f72211fd66=function(){return new Object},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,r,n){t[r]=n},e.wbg.__wbindgen_bigint_from_u64=function(t){return BigInt.asUintN(64,t)},e.wbg.__wbindgen_debug_string=function(t,r){let n=GS(r),i=ZF(n,$t.__wbindgen_malloc,$t.__wbindgen_realloc),o=mm;VS().setInt32(t+4,o,!0),VS().setInt32(t+0,i,!0)},e.wbg.__wbindgen_init_externref_table=function(){let t=$t.__wbindgen_export_2,r=t.grow(4);t.set(0,void 0),t.set(r+0,void 0),t.set(r+1,null),t.set(r+2,!0),t.set(r+3,!1)},e.wbg.__wbindgen_number_new=function(t){return t},e.wbg.__wbindgen_string_new=function(t,r){return zS(t,r)},e.wbg.__wbindgen_throw=function(t,r){throw new Error(zS(t,r))},e}function QF(e,t){return $t=e.exports,vue.__wbindgen_wasm_module=t,Ms=null,Zl=null,$t.__wbindgen_start(),$t}function WF(e){if($t!==void 0)return $t;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=HF();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let r=new WebAssembly.Instance(e,t);return QF(r,e)}async function vue(e){if($t!==void 0)return $t;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("jieba_rs_wasm_bg.wasm",import.meta.url));let t=HF();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:r,module:n}=await _ue(await e,t);return QF(r,n)}var JF=!1,YF=(e,t)=>{if(!JF){let r=bue(Tue(Sue(import.meta.url)),"jieba-engine.wasm");WF({module:Eue(r)}),JF=!0}return KF(e,t)};var Oue=new Set(["a","an","and","are","as","at","be","but","by","for","if","in","into","is","it","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]),Iue=/[a-z0-9]+/g,wue=e=>{let t=e.toLowerCase().replace(/'s\b/g,""),r=[];for(let n of t.matchAll(Iue)){let i=n[0];Oue.has(i)||r.push(Nue(i))}return r},xue=/[㐀-鿿豈--ヿ가-]|[a-z0-9]/i,Aue=e=>YF(e.toLowerCase(),!0).filter(t=>xue.test(t)),ym=e=>Uo==="ZION"?Aue(e):wue(e),qs=(e,t)=>{let r=e[t];return r==="a"||r==="e"||r==="i"||r==="o"||r==="u"?!1:r==="y"?t===0?!0:!qs(e,t-1):!0},bo=e=>{let t=0,r=!1;for(let n=0;n<e.length;n+=1){let i=!qs(e,n);r&&!i&&(t+=1),r=i}return t},BS=e=>{for(let t=0;t<e.length;t+=1)if(!qs(e,t))return!0;return!1},XF=e=>{let t=e.length;return t>=2&&e[t-1]===e[t-2]&&qs(e,t-1)},e1=e=>{let t=e.length;if(t<3||!qs(e,t-1)||qs(e,t-2)||!qs(e,t-3))return!1;let r=e[t-1];return r!=="w"&&r!=="x"&&r!=="y"},gm=(e,t,r)=>e.slice(0,e.length-t.length)+r;function Nue(e){let t=e;if(t.length<=2)return t;t.endsWith("sses")?t=gm(t,"sses","ss"):t.endsWith("ies")?t=gm(t,"ies","i"):t.endsWith("ss")||t.endsWith("s")&&(t=t.slice(0,-1));let r=!1;t.endsWith("eed")?bo(t.slice(0,-3))>0&&(t=t.slice(0,-1)):t.endsWith("ed")&&BS(t.slice(0,-2))?(t=t.slice(0,-2),r=!0):t.endsWith("ing")&&BS(t.slice(0,-3))&&(t=t.slice(0,-3),r=!0),r&&(t.endsWith("at")||t.endsWith("bl")||t.endsWith("iz")?t+="e":XF(t)&&!/[lsz]$/.test(t)?t=t.slice(0,-1):bo(t)===1&&e1(t)&&(t+="e")),t.endsWith("y")&&BS(t.slice(0,-1))&&(t=`${t.slice(0,-1)}i`);let n=[["ational","ate"],["tional","tion"],["enci","ence"],["anci","ance"],["izer","ize"],["bli","ble"],["alli","al"],["entli","ent"],["eli","e"],["ousli","ous"],["ization","ize"],["ation","ate"],["ator","ate"],["alism","al"],["iveness","ive"],["fulness","ful"],["ousness","ous"],["aliti","al"],["iviti","ive"],["biliti","ble"],["logi","log"]];for(let[a,c]of n)if(t.endsWith(a)){bo(t.slice(0,t.length-a.length))>0&&(t=gm(t,a,c));break}let i=[["icate","ic"],["ative",""],["alize","al"],["iciti","ic"],["ical","ic"],["ful",""],["ness",""]];for(let[a,c]of i)if(t.endsWith(a)){bo(t.slice(0,t.length-a.length))>0&&(t=gm(t,a,c));break}let o=["al","ance","ence","er","ic","able","ible","ant","ement","ment","ent","ou","ism","ate","iti","ous","ive","ize"],s=!1;for(let a of o)if(t.endsWith(a)){let c=t.slice(0,t.length-a.length);bo(c)>1&&(t=c),s=!0;break}if(!s&&t.endsWith("ion")){let a=t.slice(0,-3);bo(a)>1&&/[st]$/.test(a)&&(t=a)}if(t.endsWith("e")){let a=t.slice(0,-1),c=bo(a);(c>1||c===1&&!e1(a))&&(t=a)}return bo(t)>1&&XF(t)&&t.endsWith("l")&&(t=t.slice(0,-1)),t}var Pue=async()=>(await import("./corpus-V7LMU55G.js")).DOCS_CORPUS,t1=1.5,r1=.75,Rue=3,n1=null,Due=e=>{let t=[],r=new Map,n=new Map,i=0;for(let o of e){n.set(o.path,o);let s=ym(o.content),a=ym(o.title);for(let u=0;u<Rue;u+=1)s.push(...a);let c=new Map;for(let u of s)c.set(u,(c.get(u)??0)+1);for(let u of c.keys())r.set(u,(r.get(u)??0)+1);t.push({page:o,tf:c,length:s.length}),i+=s.length}return{docs:t,df:r,avgdl:t.length>0?i/t.length:0,byPath:n}},i1=async()=>(n1??=Due(await Pue()),n1),o1=async(e,t=10)=>{let r=await i1(),n=[...new Set(ym(e))];if(n.length===0||r.docs.length===0)return[];let i=r.docs.length;return r.docs.map(s=>{let a=0;for(let c of n){let u=s.tf.get(c);if(!u)continue;let l=r.df.get(c)??0,d=Math.log(1+(i-l+.5)/(l+.5)),f=u+t1*(1-r1+r1*s.length/(r.avgdl||1));a+=d*(u*(t1+1)/f)}return{page:s.page,score:a}}).filter(s=>s.score>0).sort((s,a)=>a.score-s.score).slice(0,Math.max(1,t)).map(s=>({path:s.page.path,title:s.page.title,url:s.page.url}))},s1=async e=>{let t=e.replace(/\.mdx$/,""),r=t.startsWith("/")?t:`/${t}`;return(await i1()).byPath.get(r)??null};var Cue=async(e,t)=>{let r=Re(e.query);if(!r)throw new Error("query is required");let n=dn(e.limit,10);return t.ok({results:await o1(r,n)})},kue=async(e,t)=>{let r=Re(e.path);if(!r)throw new Error("path is required");let n=await s1(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},a1={"docs.search":Cue,"docs.get_page":kue};p();var Lue=async(e,t)=>{let r=Re(e.query);if(!r)throw new Error("query is required");let n=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,n))},c1={"zb.graphql":Lue};p();var u1={...AF,...LF,...qF,...FF,...UF,...BF,...a1,...c1};var jue=new Set(["docs.search","docs.get_page"]),$ue=e=>new Proxy({},{get(){throw new Error(`${e} is a local-only command and has no authenticated client`)}});function Mue(e){if(!(e instanceof Error))return String(e);let t=SS(e.response?.errors);return t||e.message||String(e)}function _m(e,t={}){let r=new gi(e),n=new Ya(r),i=new sm(()=>OS(n,r),t.watchSchemaChanges?async(...c)=>(await eF(n,r))(...c):void 0),o=(c,u)=>({ok:!0,data:c,message:u}),s=c=>({ok:!1,error:Mue(c),data:c instanceof Es?{ztypeDiagnostics:c.diagnostics}:void 0});return{execute:async(c,u)=>{let l=TF(c.args);try{let d=u1[c.name];if(!d)throw new Error(`Unknown command: ${c.name}`);let f=jue.has(c.name)?$ue(c.name):await OS(n,r),h=null,m=async T=>(h??=await OF(r,T),h);return await d(l,{credentialStore:r,tokenManager:n,schemaManager:i,client:f,signal:u,getProjectArgs:m,checkSchema:async T=>{let b=await m(T);return i.checkRemoteAndSync(am(b.projectExId,b))},ok:o,fail:s})}catch(d){return s(d)}},schemaManager:i,setWorkspaceRoot(c){r.setWorkspaceRoot(c),i.clear()},stop(){i.clear()}}}p();var p1=Rt(fu(),1);import{createRequire as que}from"module";import{fileURLToPath as Fue}from"url";import l1 from"path";var d1=que(import.meta.url),qi=typeof g>"u"?void 0:g,Uue=()=>{if(qi)return{version:qi.agent};try{let e=l1.resolve(l1.dirname(Fue(import.meta.url)),"../../package.json");return d1(e)}catch{return{}}},vm=e=>{if(qi){if(e==="@functorz/ztype")return qi.ztype;if(e==="@functorz/crdt-helper")return qi.crdtHelper;if(e==="json-joy")return qi.jsonJoy}try{return d1(`${e}/package.json`).version??"unknown"}catch{return"unavailable"}},zue=async()=>{if(qi)return{ztypeVersion:qi.ztype,ztypeSchemaVersion:qi.ztypeSchemaVersion};try{let e=await oi();return{ztypeVersion:e?.ZTypeSystem?.getZTypeVersion?.()??vm("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:vm("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function ZS(){let e=Uue(),t=await zue();return{agentVersion:e.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:t.ztypeVersion,ztypeSchemaVersion:t.ztypeSchemaVersion,crdtHelperVersion:vm("@functorz/crdt-helper"),jsonJoyVersion:vm("json-joy")}}async function Sc(e,t){let[r,n,i]=await Promise.all([ZS(),An(e),e.loadCredentials()]),o=i?p1.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:er,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:e.getWorkspaceRoot(),startupFlags:[...t].sort()}}function f1(e,t){return JSON.stringify(e)===JSON.stringify(t)}p();import Em from"net";var Gue=600*1e3;async function Dr(e,t,r){let{socketPath:n,token:i}=e,o=`${Date.now()}-${Math.random().toString(16).slice(2)}`,s={id:o,token:i,command:t};return new Promise((a,c)=>{let u=n.startsWith("tcp://")?Em.createConnection(m1(n)):Em.createConnection(n),l="",d=setTimeout(()=>{u.destroy(),c(new Error(`Timed out waiting for daemon response to ${t.name}`))},Gue),f=()=>{r&&r.removeEventListener("abort",h)},h=()=>{clearTimeout(d),u.destroy(),c(new Error(`Request aborted: ${t.name}`))};if(r){if(r.aborted){h();return}r.addEventListener("abort",h)}u.on("connect",()=>{u.write(`${JSON.stringify(s)}
|
|
1317
1317
|
`)}),u.on("data",m=>{l+=m.toString("utf8");let y=l.indexOf(`
|
|
1318
1318
|
`);if(y<0)return;let E=l.slice(0,y);clearTimeout(d),f(),u.end();try{let T=JSON.parse(E);if(T.id!==o){c(new Error("Daemon response id mismatch"));return}a(T.result)}catch(T){c(T)}}),u.on("error",m=>{clearTimeout(d),f(),c(m)})})}function h1(e,t,r){let{socketPath:n,token:i}=e,o=null,s=!1,a=null,c=()=>{if(s)return;o=n.startsWith("tcp://")?Em.createConnection(m1(n)):Em.createConnection(n);let u=`sub-${Date.now()}-${Math.random().toString(16).slice(2)}`,l={id:u,token:i,command:{name:"schema.subscribe"}},d="";o.on("connect",()=>{o?.write(`${JSON.stringify(l)}
|
|
1319
1319
|
`)}),o.on("data",f=>{for(d+=f.toString("utf8");;){let h=d.indexOf(`
|