@skyramp/testbot-core 0.13.1-v3.455 → 0.13.1-v3.456
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/VERSION.json +1 -1
- package/dist/data-safety-worker.js +1 -1
- package/dist/main.js +454 -453
- package/dist/post.js +55 -55
- package/dist/runner-client.cjs +66 -66
- package/dist/runner-client.d.cts +5 -1
- package/dist/setup-failure.cjs +1 -0
- package/dist/setup-failure.d.cts +30 -0
- package/package.json +5 -2
|
@@ -43,7 +43,7 @@ ${i.count} ${i.noun} ${i.is} pending:
|
|
|
43
43
|
|
|
44
44
|
${t.format(n)}
|
|
45
45
|
`.trim())}};Ex.exports=Yh});var za=k((V5,vx)=>{"use strict";var Cx=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:B2}=ue(),Q2=zo();Qx()===void 0&&Bx(new Q2);function Bx(e){if(!e||typeof e.dispatch!="function")throw new B2("Argument agent must implement Agent");Object.defineProperty(globalThis,Cx,{value:e,writable:!0,enumerable:!1,configurable:!1})}function Qx(){return globalThis[Cx]}vx.exports={setGlobalDispatcher:Bx,getGlobalDispatcher:Qx}});var xu=k((Y5,wx)=>{"use strict";wx.exports=class{#e;constructor(t){if(typeof t!="object"||t===null)throw new TypeError("handler must be an object");this.#e=t}onConnect(...t){return this.#e.onConnect?.(...t)}onError(...t){return this.#e.onError?.(...t)}onUpgrade(...t){return this.#e.onUpgrade?.(...t)}onResponseStarted(...t){return this.#e.onResponseStarted?.(...t)}onHeaders(...t){return this.#e.onHeaders?.(...t)}onData(...t){return this.#e.onData?.(...t)}onComplete(...t){return this.#e.onComplete?.(...t)}onBodySent(...t){return this.#e.onBodySent?.(...t)}}});var kx=k((H5,bx)=>{"use strict";var v2=Au();bx.exports=e=>{let t=e?.maxRedirections;return n=>function(r,o){let{maxRedirections:s=t,...a}=r;if(!s)return n(r,o);let A=new v2(n,s,r,o);return n(a,A)}}});var xx=k((j5,Sx)=>{"use strict";var w2=Eu();Sx.exports=e=>t=>function(i,r){return t(i,new w2({...i,retryOptions:{...e,...i.retryOptions}},{handler:r,dispatch:t}))}});var Rx=k((q5,Dx)=>{"use strict";var b2=ie(),{InvalidArgumentError:k2,RequestAbortedError:S2}=ue(),x2=xu(),Hh=class extends x2{#e=1024*1024;#t=null;#r=!1;#i=!1;#o=0;#n=null;#s=null;constructor({maxSize:t},n){if(super(n),t!=null&&(!Number.isFinite(t)||t<1))throw new k2("maxSize must be a number greater than 0");this.#e=t??this.#e,this.#s=n}onConnect(t){this.#t=t,this.#s.onConnect(this.#a.bind(this))}#a(t){this.#i=!0,this.#n=t}onHeaders(t,n,i,r){let s=b2.parseHeaders(n)["content-length"];if(s!=null&&s>this.#e)throw new S2(`Response size (${s}) larger than maxSize (${this.#e})`);return this.#i?!0:this.#s.onHeaders(t,n,i,r)}onError(t){this.#r||(t=this.#n??t,this.#s.onError(t))}onData(t){return this.#o=this.#o+t.length,this.#o>=this.#e&&(this.#r=!0,this.#i?this.#s.onError(this.#n):this.#s.onComplete([])),!0}onComplete(t){if(!this.#r){if(this.#i){this.#s.onError(this.reason);return}this.#s.onComplete(t)}}};function D2({maxSize:e}={maxSize:1024*1024}){return t=>function(i,r){let{dumpMaxSize:o=e}=i,s=new Hh({maxSize:o},r);return t(i,s)}}Dx.exports=D2});var Ux=k((W5,Nx)=>{"use strict";var{isIP:R2}=require("node:net"),{lookup:_2}=require("node:dns"),N2=xu(),{InvalidArgumentError:Zo,InformationalError:U2}=ue(),_x=Math.pow(2,31)-1,jh=class{#e=0;#t=0;#r=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(t){this.#e=t.maxTTL,this.#t=t.maxItems,this.dualStack=t.dualStack,this.affinity=t.affinity,this.lookup=t.lookup??this.#i,this.pick=t.pick??this.#o}get full(){return this.#r.size===this.#t}runLookup(t,n,i){let r=this.#r.get(t.hostname);if(r==null&&this.full){i(null,t.origin);return}let o={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...n.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(t,o,(s,a)=>{if(s||a==null||a.length===0){i(s??new U2("No DNS entries found"));return}this.setRecords(t,a);let A=this.#r.get(t.hostname),c=this.pick(t,A,o.affinity),l;typeof c.port=="number"?l=`:${c.port}`:t.port!==""?l=`:${t.port}`:l="",i(null,`${t.protocol}//${c.family===6?`[${c.address}]`:c.address}${l}`)});else{let s=this.pick(t,r,o.affinity);if(s==null){this.#r.delete(t.hostname),this.runLookup(t,n,i);return}let a;typeof s.port=="number"?a=`:${s.port}`:t.port!==""?a=`:${t.port}`:a="",i(null,`${t.protocol}//${s.family===6?`[${s.address}]`:s.address}${a}`)}}#i(t,n,i){_2(t.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(r,o)=>{if(r)return i(r);let s=new Map;for(let a of o)s.set(`${a.address}:${a.family}`,a);i(null,s.values())})}#o(t,n,i){let r=null,{records:o,offset:s}=n,a;if(this.dualStack?(i==null&&(s==null||s===_x?(n.offset=0,i=4):(n.offset++,i=(n.offset&1)===1?6:4)),o[i]!=null&&o[i].ips.length>0?a=o[i]:a=o[i===4?6:4]):a=o[i],a==null||a.ips.length===0)return r;a.offset==null||a.offset===_x?a.offset=0:a.offset++;let A=a.offset%a.ips.length;return r=a.ips[A]??null,r==null?r:Date.now()-r.timestamp>r.ttl?(a.ips.splice(A,1),this.pick(t,n,i)):r}setRecords(t,n){let i=Date.now(),r={records:{4:null,6:null}};for(let o of n){o.timestamp=i,typeof o.ttl=="number"?o.ttl=Math.min(o.ttl,this.#e):o.ttl=this.#e;let s=r.records[o.family]??{ips:[]};s.ips.push(o),r.records[o.family]=s}this.#r.set(t.hostname,r)}getHandler(t,n){return new qh(this,t,n)}},qh=class extends N2{#e=null;#t=null;#r=null;#i=null;#o=null;constructor(t,{origin:n,handler:i,dispatch:r},o){super(i),this.#o=n,this.#i=i,this.#t={...o},this.#e=t,this.#r=r}onError(t){switch(t.code){case"ETIMEDOUT":case"ECONNREFUSED":{if(this.#e.dualStack){this.#e.runLookup(this.#o,this.#t,(n,i)=>{if(n)return this.#i.onError(n);let r={...this.#t,origin:i};this.#r(r,this)});return}this.#i.onError(t);return}case"ENOTFOUND":this.#e.deleteRecord(this.#o);default:this.#i.onError(t);break}}};Nx.exports=e=>{if(e?.maxTTL!=null&&(typeof e?.maxTTL!="number"||e?.maxTTL<0))throw new Zo("Invalid maxTTL. Must be a positive number");if(e?.maxItems!=null&&(typeof e?.maxItems!="number"||e?.maxItems<1))throw new Zo("Invalid maxItems. Must be a positive number and greater than zero");if(e?.affinity!=null&&e?.affinity!==4&&e?.affinity!==6)throw new Zo("Invalid affinity. Must be either 4 or 6");if(e?.dualStack!=null&&typeof e?.dualStack!="boolean")throw new Zo("Invalid dualStack. Must be a boolean");if(e?.lookup!=null&&typeof e?.lookup!="function")throw new Zo("Invalid lookup. Must be a function");if(e?.pick!=null&&typeof e?.pick!="function")throw new Zo("Invalid pick. Must be a function");let t=e?.dualStack??!0,n;t?n=e?.affinity??null:n=e?.affinity??4;let i={maxTTL:e?.maxTTL??1e4,lookup:e?.lookup??null,pick:e?.pick??null,dualStack:t,affinity:n,maxItems:e?.maxItems??1/0},r=new jh(i);return o=>function(a,A){let c=a.origin.constructor===URL?a.origin:new URL(a.origin);return R2(c.hostname)!==0?o(a,A):(r.runLookup(c,a,(l,d)=>{if(l)return A.onError(l);let g=null;g={...a,servername:c.hostname,origin:d,headers:{host:c.hostname,...a.headers}},o(g,r.getHandler({origin:c,dispatch:o,handler:A},a))}),!0)}}});var $i=k((Z5,Ox)=>{"use strict";var{kConstruct:$2}=ve(),{kEnumerableProperty:Ko}=ie(),{iteratorMixin:T2,isValidHeaderName:Ga,isValidHeaderValue:Tx}=bt(),{webidl:ce}=Je(),Wh=require("node:assert"),Du=require("node:util"),$e=Symbol("headers map"),Dt=Symbol("headers map sorted");function $x(e){return e===10||e===13||e===9||e===32}function Fx(e){let t=0,n=e.length;for(;n>t&&$x(e.charCodeAt(n-1));)--n;for(;n>t&&$x(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function Mx(e,t){if(Array.isArray(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.length!==2)throw ce.errors.exception({header:"Headers constructor",message:`expected name/value pair to be length 2, found ${i.length}.`});Zh(e,i[0],i[1])}else if(typeof t=="object"&&t!==null){let n=Object.keys(t);for(let i=0;i<n.length;++i)Zh(e,n[i],t[n[i]])}else throw ce.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})}function Zh(e,t,n){if(n=Fx(n),Ga(t)){if(!Tx(n))throw ce.errors.invalidArgument({prefix:"Headers.append",value:n,type:"header value"})}else throw ce.errors.invalidArgument({prefix:"Headers.append",value:t,type:"header name"});if(Px(e)==="immutable")throw new TypeError("immutable");return Kh(e).append(t,n,!1)}function Lx(e,t){return e[0]<t[0]?-1:1}var Ru=class e{cookies=null;constructor(t){t instanceof e?(this[$e]=new Map(t[$e]),this[Dt]=t[Dt],this.cookies=t.cookies===null?null:[...t.cookies]):(this[$e]=new Map(t),this[Dt]=null)}contains(t,n){return this[$e].has(n?t:t.toLowerCase())}clear(){this[$e].clear(),this[Dt]=null,this.cookies=null}append(t,n,i){this[Dt]=null;let r=i?t:t.toLowerCase(),o=this[$e].get(r);if(o){let s=r==="cookie"?"; ":", ";this[$e].set(r,{name:o.name,value:`${o.value}${s}${n}`})}else this[$e].set(r,{name:t,value:n});r==="set-cookie"&&(this.cookies??=[]).push(n)}set(t,n,i){this[Dt]=null;let r=i?t:t.toLowerCase();r==="set-cookie"&&(this.cookies=[n]),this[$e].set(r,{name:t,value:n})}delete(t,n){this[Dt]=null,n||(t=t.toLowerCase()),t==="set-cookie"&&(this.cookies=null),this[$e].delete(t)}get(t,n){return this[$e].get(n?t:t.toLowerCase())?.value??null}*[Symbol.iterator](){for(let{0:t,1:{value:n}}of this[$e])yield[t,n]}get entries(){let t={};if(this[$e].size!==0)for(let{name:n,value:i}of this[$e].values())t[n]=i;return t}rawValues(){return this[$e].values()}get entriesList(){let t=[];if(this[$e].size!==0)for(let{0:n,1:{name:i,value:r}}of this[$e])if(n==="set-cookie")for(let o of this.cookies)t.push([i,o]);else t.push([i,r]);return t}toSortedArray(){let t=this[$e].size,n=new Array(t);if(t<=32){if(t===0)return n;let i=this[$e][Symbol.iterator](),r=i.next().value;n[0]=[r[0],r[1].value],Wh(r[1].value!==null);for(let o=1,s=0,a=0,A=0,c=0,l,d;o<t;++o){for(d=i.next().value,l=n[o]=[d[0],d[1].value],Wh(l[1]!==null),A=0,a=o;A<a;)c=A+(a-A>>1),n[c][0]<=l[0]?A=c+1:a=c;if(o!==c){for(s=o;s>A;)n[s]=n[--s];n[A]=l}}if(!i.next().done)throw new TypeError("Unreachable");return n}else{let i=0;for(let{0:r,1:{value:o}}of this[$e])n[i++]=[r,o],Wh(o!==null);return n.sort(Lx)}}},Ar=class e{#e;#t;constructor(t=void 0){ce.util.markAsUncloneable(this),t!==$2&&(this.#t=new Ru,this.#e="none",t!==void 0&&(t=ce.converters.HeadersInit(t,"Headers contructor","init"),Mx(this,t)))}append(t,n){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,2,"Headers.append");let i="Headers.append";return t=ce.converters.ByteString(t,i,"name"),n=ce.converters.ByteString(n,i,"value"),Zh(this,t,n)}delete(t){if(ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,1,"Headers.delete"),t=ce.converters.ByteString(t,"Headers.delete","name"),!Ga(t))throw ce.errors.invalidArgument({prefix:"Headers.delete",value:t,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.contains(t,!1)&&this.#t.delete(t,!1)}get(t){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,1,"Headers.get");let n="Headers.get";if(t=ce.converters.ByteString(t,n,"name"),!Ga(t))throw ce.errors.invalidArgument({prefix:n,value:t,type:"header name"});return this.#t.get(t,!1)}has(t){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,1,"Headers.has");let n="Headers.has";if(t=ce.converters.ByteString(t,n,"name"),!Ga(t))throw ce.errors.invalidArgument({prefix:n,value:t,type:"header name"});return this.#t.contains(t,!1)}set(t,n){ce.brandCheck(this,e),ce.argumentLengthCheck(arguments,2,"Headers.set");let i="Headers.set";if(t=ce.converters.ByteString(t,i,"name"),n=ce.converters.ByteString(n,i,"value"),n=Fx(n),Ga(t)){if(!Tx(n))throw ce.errors.invalidArgument({prefix:i,value:n,type:"header value"})}else throw ce.errors.invalidArgument({prefix:i,value:t,type:"header name"});if(this.#e==="immutable")throw new TypeError("immutable");this.#t.set(t,n,!1)}getSetCookie(){ce.brandCheck(this,e);let t=this.#t.cookies;return t?[...t]:[]}get[Dt](){if(this.#t[Dt])return this.#t[Dt];let t=[],n=this.#t.toSortedArray(),i=this.#t.cookies;if(i===null||i.length===1)return this.#t[Dt]=n;for(let r=0;r<n.length;++r){let{0:o,1:s}=n[r];if(o==="set-cookie")for(let a=0;a<i.length;++a)t.push([o,i[a]]);else t.push([o,s])}return this.#t[Dt]=t}[Du.inspect.custom](t,n){return n.depth??=t,`Headers ${Du.formatWithOptions(n,this.#t.entries)}`}static getHeadersGuard(t){return t.#e}static setHeadersGuard(t,n){t.#e=n}static getHeadersList(t){return t.#t}static setHeadersList(t,n){t.#t=n}},{getHeadersGuard:Px,setHeadersGuard:F2,getHeadersList:Kh,setHeadersList:M2}=Ar;Reflect.deleteProperty(Ar,"getHeadersGuard");Reflect.deleteProperty(Ar,"setHeadersGuard");Reflect.deleteProperty(Ar,"getHeadersList");Reflect.deleteProperty(Ar,"setHeadersList");T2("Headers",Ar,Dt,0,1);Object.defineProperties(Ar.prototype,{append:Ko,delete:Ko,get:Ko,has:Ko,set:Ko,getSetCookie:Ko,[Symbol.toStringTag]:{value:"Headers",configurable:!0},[Du.inspect.custom]:{enumerable:!1}});ce.converters.HeadersInit=function(e,t,n){if(ce.util.Type(e)==="Object"){let i=Reflect.get(e,Symbol.iterator);if(!Du.types.isProxy(e)&&i===Ar.prototype.entries)try{return Kh(e).entriesList}catch{}return typeof i=="function"?ce.converters["sequence<sequence<ByteString>>"](e,t,n,i.bind(e)):ce.converters["record<ByteString, ByteString>"](e,t,n)}throw ce.errors.conversionFailed({prefix:"Headers constructor",argument:"Argument 1",types:["sequence<sequence<ByteString>>","record<ByteString, ByteString>"]})};Ox.exports={fill:Mx,compareHeaderName:Lx,Headers:Ar,HeadersList:Ru,getHeadersGuard:Px,setHeadersGuard:F2,setHeadersList:M2,getHeadersList:Kh}});var Ja=k((K5,Xx)=>{"use strict";var{Headers:Hx,HeadersList:zx,fill:L2,getHeadersGuard:P2,setHeadersGuard:jx,setHeadersList:qx}=$i(),{extractBody:Gx,cloneBody:O2,mixinBody:z2,hasFinalizationRegistry:Wx,streamRegistry:Zx,bodyUnusable:G2}=No(),Xh=ie(),Vx=require("node:util"),{kEnumerableProperty:Rt}=Xh,{isValidReasonPhrase:V2,isCancelled:J2,isAborted:Y2,isBlobLike:H2,serializeJavascriptValueToJSONString:j2,isErrorLike:q2,isomorphicEncode:W2,environmentSettingsObject:Z2}=bt(),{redirectStatusSet:K2,nullBodyStatus:X2}=ga(),{kState:be,kHeaders:rn}=In(),{webidl:te}=Je(),{FormData:eJ}=Ea(),{URLSerializer:Jx}=ft(),{kConstruct:Nu}=ve(),em=require("node:assert"),{types:tJ}=require("node:util"),rJ=new TextEncoder("utf-8"),Ti=class e{static error(){return Va(Uu(),"immutable")}static json(t,n={}){te.argumentLengthCheck(arguments,1,"Response.json"),n!==null&&(n=te.converters.ResponseInit(n));let i=rJ.encode(j2(t)),r=Gx(i),o=Va(Xo({}),"response");return Yx(o,n,{body:r[0],type:"application/json"}),o}static redirect(t,n=302){te.argumentLengthCheck(arguments,1,"Response.redirect"),t=te.converters.USVString(t),n=te.converters["unsigned short"](n);let i;try{i=new URL(t,Z2.settingsObject.baseUrl)}catch(s){throw new TypeError(`Failed to parse URL from ${t}`,{cause:s})}if(!K2.has(n))throw new RangeError(`Invalid status code ${n}`);let r=Va(Xo({}),"immutable");r[be].status=n;let o=W2(Jx(i));return r[be].headersList.append("location",o,!0),r}constructor(t=null,n={}){if(te.util.markAsUncloneable(this),t===Nu)return;t!==null&&(t=te.converters.BodyInit(t)),n=te.converters.ResponseInit(n),this[be]=Xo({}),this[rn]=new Hx(Nu),jx(this[rn],"response"),qx(this[rn],this[be].headersList);let i=null;if(t!=null){let[r,o]=Gx(t);i={body:r,type:o}}Yx(this,n,i)}get type(){return te.brandCheck(this,e),this[be].type}get url(){te.brandCheck(this,e);let t=this[be].urlList,n=t[t.length-1]??null;return n===null?"":Jx(n,!0)}get redirected(){return te.brandCheck(this,e),this[be].urlList.length>1}get status(){return te.brandCheck(this,e),this[be].status}get ok(){return te.brandCheck(this,e),this[be].status>=200&&this[be].status<=299}get statusText(){return te.brandCheck(this,e),this[be].statusText}get headers(){return te.brandCheck(this,e),this[rn]}get body(){return te.brandCheck(this,e),this[be].body?this[be].body.stream:null}get bodyUsed(){return te.brandCheck(this,e),!!this[be].body&&Xh.isDisturbed(this[be].body.stream)}clone(){if(te.brandCheck(this,e),G2(this))throw te.errors.exception({header:"Response.clone",message:"Body has already been consumed."});let t=tm(this[be]);return Wx&&this[be].body?.stream&&Zx.register(this,new WeakRef(this[be].body.stream)),Va(t,P2(this[rn]))}[Vx.inspect.custom](t,n){n.depth===null&&(n.depth=2),n.colors??=!0;let i={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${Vx.formatWithOptions(n,i)}`}};z2(Ti);Object.defineProperties(Ti.prototype,{type:Rt,url:Rt,status:Rt,ok:Rt,redirected:Rt,statusText:Rt,headers:Rt,clone:Rt,body:Rt,bodyUsed:Rt,[Symbol.toStringTag]:{value:"Response",configurable:!0}});Object.defineProperties(Ti,{json:Rt,redirect:Rt,error:Rt});function tm(e){if(e.internalResponse)return Kx(tm(e.internalResponse),e.type);let t=Xo({...e,body:null});return e.body!=null&&(t.body=O2(t,e.body)),t}function Xo(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:"default",status:200,timingInfo:null,cacheState:"",statusText:"",...e,headersList:e?.headersList?new zx(e?.headersList):new zx,urlList:e?.urlList?[...e.urlList]:[]}}function Uu(e){let t=q2(e);return Xo({type:"error",status:0,error:t?e:new Error(e&&String(e)),aborted:e&&e.name==="AbortError"})}function nJ(e){return e.type==="error"&&e.status===0}function _u(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(n,i){return i in t?t[i]:n[i]},set(n,i,r){return em(!(i in t)),n[i]=r,!0}})}function Kx(e,t){if(t==="basic")return _u(e,{type:"basic",headersList:e.headersList});if(t==="cors")return _u(e,{type:"cors",headersList:e.headersList});if(t==="opaque")return _u(e,{type:"opaque",urlList:Object.freeze([]),status:0,statusText:"",body:null});if(t==="opaqueredirect")return _u(e,{type:"opaqueredirect",status:0,statusText:"",headersList:[],body:null});em(!1)}function iJ(e,t=null){return em(J2(e)),Y2(e)?Uu(Object.assign(new DOMException("The operation was aborted.","AbortError"),{cause:t})):Uu(Object.assign(new DOMException("Request was cancelled."),{cause:t}))}function Yx(e,t,n){if(t.status!==null&&(t.status<200||t.status>599))throw new RangeError('init["status"] must be in the range of 200 to 599, inclusive.');if("statusText"in t&&t.statusText!=null&&!V2(String(t.statusText)))throw new TypeError("Invalid statusText");if("status"in t&&t.status!=null&&(e[be].status=t.status),"statusText"in t&&t.statusText!=null&&(e[be].statusText=t.statusText),"headers"in t&&t.headers!=null&&L2(e[rn],t.headers),n){if(X2.includes(e.status))throw te.errors.exception({header:"Response constructor",message:`Invalid response status code ${e.status}`});e[be].body=n.body,n.type!=null&&!e[be].headersList.contains("content-type",!0)&&e[be].headersList.append("content-type",n.type,!0)}}function Va(e,t){let n=new Ti(Nu);return n[be]=e,n[rn]=new Hx(Nu),qx(n[rn],e.headersList),jx(n[rn],t),Wx&&e.body?.stream&&Zx.register(n,new WeakRef(e.body.stream)),n}te.converters.ReadableStream=te.interfaceConverter(ReadableStream);te.converters.FormData=te.interfaceConverter(eJ);te.converters.URLSearchParams=te.interfaceConverter(URLSearchParams);te.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e=="string"?te.converters.USVString(e,t,n):H2(e)?te.converters.Blob(e,t,n,{strict:!1}):ArrayBuffer.isView(e)||tJ.isArrayBuffer(e)?te.converters.BufferSource(e,t,n):Xh.isFormDataLike(e)?te.converters.FormData(e,t,n,{strict:!1}):e instanceof URLSearchParams?te.converters.URLSearchParams(e,t,n):te.converters.DOMString(e,t,n)};te.converters.BodyInit=function(e,t,n){return e instanceof ReadableStream?te.converters.ReadableStream(e,t,n):e?.[Symbol.asyncIterator]?e:te.converters.XMLHttpRequestBodyInit(e,t,n)};te.converters.ResponseInit=te.dictionaryConverter([{key:"status",converter:te.converters["unsigned short"],defaultValue:()=>200},{key:"statusText",converter:te.converters.ByteString,defaultValue:()=>""},{key:"headers",converter:te.converters.HeadersInit}]);Xx.exports={isNetworkError:nJ,makeNetworkError:Uu,makeResponse:Xo,makeAppropriateNetworkError:iJ,filterResponse:Kx,Response:Ti,cloneResponse:tm,fromInnerResponse:Va}});var nD=k((X5,rD)=>{"use strict";var{kConnected:eD,kSize:tD}=ve(),rm=class{constructor(t){this.value=t}deref(){return this.value[eD]===0&&this.value[tD]===0?void 0:this.value}},nm=class{constructor(t){this.finalizer=t}register(t,n){t.on&&t.on("disconnect",()=>{t[eD]===0&&t[tD]===0&&this.finalizer(n)})}unregister(t){}};rD.exports=function(){return process.env.NODE_V8_COVERAGE&&process.version.startsWith("v18")?(process._rawDebug("Using compatibility WeakRef and FinalizationRegistry"),{WeakRef:rm,FinalizationRegistry:nm}):{WeakRef,FinalizationRegistry}}});var es=k((e3,ID)=>{"use strict";var{extractBody:oJ,mixinBody:sJ,cloneBody:aJ,bodyUnusable:iD}=No(),{Headers:gD,fill:AJ,HeadersList:Mu,setHeadersGuard:om,getHeadersGuard:cJ,setHeadersList:fD,getHeadersList:oD}=$i(),{FinalizationRegistry:uJ}=nD()(),Tu=ie(),sD=require("node:util"),{isValidHTTPToken:lJ,sameOrigin:aD,environmentSettingsObject:$u}=bt(),{forbiddenMethodsSet:dJ,corsSafeListedMethodsSet:gJ,referrerPolicy:fJ,requestRedirect:pJ,requestMode:hJ,requestCredentials:mJ,requestCache:IJ,requestDuplex:EJ}=ga(),{kEnumerableProperty:Te,normalizedMethodRecordsBase:yJ,normalizedMethodRecords:CJ}=Tu,{kHeaders:_t,kSignal:Fu,kState:Qe,kDispatcher:im}=In(),{webidl:J}=Je(),{URLSerializer:BJ}=ft(),{kConstruct:Lu}=ve(),QJ=require("node:assert"),{getMaxListeners:AD,setMaxListeners:cD,getEventListeners:vJ,defaultMaxListeners:uD}=require("node:events"),wJ=Symbol("abortController"),pD=new uJ(({signal:e,abort:t})=>{e.removeEventListener("abort",t)}),Pu=new WeakMap;function lD(e){return t;function t(){let n=e.deref();if(n!==void 0){pD.unregister(t),this.removeEventListener("abort",t),n.abort(this.reason);let i=Pu.get(n.signal);if(i!==void 0){if(i.size!==0){for(let r of i){let o=r.deref();o!==void 0&&o.abort(this.reason)}i.clear()}Pu.delete(n.signal)}}}}var dD=!1,xn=class e{constructor(t,n={}){if(J.util.markAsUncloneable(this),t===Lu)return;let i="Request constructor";J.argumentLengthCheck(arguments,1,i),t=J.converters.RequestInfo(t,i,"input"),n=J.converters.RequestInit(n,i,"init");let r=null,o=null,s=$u.settingsObject.baseUrl,a=null;if(typeof t=="string"){this[im]=n.dispatcher;let m;try{m=new URL(t,s)}catch(C){throw new TypeError("Failed to parse URL from "+t,{cause:C})}if(m.username||m.password)throw new TypeError("Request cannot be constructed from a URL that includes credentials: "+t);r=Ou({urlList:[m]}),o="cors"}else this[im]=n.dispatcher||t[im],QJ(t instanceof e),r=t[Qe],a=t[Fu];let A=$u.settingsObject.origin,c="client";if(r.window?.constructor?.name==="EnvironmentSettingsObject"&&aD(r.window,A)&&(c=r.window),n.window!=null)throw new TypeError(`'window' option '${c}' must be null`);"window"in n&&(c="no-window"),r=Ou({method:r.method,headersList:r.headersList,unsafeRequest:r.unsafeRequest,client:$u.settingsObject,window:c,priority:r.priority,origin:r.origin,referrer:r.referrer,referrerPolicy:r.referrerPolicy,mode:r.mode,credentials:r.credentials,cache:r.cache,redirect:r.redirect,integrity:r.integrity,keepalive:r.keepalive,reloadNavigation:r.reloadNavigation,historyNavigation:r.historyNavigation,urlList:[...r.urlList]});let l=Object.keys(n).length!==0;if(l&&(r.mode==="navigate"&&(r.mode="same-origin"),r.reloadNavigation=!1,r.historyNavigation=!1,r.origin="client",r.referrer="client",r.referrerPolicy="",r.url=r.urlList[r.urlList.length-1],r.urlList=[r.url]),n.referrer!==void 0){let m=n.referrer;if(m==="")r.referrer="no-referrer";else{let C;try{C=new URL(m,s)}catch(w){throw new TypeError(`Referrer "${m}" is not a valid URL.`,{cause:w})}C.protocol==="about:"&&C.hostname==="client"||A&&!aD(C,$u.settingsObject.baseUrl)?r.referrer="client":r.referrer=C}}n.referrerPolicy!==void 0&&(r.referrerPolicy=n.referrerPolicy);let d;if(n.mode!==void 0?d=n.mode:d=o,d==="navigate")throw J.errors.exception({header:"Request constructor",message:"invalid request mode navigate."});if(d!=null&&(r.mode=d),n.credentials!==void 0&&(r.credentials=n.credentials),n.cache!==void 0&&(r.cache=n.cache),r.cache==="only-if-cached"&&r.mode!=="same-origin")throw new TypeError("'only-if-cached' can be set only with 'same-origin' mode");if(n.redirect!==void 0&&(r.redirect=n.redirect),n.integrity!=null&&(r.integrity=String(n.integrity)),n.keepalive!==void 0&&(r.keepalive=!!n.keepalive),n.method!==void 0){let m=n.method,C=CJ[m];if(C!==void 0)r.method=C;else{if(!lJ(m))throw new TypeError(`'${m}' is not a valid HTTP method.`);let w=m.toUpperCase();if(dJ.has(w))throw new TypeError(`'${m}' HTTP method is unsupported.`);m=yJ[w]??m,r.method=m}!dD&&r.method==="patch"&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:"UNDICI-FETCH-patch"}),dD=!0)}n.signal!==void 0&&(a=n.signal),this[Qe]=r;let g=new AbortController;if(this[Fu]=g.signal,a!=null){if(!a||typeof a.aborted!="boolean"||typeof a.addEventListener!="function")throw new TypeError("Failed to construct 'Request': member signal is not of type AbortSignal.");if(a.aborted)g.abort(a.reason);else{this[wJ]=g;let m=new WeakRef(g),C=lD(m);try{(typeof AD=="function"&&AD(a)===uD||vJ(a,"abort").length>=uD)&&cD(1500,a)}catch{}Tu.addAbortListener(a,C),pD.register(g,{signal:a,abort:C},C)}}if(this[_t]=new gD(Lu),fD(this[_t],r.headersList),om(this[_t],"request"),d==="no-cors"){if(!gJ.has(r.method))throw new TypeError(`'${r.method} is unsupported in no-cors mode.`);om(this[_t],"request-no-cors")}if(l){let m=oD(this[_t]),C=n.headers!==void 0?n.headers:new Mu(m);if(m.clear(),C instanceof Mu){for(let{name:w,value:b}of C.rawValues())m.append(w,b,!1);m.cookies=C.cookies}else AJ(this[_t],C)}let f=t instanceof e?t[Qe].body:null;if((n.body!=null||f!=null)&&(r.method==="GET"||r.method==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body.");let p=null;if(n.body!=null){let[m,C]=oJ(n.body,r.keepalive);p=m,C&&!oD(this[_t]).contains("content-type",!0)&&this[_t].append("content-type",C)}let h=p??f;if(h!=null&&h.source==null){if(p!=null&&n.duplex==null)throw new TypeError("RequestInit: duplex option is required when sending a body.");if(r.mode!=="same-origin"&&r.mode!=="cors")throw new TypeError('If request is made from ReadableStream, mode should be "same-origin" or "cors"');r.useCORSPreflightFlag=!0}let y=h;if(p==null&&f!=null){if(iD(t))throw new TypeError("Cannot construct a Request with a Request object that has already been used.");let m=new TransformStream;f.stream.pipeThrough(m),y={source:f.source,length:f.length,stream:m.readable}}this[Qe].body=y}get method(){return J.brandCheck(this,e),this[Qe].method}get url(){return J.brandCheck(this,e),BJ(this[Qe].url)}get headers(){return J.brandCheck(this,e),this[_t]}get destination(){return J.brandCheck(this,e),this[Qe].destination}get referrer(){return J.brandCheck(this,e),this[Qe].referrer==="no-referrer"?"":this[Qe].referrer==="client"?"about:client":this[Qe].referrer.toString()}get referrerPolicy(){return J.brandCheck(this,e),this[Qe].referrerPolicy}get mode(){return J.brandCheck(this,e),this[Qe].mode}get credentials(){return this[Qe].credentials}get cache(){return J.brandCheck(this,e),this[Qe].cache}get redirect(){return J.brandCheck(this,e),this[Qe].redirect}get integrity(){return J.brandCheck(this,e),this[Qe].integrity}get keepalive(){return J.brandCheck(this,e),this[Qe].keepalive}get isReloadNavigation(){return J.brandCheck(this,e),this[Qe].reloadNavigation}get isHistoryNavigation(){return J.brandCheck(this,e),this[Qe].historyNavigation}get signal(){return J.brandCheck(this,e),this[Fu]}get body(){return J.brandCheck(this,e),this[Qe].body?this[Qe].body.stream:null}get bodyUsed(){return J.brandCheck(this,e),!!this[Qe].body&&Tu.isDisturbed(this[Qe].body.stream)}get duplex(){return J.brandCheck(this,e),"half"}clone(){if(J.brandCheck(this,e),iD(this))throw new TypeError("unusable");let t=hD(this[Qe]),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let i=Pu.get(this.signal);i===void 0&&(i=new Set,Pu.set(this.signal,i));let r=new WeakRef(n);i.add(r),Tu.addAbortListener(n.signal,lD(r))}return mD(t,n.signal,cJ(this[_t]))}[sD.inspect.custom](t,n){n.depth===null&&(n.depth=2),n.colors??=!0;let i={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${sD.formatWithOptions(n,i)}`}};sJ(xn);function Ou(e){return{method:e.method??"GET",localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??"",window:e.window??"client",keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??"all",initiator:e.initiator??"",destination:e.destination??"",priority:e.priority??null,origin:e.origin??"client",policyContainer:e.policyContainer??"client",referrer:e.referrer??"client",referrerPolicy:e.referrerPolicy??"",mode:e.mode??"no-cors",useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??"same-origin",useCredentials:e.useCredentials??!1,cache:e.cache??"default",redirect:e.redirect??"follow",integrity:e.integrity??"",cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??"",parserMetadata:e.parserMetadata??"",reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??"basic",preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new Mu(e.headersList):new Mu}}function hD(e){let t=Ou({...e,body:null});return e.body!=null&&(t.body=aJ(t,e.body)),t}function mD(e,t,n){let i=new xn(Lu);return i[Qe]=e,i[Fu]=t,i[_t]=new gD(Lu),fD(i[_t],e.headersList),om(i[_t],n),i}Object.defineProperties(xn.prototype,{method:Te,url:Te,headers:Te,redirect:Te,clone:Te,signal:Te,duplex:Te,destination:Te,body:Te,bodyUsed:Te,isHistoryNavigation:Te,isReloadNavigation:Te,keepalive:Te,integrity:Te,cache:Te,credentials:Te,attribute:Te,referrerPolicy:Te,referrer:Te,mode:Te,[Symbol.toStringTag]:{value:"Request",configurable:!0}});J.converters.Request=J.interfaceConverter(xn);J.converters.RequestInfo=function(e,t,n){return typeof e=="string"?J.converters.USVString(e,t,n):e instanceof xn?J.converters.Request(e,t,n):J.converters.USVString(e,t,n)};J.converters.AbortSignal=J.interfaceConverter(AbortSignal);J.converters.RequestInit=J.dictionaryConverter([{key:"method",converter:J.converters.ByteString},{key:"headers",converter:J.converters.HeadersInit},{key:"body",converter:J.nullableConverter(J.converters.BodyInit)},{key:"referrer",converter:J.converters.USVString},{key:"referrerPolicy",converter:J.converters.DOMString,allowedValues:fJ},{key:"mode",converter:J.converters.DOMString,allowedValues:hJ},{key:"credentials",converter:J.converters.DOMString,allowedValues:mJ},{key:"cache",converter:J.converters.DOMString,allowedValues:IJ},{key:"redirect",converter:J.converters.DOMString,allowedValues:pJ},{key:"integrity",converter:J.converters.DOMString},{key:"keepalive",converter:J.converters.boolean},{key:"signal",converter:J.nullableConverter(e=>J.converters.AbortSignal(e,"RequestInit","signal",{strict:!1}))},{key:"window",converter:J.converters.any},{key:"duplex",converter:J.converters.DOMString,allowedValues:EJ},{key:"dispatcher",converter:J.converters.any}]);ID.exports={Request:xn,makeRequest:Ou,fromInnerRequest:mD,cloneRequest:hD}});var Ha=k((t3,ND)=>{"use strict";var{makeNetworkError:he,makeAppropriateNetworkError:zu,filterResponse:sm,makeResponse:Gu,fromInnerResponse:bJ}=Ja(),{HeadersList:ED}=$i(),{Request:kJ,cloneRequest:SJ}=es(),Dn=require("node:zlib"),{bytesMatch:xJ,makePolicyContainer:DJ,clonePolicyContainer:RJ,requestBadPort:_J,TAOCheck:NJ,appendRequestOriginHeader:UJ,responseLocationURL:$J,requestCurrentURL:Ur,setRequestReferrerPolicyOnRedirect:TJ,tryUpgradeRequestToAPotentiallyTrustworthyURL:FJ,createOpaqueTimingInfo:lm,appendFetchMetadata:MJ,corsCheck:LJ,crossOriginResourcePolicyCheck:PJ,determineRequestsReferrer:OJ,coarsenedSharedCurrentTime:Ya,createDeferredPromise:zJ,isBlobLike:GJ,sameOrigin:um,isCancelled:Fi,isAborted:yD,isErrorLike:VJ,fullyReadBody:JJ,readableStreamClose:YJ,isomorphicEncode:Vu,urlIsLocal:HJ,urlIsHttpHttpsScheme:dm,urlHasHttpsScheme:jJ,clampAndCoarsenConnectionTimingInfo:qJ,simpleRangeHeaderValue:WJ,buildContentRange:ZJ,createInflate:KJ,extractMimeType:XJ}=bt(),{kState:vD,kDispatcher:eY}=In(),Mi=require("node:assert"),{safelyExtractBody:gm,extractBody:CD}=No(),{redirectStatusSet:wD,nullBodyStatus:bD,safeMethodsSet:tY,requestBodyHeader:rY,subresourceSet:nY}=ga(),iY=require("node:events"),{Readable:oY,pipeline:sY,finished:aY}=require("node:stream"),{addAbortListener:AY,isErrored:cY,isReadable:Ju,bufferToLowerCasedHeaderName:BD}=ie(),{dataURLProcessor:uY,serializeAMimeType:lY,minimizeSupportedMimeType:dY}=ft(),{getGlobalDispatcher:gY}=za(),{webidl:fY}=Je(),{STATUS_CODES:pY}=require("node:http"),hY=["GET","HEAD"],mY=typeof __UNDICI_IS_NODE__<"u"||typeof esbuildDetection<"u"?"node":"undici",am,Yu=class extends iY{constructor(t){super(),this.dispatcher=t,this.connection=null,this.dump=!1,this.state="ongoing"}terminate(t){this.state==="ongoing"&&(this.state="terminated",this.connection?.destroy(t),this.emit("terminated",t))}abort(t){this.state==="ongoing"&&(this.state="aborted",t||(t=new DOMException("The operation was aborted.","AbortError")),this.serializedAbortReason=t,this.connection?.destroy(t),this.emit("terminated",t))}};function IY(e){kD(e,"fetch")}function EY(e,t=void 0){fY.argumentLengthCheck(arguments,1,"globalThis.fetch");let n=zJ(),i;try{i=new kJ(e,t)}catch(l){return n.reject(l),n.promise}let r=i[vD];if(i.signal.aborted)return Am(n,r,null,i.signal.reason),n.promise;r.client.globalObject?.constructor?.name==="ServiceWorkerGlobalScope"&&(r.serviceWorkers="none");let s=null,a=!1,A=null;return AY(i.signal,()=>{a=!0,Mi(A!=null),A.abort(i.signal.reason);let l=s?.deref();Am(n,r,l,i.signal.reason)}),A=xD({request:r,processResponseEndOfBody:IY,processResponse:l=>{if(!a){if(l.aborted){Am(n,r,s,A.serializedAbortReason);return}if(l.type==="error"){n.reject(new TypeError("fetch failed",{cause:l.error}));return}s=new WeakRef(bJ(l,"immutable")),n.resolve(s.deref()),n=null}},dispatcher:i[eY]}),n.promise}function kD(e,t="other"){if(e.type==="error"&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],i=e.timingInfo,r=e.cacheState;dm(n)&&i!==null&&(e.timingAllowPassed||(i=lm({startTime:i.startTime}),r=""),i.endTime=Ya(),e.timingInfo=i,SD(i,n.href,t,globalThis,r))}var SD=performance.markResourceTiming;function Am(e,t,n,i){if(e&&e.reject(i),t.body!=null&&Ju(t.body?.stream)&&t.body.stream.cancel(i).catch(o=>{if(o.code!=="ERR_INVALID_STATE")throw o}),n==null)return;let r=n[vD];r.body!=null&&Ju(r.body?.stream)&&r.body.stream.cancel(i).catch(o=>{if(o.code!=="ERR_INVALID_STATE")throw o})}function xD({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:i,processResponseEndOfBody:r,processResponseConsumeBody:o,useParallelQueue:s=!1,dispatcher:a=gY()}){Mi(a);let A=null,c=!1;e.client!=null&&(A=e.client.globalObject,c=e.client.crossOriginIsolatedCapability);let l=Ya(c),d=lm({startTime:l}),g={controller:new Yu(a),request:e,timingInfo:d,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:i,processResponseConsumeBody:o,processResponseEndOfBody:r,taskDestination:A,crossOriginIsolatedCapability:c};return Mi(!e.body||e.body.stream),e.window==="client"&&(e.window=e.client?.globalObject?.constructor?.name==="Window"?e.client:"no-window"),e.origin==="client"&&(e.origin=e.client.origin),e.policyContainer==="client"&&(e.client!=null?e.policyContainer=RJ(e.client.policyContainer):e.policyContainer=DJ()),e.headersList.contains("accept",!0)||e.headersList.append("accept","*/*",!0),e.headersList.contains("accept-language",!0)||e.headersList.append("accept-language","*",!0),e.priority,nY.has(e.destination),DD(g).catch(f=>{g.controller.terminate(f)}),g.controller}async function DD(e,t=!1){let n=e.request,i=null;if(n.localURLsOnly&&!HJ(Ur(n))&&(i=he("local URLs only")),FJ(n),_J(n)==="blocked"&&(i=he("bad port")),n.referrerPolicy===""&&(n.referrerPolicy=n.policyContainer.referrerPolicy),n.referrer!=="no-referrer"&&(n.referrer=OJ(n)),i===null&&(i=await(async()=>{let o=Ur(n);return um(o,n.url)&&n.responseTainting==="basic"||o.protocol==="data:"||n.mode==="navigate"||n.mode==="websocket"?(n.responseTainting="basic",await QD(e)):n.mode==="same-origin"?he('request mode cannot be "same-origin"'):n.mode==="no-cors"?n.redirect!=="follow"?he('redirect mode cannot be "follow" for "no-cors" request'):(n.responseTainting="opaque",await QD(e)):dm(Ur(n))?(n.responseTainting="cors",await RD(e)):he("URL scheme must be a HTTP(S) scheme")})()),t)return i;i.status!==0&&!i.internalResponse&&(n.responseTainting,n.responseTainting==="basic"?i=sm(i,"basic"):n.responseTainting==="cors"?i=sm(i,"cors"):n.responseTainting==="opaque"?i=sm(i,"opaque"):Mi(!1));let r=i.status===0?i:i.internalResponse;if(r.urlList.length===0&&r.urlList.push(...n.urlList),n.timingAllowFailed||(i.timingAllowPassed=!0),i.type==="opaque"&&r.status===206&&r.rangeRequested&&!n.headers.contains("range",!0)&&(i=r=he()),i.status!==0&&(n.method==="HEAD"||n.method==="CONNECT"||bD.includes(r.status))&&(r.body=null,e.controller.dump=!0),n.integrity){let o=a=>cm(e,he(a));if(n.responseTainting==="opaque"||i.body==null){o(i.error);return}let s=a=>{if(!xJ(a,n.integrity)){o("integrity mismatch");return}i.body=gm(a)[0],cm(e,i)};await JJ(i.body,s,o)}else cm(e,i)}function QD(e){if(Fi(e)&&e.request.redirectCount===0)return Promise.resolve(zu(e));let{request:t}=e,{protocol:n}=Ur(t);switch(n){case"about:":return Promise.resolve(he("about scheme is not supported"));case"blob:":{am||(am=require("node:buffer").resolveObjectURL);let i=Ur(t);if(i.search.length!==0)return Promise.resolve(he("NetworkError when attempting to fetch resource."));let r=am(i.toString());if(t.method!=="GET"||!GJ(r))return Promise.resolve(he("invalid method"));let o=Gu(),s=r.size,a=Vu(`${s}`),A=r.type;if(t.headersList.contains("range",!0)){o.rangeRequested=!0;let c=t.headersList.get("range",!0),l=WJ(c,!0);if(l==="failure")return Promise.resolve(he("failed to fetch the data URL"));let{rangeStartValue:d,rangeEndValue:g}=l;if(d===null)d=s-g,g=d+g-1;else{if(d>=s)return Promise.resolve(he("Range start is greater than the blob's size."));(g===null||g>=s)&&(g=s-1)}let f=r.slice(d,g,A),p=CD(f);o.body=p[0];let h=Vu(`${f.size}`),y=ZJ(d,g,s);o.status=206,o.statusText="Partial Content",o.headersList.set("content-length",h,!0),o.headersList.set("content-type",A,!0),o.headersList.set("content-range",y,!0)}else{let c=CD(r);o.statusText="OK",o.body=c[0],o.headersList.set("content-length",a,!0),o.headersList.set("content-type",A,!0)}return Promise.resolve(o)}case"data:":{let i=Ur(t),r=uY(i);if(r==="failure")return Promise.resolve(he("failed to fetch the data URL"));let o=lY(r.mimeType);return Promise.resolve(Gu({statusText:"OK",headersList:[["content-type",{name:"Content-Type",value:o}]],body:gm(r.body)[0]}))}case"file:":return Promise.resolve(he("not implemented... yet..."));case"http:":case"https:":return RD(e).catch(i=>he(i));default:return Promise.resolve(he("unknown scheme"))}}function yY(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function cm(e,t){let n=e.timingInfo,i=()=>{let o=Date.now();e.request.destination==="document"&&(e.controller.fullTimingInfo=n),e.controller.reportTimingSteps=()=>{if(e.request.url.protocol!=="https:")return;n.endTime=o;let a=t.cacheState,A=t.bodyInfo;t.timingAllowPassed||(n=lm(n),a="");let c=0;if(e.request.mode!=="navigator"||!t.hasCrossOriginRedirects){c=t.status;let l=XJ(t.headersList);l!=="failure"&&(A.contentType=dY(l))}e.request.initiatorType!=null&&SD(n,e.request.url.href,e.request.initiatorType,globalThis,a,A,c)};let s=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>s())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let r=t.type==="error"?t:t.internalResponse??t;r.body==null?i():aY(r.body.stream,()=>{i()})}async function RD(e){let t=e.request,n=null,i=null,r=e.timingInfo;if(t.serviceWorkers,n===null){if(t.redirect==="follow"&&(t.serviceWorkers="none"),i=n=await _D(e),t.responseTainting==="cors"&&LJ(t,n)==="failure")return he("cors failure");NJ(t,n)==="failure"&&(t.timingAllowFailed=!0)}return(t.responseTainting==="opaque"||n.type==="opaque")&&PJ(t.origin,t.client,t.destination,i)==="blocked"?he("blocked"):(wD.has(i.status)&&(t.redirect!=="manual"&&e.controller.connection.destroy(void 0,!1),t.redirect==="error"?n=he("unexpected redirect"):t.redirect==="manual"?n=i:t.redirect==="follow"?n=await CY(e,n):Mi(!1)),n.timingInfo=r,n)}function CY(e,t){let n=e.request,i=t.internalResponse?t.internalResponse:t,r;try{if(r=$J(i,Ur(n).hash),r==null)return t}catch(s){return Promise.resolve(he(s))}if(!dm(r))return Promise.resolve(he("URL scheme must be a HTTP(S) scheme"));if(n.redirectCount===20)return Promise.resolve(he("redirect count exceeded"));if(n.redirectCount+=1,n.mode==="cors"&&(r.username||r.password)&&!um(n,r))return Promise.resolve(he('cross origin not allowed for request mode "cors"'));if(n.responseTainting==="cors"&&(r.username||r.password))return Promise.resolve(he('URL cannot contain credentials for request mode "cors"'));if(i.status!==303&&n.body!=null&&n.body.source==null)return Promise.resolve(he());if([301,302].includes(i.status)&&n.method==="POST"||i.status===303&&!hY.includes(n.method)){n.method="GET",n.body=null;for(let s of rY)n.headersList.delete(s)}um(Ur(n),r)||(n.headersList.delete("authorization",!0),n.headersList.delete("proxy-authorization",!0),n.headersList.delete("cookie",!0),n.headersList.delete("host",!0)),n.body!=null&&(Mi(n.body.source!=null),n.body=gm(n.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=Ya(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),n.urlList.push(r),TJ(n,i),DD(e,!0)}async function _D(e,t=!1,n=!1){let i=e.request,r=null,o=null,s=null,a=null,A=!1;i.window==="no-window"&&i.redirect==="error"?(r=e,o=i):(o=SJ(i),r={...e},r.request=o);let c=i.credentials==="include"||i.credentials==="same-origin"&&i.responseTainting==="basic",l=o.body?o.body.length:null,d=null;if(o.body==null&&["POST","PUT"].includes(o.method)&&(d="0"),l!=null&&(d=Vu(`${l}`)),d!=null&&o.headersList.append("content-length",d,!0),l!=null&&o.keepalive,o.referrer instanceof URL&&o.headersList.append("referer",Vu(o.referrer.href),!0),UJ(o),MJ(o),o.headersList.contains("user-agent",!0)||o.headersList.append("user-agent",mY),o.cache==="default"&&(o.headersList.contains("if-modified-since",!0)||o.headersList.contains("if-none-match",!0)||o.headersList.contains("if-unmodified-since",!0)||o.headersList.contains("if-match",!0)||o.headersList.contains("if-range",!0))&&(o.cache="no-store"),o.cache==="no-cache"&&!o.preventNoCacheCacheControlHeaderModification&&!o.headersList.contains("cache-control",!0)&&o.headersList.append("cache-control","max-age=0",!0),(o.cache==="no-store"||o.cache==="reload")&&(o.headersList.contains("pragma",!0)||o.headersList.append("pragma","no-cache",!0),o.headersList.contains("cache-control",!0)||o.headersList.append("cache-control","no-cache",!0)),o.headersList.contains("range",!0)&&o.headersList.append("accept-encoding","identity",!0),o.headersList.contains("accept-encoding",!0)||(jJ(Ur(o))?o.headersList.append("accept-encoding","br, gzip, deflate",!0):o.headersList.append("accept-encoding","gzip, deflate",!0)),o.headersList.delete("host",!0),a==null&&(o.cache="no-store"),o.cache!=="no-store"&&o.cache,s==null){if(o.cache==="only-if-cached")return he("only if cached");let g=await BY(r,c,n);!tY.has(o.method)&&g.status>=200&&g.status<=399,A&&g.status,s==null&&(s=g)}if(s.urlList=[...o.urlList],o.headersList.contains("range",!0)&&(s.rangeRequested=!0),s.requestIncludesCredentials=c,s.status===407)return i.window==="no-window"?he():Fi(e)?zu(e):he("proxy authentication required");if(s.status===421&&!n&&(i.body==null||i.body.source!=null)){if(Fi(e))return zu(e);e.controller.connection.destroy(),s=await _D(e,t,!0)}return s}async function BY(e,t=!1,n=!1){Mi(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(p,h=!0){this.destroyed||(this.destroyed=!0,h&&this.abort?.(p??new DOMException("The operation was aborted.","AbortError")))}};let i=e.request,r=null,o=e.timingInfo;null==null&&(i.cache="no-store");let a=n?"yes":"no";i.mode;let A=null;if(i.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(i.body!=null){let p=async function*(m){Fi(e)||(yield m,e.processRequestBodyChunkLength?.(m.byteLength))},h=()=>{Fi(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},y=m=>{Fi(e)||(m.name==="AbortError"?e.controller.abort():e.controller.terminate(m))};A=(async function*(){try{for await(let m of i.body.stream)yield*p(m);h()}catch(m){y(m)}})()}try{let{body:p,status:h,statusText:y,headersList:m,socket:C}=await f({body:A});if(C)r=Gu({status:h,statusText:y,headersList:m,socket:C});else{let w=p[Symbol.asyncIterator]();e.controller.next=()=>w.next(),r=Gu({status:h,statusText:y,headersList:m})}}catch(p){return p.name==="AbortError"?(e.controller.connection.destroy(),zu(e,p)):he(p)}let c=async()=>{await e.controller.resume()},l=p=>{Fi(e)||e.controller.abort(p)},d=new ReadableStream({async start(p){e.controller.controller=p},async pull(p){await c(p)},async cancel(p){await l(p)},type:"bytes"});r.body={stream:d,source:null,length:null},e.controller.resume||e.controller.on("terminated",g),e.controller.resume=async()=>{for(;;){let p,h;try{let{done:m,value:C}=await e.controller.next();if(yD(e))break;p=m?void 0:C}catch(m){e.controller.ended&&!o.encodedBodySize?p=void 0:(p=m,h=!0)}if(p===void 0){YJ(e.controller.controller),yY(e,r);return}if(o.decodedBodySize+=p?.byteLength??0,h){e.controller.terminate(p);return}let y=new Uint8Array(p);if(y.byteLength&&e.controller.controller.enqueue(y),cY(d)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function g(p){yD(e)?(r.aborted=!0,Ju(d)&&e.controller.controller.error(e.controller.serializedAbortReason)):Ju(d)&&e.controller.controller.error(new TypeError("terminated",{cause:VJ(p)?p:void 0})),e.controller.connection.destroy()}return r;function f({body:p}){let h=Ur(i),y=e.controller.dispatcher;return new Promise((m,C)=>y.dispatch({path:h.pathname+h.search,origin:h.origin,method:i.method,body:y.isMockActive?i.body&&(i.body.source||i.body.stream):p,headers:i.headersList.entries,maxRedirections:0,upgrade:i.mode==="websocket"?"websocket":void 0},{body:null,abort:null,onConnect(w){let{connection:b}=e.controller;o.finalConnectionTimingInfo=qJ(void 0,o.postRedirectStartTime,e.crossOriginIsolatedCapability),b.destroyed?w(new DOMException("The operation was aborted.","AbortError")):(e.controller.on("terminated",w),this.abort=b.abort=w),o.finalNetworkRequestStartTime=Ya(e.crossOriginIsolatedCapability)},onResponseStarted(){o.finalNetworkResponseStartTime=Ya(e.crossOriginIsolatedCapability)},onHeaders(w,b,F,T){if(w<200)return;let K="",Se=new ED;for(let qe=0;qe<b.length;qe+=2)Se.append(BD(b[qe]),b[qe+1].toString("latin1"),!0);K=Se.get("location",!0);let Pt=[],mr=K&&i.redirect==="follow"&&wD.has(w);if(i.method!=="HEAD"&&i.method!=="CONNECT"&&!bD.includes(w)&&!mr){let qe=Se.get("content-encoding",!0),dn=qe?qe.toLowerCase().split(","):[],gc=5;if(dn.length>gc)return this.abort(new Error(`too many content-encodings in response: ${dn.length}, maximum allowed is ${gc}`)),!0;for(let Kn=dn.length-1;Kn>=0;--Kn){let fc=dn[Kn].trim();if(fc==="x-gzip"||fc==="gzip")Pt.push(Dn.createGunzip({flush:Dn.constants.Z_SYNC_FLUSH,finishFlush:Dn.constants.Z_SYNC_FLUSH}));else if(fc==="deflate")Pt.push(KJ({flush:Dn.constants.Z_SYNC_FLUSH,finishFlush:Dn.constants.Z_SYNC_FLUSH}));else if(fc==="br")Pt.push(Dn.createBrotliDecompress({flush:Dn.constants.BROTLI_OPERATION_FLUSH,finishFlush:Dn.constants.BROTLI_OPERATION_FLUSH}));else{Pt.length=0;break}}}this.body=new oY({read:F});let er=this.onError.bind(this);return m({status:w,statusText:T,headersList:Se,body:Pt.length?sY(this.body,...Pt,qe=>{qe&&this.onError(qe)}).on("error",er):this.body.on("error",er)}),!0},onData(w){if(e.controller.dump)return;let b=w;return o.encodedBodySize+=b.byteLength,this.body.push(b)},onComplete(){this.abort&&e.controller.off("terminated",this.abort),e.controller.ended=!0,this.body.push(null)},onError(w){this.abort&&e.controller.off("terminated",this.abort),this.body?.destroy(w),e.controller.terminate(w),C(w)},onUpgrade(w,b,F){if(w!==101)return;let T=new ED;for(let K=0;K<b.length;K+=2)T.append(BD(b[K]),b[K+1].toString("latin1"),!0);return m({status:w,statusText:pY[w],headersList:T,socket:F}),!0}}))}}ND.exports={fetch:EY,Fetch:Yu,fetching:xD,finalizeAndReportTiming:kD}});var fm=k((r3,UD)=>{"use strict";UD.exports={kState:Symbol("FileReader state"),kResult:Symbol("FileReader result"),kError:Symbol("FileReader error"),kLastProgressEventFired:Symbol("FileReader last progress event fired timestamp"),kEvents:Symbol("FileReader events"),kAborted:Symbol("FileReader aborted")}});var TD=k((n3,$D)=>{"use strict";var{webidl:Nt}=Je(),Hu=Symbol("ProgressEvent state"),pm=class e extends Event{constructor(t,n={}){t=Nt.converters.DOMString(t,"ProgressEvent constructor","type"),n=Nt.converters.ProgressEventInit(n??{}),super(t,n),this[Hu]={lengthComputable:n.lengthComputable,loaded:n.loaded,total:n.total}}get lengthComputable(){return Nt.brandCheck(this,e),this[Hu].lengthComputable}get loaded(){return Nt.brandCheck(this,e),this[Hu].loaded}get total(){return Nt.brandCheck(this,e),this[Hu].total}};Nt.converters.ProgressEventInit=Nt.dictionaryConverter([{key:"lengthComputable",converter:Nt.converters.boolean,defaultValue:()=>!1},{key:"loaded",converter:Nt.converters["unsigned long long"],defaultValue:()=>0},{key:"total",converter:Nt.converters["unsigned long long"],defaultValue:()=>0},{key:"bubbles",converter:Nt.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:Nt.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:Nt.converters.boolean,defaultValue:()=>!1}]);$D.exports={ProgressEvent:pm}});var MD=k((i3,FD)=>{"use strict";function QY(e){if(!e)return"failure";switch(e.trim().toLowerCase()){case"unicode-1-1-utf-8":case"unicode11utf8":case"unicode20utf8":case"utf-8":case"utf8":case"x-unicode20utf8":return"UTF-8";case"866":case"cp866":case"csibm866":case"ibm866":return"IBM866";case"csisolatin2":case"iso-8859-2":case"iso-ir-101":case"iso8859-2":case"iso88592":case"iso_8859-2":case"iso_8859-2:1987":case"l2":case"latin2":return"ISO-8859-2";case"csisolatin3":case"iso-8859-3":case"iso-ir-109":case"iso8859-3":case"iso88593":case"iso_8859-3":case"iso_8859-3:1988":case"l3":case"latin3":return"ISO-8859-3";case"csisolatin4":case"iso-8859-4":case"iso-ir-110":case"iso8859-4":case"iso88594":case"iso_8859-4":case"iso_8859-4:1988":case"l4":case"latin4":return"ISO-8859-4";case"csisolatincyrillic":case"cyrillic":case"iso-8859-5":case"iso-ir-144":case"iso8859-5":case"iso88595":case"iso_8859-5":case"iso_8859-5:1988":return"ISO-8859-5";case"arabic":case"asmo-708":case"csiso88596e":case"csiso88596i":case"csisolatinarabic":case"ecma-114":case"iso-8859-6":case"iso-8859-6-e":case"iso-8859-6-i":case"iso-ir-127":case"iso8859-6":case"iso88596":case"iso_8859-6":case"iso_8859-6:1987":return"ISO-8859-6";case"csisolatingreek":case"ecma-118":case"elot_928":case"greek":case"greek8":case"iso-8859-7":case"iso-ir-126":case"iso8859-7":case"iso88597":case"iso_8859-7":case"iso_8859-7:1987":case"sun_eu_greek":return"ISO-8859-7";case"csiso88598e":case"csisolatinhebrew":case"hebrew":case"iso-8859-8":case"iso-8859-8-e":case"iso-ir-138":case"iso8859-8":case"iso88598":case"iso_8859-8":case"iso_8859-8:1988":case"visual":return"ISO-8859-8";case"csiso88598i":case"iso-8859-8-i":case"logical":return"ISO-8859-8-I";case"csisolatin6":case"iso-8859-10":case"iso-ir-157":case"iso8859-10":case"iso885910":case"l6":case"latin6":return"ISO-8859-10";case"iso-8859-13":case"iso8859-13":case"iso885913":return"ISO-8859-13";case"iso-8859-14":case"iso8859-14":case"iso885914":return"ISO-8859-14";case"csisolatin9":case"iso-8859-15":case"iso8859-15":case"iso885915":case"iso_8859-15":case"l9":return"ISO-8859-15";case"iso-8859-16":return"ISO-8859-16";case"cskoi8r":case"koi":case"koi8":case"koi8-r":case"koi8_r":return"KOI8-R";case"koi8-ru":case"koi8-u":return"KOI8-U";case"csmacintosh":case"mac":case"macintosh":case"x-mac-roman":return"macintosh";case"iso-8859-11":case"iso8859-11":case"iso885911":case"tis-620":case"windows-874":return"windows-874";case"cp1250":case"windows-1250":case"x-cp1250":return"windows-1250";case"cp1251":case"windows-1251":case"x-cp1251":return"windows-1251";case"ansi_x3.4-1968":case"ascii":case"cp1252":case"cp819":case"csisolatin1":case"ibm819":case"iso-8859-1":case"iso-ir-100":case"iso8859-1":case"iso88591":case"iso_8859-1":case"iso_8859-1:1987":case"l1":case"latin1":case"us-ascii":case"windows-1252":case"x-cp1252":return"windows-1252";case"cp1253":case"windows-1253":case"x-cp1253":return"windows-1253";case"cp1254":case"csisolatin5":case"iso-8859-9":case"iso-ir-148":case"iso8859-9":case"iso88599":case"iso_8859-9":case"iso_8859-9:1989":case"l5":case"latin5":case"windows-1254":case"x-cp1254":return"windows-1254";case"cp1255":case"windows-1255":case"x-cp1255":return"windows-1255";case"cp1256":case"windows-1256":case"x-cp1256":return"windows-1256";case"cp1257":case"windows-1257":case"x-cp1257":return"windows-1257";case"cp1258":case"windows-1258":case"x-cp1258":return"windows-1258";case"x-mac-cyrillic":case"x-mac-ukrainian":return"x-mac-cyrillic";case"chinese":case"csgb2312":case"csiso58gb231280":case"gb2312":case"gb_2312":case"gb_2312-80":case"gbk":case"iso-ir-58":case"x-gbk":return"GBK";case"gb18030":return"gb18030";case"big5":case"big5-hkscs":case"cn-big5":case"csbig5":case"x-x-big5":return"Big5";case"cseucpkdfmtjapanese":case"euc-jp":case"x-euc-jp":return"EUC-JP";case"csiso2022jp":case"iso-2022-jp":return"ISO-2022-JP";case"csshiftjis":case"ms932":case"ms_kanji":case"shift-jis":case"shift_jis":case"sjis":case"windows-31j":case"x-sjis":return"Shift_JIS";case"cseuckr":case"csksc56011987":case"euc-kr":case"iso-ir-149":case"korean":case"ks_c_5601-1987":case"ks_c_5601-1989":case"ksc5601":case"ksc_5601":case"windows-949":return"EUC-KR";case"csiso2022kr":case"hz-gb-2312":case"iso-2022-cn":case"iso-2022-cn-ext":case"iso-2022-kr":case"replacement":return"replacement";case"unicodefffe":case"utf-16be":return"UTF-16BE";case"csunicode":case"iso-10646-ucs-2":case"ucs-2":case"unicode":case"unicodefeff":case"utf-16":case"utf-16le":return"UTF-16LE";case"x-user-defined":return"x-user-defined";default:return"failure"}}FD.exports={getEncoding:QY}});var YD=k((o3,JD)=>{"use strict";var{kState:ts,kError:hm,kResult:LD,kAborted:ja,kLastProgressEventFired:mm}=fm(),{ProgressEvent:vY}=TD(),{getEncoding:PD}=MD(),{serializeAMimeType:wY,parseMIMEType:OD}=ft(),{types:bY}=require("node:util"),{StringDecoder:zD}=require("string_decoder"),{btoa:GD}=require("node:buffer"),kY={enumerable:!0,writable:!1,configurable:!1};function SY(e,t,n,i){if(e[ts]==="loading")throw new DOMException("Invalid state","InvalidStateError");e[ts]="loading",e[LD]=null,e[hm]=null;let o=t.stream().getReader(),s=[],a=o.read(),A=!0;(async()=>{for(;!e[ja];)try{let{done:c,value:l}=await a;if(A&&!e[ja]&&queueMicrotask(()=>{Rn("loadstart",e)}),A=!1,!c&&bY.isUint8Array(l))s.push(l),(e[mm]===void 0||Date.now()-e[mm]>=50)&&!e[ja]&&(e[mm]=Date.now(),queueMicrotask(()=>{Rn("progress",e)})),a=o.read();else if(c){queueMicrotask(()=>{e[ts]="done";try{let d=xY(s,n,t.type,i);if(e[ja])return;e[LD]=d,Rn("load",e)}catch(d){e[hm]=d,Rn("error",e)}e[ts]!=="loading"&&Rn("loadend",e)});break}}catch(c){if(e[ja])return;queueMicrotask(()=>{e[ts]="done",e[hm]=c,Rn("error",e),e[ts]!=="loading"&&Rn("loadend",e)});break}})()}function Rn(e,t){let n=new vY(e,{bubbles:!1,cancelable:!1});t.dispatchEvent(n)}function xY(e,t,n,i){switch(t){case"DataURL":{let r="data:",o=OD(n||"application/octet-stream");o!=="failure"&&(r+=wY(o)),r+=";base64,";let s=new zD("latin1");for(let a of e)r+=GD(s.write(a));return r+=GD(s.end()),r}case"Text":{let r="failure";if(i&&(r=PD(i)),r==="failure"&&n){let o=OD(n);o!=="failure"&&(r=PD(o.parameters.get("charset")))}return r==="failure"&&(r="UTF-8"),DY(e,r)}case"ArrayBuffer":return VD(e).buffer;case"BinaryString":{let r="",o=new zD("latin1");for(let s of e)r+=o.write(s);return r+=o.end(),r}}}function DY(e,t){let n=VD(e),i=RY(n),r=0;i!==null&&(t=i,r=i==="UTF-8"?3:2);let o=n.slice(r);return new TextDecoder(t).decode(o)}function RY(e){let[t,n,i]=e;return t===239&&n===187&&i===191?"UTF-8":t===254&&n===255?"UTF-16BE":t===255&&n===254?"UTF-16LE":null}function VD(e){let t=e.reduce((i,r)=>i+r.byteLength,0),n=0;return e.reduce((i,r)=>(i.set(r,n),n+=r.byteLength,i),new Uint8Array(t))}JD.exports={staticPropertyDescriptors:kY,readOperation:SY,fireAProgressEvent:Rn}});var WD=k((s3,qD)=>{"use strict";var{staticPropertyDescriptors:rs,readOperation:ju,fireAProgressEvent:HD}=YD(),{kState:Li,kError:jD,kResult:qu,kEvents:le,kAborted:_Y}=fm(),{webidl:Ee}=Je(),{kEnumerableProperty:mt}=ie(),cr=class e extends EventTarget{constructor(){super(),this[Li]="empty",this[qu]=null,this[jD]=null,this[le]={loadend:null,error:null,abort:null,load:null,progress:null,loadstart:null}}readAsArrayBuffer(t){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsArrayBuffer"),t=Ee.converters.Blob(t,{strict:!1}),ju(this,t,"ArrayBuffer")}readAsBinaryString(t){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsBinaryString"),t=Ee.converters.Blob(t,{strict:!1}),ju(this,t,"BinaryString")}readAsText(t,n=void 0){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsText"),t=Ee.converters.Blob(t,{strict:!1}),n!==void 0&&(n=Ee.converters.DOMString(n,"FileReader.readAsText","encoding")),ju(this,t,"Text",n)}readAsDataURL(t){Ee.brandCheck(this,e),Ee.argumentLengthCheck(arguments,1,"FileReader.readAsDataURL"),t=Ee.converters.Blob(t,{strict:!1}),ju(this,t,"DataURL")}abort(){if(this[Li]==="empty"||this[Li]==="done"){this[qu]=null;return}this[Li]==="loading"&&(this[Li]="done",this[qu]=null),this[_Y]=!0,HD("abort",this),this[Li]!=="loading"&&HD("loadend",this)}get readyState(){switch(Ee.brandCheck(this,e),this[Li]){case"empty":return this.EMPTY;case"loading":return this.LOADING;case"done":return this.DONE}}get result(){return Ee.brandCheck(this,e),this[qu]}get error(){return Ee.brandCheck(this,e),this[jD]}get onloadend(){return Ee.brandCheck(this,e),this[le].loadend}set onloadend(t){Ee.brandCheck(this,e),this[le].loadend&&this.removeEventListener("loadend",this[le].loadend),typeof t=="function"?(this[le].loadend=t,this.addEventListener("loadend",t)):this[le].loadend=null}get onerror(){return Ee.brandCheck(this,e),this[le].error}set onerror(t){Ee.brandCheck(this,e),this[le].error&&this.removeEventListener("error",this[le].error),typeof t=="function"?(this[le].error=t,this.addEventListener("error",t)):this[le].error=null}get onloadstart(){return Ee.brandCheck(this,e),this[le].loadstart}set onloadstart(t){Ee.brandCheck(this,e),this[le].loadstart&&this.removeEventListener("loadstart",this[le].loadstart),typeof t=="function"?(this[le].loadstart=t,this.addEventListener("loadstart",t)):this[le].loadstart=null}get onprogress(){return Ee.brandCheck(this,e),this[le].progress}set onprogress(t){Ee.brandCheck(this,e),this[le].progress&&this.removeEventListener("progress",this[le].progress),typeof t=="function"?(this[le].progress=t,this.addEventListener("progress",t)):this[le].progress=null}get onload(){return Ee.brandCheck(this,e),this[le].load}set onload(t){Ee.brandCheck(this,e),this[le].load&&this.removeEventListener("load",this[le].load),typeof t=="function"?(this[le].load=t,this.addEventListener("load",t)):this[le].load=null}get onabort(){return Ee.brandCheck(this,e),this[le].abort}set onabort(t){Ee.brandCheck(this,e),this[le].abort&&this.removeEventListener("abort",this[le].abort),typeof t=="function"?(this[le].abort=t,this.addEventListener("abort",t)):this[le].abort=null}};cr.EMPTY=cr.prototype.EMPTY=0;cr.LOADING=cr.prototype.LOADING=1;cr.DONE=cr.prototype.DONE=2;Object.defineProperties(cr.prototype,{EMPTY:rs,LOADING:rs,DONE:rs,readAsArrayBuffer:mt,readAsBinaryString:mt,readAsText:mt,readAsDataURL:mt,abort:mt,readyState:mt,result:mt,error:mt,onloadstart:mt,onprogress:mt,onload:mt,onabort:mt,onerror:mt,onloadend:mt,[Symbol.toStringTag]:{value:"FileReader",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties(cr,{EMPTY:rs,LOADING:rs,DONE:rs});qD.exports={FileReader:cr}});var Wu=k((a3,ZD)=>{"use strict";ZD.exports={kConstruct:ve().kConstruct}});var eR=k((A3,XD)=>{"use strict";var NY=require("node:assert"),{URLSerializer:KD}=ft(),{isValidHeaderName:UY}=bt();function $Y(e,t,n=!1){let i=KD(e,n),r=KD(t,n);return i===r}function TY(e){NY(e!==null);let t=[];for(let n of e.split(","))n=n.trim(),UY(n)&&t.push(n);return t}XD.exports={urlEquals:$Y,getFieldValues:TY}});var nR=k((c3,rR)=>{"use strict";var{kConstruct:FY}=Wu(),{urlEquals:MY,getFieldValues:Im}=eR(),{kEnumerableProperty:Pi,isDisturbed:LY}=ie(),{webidl:O}=Je(),{Response:PY,cloneResponse:OY,fromInnerResponse:zY}=Ja(),{Request:nn,fromInnerRequest:GY}=es(),{kState:ur}=In(),{fetching:VY}=Ha(),{urlIsHttpHttpsScheme:Zu,createDeferredPromise:ns,readAllBytes:JY}=bt(),Em=require("node:assert"),Ku=class e{#e;constructor(){arguments[0]!==FY&&O.illegalConstructor(),O.util.markAsUncloneable(this),this.#e=arguments[1]}async match(t,n={}){O.brandCheck(this,e);let i="Cache.match";O.argumentLengthCheck(arguments,1,i),t=O.converters.RequestInfo(t,i,"request"),n=O.converters.CacheQueryOptions(n,i,"options");let r=this.#o(t,n,1);if(r.length!==0)return r[0]}async matchAll(t=void 0,n={}){O.brandCheck(this,e);let i="Cache.matchAll";return t!==void 0&&(t=O.converters.RequestInfo(t,i,"request")),n=O.converters.CacheQueryOptions(n,i,"options"),this.#o(t,n)}async add(t){O.brandCheck(this,e);let n="Cache.add";O.argumentLengthCheck(arguments,1,n),t=O.converters.RequestInfo(t,n,"request");let i=[t];return await this.addAll(i)}async addAll(t){O.brandCheck(this,e);let n="Cache.addAll";O.argumentLengthCheck(arguments,1,n);let i=[],r=[];for(let g of t){if(g===void 0)throw O.errors.conversionFailed({prefix:n,argument:"Argument 1",types:["undefined is not allowed"]});if(g=O.converters.RequestInfo(g),typeof g=="string")continue;let f=g[ur];if(!Zu(f.url)||f.method!=="GET")throw O.errors.exception({header:n,message:"Expected http/s scheme when method is not GET."})}let o=[];for(let g of t){let f=new nn(g)[ur];if(!Zu(f.url))throw O.errors.exception({header:n,message:"Expected http/s scheme."});f.initiator="fetch",f.destination="subresource",r.push(f);let p=ns();o.push(VY({request:f,processResponse(h){if(h.type==="error"||h.status===206||h.status<200||h.status>299)p.reject(O.errors.exception({header:"Cache.addAll",message:"Received an invalid status code or the request failed."}));else if(h.headersList.contains("vary")){let y=Im(h.headersList.get("vary"));for(let m of y)if(m==="*"){p.reject(O.errors.exception({header:"Cache.addAll",message:"invalid vary field value"}));for(let C of o)C.abort();return}}},processResponseEndOfBody(h){if(h.aborted){p.reject(new DOMException("aborted","AbortError"));return}p.resolve(h)}})),i.push(p.promise)}let a=await Promise.all(i),A=[],c=0;for(let g of a){let f={type:"put",request:r[c],response:g};A.push(f),c++}let l=ns(),d=null;try{this.#t(A)}catch(g){d=g}return queueMicrotask(()=>{d===null?l.resolve(void 0):l.reject(d)}),l.promise}async put(t,n){O.brandCheck(this,e);let i="Cache.put";O.argumentLengthCheck(arguments,2,i),t=O.converters.RequestInfo(t,i,"request"),n=O.converters.Response(n,i,"response");let r=null;if(t instanceof nn?r=t[ur]:r=new nn(t)[ur],!Zu(r.url)||r.method!=="GET")throw O.errors.exception({header:i,message:"Expected an http/s scheme when method is not GET"});let o=n[ur];if(o.status===206)throw O.errors.exception({header:i,message:"Got 206 status"});if(o.headersList.contains("vary")){let f=Im(o.headersList.get("vary"));for(let p of f)if(p==="*")throw O.errors.exception({header:i,message:"Got * vary field value"})}if(o.body&&(LY(o.body.stream)||o.body.stream.locked))throw O.errors.exception({header:i,message:"Response body is locked or disturbed"});let s=OY(o),a=ns();if(o.body!=null){let p=o.body.stream.getReader();JY(p).then(a.resolve,a.reject)}else a.resolve(void 0);let A=[],c={type:"put",request:r,response:s};A.push(c);let l=await a.promise;s.body!=null&&(s.body.source=l);let d=ns(),g=null;try{this.#t(A)}catch(f){g=f}return queueMicrotask(()=>{g===null?d.resolve():d.reject(g)}),d.promise}async delete(t,n={}){O.brandCheck(this,e);let i="Cache.delete";O.argumentLengthCheck(arguments,1,i),t=O.converters.RequestInfo(t,i,"request"),n=O.converters.CacheQueryOptions(n,i,"options");let r=null;if(t instanceof nn){if(r=t[ur],r.method!=="GET"&&!n.ignoreMethod)return!1}else Em(typeof t=="string"),r=new nn(t)[ur];let o=[],s={type:"delete",request:r,options:n};o.push(s);let a=ns(),A=null,c;try{c=this.#t(o)}catch(l){A=l}return queueMicrotask(()=>{A===null?a.resolve(!!c?.length):a.reject(A)}),a.promise}async keys(t=void 0,n={}){O.brandCheck(this,e);let i="Cache.keys";t!==void 0&&(t=O.converters.RequestInfo(t,i,"request")),n=O.converters.CacheQueryOptions(n,i,"options");let r=null;if(t!==void 0)if(t instanceof nn){if(r=t[ur],r.method!=="GET"&&!n.ignoreMethod)return[]}else typeof t=="string"&&(r=new nn(t)[ur]);let o=ns(),s=[];if(t===void 0)for(let a of this.#e)s.push(a[0]);else{let a=this.#r(r,n);for(let A of a)s.push(A[0])}return queueMicrotask(()=>{let a=[];for(let A of s){let c=GY(A,new AbortController().signal,"immutable");a.push(c)}o.resolve(Object.freeze(a))}),o.promise}#t(t){let n=this.#e,i=[...n],r=[],o=[];try{for(let s of t){if(s.type!=="delete"&&s.type!=="put")throw O.errors.exception({header:"Cache.#batchCacheOperations",message:'operation type does not match "delete" or "put"'});if(s.type==="delete"&&s.response!=null)throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"delete operation should not have an associated response"});if(this.#r(s.request,s.options,r).length)throw new DOMException("???","InvalidStateError");let a;if(s.type==="delete"){if(a=this.#r(s.request,s.options),a.length===0)return[];for(let A of a){let c=n.indexOf(A);Em(c!==-1),n.splice(c,1)}}else if(s.type==="put"){if(s.response==null)throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"put operation should have an associated response"});let A=s.request;if(!Zu(A.url))throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"expected http or https scheme"});if(A.method!=="GET")throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"not get method"});if(s.options!=null)throw O.errors.exception({header:"Cache.#batchCacheOperations",message:"options must not be defined"});a=this.#r(s.request);for(let c of a){let l=n.indexOf(c);Em(l!==-1),n.splice(l,1)}n.push([s.request,s.response]),r.push([s.request,s.response])}o.push([s.request,s.response])}return o}catch(s){throw this.#e.length=0,this.#e=i,s}}#r(t,n,i){let r=[],o=i??this.#e;for(let s of o){let[a,A]=s;this.#i(t,a,A,n)&&r.push(s)}return r}#i(t,n,i=null,r){let o=new URL(t.url),s=new URL(n.url);if(r?.ignoreSearch&&(s.search="",o.search=""),!MY(o,s,!0))return!1;if(i==null||r?.ignoreVary||!i.headersList.contains("vary"))return!0;let a=Im(i.headersList.get("vary"));for(let A of a){if(A==="*")return!1;let c=n.headersList.get(A),l=t.headersList.get(A);if(c!==l)return!1}return!0}#o(t,n,i=1/0){let r=null;if(t!==void 0)if(t instanceof nn){if(r=t[ur],r.method!=="GET"&&!n.ignoreMethod)return[]}else typeof t=="string"&&(r=new nn(t)[ur]);let o=[];if(t===void 0)for(let a of this.#e)o.push(a[1]);else{let a=this.#r(r,n);for(let A of a)o.push(A[1])}let s=[];for(let a of o){let A=zY(a,"immutable");if(s.push(A.clone()),s.length>=i)break}return Object.freeze(s)}};Object.defineProperties(Ku.prototype,{[Symbol.toStringTag]:{value:"Cache",configurable:!0},match:Pi,matchAll:Pi,add:Pi,addAll:Pi,put:Pi,delete:Pi,keys:Pi});var tR=[{key:"ignoreSearch",converter:O.converters.boolean,defaultValue:()=>!1},{key:"ignoreMethod",converter:O.converters.boolean,defaultValue:()=>!1},{key:"ignoreVary",converter:O.converters.boolean,defaultValue:()=>!1}];O.converters.CacheQueryOptions=O.dictionaryConverter(tR);O.converters.MultiCacheQueryOptions=O.dictionaryConverter([...tR,{key:"cacheName",converter:O.converters.DOMString}]);O.converters.Response=O.interfaceConverter(PY);O.converters["sequence<RequestInfo>"]=O.sequenceConverter(O.converters.RequestInfo);rR.exports={Cache:Ku}});var oR=k((u3,iR)=>{"use strict";var{kConstruct:qa}=Wu(),{Cache:Xu}=nR(),{webidl:Ke}=Je(),{kEnumerableProperty:Wa}=ie(),el=class e{#e=new Map;constructor(){arguments[0]!==qa&&Ke.illegalConstructor(),Ke.util.markAsUncloneable(this)}async match(t,n={}){if(Ke.brandCheck(this,e),Ke.argumentLengthCheck(arguments,1,"CacheStorage.match"),t=Ke.converters.RequestInfo(t),n=Ke.converters.MultiCacheQueryOptions(n),n.cacheName!=null){if(this.#e.has(n.cacheName)){let i=this.#e.get(n.cacheName);return await new Xu(qa,i).match(t,n)}}else for(let i of this.#e.values()){let o=await new Xu(qa,i).match(t,n);if(o!==void 0)return o}}async has(t){Ke.brandCheck(this,e);let n="CacheStorage.has";return Ke.argumentLengthCheck(arguments,1,n),t=Ke.converters.DOMString(t,n,"cacheName"),this.#e.has(t)}async open(t){Ke.brandCheck(this,e);let n="CacheStorage.open";if(Ke.argumentLengthCheck(arguments,1,n),t=Ke.converters.DOMString(t,n,"cacheName"),this.#e.has(t)){let r=this.#e.get(t);return new Xu(qa,r)}let i=[];return this.#e.set(t,i),new Xu(qa,i)}async delete(t){Ke.brandCheck(this,e);let n="CacheStorage.delete";return Ke.argumentLengthCheck(arguments,1,n),t=Ke.converters.DOMString(t,n,"cacheName"),this.#e.delete(t)}async keys(){return Ke.brandCheck(this,e),[...this.#e.keys()]}};Object.defineProperties(el.prototype,{[Symbol.toStringTag]:{value:"CacheStorage",configurable:!0},match:Wa,has:Wa,open:Wa,delete:Wa,keys:Wa});iR.exports={CacheStorage:el}});var aR=k((l3,sR)=>{"use strict";sR.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}});var Bm=k((d3,lR)=>{"use strict";function YY(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n>=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function ym(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<33||n>126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw new Error("Invalid cookie name")}}function Cm(e){let t=e.length,n=0;if(e[0]==='"'){if(t===1||e[t-1]!=='"')throw new Error("Invalid cookie value");--t,++n}for(;n<t;){let i=e.charCodeAt(n++);if(i<33||i>126||i===34||i===44||i===59||i===92)throw new Error("Invalid cookie value")}}function cR(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<32||n>126||n===59)throw new Error("Invalid cookie path")}}function AR(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function HY(e){if(e===" ")return;if(e.length>255)throw new Error("Invalid cookie domain");let t=0;for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);if(i===46){if(t===0)throw new Error("Invalid cookie domain");if(e.charCodeAt(n-1)===45)throw new Error("Invalid cookie domain");t=0;continue}if(t===0&&!AR(i))throw new Error("Invalid cookie domain");if(!AR(i)&&i!==45)throw new Error("Invalid cookie domain");if(++t>63)throw new Error("Invalid cookie domain")}if(t===0||e.charCodeAt(e.length-1)===45)throw new Error("Invalid cookie domain")}var jY=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],qY=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],tl=Array(61).fill(0).map((e,t)=>t.toString().padStart(2,"0"));function uR(e){return typeof e=="number"&&(e=new Date(e)),`${jY[e.getUTCDay()]}, ${tl[e.getUTCDate()]} ${qY[e.getUTCMonth()]} ${e.getUTCFullYear()} ${tl[e.getUTCHours()]}:${tl[e.getUTCMinutes()]}:${tl[e.getUTCSeconds()]} GMT`}function WY(e){if(e<0)throw new Error("Invalid cookie max-age")}function ZY(e){if(e.name.length===0)return null;ym(e.name),Cm(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith("__Secure-")&&(e.secure=!0),e.name.startsWith("__Host-")&&(e.secure=!0,e.domain=null,e.path="/"),e.secure&&t.push("Secure"),e.httpOnly&&t.push("HttpOnly"),typeof e.maxAge=="number"&&(WY(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(HY(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(cR(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!=="Invalid Date"&&t.push(`Expires=${uR(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let n of e.unparsed){if(!n.includes("="))throw new Error("Invalid unparsed");let[i,...r]=n.split("="),o=i.trim(),s=r.join("=");ym(o),Cm(s),t.push(`${o}=${s}`)}return t.join("; ")}lR.exports={isCTLExcludingHtab:YY,validateCookieName:ym,validateCookiePath:cR,validateCookieValue:Cm,toIMFDate:uR,stringify:ZY}});var gR=k((g3,dR)=>{"use strict";var{maxNameValuePairSize:KY,maxAttributeValueSize:XY}=aR(),{isCTLExcludingHtab:eH}=Bm(),{collectASequenceOfCodePointsFast:rl}=ft(),tH=require("node:assert");function rH(e){if(eH(e))return null;let t="",n="",i="",r="";if(e.includes(";")){let o={position:0};t=rl(";",e,o),n=e.slice(o.position)}else t=e;if(!t.includes("="))r=t;else{let o={position:0};i=rl("=",t,o),r=t.slice(o.position+1)}return i=i.trim(),r=r.trim(),i.length+r.length>KY?null:{name:i,value:r,...is(n)}}function is(e,t={}){if(e.length===0)return t;tH(e[0]===";"),e=e.slice(1);let n="";e.includes(";")?(n=rl(";",e,{position:0}),e=e.slice(n.length)):(n=e,e="");let i="",r="";if(n.includes("=")){let s={position:0};i=rl("=",n,s),r=n.slice(s.position+1)}else i=n;if(i=i.trim(),r=r.trim(),r.length>XY)return is(e,t);let o=i.toLowerCase();if(o==="expires"){let s=new Date(r);t.expires=s}else if(o==="max-age"){let s=r.charCodeAt(0);if((s<48||s>57)&&r[0]!=="-"||!/^\d+$/.test(r))return is(e,t);let a=Number(r);t.maxAge=a}else if(o==="domain"){let s=r;s[0]==="."&&(s=s.slice(1)),s=s.toLowerCase(),t.domain=s}else if(o==="path"){let s="";r.length===0||r[0]!=="/"?s="/":s=r,t.path=s}else if(o==="secure")t.secure=!0;else if(o==="httponly")t.httpOnly=!0;else if(o==="samesite"){let s=r.toLowerCase();s==="none"?t.sameSite="None":s==="strict"?t.sameSite="Strict":s==="lax"&&(t.sameSite="Lax")}else t.unparsed??=[],t.unparsed.push(`${i}=${r}`);return is(e,t)}dR.exports={parseSetCookie:rH,parseUnparsedAttributes:is}});var hR=k((f3,pR)=>{"use strict";var{parseSetCookie:nH}=gR(),{stringify:iH}=Bm(),{webidl:Ae}=Je(),{Headers:nl}=$i();function oH(e){Ae.argumentLengthCheck(arguments,1,"getCookies"),Ae.brandCheck(e,nl,{strict:!1});let t=e.get("cookie"),n={};if(!t)return n;for(let i of t.split(";")){let[r,...o]=i.split("=");n[r.trim()]=o.join("=")}return n}function sH(e,t,n){Ae.brandCheck(e,nl,{strict:!1});let i="deleteCookie";Ae.argumentLengthCheck(arguments,2,i),t=Ae.converters.DOMString(t,i,"name"),n=Ae.converters.DeleteCookieAttributes(n),fR(e,{name:t,value:"",expires:new Date(0),...n})}function aH(e){Ae.argumentLengthCheck(arguments,1,"getSetCookies"),Ae.brandCheck(e,nl,{strict:!1});let t=e.getSetCookie();return t?t.map(n=>nH(n)):[]}function fR(e,t){Ae.argumentLengthCheck(arguments,2,"setCookie"),Ae.brandCheck(e,nl,{strict:!1}),t=Ae.converters.Cookie(t);let n=iH(t);n&&e.append("Set-Cookie",n)}Ae.converters.DeleteCookieAttributes=Ae.dictionaryConverter([{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"path",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"domain",defaultValue:()=>null}]);Ae.converters.Cookie=Ae.dictionaryConverter([{converter:Ae.converters.DOMString,key:"name"},{converter:Ae.converters.DOMString,key:"value"},{converter:Ae.nullableConverter(e=>typeof e=="number"?Ae.converters["unsigned long long"](e):new Date(e)),key:"expires",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters["long long"]),key:"maxAge",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"domain",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.DOMString),key:"path",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.boolean),key:"secure",defaultValue:()=>null},{converter:Ae.nullableConverter(Ae.converters.boolean),key:"httpOnly",defaultValue:()=>null},{converter:Ae.converters.USVString,key:"sameSite",allowedValues:["Strict","Lax","None"]},{converter:Ae.sequenceConverter(Ae.converters.DOMString),key:"unparsed",defaultValue:()=>new Array(0)}]);pR.exports={getCookies:oH,deleteCookie:sH,getSetCookies:aH,setCookie:fR}});var ss=k((p3,IR)=>{"use strict";var{webidl:M}=Je(),{kEnumerableProperty:It}=ie(),{kConstruct:mR}=ve(),{MessagePort:AH}=require("node:worker_threads"),os=class e extends Event{#e;constructor(t,n={}){if(t===mR){super(arguments[1],arguments[2]),M.util.markAsUncloneable(this);return}let i="MessageEvent constructor";M.argumentLengthCheck(arguments,1,i),t=M.converters.DOMString(t,i,"type"),n=M.converters.MessageEventInit(n,i,"eventInitDict"),super(t,n),this.#e=n,M.util.markAsUncloneable(this)}get data(){return M.brandCheck(this,e),this.#e.data}get origin(){return M.brandCheck(this,e),this.#e.origin}get lastEventId(){return M.brandCheck(this,e),this.#e.lastEventId}get source(){return M.brandCheck(this,e),this.#e.source}get ports(){return M.brandCheck(this,e),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(t,n=!1,i=!1,r=null,o="",s="",a=null,A=[]){return M.brandCheck(this,e),M.argumentLengthCheck(arguments,1,"MessageEvent.initMessageEvent"),new e(t,{bubbles:n,cancelable:i,data:r,origin:o,lastEventId:s,source:a,ports:A})}static createFastMessageEvent(t,n){let i=new e(mR,t,n);return i.#e=n,i.#e.data??=null,i.#e.origin??="",i.#e.lastEventId??="",i.#e.source??=null,i.#e.ports??=[],i}},{createFastMessageEvent:cH}=os;delete os.createFastMessageEvent;var il=class e extends Event{#e;constructor(t,n={}){let i="CloseEvent constructor";M.argumentLengthCheck(arguments,1,i),t=M.converters.DOMString(t,i,"type"),n=M.converters.CloseEventInit(n),super(t,n),this.#e=n,M.util.markAsUncloneable(this)}get wasClean(){return M.brandCheck(this,e),this.#e.wasClean}get code(){return M.brandCheck(this,e),this.#e.code}get reason(){return M.brandCheck(this,e),this.#e.reason}},ol=class e extends Event{#e;constructor(t,n){let i="ErrorEvent constructor";M.argumentLengthCheck(arguments,1,i),super(t,n),M.util.markAsUncloneable(this),t=M.converters.DOMString(t,i,"type"),n=M.converters.ErrorEventInit(n??{}),this.#e=n}get message(){return M.brandCheck(this,e),this.#e.message}get filename(){return M.brandCheck(this,e),this.#e.filename}get lineno(){return M.brandCheck(this,e),this.#e.lineno}get colno(){return M.brandCheck(this,e),this.#e.colno}get error(){return M.brandCheck(this,e),this.#e.error}};Object.defineProperties(os.prototype,{[Symbol.toStringTag]:{value:"MessageEvent",configurable:!0},data:It,origin:It,lastEventId:It,source:It,ports:It,initMessageEvent:It});Object.defineProperties(il.prototype,{[Symbol.toStringTag]:{value:"CloseEvent",configurable:!0},reason:It,code:It,wasClean:It});Object.defineProperties(ol.prototype,{[Symbol.toStringTag]:{value:"ErrorEvent",configurable:!0},message:It,filename:It,lineno:It,colno:It,error:It});M.converters.MessagePort=M.interfaceConverter(AH);M.converters["sequence<MessagePort>"]=M.sequenceConverter(M.converters.MessagePort);var Qm=[{key:"bubbles",converter:M.converters.boolean,defaultValue:()=>!1},{key:"cancelable",converter:M.converters.boolean,defaultValue:()=>!1},{key:"composed",converter:M.converters.boolean,defaultValue:()=>!1}];M.converters.MessageEventInit=M.dictionaryConverter([...Qm,{key:"data",converter:M.converters.any,defaultValue:()=>null},{key:"origin",converter:M.converters.USVString,defaultValue:()=>""},{key:"lastEventId",converter:M.converters.DOMString,defaultValue:()=>""},{key:"source",converter:M.nullableConverter(M.converters.MessagePort),defaultValue:()=>null},{key:"ports",converter:M.converters["sequence<MessagePort>"],defaultValue:()=>new Array(0)}]);M.converters.CloseEventInit=M.dictionaryConverter([...Qm,{key:"wasClean",converter:M.converters.boolean,defaultValue:()=>!1},{key:"code",converter:M.converters["unsigned short"],defaultValue:()=>0},{key:"reason",converter:M.converters.USVString,defaultValue:()=>""}]);M.converters.ErrorEventInit=M.dictionaryConverter([...Qm,{key:"message",converter:M.converters.DOMString,defaultValue:()=>""},{key:"filename",converter:M.converters.USVString,defaultValue:()=>""},{key:"lineno",converter:M.converters["unsigned long"],defaultValue:()=>0},{key:"colno",converter:M.converters["unsigned long"],defaultValue:()=>0},{key:"error",converter:M.converters.any}]);IR.exports={MessageEvent:os,CloseEvent:il,ErrorEvent:ol,createFastMessageEvent:cH}});var Oi=k((h3,ER)=>{"use strict";var uH="258EAFA5-E914-47DA-95CA-C5AB0DC85B11",lH={enumerable:!0,writable:!1,configurable:!1},dH={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},gH={NOT_SENT:0,PROCESSING:1,SENT:2},fH={CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},pH=2**16-1,hH={INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},mH=Buffer.allocUnsafe(0),IH={string:1,typedArray:2,arrayBuffer:3,blob:4};ER.exports={uid:uH,sentCloseFrameState:gH,staticPropertyDescriptors:lH,states:dH,opcodes:fH,maxUnsigned16Bit:pH,parserStates:hH,emptyBuffer:mH,sendHints:IH}});var Za=k((m3,yR)=>{"use strict";yR.exports={kWebSocketURL:Symbol("url"),kReadyState:Symbol("ready state"),kController:Symbol("controller"),kResponse:Symbol("response"),kBinaryType:Symbol("binary type"),kSentClose:Symbol("sent close"),kReceivedClose:Symbol("received close"),kByteParser:Symbol("byte parser")}});var eA=k((I3,xR)=>{"use strict";var{kReadyState:Ka,kController:EH,kResponse:yH,kBinaryType:CH,kWebSocketURL:BH}=Za(),{states:Xa,opcodes:_n}=Oi(),{ErrorEvent:QH,createFastMessageEvent:vH}=ss(),{isUtf8:wH}=require("node:buffer"),{collectASequenceOfCodePointsFast:bH,removeHTTPWhitespace:CR}=ft();function kH(e){return e[Ka]===Xa.CONNECTING}function SH(e){return e[Ka]===Xa.OPEN}function xH(e){return e[Ka]===Xa.CLOSING}function DH(e){return e[Ka]===Xa.CLOSED}function vm(e,t,n=(r,o)=>new Event(r,o),i={}){let r=n(e,i);t.dispatchEvent(r)}function RH(e,t,n){if(e[Ka]!==Xa.OPEN)return;let i;if(t===_n.TEXT)try{i=SR(n)}catch{QR(e,"Received invalid UTF-8 in text frame.");return}else t===_n.BINARY&&(e[CH]==="blob"?i=new Blob([n]):i=_H(n));vm("message",e,vH,{origin:e[BH].origin,data:i})}function _H(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function NH(e){if(e.length===0)return!1;for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<33||n>126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function UH(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function QR(e,t){let{[EH]:n,[yH]:i}=e;n.abort(),i?.socket&&!i.socket.destroyed&&i.socket.destroy(),t&&vm("error",e,(r,o)=>new QH(r,o),{error:new Error(t),message:t})}function vR(e){return e===_n.CLOSE||e===_n.PING||e===_n.PONG}function wR(e){return e===_n.CONTINUATION}function bR(e){return e===_n.TEXT||e===_n.BINARY}function $H(e){return bR(e)||wR(e)||vR(e)}function TH(e){let t={position:0},n=new Map;for(;t.position<e.length;){let i=bH(";",e,t),[r,o=""]=i.split("=");n.set(CR(r,!0,!1),CR(o,!1,!0)),t.position++}return n}function FH(e){if(e.length===0)return!1;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(i<48||i>57)return!1}let t=Number.parseInt(e,10);return t>=8&&t<=15}var kR=typeof process.versions.icu=="string",BR=kR?new TextDecoder("utf-8",{fatal:!0}):void 0,SR=kR?BR.decode.bind(BR):function(e){if(wH(e))return e.toString("utf-8");throw new TypeError("Invalid utf-8 received.")};xR.exports={isConnecting:kH,isEstablished:SH,isClosing:xH,isClosed:DH,fireEvent:vm,isValidSubprotocol:NH,isValidStatusCode:UH,failWebsocketConnection:QR,websocketMessageReceived:RH,utf8Decode:SR,isControlFrame:vR,isContinuationFrame:wR,isTextBinaryFrame:bR,isValidOpcode:$H,parseExtensions:TH,isValidClientWindowBits:FH}});var al=k((E3,DR)=>{"use strict";var{maxUnsigned16Bit:MH}=Oi(),sl=16386,wm,tA=null,as=sl;try{wm=require("node:crypto")}catch{wm={randomFillSync:function(t,n,i){for(let r=0;r<t.length;++r)t[r]=Math.random()*255|0;return t}}}function LH(){return as===sl&&(as=0,wm.randomFillSync(tA??=Buffer.allocUnsafe(sl),0,sl)),[tA[as++],tA[as++],tA[as++],tA[as++]]}var bm=class{constructor(t){this.frameData=t}createFrame(t){let n=this.frameData,i=LH(),r=n?.byteLength??0,o=r,s=6;r>MH?(s+=8,o=127):r>125&&(s+=2,o=126);let a=Buffer.allocUnsafe(r+s);a[0]=a[1]=0,a[0]|=128,a[0]=(a[0]&240)+t;a[s-4]=i[0],a[s-3]=i[1],a[s-2]=i[2],a[s-1]=i[3],a[1]=o,o===126?a.writeUInt16BE(r,2):o===127&&(a[2]=a[3]=0,a.writeUIntBE(r,4,6)),a[1]|=128;for(let A=0;A<r;++A)a[s+A]=n[A]^i[A&3];return a}};DR.exports={WebsocketFrameSend:bm}});var Sm=k((y3,FR)=>{"use strict";var{uid:PH,states:rA,sentCloseFrameState:Al,emptyBuffer:OH,opcodes:zH}=Oi(),{kReadyState:nA,kSentClose:cl,kByteParser:_R,kReceivedClose:RR,kResponse:NR}=Za(),{fireEvent:GH,failWebsocketConnection:Nn,isClosing:VH,isClosed:JH,isEstablished:YH,parseExtensions:HH}=eA(),{channels:As}=yo(),{CloseEvent:jH}=ss(),{makeRequest:qH}=es(),{fetching:WH}=Ha(),{Headers:ZH,getHeadersList:KH}=$i(),{getDecodeSplit:XH}=bt(),{WebsocketFrameSend:ej}=al(),km;try{km=require("node:crypto")}catch{}function tj(e,t,n,i,r,o){let s=e;s.protocol=e.protocol==="ws:"?"http:":"https:";let a=qH({urlList:[s],client:n,serviceWorkers:"none",referrer:"no-referrer",mode:"websocket",credentials:"include",cache:"no-store",redirect:"error"});if(o.headers){let d=KH(new ZH(o.headers));a.headersList=d}let A=km.randomBytes(16).toString("base64");a.headersList.append("sec-websocket-key",A),a.headersList.append("sec-websocket-version","13");for(let d of t)a.headersList.append("sec-websocket-protocol",d);return a.headersList.append("sec-websocket-extensions","permessage-deflate; client_max_window_bits"),WH({request:a,useParallelQueue:!0,dispatcher:o.dispatcher,processResponse(d){if(d.type==="error"||d.status!==101){Nn(i,"Received network error or non-101 status code.");return}if(t.length!==0&&!d.headersList.get("Sec-WebSocket-Protocol")){Nn(i,"Server did not respond with sent protocols.");return}if(d.headersList.get("Upgrade")?.toLowerCase()!=="websocket"){Nn(i,'Server did not set Upgrade header to "websocket".');return}if(d.headersList.get("Connection")?.toLowerCase()!=="upgrade"){Nn(i,'Server did not set Connection header to "upgrade".');return}let g=d.headersList.get("Sec-WebSocket-Accept"),f=km.createHash("sha1").update(A+PH).digest("base64");if(g!==f){Nn(i,"Incorrect hash received in Sec-WebSocket-Accept header.");return}let p=d.headersList.get("Sec-WebSocket-Extensions"),h;if(p!==null&&(h=HH(p),!h.has("permessage-deflate"))){Nn(i,"Sec-WebSocket-Extensions header does not match.");return}let y=d.headersList.get("Sec-WebSocket-Protocol");if(y!==null){let m=XH("sec-websocket-protocol",a.headersList);if(m===null||!m.includes(y)){Nn(i,"Protocol was not set in the opening handshake.");return}}d.socket.on("data",UR),d.socket.on("close",$R),d.socket.on("error",TR),As.open.hasSubscribers&&As.open.publish({address:d.socket.address(),protocol:y,extensions:p}),r(d,h)}})}function rj(e,t,n,i){if(!(VH(e)||JH(e)))if(!YH(e))Nn(e,"Connection was closed before it was established."),e[nA]=rA.CLOSING;else if(e[cl]===Al.NOT_SENT){e[cl]=Al.PROCESSING;let r=new ej;t!==void 0&&n===void 0?(r.frameData=Buffer.allocUnsafe(2),r.frameData.writeUInt16BE(t,0)):t!==void 0&&n!==void 0?(r.frameData=Buffer.allocUnsafe(2+i),r.frameData.writeUInt16BE(t,0),r.frameData.write(n,2,"utf-8")):r.frameData=OH,e[NR].socket.write(r.createFrame(zH.CLOSE)),e[cl]=Al.SENT,e[nA]=rA.CLOSING}else e[nA]=rA.CLOSING}function UR(e){this.ws[_R].write(e)||this.pause()}function $R(){let{ws:e}=this,{[NR]:t}=e;t.socket.off("data",UR),t.socket.off("close",$R),t.socket.off("error",TR);let n=e[cl]===Al.SENT&&e[RR],i=1005,r="",o=e[_R].closingInfo;o&&!o.error?(i=o.code??1005,r=o.reason):e[RR]||(i=1006),e[nA]=rA.CLOSED,GH("close",e,(s,a)=>new jH(s,a),{wasClean:n,code:i,reason:r}),As.close.hasSubscribers&&As.close.publish({websocket:e,code:i,reason:r})}function TR(e){let{ws:t}=this;t[nA]=rA.CLOSING,As.socketError.hasSubscribers&&As.socketError.publish(e),this.destroy()}FR.exports={establishWebSocketConnection:tj,closeWebSocketConnection:rj}});var LR=k((C3,MR)=>{"use strict";var{createInflateRaw:nj,Z_DEFAULT_WINDOWBITS:ij}=require("node:zlib"),{isValidClientWindowBits:oj}=eA(),{MessageSizeExceededError:sj}=ue(),aj=Buffer.from([0,0,255,255]),ul=Symbol("kBuffer"),iA=Symbol("kLength"),xm=class{#e;#t={};#r=0;constructor(t,n){this.#t.serverNoContextTakeover=t.has("server_no_context_takeover"),this.#t.serverMaxWindowBits=t.get("server_max_window_bits"),this.#r=n.maxPayloadSize}decompress(t,n,i){if(!this.#e){let r=ij;if(this.#t.serverMaxWindowBits){if(!oj(this.#t.serverMaxWindowBits)){i(new Error("Invalid server_max_window_bits"));return}r=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=nj({windowBits:r})}catch(o){i(o);return}this.#e[ul]=[],this.#e[iA]=0,this.#e.on("data",o=>{if(this.#e[iA]+=o.length,this.#r>0&&this.#e[iA]>this.#r){i(new sj),this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null;return}this.#e[ul].push(o)}),this.#e.on("error",o=>{this.#e=null,i(o)})}this.#e.write(t),n&&this.#e.write(aj),this.#e.flush(()=>{if(!this.#e)return;let r=Buffer.concat(this.#e[ul],this.#e[iA]);this.#e[ul].length=0,this.#e[iA]=0,i(null,r)})}};MR.exports={PerMessageDeflate:xm}});var jR=k((B3,HR)=>{"use strict";var{Writable:Aj}=require("node:stream"),cj=require("node:assert"),{parserStates:Et,opcodes:cs,states:uj,emptyBuffer:PR,sentCloseFrameState:OR}=Oi(),{kReadyState:lj,kSentClose:zR,kResponse:Dm,kReceivedClose:GR}=Za(),{channels:ll}=yo(),{isValidStatusCode:dj,isValidOpcode:gj,failWebsocketConnection:Ut,websocketMessageReceived:VR,utf8Decode:fj,isControlFrame:Rm,isTextBinaryFrame:_m,isContinuationFrame:pj}=eA(),{WebsocketFrameSend:JR}=al(),{closeWebSocketConnection:YR}=Sm(),{PerMessageDeflate:hj}=LR(),{MessageSizeExceededError:Nm}=ue();function oA(e,t,n){YR(e,t,n,Buffer.byteLength(n)),Ut(e,n)}var Um=class extends Aj{#e=[];#t=0;#r=0;#i=!1;#o=Et.INFO;#n={};#s=[];#a;#c;#A;constructor(t,n,i={}){super(),this.ws=t,this.#a=n??new Map,this.#c=i.maxFragments??0,this.#A=i.maxPayloadSize??0,this.#a.has("permessage-deflate")&&this.#a.set("permessage-deflate",new hj(n,i))}_write(t,n,i){this.#e.push(t),this.#r+=t.length,this.#i=!0,this.run(i)}#u(){return this.#A>0&&!Rm(this.#n.opcode)&&this.#n.payloadLength+this.#t>this.#A?(oA(this.ws,1009,"Payload size exceeds maximum allowed size"),!1):!0}run(t){for(;this.#i;)if(this.#o===Et.INFO){if(this.#r<2)return t();let n=this.consume(2),i=(n[0]&128)!==0,r=n[0]&15,o=(n[1]&128)===128,s=!i&&r!==cs.CONTINUATION,a=n[1]&127,A=n[0]&64,c=n[0]&32,l=n[0]&16;if(!gj(r))return Ut(this.ws,"Invalid opcode received"),t();if(o)return Ut(this.ws,"Frame cannot be masked"),t();if(A!==0&&!this.#a.has("permessage-deflate")){Ut(this.ws,"Expected RSV1 to be clear.");return}if(c!==0||l!==0){Ut(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(s&&!_m(r)){Ut(this.ws,"Invalid frame type was fragmented.");return}if(_m(r)&&this.#s.length>0){Ut(this.ws,"Expected continuation frame");return}if(this.#n.fragmented&&s){Ut(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((a>125||s)&&Rm(r)){Ut(this.ws,"Control frame either too large or fragmented");return}if(pj(r)&&this.#s.length===0&&!this.#n.compressed){Ut(this.ws,"Unexpected continuation frame");return}if(a<=125){if(this.#n.payloadLength=a,this.#o=Et.READ_DATA,!this.#u())return}else a===126?this.#o=Et.PAYLOADLENGTH_16:a===127&&(this.#o=Et.PAYLOADLENGTH_64);_m(r)&&(this.#n.binaryType=r,this.#n.compressed=A!==0),this.#n.opcode=r,this.#n.masked=o,this.#n.fin=i,this.#n.fragmented=s}else if(this.#o===Et.PAYLOADLENGTH_16){if(this.#r<2)return t();let n=this.consume(2);if(this.#n.payloadLength=n.readUInt16BE(0),this.#o=Et.READ_DATA,!this.#u())return}else if(this.#o===Et.PAYLOADLENGTH_64){if(this.#r<8)return t();let n=this.consume(8),i=n.readUInt32BE(0),r=n.readUInt32BE(4);if(i!==0||r>2**31-1){Ut(this.ws,"Received payload length > 2^31 bytes.");return}if(this.#n.payloadLength=r,this.#o=Et.READ_DATA,!this.#u())return}else if(this.#o===Et.READ_DATA){if(this.#r<this.#n.payloadLength)return t();let n=this.consume(this.#n.payloadLength);if(Rm(this.#n.opcode)){this.#i=this.parseControlFrame(n),this.#o=Et.INFO;let i=this.ws[Dm].socket;if(this.#i&&i.writableNeedDrain){this.#i=!1,i.once("drain",()=>{this.destroyed||(this.#i=!0,this.run(t))});return}}else if(this.#n.compressed){this.#a.get("permessage-deflate").decompress(n,this.#n.fin,(i,r)=>{if(i){let o=i instanceof Nm?1009:1007;oA(this.ws,o,i.message);return}if(this.writeFragments(r)){if(this.#A>0&&this.#t>this.#A){oA(this.ws,1009,new Nm().message);return}if(!this.#n.fin){this.#o=Et.INFO,this.#i=!0,this.run(t);return}VR(this.ws,this.#n.binaryType,this.consumeFragments()),this.#i=!0,this.#o=Et.INFO,this.run(t)}}),this.#i=!1;break}else{if(!this.writeFragments(n))return;if(this.#A>0&&this.#t>this.#A){oA(this.ws,1009,new Nm().message);return}!this.#n.fragmented&&this.#n.fin&&VR(this.ws,this.#n.binaryType,this.consumeFragments()),this.#o=Et.INFO}}}consume(t){if(t>this.#r)throw new Error("Called consume() before buffers satiated.");if(t===0)return PR;if(this.#e[0].length===t)return this.#r-=this.#e[0].length,this.#e.shift();let n=Buffer.allocUnsafe(t),i=0;for(;i!==t;){let r=this.#e[0],{length:o}=r;if(o+i===t){n.set(this.#e.shift(),i);break}else if(o+i>t){n.set(r.subarray(0,t-i),i),this.#e[0]=r.subarray(t-i);break}else n.set(this.#e.shift(),i),i+=r.length}return this.#r-=t,n}writeFragments(t){return this.#c>0&&this.#s.length===this.#c?(oA(this.ws,1008,"Too many message fragments"),!1):(this.#t+=t.length,this.#s.push(t),!0)}consumeFragments(){let t=this.#s;if(t.length===1)return this.#t=0,t.shift();let n=Buffer.concat(t,this.#t);return this.#s=[],this.#t=0,n}parseCloseBody(t){cj(t.length!==1);let n;if(t.length>=2&&(n=t.readUInt16BE(0)),n!==void 0&&!dj(n))return{code:1002,reason:"Invalid status code",error:!0};let i=t.subarray(2);i[0]===239&&i[1]===187&&i[2]===191&&(i=i.subarray(3));try{i=fj(i)}catch{return{code:1007,reason:"Invalid UTF-8",error:!0}}return{code:n,reason:i,error:!1}}parseControlFrame(t){let{opcode:n,payloadLength:i}=this.#n;if(n===cs.CLOSE){if(i===1)return Ut(this.ws,"Received close frame with a 1-byte body."),!1;if(this.#n.closeInfo=this.parseCloseBody(t),this.#n.closeInfo.error){let{code:r,reason:o}=this.#n.closeInfo;return YR(this.ws,r,o,o.length),Ut(this.ws,o),!1}if(this.ws[zR]!==OR.SENT){let r=PR;this.#n.closeInfo.code&&(r=Buffer.allocUnsafe(2),r.writeUInt16BE(this.#n.closeInfo.code,0));let o=new JR(r);this.ws[Dm].socket.write(o.createFrame(cs.CLOSE),s=>{s||(this.ws[zR]=OR.SENT)})}return this.ws[lj]=uj.CLOSING,this.ws[GR]=!0,!1}else if(n===cs.PING){if(!this.ws[GR]){let r=new JR(t);this.ws[Dm].socket.write(r.createFrame(cs.PONG)),ll.ping.hasSubscribers&&ll.ping.publish({payload:t})}}else n===cs.PONG&&ll.pong.hasSubscribers&&ll.pong.publish({payload:t});return!0}get closingInfo(){return this.#n.closeInfo}};HR.exports={ByteParser:Um}});var XR=k((Q3,KR)=>{"use strict";var{WebsocketFrameSend:mj}=al(),{opcodes:qR,sendHints:us}=Oi(),Ij=Lp(),WR=Buffer[Symbol.species],$m=class{#e=new Ij;#t=!1;#r;constructor(t){this.#r=t}add(t,n,i){if(i!==us.blob){let o=ZR(t,i);if(!this.#t)this.#r.write(o,n);else{let s={promise:null,callback:n,frame:o};this.#e.push(s)}return}let r={promise:t.arrayBuffer().then(o=>{r.promise=null,r.frame=ZR(o,i)}),callback:n,frame:null};this.#e.push(r),this.#t||this.#i()}async#i(){this.#t=!0;let t=this.#e;for(;!t.isEmpty();){let n=t.shift();n.promise!==null&&await n.promise,this.#r.write(n.frame,n.callback),n.callback=n.frame=null}this.#t=!1}};function ZR(e,t){return new mj(Ej(e,t)).createFrame(t===us.string?qR.TEXT:qR.BINARY)}function Ej(e,t){switch(t){case us.string:return Buffer.from(e);case us.arrayBuffer:case us.blob:return new WR(e);case us.typedArray:return new WR(e.buffer,e.byteOffset,e.byteLength)}}KR.exports={SendQueue:$m}});var c0=k((v3,A0)=>{"use strict";var{webidl:q}=Je(),{URLSerializer:yj}=ft(),{environmentSettingsObject:e0}=bt(),{staticPropertyDescriptors:Un,states:sA,sentCloseFrameState:Cj,sendHints:dl}=Oi(),{kWebSocketURL:t0,kReadyState:Tm,kController:r0,kBinaryType:gl,kResponse:n0,kSentClose:Bj,kByteParser:Qj}=Za(),{isConnecting:vj,isEstablished:wj,isClosing:bj,isValidSubprotocol:kj,fireEvent:i0}=eA(),{establishWebSocketConnection:Sj,closeWebSocketConnection:o0}=Sm(),{ByteParser:xj}=jR(),{kEnumerableProperty:jt,isBlobLike:s0}=ie(),{getGlobalDispatcher:Dj}=za(),{types:a0}=require("node:util"),{ErrorEvent:Rj,CloseEvent:_j}=ss(),{SendQueue:Nj}=XR(),$t=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#r="";#i="";#o;constructor(t,n=[]){super(),q.util.markAsUncloneable(this);let i="WebSocket constructor";q.argumentLengthCheck(arguments,1,i);let r=q.converters["DOMString or sequence<DOMString> or WebSocketInit"](n,i,"options");t=q.converters.USVString(t,i,"url"),n=r.protocols;let o=e0.settingsObject.baseUrl,s;try{s=new URL(t,o)}catch(A){throw new DOMException(A,"SyntaxError")}if(s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),s.protocol!=="ws:"&&s.protocol!=="wss:")throw new DOMException(`Expected a ws: or wss: protocol, got ${s.protocol}`,"SyntaxError");if(s.hash||s.href.endsWith("#"))throw new DOMException("Got fragment","SyntaxError");if(typeof n=="string"&&(n=[n]),n.length!==new Set(n.map(A=>A.toLowerCase())).size)throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");if(n.length>0&&!n.every(A=>kj(A)))throw new DOMException("Invalid Sec-WebSocket-Protocol value","SyntaxError");this[t0]=new URL(s.href);let a=e0.settingsObject;this[r0]=Sj(s,n,a,this,(A,c)=>this.#n(A,c),r),this[Tm]=e.CONNECTING,this[Bj]=Cj.NOT_SENT,this[gl]="blob"}close(t=void 0,n=void 0){q.brandCheck(this,e);let i="WebSocket.close";if(t!==void 0&&(t=q.converters["unsigned short"](t,i,"code",{clamp:!0})),n!==void 0&&(n=q.converters.USVString(n,i,"reason")),t!==void 0&&t!==1e3&&(t<3e3||t>4999))throw new DOMException("invalid code","InvalidAccessError");let r=0;if(n!==void 0&&(r=Buffer.byteLength(n),r>123))throw new DOMException(`Reason must be less than 123 bytes; received ${r}`,"SyntaxError");o0(this,t,n,r)}send(t){q.brandCheck(this,e);let n="WebSocket.send";if(q.argumentLengthCheck(arguments,1,n),t=q.converters.WebSocketSendData(t,n,"data"),vj(this))throw new DOMException("Sent before connected.","InvalidStateError");if(!(!wj(this)||bj(this)))if(typeof t=="string"){let i=Buffer.byteLength(t);this.#t+=i,this.#o.add(t,()=>{this.#t-=i},dl.string)}else a0.isArrayBuffer(t)?(this.#t+=t.byteLength,this.#o.add(t,()=>{this.#t-=t.byteLength},dl.arrayBuffer)):ArrayBuffer.isView(t)?(this.#t+=t.byteLength,this.#o.add(t,()=>{this.#t-=t.byteLength},dl.typedArray)):s0(t)&&(this.#t+=t.size,this.#o.add(t,()=>{this.#t-=t.size},dl.blob))}get readyState(){return q.brandCheck(this,e),this[Tm]}get bufferedAmount(){return q.brandCheck(this,e),this.#t}get url(){return q.brandCheck(this,e),yj(this[t0])}get extensions(){return q.brandCheck(this,e),this.#i}get protocol(){return q.brandCheck(this,e),this.#r}get onopen(){return q.brandCheck(this,e),this.#e.open}set onopen(t){q.brandCheck(this,e),this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onerror(){return q.brandCheck(this,e),this.#e.error}set onerror(t){q.brandCheck(this,e),this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}get onclose(){return q.brandCheck(this,e),this.#e.close}set onclose(t){q.brandCheck(this,e),this.#e.close&&this.removeEventListener("close",this.#e.close),typeof t=="function"?(this.#e.close=t,this.addEventListener("close",t)):this.#e.close=null}get onmessage(){return q.brandCheck(this,e),this.#e.message}set onmessage(t){q.brandCheck(this,e),this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get binaryType(){return q.brandCheck(this,e),this[gl]}set binaryType(t){q.brandCheck(this,e),t!=="blob"&&t!=="arraybuffer"?this[gl]="blob":this[gl]=t}#n(t,n){this[n0]=t;let i=this[r0]?.dispatcher?.webSocketOptions,r=i?.maxFragments,o=i?.maxPayloadSize,s=new xj(this,n,{maxFragments:r,maxPayloadSize:o});s.on("drain",Uj),s.on("error",$j.bind(this)),t.socket.ws=this,this[Qj]=s,this.#o=new Nj(t.socket),this[Tm]=sA.OPEN;let a=t.headersList.get("sec-websocket-extensions");a!==null&&(this.#i=a);let A=t.headersList.get("sec-websocket-protocol");A!==null&&(this.#r=A),i0("open",this)}};$t.CONNECTING=$t.prototype.CONNECTING=sA.CONNECTING;$t.OPEN=$t.prototype.OPEN=sA.OPEN;$t.CLOSING=$t.prototype.CLOSING=sA.CLOSING;$t.CLOSED=$t.prototype.CLOSED=sA.CLOSED;Object.defineProperties($t.prototype,{CONNECTING:Un,OPEN:Un,CLOSING:Un,CLOSED:Un,url:jt,readyState:jt,bufferedAmount:jt,onopen:jt,onerror:jt,onclose:jt,close:jt,onmessage:jt,binaryType:jt,send:jt,extensions:jt,protocol:jt,[Symbol.toStringTag]:{value:"WebSocket",writable:!1,enumerable:!1,configurable:!0}});Object.defineProperties($t,{CONNECTING:Un,OPEN:Un,CLOSING:Un,CLOSED:Un});q.converters["sequence<DOMString>"]=q.sequenceConverter(q.converters.DOMString);q.converters["DOMString or sequence<DOMString>"]=function(e,t,n){return q.util.Type(e)==="Object"&&Symbol.iterator in e?q.converters["sequence<DOMString>"](e):q.converters.DOMString(e,t,n)};q.converters.WebSocketInit=q.dictionaryConverter([{key:"protocols",converter:q.converters["DOMString or sequence<DOMString>"],defaultValue:()=>new Array(0)},{key:"dispatcher",converter:q.converters.any,defaultValue:()=>Dj()},{key:"headers",converter:q.nullableConverter(q.converters.HeadersInit)}]);q.converters["DOMString or sequence<DOMString> or WebSocketInit"]=function(e){return q.util.Type(e)==="Object"&&!(Symbol.iterator in e)?q.converters.WebSocketInit(e):{protocols:q.converters["DOMString or sequence<DOMString>"](e)}};q.converters.WebSocketSendData=function(e){if(q.util.Type(e)==="Object"){if(s0(e))return q.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||a0.isArrayBuffer(e))return q.converters.BufferSource(e)}return q.converters.USVString(e)};function Uj(){this.ws[n0].socket.resume()}function $j(e){let t,n;e instanceof _j?(t=e.reason,n=e.code):t=e.message,i0("error",this,()=>new Rj("error",{error:e,message:t})),o0(this,n)}A0.exports={WebSocket:$t}});var Fm=k((w3,u0)=>{"use strict";function Tj(e){return e.indexOf("\0")===-1}function Fj(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)<48||e.charCodeAt(t)>57)return!1;return!0}function Mj(e){return new Promise(t=>{setTimeout(t,e).unref()})}u0.exports={isValidLastEventId:Tj,isASCIINumber:Fj,delay:Mj}});var d0=k((b3,l0)=>{"use strict";var Lj=require("node:buffer"),{Transform:Pj}=require("node:stream"),{isASCIINumber:Oj,isValidLastEventId:zj}=Fm(),ls=[239,187,191],fl=10,aA=13,Gj=58,Vj=32,Jj=Lj.kStringMaxLength,Yj=Buffer.from("data"),Hj=Buffer.from("event"),jj=Buffer.from("id"),qj=Buffer.from("retry"),Wj=1024,Zj=131072,Kj=128;function Xj(e,t){if(t>=e.length)return!1;for(let n=t;n<e.length;n++)if(e[n]<48||e[n]>57)return!1;return!0}function e4(e,t){for(let n=t;n<e.length;n++)if(e[n]===0)return!1;return!0}function pl(e,t,n){if(t!==n.length)return!1;for(let i=0;i<t;i++)if(e[i]!==n[i])return!1;return!0}function hl(){let e=new Error("EventSource message size exceeded");return e.aborted=!1,e}var Mm=class extends Pj{state=null;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;chunks=[];chunkIndex=0;pos=0;lineChunkIndex=0;linePos=0;lineLength=0;eventSize=0;eventFieldSizes={data:0,event:0,id:0,retry:0};dataLineCount=0;maxEventSize;maxDataLines;maxBufferedChunks;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(t={}){t.readableObjectMode=!0,super(t),this.state=t.eventSourceSettings||{},this.maxEventSize=t.maxEventSize??Jj;let n=this.maxEventSize>0?Math.min(Zj,Math.max(Wj,Math.floor(this.maxEventSize/Kj))):0;this.maxDataLines=n,this.maxBufferedChunks=n,t.push&&(this.push=t.push)}_transform(t,n,i){if(t.length===0){i();return}if(this.maxEventSize>0&&this.chunks.length>=this.maxBufferedChunks&&t[0]!==fl&&t[0]!==aA){i(hl());return}if(this.chunks.push(t),this.checkBOM&&this.handleBOM()){i();return}for(;this.hasCurrentByte();){let r=this.currentByte();if(this.eventEndCheck){if(this.crlfCheck){if(r===fl){this.crlfCheck=!1,this.consumeCurrentByte();continue}this.crlfCheck=!1}if(r===fl||r===aA){r===aA&&(this.crlfCheck=!0),this.consumeCurrentByte(),this.hasPendingEvent()&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1;continue}if(r===fl||r===aA){r===aA&&(this.crlfCheck=!0);try{this.parseLine(this.readLine(),this.event)}catch(o){i(o);return}this.consumeCurrentByte(),this.eventEndCheck=!0;continue}if(this.maxEventSize>0&&++this.lineLength>this.maxEventSize+7){i(hl());return}this.advanceCursor()}i()}_destroy(t,n){this.chunks.length=0,this.clearEvent(),super._destroy(t,n)}parseLine(t,n){if(t.length===0)return;let i=t.indexOf(Gj);if(i===0)return;let r=t.length,o=t.length;if(i!==-1&&(r=i,o=i+1,t[o]===Vj&&++o),pl(t,r,Yj)){if(this.maxEventSize>0&&this.dataLineCount>=this.maxDataLines)throw hl();let s=t.length-o,a=this.eventFieldSizes.data+(n.data===void 0?0:1)+s;this.setEventFieldSize("data",a);let A=t.toString("utf8",o);n.data===void 0?n.data=A:n.data+=`
|
|
46
|
-
${A}`,this.dataLineCount++;return}if(pl(t,r,qj)){Xj(t,o)&&(this.setEventFieldSize("retry",t.length-o),n.retry=t.toString("utf8",o));return}if(pl(t,r,jj)){e4(t,o)&&(this.setEventFieldSize("id",t.length-o),n.id=t.toString("utf8",o));return}pl(t,r,Hj)&&o<t.length&&(this.setEventFieldSize("event",t.length-o),n.event=t.toString("utf8",o))}setEventFieldSize(t,n){let i=this.eventSize-this.eventFieldSizes[t]+n;if(this.maxEventSize>0&&i>this.maxEventSize)throw hl();this.eventSize=i,this.eventFieldSizes[t]=n}processEvent(t){t.retry&&Oj(t.retry)&&(this.state.reconnectionTime=parseInt(t.retry,10)),t.id&&zj(t.id)&&(this.state.lastEventId=t.id),t.data!==void 0&&this.push({type:t.event||"message",options:{data:t.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event.data=void 0,this.event.event=void 0,this.event.id=void 0,this.event.retry=void 0,this.eventSize=0,this.dataLineCount=0,this.eventFieldSizes.data=0,this.eventFieldSizes.event=0,this.eventFieldSizes.id=0,this.eventFieldSizes.retry=0}hasPendingEvent(){return this.event.data!==void 0||this.event.event!==void 0||this.event.id!==void 0||this.event.retry!==void 0}hasCurrentByte(){return this.chunkIndex<this.chunks.length&&this.pos<this.chunks[this.chunkIndex].length}currentByte(){return this.chunks[this.chunkIndex][this.pos]}consumeCurrentByte(){this.advanceCursor(),this.syncLineStartToCursor()}advanceCursor(){for(this.pos++;this.chunkIndex<this.chunks.length&&this.pos>=this.chunks[this.chunkIndex].length;)this.chunkIndex++,this.pos=0}syncLineStartToCursor(){this.lineChunkIndex=this.chunkIndex,this.linePos=this.pos,this.lineLength=0,this.dropConsumedChunks()}dropConsumedChunks(){if(this.lineChunkIndex>0){let t=this.lineChunkIndex;this.chunks.splice(0,t),this.lineChunkIndex=0,this.chunkIndex-=t}this.chunkIndex===this.chunks.length&&(this.chunks.length=0,this.chunkIndex=0,this.pos=0,this.lineChunkIndex=0,this.linePos=0)}readLine(){if(this.lineChunkIndex===this.chunkIndex)return this.chunks[this.chunkIndex].subarray(this.linePos,this.pos);let t=[],n=0;for(let i=this.lineChunkIndex;i<=this.chunkIndex;i++){let r=this.chunks[i],o=i===this.lineChunkIndex?this.linePos:0,s=i===this.chunkIndex?this.pos:r.length,a=r.subarray(o,s);n+=a.length,t.push(a)}return Buffer.concat(t,n)}peekBufferedByte(t){let n=this.lineChunkIndex,i=this.linePos;for(;n<this.chunks.length;){let r=this.chunks[n],o=r.length-i;if(t<o)return r[i+t];t-=o,n++,i=0}}discardLeadingBytes(t){for(;t>0&&this.lineChunkIndex<this.chunks.length;){let i=this.chunks[this.lineChunkIndex].length-this.linePos;t<i?(this.linePos+=t,t=0):(t-=i,this.lineChunkIndex++,this.linePos=0)}this.chunkIndex=this.lineChunkIndex,this.pos=this.linePos,this.dropConsumedChunks()}handleBOM(){let t=this.peekBufferedByte(0),n=this.peekBufferedByte(1),i=this.peekBufferedByte(2);return n===void 0?(t===ls[0]||(this.checkBOM=!1),!0):i===void 0?t===ls[0]&&n===ls[1]?!0:(this.checkBOM=!1,!1):(t===ls[0]&&n===ls[1]&&i===ls[2]&&this.discardLeadingBytes(3),this.checkBOM=!1,!this.hasCurrentByte())}};l0.exports={EventSourceStream:Mm}});var y0=k((k3,E0)=>{"use strict";var{pipeline:t4}=require("node:stream"),{fetching:r4}=Ha(),{makeRequest:n4}=es(),{webidl:on}=Je(),{EventSourceStream:i4}=d0(),{parseMIMEType:o4}=ft(),{createFastMessageEvent:s4}=ss(),{isNetworkError:g0}=Ja(),{delay:a4}=Fm(),{kEnumerableProperty:zi}=ie(),{environmentSettingsObject:f0}=bt(),{getGlobalDispatcher:A4}=za(),p0=!1,h0=3e3,AA=0,m0=1,cA=2,c4="anonymous",u4="use-credentials",ds=class e extends EventTarget{#e={open:null,error:null,message:null};#t=null;#r=!1;#i=AA;#o=null;#n=null;#s;#a;constructor(t,n={}){super(),on.util.markAsUncloneable(this);let i="EventSource constructor";on.argumentLengthCheck(arguments,1,i),p0||(p0=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),t=on.converters.USVString(t,i,"url"),n=on.converters.EventSourceInitDict(n,i,"eventSourceInitDict"),this.#s=n.dispatcher,this.#a={lastEventId:"",reconnectionTime:h0};let r=f0,o;try{o=new URL(t,r.settingsObject.baseUrl),this.#a.origin=o.origin}catch(A){throw new DOMException(A,"SyntaxError")}this.#t=o.href;let s=c4;n.withCredentials&&(s=u4,this.#r=!0);let a={redirect:"follow",keepalive:!0,mode:"cors",credentials:s==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};a.client=f0.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#t)],this.#o=n4(a),this.#c()}get readyState(){return this.#i}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#i===cA)return;this.#i=AA;let t={request:this.#o,dispatcher:this.#s},n=i=>{g0(i)&&(this.dispatchEvent(new Event("error")),this.close()),this.#A()};t.processResponseEndOfBody=n,t.processResponse=i=>{if(g0(i))if(i.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#A();return}let r=i.headersList.get("content-type",!0),o=r!==null?o4(r):"failure",s=o!=="failure"&&o.essence==="text/event-stream";if(i.status!==200||s===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#i=m0,this.dispatchEvent(new Event("open")),this.#a.origin=i.urlList[i.urlList.length-1].origin;let a=new i4({eventSourceSettings:this.#a,maxEventSize:this.#s.eventSourceOptions?.maxEventSize,push:A=>{this.dispatchEvent(s4(A.type,A.options))}});t4(i.body.stream,a,A=>{A?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#n=r4(t)}async#A(){this.#i!==cA&&(this.#i=AA,this.dispatchEvent(new Event("error")),await a4(this.#a.reconnectionTime),this.#i===AA&&(this.#a.lastEventId.length&&this.#o.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){on.brandCheck(this,e),this.#i!==cA&&(this.#i=cA,this.#n.abort(),this.#o=null)}get onopen(){return this.#e.open}set onopen(t){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(t){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(t){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}},I0={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:AA,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:m0,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:cA,writable:!1}};Object.defineProperties(ds,I0);Object.defineProperties(ds.prototype,I0);Object.defineProperties(ds.prototype,{close:zi,onerror:zi,onmessage:zi,onopen:zi,readyState:zi,url:zi,withCredentials:zi});on.converters.EventSourceInitDict=on.dictionaryConverter([{key:"withCredentials",converter:on.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:on.converters.any,defaultValue:()=>A4()}]);E0.exports={EventSource:ds,defaultReconnectionTime:h0}});var v0=k((S3,H)=>{"use strict";var l4=Po(),C0=ua(),d4=Oo(),g4=Ck(),f4=zo(),p4=oh(),h4=Jk(),m4=Kk(),B0=ue(),Il=ie(),{InvalidArgumentError:ml}=B0,gs=MS(),I4=da(),E4=Ph(),y4=yx(),C4=Gh(),B4=kh(),Q4=Eu(),{getGlobalDispatcher:Q0,setGlobalDispatcher:v4}=za(),w4=xu(),b4=Au(),k4=cu();Object.assign(C0.prototype,gs);H.exports.Dispatcher=C0;H.exports.Client=l4;H.exports.Pool=d4;H.exports.BalancedPool=g4;H.exports.Agent=f4;H.exports.ProxyAgent=p4;H.exports.EnvHttpProxyAgent=h4;H.exports.RetryAgent=m4;H.exports.RetryHandler=Q4;H.exports.DecoratorHandler=w4;H.exports.RedirectHandler=b4;H.exports.createRedirectInterceptor=k4;H.exports.interceptors={redirect:kx(),retry:xx(),dump:Rx(),dns:Ux()};H.exports.buildConnector=I4;H.exports.errors=B0;H.exports.util={parseHeaders:Il.parseHeaders,headerNameToString:Il.headerNameToString};function uA(e){return(t,n,i)=>{if(typeof n=="function"&&(i=n,n=null),!t||typeof t!="string"&&typeof t!="object"&&!(t instanceof URL))throw new ml("invalid url");if(n!=null&&typeof n!="object")throw new ml("invalid opts");if(n&&n.path!=null){if(typeof n.path!="string")throw new ml("invalid opts.path");let s=n.path;n.path.startsWith("/")||(s=`/${s}`),t=new URL(Il.parseOrigin(t).origin+s)}else n||(n=typeof t=="object"?t:{}),t=Il.parseURL(t);let{agent:r,dispatcher:o=Q0()}=n;if(r)throw new ml("unsupported opts.agent. Did you mean opts.client?");return e.call(o,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?"PUT":"GET")},i)}}H.exports.setGlobalDispatcher=v4;H.exports.getGlobalDispatcher=Q0;var S4=Ha().fetch;H.exports.fetch=async function(t,n=void 0){try{return await S4(t,n)}catch(i){throw i&&typeof i=="object"&&Error.captureStackTrace(i),i}};H.exports.Headers=$i().Headers;H.exports.Response=Ja().Response;H.exports.Request=es().Request;H.exports.FormData=Ea().FormData;H.exports.File=globalThis.File??require("node:buffer").File;H.exports.FileReader=WD().FileReader;var{setGlobalOrigin:x4,getGlobalOrigin:D4}=ip();H.exports.setGlobalOrigin=x4;H.exports.getGlobalOrigin=D4;var{CacheStorage:R4}=oR(),{kConstruct:_4}=Wu();H.exports.caches=new R4(_4);var{deleteCookie:N4,getCookies:U4,getSetCookies:$4,setCookie:T4}=hR();H.exports.deleteCookie=N4;H.exports.getCookies=U4;H.exports.getSetCookies=$4;H.exports.setCookie=T4;var{parseMIMEType:F4,serializeAMimeType:M4}=ft();H.exports.parseMIMEType=F4;H.exports.serializeAMimeType=M4;var{CloseEvent:L4,ErrorEvent:P4,MessageEvent:O4}=ss();H.exports.WebSocket=c0().WebSocket;H.exports.CloseEvent=L4;H.exports.ErrorEvent=P4;H.exports.MessageEvent=O4;H.exports.request=uA(gs.request);H.exports.stream=uA(gs.stream);H.exports.pipeline=uA(gs.pipeline);H.exports.connect=uA(gs.connect);H.exports.upgrade=uA(gs.upgrade);H.exports.MockClient=E4;H.exports.MockPool=C4;H.exports.MockAgent=y4;H.exports.mockErrors=B4;var{EventSource:z4}=y0();H.exports.EventSource=z4});var ln=lt(require("fs")),dc=lt(require("path")),$T=require("crypto");var u={};Ir(u,{BRAND:()=>gF,DIRTY:()=>Xn,EMPTY_PATH:()=>JT,INVALID:()=>V,NEVER:()=>ZF,OK:()=>We,ParseStatus:()=>Ge,Schema:()=>ne,ZodAny:()=>pn,ZodArray:()=>Jr,ZodBigInt:()=>ti,ZodBoolean:()=>ri,ZodBranded:()=>na,ZodCatch:()=>gi,ZodDate:()=>ni,ZodDefault:()=>di,ZodDiscriminatedUnion:()=>mc,ZodEffects:()=>Gt,ZodEnum:()=>ui,ZodError:()=>dt,ZodFirstPartyTypeKind:()=>Y,ZodFunction:()=>Ec,ZodIntersection:()=>ai,ZodIssueCode:()=>S,ZodLazy:()=>Ai,ZodLiteral:()=>ci,ZodMap:()=>fo,ZodNaN:()=>ho,ZodNativeEnum:()=>li,ZodNever:()=>tr,ZodNull:()=>oi,ZodNullable:()=>Cr,ZodNumber:()=>ei,ZodObject:()=>gt,ZodOptional:()=>Ot,ZodParsedType:()=>U,ZodPipeline:()=>ia,ZodPromise:()=>hn,ZodReadonly:()=>fi,ZodRecord:()=>Ic,ZodSchema:()=>ne,ZodSet:()=>po,ZodString:()=>fn,ZodSymbol:()=>lo,ZodTransformer:()=>Gt,ZodTuple:()=>yr,ZodType:()=>ne,ZodUndefined:()=>ii,ZodUnion:()=>si,ZodUnknown:()=>Vr,ZodVoid:()=>go,addIssueToContext:()=>_,any:()=>BF,array:()=>bF,bigint:()=>mF,boolean:()=>LQ,coerce:()=>WF,custom:()=>TQ,date:()=>IF,datetimeRegex:()=>UQ,defaultErrorMap:()=>zr,discriminatedUnion:()=>DF,effect:()=>zF,enum:()=>LF,function:()=>TF,getErrorMap:()=>Ao,getParsedType:()=>Er,instanceof:()=>pF,intersection:()=>RF,isAborted:()=>pc,isAsync:()=>co,isDirty:()=>hc,isValid:()=>gn,late:()=>fF,lazy:()=>FF,literal:()=>MF,makeIssue:()=>ra,map:()=>UF,nan:()=>hF,nativeEnum:()=>PF,never:()=>vF,null:()=>CF,nullable:()=>VF,number:()=>MQ,object:()=>kF,objectUtil:()=>Vg,oboolean:()=>qF,onumber:()=>jF,optional:()=>GF,ostring:()=>HF,pipeline:()=>YF,preprocess:()=>JF,promise:()=>OF,quotelessJson:()=>zT,record:()=>NF,set:()=>$F,setErrorMap:()=>VT,strictObject:()=>SF,string:()=>FQ,symbol:()=>EF,transformer:()=>zF,tuple:()=>_F,undefined:()=>yF,union:()=>xF,unknown:()=>QF,util:()=>se,void:()=>wF});var se;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},e.getValidEnumValues=r=>{let o=e.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),s={};for(let a of o)s[a]=r[a];return e.objectValues(s)},e.objectValues=r=>e.objectKeys(r).map(function(o){return r[o]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},e.find=(r,o)=>{for(let s of r)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(se||(se={}));var Vg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Vg||(Vg={}));var U=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=e=>{switch(typeof e){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(e)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(e)?U.array:e===null?U.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?U.promise:typeof Map<"u"&&e instanceof Map?U.map:typeof Set<"u"&&e instanceof Set?U.set:typeof Date<"u"&&e instanceof Date?U.date:U.object;default:return U.unknown}};var S=se.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"]),zT=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),dt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let a=i,A=0;for(;A<s.path.length;){let c=s.path[A],l=A===s.path.length-1;if(c==="_errors"){l&&a._errors.push(n(s)),A++;continue}Object.prototype.hasOwnProperty.call(a,c)||(c==="__proto__"?Object.defineProperty(a,c,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):a[c]={_errors:[]}),a=a[c],l&&a._errors.push(n(s)),A++}}};return r(this),i}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,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};dt.create=e=>new dt(e);var GT=(e,t)=>{let n;switch(e.code){case S.invalid_type:e.received===U.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case S.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,se.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:n=`Unrecognized key(s) in object: ${se.joinValues(e.keys,", ")}`;break;case S.invalid_union:n="Invalid input";break;case S.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${se.joinValues(e.options)}`;break;case S.invalid_enum_value:n=`Invalid enum value. Expected ${se.joinValues(e.options)}, received '${e.received}'`;break;case S.invalid_arguments:n="Invalid function arguments";break;case S.invalid_return_type:n="Invalid function return type";break;case S.invalid_date:n="Invalid date";break;case S.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:se.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case S.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case S.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case S.custom:n="Invalid input";break;case S.invalid_intersection_types:n="Intersection results could not be merged";break;case S.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case S.not_finite:n="Number must be finite";break;default:n=t.defaultError,se.assertNever(e)}return{message:n}},zr=GT;var xQ=zr;function VT(e){xQ=e}function Ao(){return xQ}var ra=e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let a="",A=i.filter(c=>!!c).slice().reverse();for(let c of A)a=c(s,{data:t,defaultError:a}).message;return{...r,path:o,message:a}},JT=[];function _(e,t){let n=Ao(),i=ra({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===zr?void 0:zr].filter(r=>!!r)});e.common.issues.push(i)}var Ge=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return V;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return V;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:t.value,value:i}}},V=Object.freeze({status:"aborted"}),Xn=e=>({status:"dirty",value:e}),We=e=>({status:"valid",value:e}),pc=e=>e.status==="aborted",hc=e=>e.status==="dirty",gn=e=>e.status==="valid",co=e=>typeof Promise<"u"&&e instanceof Promise;var $;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})($||($={}));var zt=class{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}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}},DQ=(e,t)=>{if(gn(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 n=new dt(e.common.issues);return this._error=n,this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(s,a)=>{let{message:A}=e;return s.code==="invalid_enum_value"?{message:A??a.defaultError}:typeof a.data>"u"?{message:A??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:A??n??a.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ge,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(co(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},r=this._parseSync({data:t,path:i.path,parent:i});return DQ(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return gn(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>gn(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(co(r)?r:Promise.resolve(r));return DQ(i,o)}refine(t,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let s=t(r),a=()=>o.addIssue({code:S.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(A=>A?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Gt({schema:this,typeName:Y.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:n=>this["~validate"](n)}}optional(){return Ot.create(this,this._def)}nullable(){return Cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jr.create(this)}promise(){return hn.create(this,this._def)}or(t){return si.create([this,t],this._def)}and(t){return ai.create(this,t,this._def)}transform(t){return new Gt({...X(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new di({...X(this._def),innerType:this,defaultValue:n,typeName:Y.ZodDefault})}brand(){return new na({typeName:Y.ZodBranded,type:this,...X(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new gi({...X(this._def),innerType:this,catchValue:n,typeName:Y.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ia.create(this,t)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},YT=/^c[^\s-]{8,}$/i,HT=/^[0-9a-z]+$/,jT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qT=/^[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,WT=/^[a-z0-9_-]{21}$/i,ZT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KT=/^[-+]?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)?)??$/,XT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eF="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Jg,tF=/^(?:(?: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])$/,rF=/^(?:(?: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])$/,nF=/^(([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]))$/,iF=/^(([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])$/,oF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_Q="((\\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])))",aF=new RegExp(`^${_Q}$`);function NQ(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function AF(e){return new RegExp(`^${NQ(e)}$`)}function UQ(e){let t=`${_Q}T${NQ(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function cF(e,t){return!!((t==="v4"||!t)&&tF.test(e)||(t==="v6"||!t)&&nF.test(e))}function uF(e,t){if(!ZT.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function lF(e,t){return!!((t==="v4"||!t)&&rF.test(e)||(t==="v6"||!t)&&iF.test(e))}var fn=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==U.string){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.string,received:o.parsedType}),V}let i=new Ge,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(r=this._getOrReturnCtx(t,r),s?_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")XT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"email",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Jg||(Jg=new RegExp(eF,"u")),Jg.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"emoji",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")qT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"uuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")WT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"nanoid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")YT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")HT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid2",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")jT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ulid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),_(r,{validation:"url",code:S.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"regex",code:S.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.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)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?UQ(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?aF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?AF(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?KT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?cF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?uF(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?lF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?oF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?sF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64url",code:S.invalid_string,message:o.message}),i.dirty()):se.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:S.invalid_string,...$.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...$.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...$.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...$.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,...$.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,...$.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...$.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...$.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...$.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...$.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...$.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...$.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...$.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...$.errToObj(n)})}nonempty(t){return this.min(1,$.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};fn.create=e=>new fn({checks:[],typeName:Y.ZodString,coerce:e?.coerce??!1,...X(e)});function dF(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return o%s/10**r}var ei=class e extends ne{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)!==U.number){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.number,received:o.parsedType}),V}let i,r=new Ge;for(let o of this._def.checks)o.kind==="int"?se.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?dF(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_finite,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:$.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&se.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ei.create=e=>new ei({checks:[],typeName:Y.ZodNumber,coerce:e?.coerce||!1,...X(e)});var ti=class e extends ne{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)!==U.bigint)return this._getInvalidInput(t);let i,r=new Ge;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.bigint,received:n.parsedType}),V}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.toString(r)}]})}_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:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ti.create=e=>new ti({checks:[],typeName:Y.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var ri=class extends ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==U.boolean){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.boolean,received:i.parsedType}),V}return We(t.data)}};ri.create=e=>new ri({typeName:Y.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var ni=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==U.date){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.date,received:o.parsedType}),V}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_date}),V}let i=new Ge,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):se.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:$.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:$.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ni.create=e=>new ni({checks:[],coerce:e?.coerce||!1,typeName:Y.ZodDate,...X(e)});var lo=class extends ne{_parse(t){if(this._getType(t)!==U.symbol){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.symbol,received:i.parsedType}),V}return We(t.data)}};lo.create=e=>new lo({typeName:Y.ZodSymbol,...X(e)});var ii=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.undefined,received:i.parsedType}),V}return We(t.data)}};ii.create=e=>new ii({typeName:Y.ZodUndefined,...X(e)});var oi=class extends ne{_parse(t){if(this._getType(t)!==U.null){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.null,received:i.parsedType}),V}return We(t.data)}};oi.create=e=>new oi({typeName:Y.ZodNull,...X(e)});var pn=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(t){return We(t.data)}};pn.create=e=>new pn({typeName:Y.ZodAny,...X(e)});var Vr=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return We(t.data)}};Vr.create=e=>new Vr({typeName:Y.ZodUnknown,...X(e)});var tr=class extends ne{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.never,received:n.parsedType}),V}};tr.create=e=>new tr({typeName:Y.ZodNever,...X(e)});var go=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.void,received:i.parsedType}),V}return We(t.data)}};go.create=e=>new go({typeName:Y.ZodVoid,...X(e)});var Jr=class e extends ne{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==U.array)return _(n,{code:S.invalid_type,expected:U.array,received:n.parsedType}),V;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(_(n,{code:s?S.too_big:S.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(_(n,{code:S.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(_(n,{code:S.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new zt(n,s,n.path,a)))).then(s=>Ge.mergeArray(i,s));let o=[...n.data].map((s,a)=>r.type._parseSync(new zt(n,s,n.path,a)));return Ge.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(t){return this.min(1,t)}};Jr.create=(e,t)=>new Jr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...X(t)});function uo(e){if(e instanceof gt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Ot.create(uo(i))}return new gt({...e._def,shape:()=>t})}else return e instanceof Jr?new Jr({...e._def,type:uo(e.element)}):e instanceof Ot?Ot.create(uo(e.unwrap())):e instanceof Cr?Cr.create(uo(e.unwrap())):e instanceof yr?yr.create(e.items.map(t=>uo(t))):e}var gt=class e extends ne{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(),n=se.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==U.object){let c=this._getOrReturnCtx(t);return _(c,{code:S.invalid_type,expected:U.object,received:c.parsedType}),V}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof tr&&this._def.unknownKeys==="strip"))for(let c in r.data)s.includes(c)||a.push(c);let A=[];for(let c of s){let l=o[c],d=r.data[c];A.push({key:{status:"valid",value:c},value:l._parse(new zt(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof tr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)A.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict")a.length>0&&(_(r,{code:S.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let d=r.data[l];A.push({key:{status:"valid",value:l},value:c._parse(new zt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of A){let d=await l.key,g=await l.value;c.push({key:d,value:g,alwaysSet:l.alwaysSet})}return c}).then(c=>Ge.mergeObjectSync(i,c)):Ge.mergeObjectSync(i,A)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:$.errToObj(t).message??r}:{message:r}}}:{}})}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:Y.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of se.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let i of se.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return uo(this)}partial(t){let n={};for(let i of se.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let i of se.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Ot;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return $Q(se.objectKeys(this.shape))}};gt.create=(e,t)=>new gt({shape:()=>e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...X(t)});gt.strictCreate=(e,t)=>new gt({shape:()=>e,unknownKeys:"strict",catchall:tr.create(),typeName:Y.ZodObject,...X(t)});gt.lazycreate=(e,t)=>new gt({shape:e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...X(t)});var si=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(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 n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new dt(a.ctx.common.issues));return _(n,{code:S.invalid_union,unionErrors:s}),V}if(n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let A of i){let c={...n,common:{...n.common,issues:[]},parent:null},l=A._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(A=>new dt(A));return _(n,{code:S.invalid_union,unionErrors:a}),V}}get options(){return this._def.options}};si.create=(e,t)=>new si({options:e,typeName:Y.ZodUnion,...X(t)});var Gr=e=>e instanceof Ai?Gr(e.schema):e instanceof Gt?Gr(e.innerType()):e instanceof ci?[e.value]:e instanceof ui?e.options:e instanceof li?se.objectValues(e.enum):e instanceof di?Gr(e._def.innerType):e instanceof ii?[void 0]:e instanceof oi?[null]:e instanceof Ot?[void 0,...Gr(e.unwrap())]:e instanceof Cr?[null,...Gr(e.unwrap())]:e instanceof na||e instanceof fi?Gr(e.unwrap()):e instanceof gi?Gr(e._def.innerType):[],mc=class e extends ne{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.object)return _(n,{code:S.invalid_type,expected:U.object,received:n.parsedType}),V;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(_(n,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let s=Gr(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(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,o)}}return new e({typeName:Y.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...X(i)})}};function Yg(e,t){let n=Er(e),i=Er(t);if(e===t)return{valid:!0,data:e};if(n===U.object&&i===U.object){let r=se.objectKeys(t),o=se.objectKeys(e).filter(a=>r.indexOf(a)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(let a of o){if(a==="__proto__")continue;let A=Yg(e[a],t[a]);if(!A.valid)return{valid:!1};s[a]=A.data}return{valid:!0,data:s}}else if(n===U.array&&i===U.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],A=Yg(s,a);if(!A.valid)return{valid:!1};r.push(A.data)}return{valid:!0,data:r}}else return n===U.date&&i===U.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ai=class extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,s)=>{if(pc(o)||pc(s))return V;let a=Yg(o.value,s.value);return a.valid?((hc(o)||hc(s))&&n.dirty(),{status:n.value,value:a.data}):(_(i,{code:S.invalid_intersection_types}),V)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ai.create=(e,t,n)=>new ai({left:e,right:t,typeName:Y.ZodIntersection,...X(n)});var yr=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.array)return _(i,{code:S.invalid_type,expected:U.array,received:i.parsedType}),V;if(i.data.length<this._def.items.length)return _(i,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&i.data.length>this._def.items.length&&(_(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,a)=>{let A=this._def.items[a]||this._def.rest;return A?A._parse(new zt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ge.mergeArray(n,s)):Ge.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};yr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yr({items:e,typeName:Y.ZodTuple,rest:null,...X(t)})};var Ic=class e extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.object)return _(i,{code:S.invalid_type,expected:U.object,received:i.parsedType}),V;let r=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)r.push({key:o._parse(new zt(i,a,i.path,a)),value:s._parse(new zt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ge.mergeObjectAsync(n,r):Ge.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof ne?new e({keyType:t,valueType:n,typeName:Y.ZodRecord,...X(i)}):new e({keyType:fn.create(),valueType:t,typeName:Y.ZodRecord,...X(n)})}},fo=class extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.map)return _(i,{code:S.invalid_type,expected:U.map,received:i.parsedType}),V;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,A],c)=>({key:r._parse(new zt(i,a,i.path,[c,"key"])),value:o._parse(new zt(i,A,i.path,[c,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let A of s){let c=await A.key,l=await A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let A of s){let c=A.key,l=A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}}}};fo.create=(e,t,n)=>new fo({valueType:t,keyType:e,typeName:Y.ZodMap,...X(n)});var po=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.set)return _(i,{code:S.invalid_type,expected:U.set,received:i.parsedType}),V;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(_(i,{code:S.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(_(i,{code:S.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(A){let c=new Set;for(let l of A){if(l.status==="aborted")return V;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}let a=[...i.data.values()].map((A,c)=>o._parse(new zt(i,A,i.path,c)));return i.common.async?Promise.all(a).then(A=>s(A)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};po.create=(e,t)=>new po({valueType:e,minSize:null,maxSize:null,typeName:Y.ZodSet,...X(t)});var Ec=class e extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.function)return _(n,{code:S.invalid_type,expected:U.function,received:n.parsedType}),V;function i(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_arguments,argumentsError:A}})}function r(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_return_type,returnTypeError:A}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof hn){let a=this;return We(async function(...A){let c=new dt([]),l=await a._def.args.parseAsync(A,o).catch(f=>{throw c.addIssue(i(A,f)),c}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw c.addIssue(r(d,f)),c})})}else{let a=this;return We(function(...A){let c=a._def.args.safeParse(A,o);if(!c.success)throw new dt([i(A,c.error)]);let l=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new dt([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:yr.create(t).rest(Vr.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,n,i){return new e({args:t||yr.create([]).rest(Vr.create()),returns:n||Vr.create(),typeName:Y.ZodFunction,...X(i)})}},Ai=class extends ne{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ai.create=(e,t)=>new Ai({getter:e,typeName:Y.ZodLazy,...X(t)});var ci=class extends ne{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return _(n,{received:n.data,code:S.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}};ci.create=(e,t)=>new ci({value:e,typeName:Y.ZodLiteral,...X(t)});function $Q(e,t){return new ui({values:e,typeName:Y.ZodEnum,...X(t)})}var ui=class e extends ne{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{expected:se.joinValues(i),received:n.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{received:n.data,code:S.invalid_enum_value,options:i}),V}return We(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};ui.create=$Q;var li=class extends ne{_parse(t){let n=se.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==U.string&&i.parsedType!==U.number){let r=se.objectValues(n);return _(i,{expected:se.joinValues(r),received:i.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(se.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=se.objectValues(n);return _(i,{received:i.data,code:S.invalid_enum_value,options:r}),V}return We(t.data)}get enum(){return this._def.values}};li.create=(e,t)=>new li({values:e,typeName:Y.ZodNativeEnum,...X(t)});var hn=class extends ne{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.promise&&n.common.async===!1)return _(n,{code:S.invalid_type,expected:U.promise,received:n.parsedType}),V;let i=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return We(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};hn.create=(e,t)=>new hn({type:e,typeName:Y.ZodPromise,...X(t)});var Gt=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:s=>{_(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return V;let A=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return A.status==="aborted"?V:A.status==="dirty"?Xn(A.value):n.value==="dirty"?Xn(A.value):A});{if(n.value==="aborted")return V;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?V:a.status==="dirty"?Xn(a.value):n.value==="dirty"?Xn(a.value):a}}if(r.type==="refinement"){let s=a=>{let A=r.refinement(a,o);if(i.common.async)return Promise.resolve(A);if(A instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!gn(s))return V;let a=r.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>gn(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:n.value,value:a})):V);se.assertNever(r)}};Gt.create=(e,t,n)=>new Gt({schema:e,typeName:Y.ZodEffects,effect:t,...X(n)});Gt.createWithPreprocess=(e,t,n)=>new Gt({schema:t,effect:{type:"preprocess",transform:e},typeName:Y.ZodEffects,...X(n)});var Ot=class extends ne{_parse(t){return this._getType(t)===U.undefined?We(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ot.create=(e,t)=>new Ot({innerType:e,typeName:Y.ZodOptional,...X(t)});var Cr=class extends ne{_parse(t){return this._getType(t)===U.null?We(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Cr.create=(e,t)=>new Cr({innerType:e,typeName:Y.ZodNullable,...X(t)});var di=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};di.create=(e,t)=>new di({innerType:e,typeName:Y.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...X(t)});var gi=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return co(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new dt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new dt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};gi.create=(e,t)=>new gi({innerType:e,typeName:Y.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...X(t)});var ho=class extends ne{_parse(t){if(this._getType(t)!==U.nan){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.nan,received:i.parsedType}),V}return{status:"valid",value:t.data}}};ho.create=e=>new ho({typeName:Y.ZodNaN,...X(e)});var gF=Symbol("zod_brand"),na=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},ia=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?V:o.status==="dirty"?(n.dirty(),Xn(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?V:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:Y.ZodPipeline})}},fi=class extends ne{_parse(t){let n=this._def.innerType._parse(t),i=r=>(gn(r)&&(r.value=Object.freeze(r.value)),r);return co(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};fi.create=(e,t)=>new fi({innerType:e,typeName:Y.ZodReadonly,...X(t)});function RQ(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function TQ(e,t={},n){return e?pn.create().superRefine((i,r)=>{let o=e(i);if(o instanceof Promise)return o.then(s=>{if(!s){let a=RQ(t,i),A=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:A})}});if(!o){let s=RQ(t,i),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):pn.create()}var fF={object:gt.lazycreate},Y;(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"})(Y||(Y={}));var pF=(e,t={message:`Input not instance of ${e.name}`})=>TQ(n=>n instanceof e,t),FQ=fn.create,MQ=ei.create,hF=ho.create,mF=ti.create,LQ=ri.create,IF=ni.create,EF=lo.create,yF=ii.create,CF=oi.create,BF=pn.create,QF=Vr.create,vF=tr.create,wF=go.create,bF=Jr.create,kF=gt.create,SF=gt.strictCreate,xF=si.create,DF=mc.create,RF=ai.create,_F=yr.create,NF=Ic.create,UF=fo.create,$F=po.create,TF=Ec.create,FF=Ai.create,MF=ci.create,LF=ui.create,PF=li.create,OF=hn.create,zF=Gt.create,GF=Ot.create,VF=Cr.create,JF=Gt.createWithPreprocess,YF=ia.create,HF=()=>FQ().optional(),jF=()=>MQ().optional(),qF=()=>LQ().optional(),WF={string:(e=>fn.create({...e,coerce:!0})),number:(e=>ei.create({...e,coerce:!0})),boolean:(e=>ri.create({...e,coerce:!0})),bigint:(e=>ti.create({...e,coerce:!0})),date:(e=>ni.create({...e,coerce:!0}))};var ZF=V;var Hg=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Hg||{}),jg=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(jg||{});var qg=300,xe=u.string().trim().min(1),KF=u.object({action:u.enum(["start","run","wait"]),text:xe,source:u.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:xe.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),Wg=/^[A-Za-z_][A-Za-z0-9_]*$/,Br=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,oa=(s=>(s.VersionEndpoint="version_endpoint",s.DeployWorkflow="deploy_workflow",s.KubernetesLabels="kubernetes_labels",s.Command="command",s.Api="api",s.NotTracked="not_tracked",s))(oa||{}),Yr="shared",XF=xe.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),mo=u.object({address:XF,readyWhen:xe.nullable(),credentials:u.array(u.string().regex(Br)).max(50),revisionSources:u.array(u.object({method:u.nativeEnum(oa),detail:xe.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:u.array(xe).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),Zg={steps:u.array(KF).max(20).optional().describe("how it starts, in order"),kind:u.enum(["web_app","service","database","external_service"]).optional(),from:u.object({file:xe,service:xe.nullable()}).strict().optional(),credentials:u.array(u.string().max(100).regex(Wg)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},eM=u.object({name:xe,repository:xe.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:u.boolean(),...Zg,deployed:xe.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),tM=u.object({name:u.string().regex(Br).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:u.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:u.boolean().describe("false only when the SUT starts without it, with less working"),how:xe.max(qg).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),rM=u.object({component:xe,problem:xe,evidence:xe.describe("the exact command and output that shows it"),fix:xe.describe("what the user must provide, and where")}),nM=u.object({framework:xe,file:xe.describe("the test file run, relative to its repository root"),result:u.enum(["pass","fail","error"])}),iM=u.object({input:xe.describe("the part of the user's SUT input, as given"),reason:xe}),uX=u.object({schemaVersion:u.literal(1),status:u.nativeEnum(jg).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:u.array(eM),suites:u.array(nM).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:u.array(xe).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:u.array(u.object({input:xe.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:xe.describe("what the recipe did with it")})).optional(),inputsNotUsed:u.array(iM).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:u.array(rM).describe("required (non-empty) when status is blocked"),inputs:u.array(tM).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:mo.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward, proxy or client certificate)")});var Kg=64*1024,Xg=512*1024,PQ=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var pX=new TextDecoder("utf-8",{fatal:!0});var sa=(o=>(o.NotFound="not_found",o.NoAccess="no_access",o.Unavailable="unavailable",o.AccessLost="access_lost",o.CannotOpen="cannot_open",o))(sa||{});var OQ=e=>`${e.source}:${e.site??""}:${e.key}`;var yc=/^pasted-[0-9a-f]{16}$/,Cc=/^file-[0-9a-f]{16}$/,Bc=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(Bc||{});var ef=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(ef||{}),tf=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(tf||{}),rf=(m=>(m.RelatedChangeConflict="related_change_conflict",m.ReferenceOutsideTarget="reference_outside_target",m.SourceAccessLost="source_access_lost",m.ConfigurationIncomplete="configuration_incomplete",m.CredentialUnavailable="credential_unavailable",m.WorkflowBindingUnverified="workflow_binding_unverified",m.WorkflowRefUnprotected="workflow_ref_unprotected",m.BedrockWorkflowRequired="bedrock_workflow_required",m.DeploymentReview="deployment_review",m.SutRevisionMismatch="sut_revision_mismatch",m.IsolationUnavailable="isolation_unavailable",m.EvidenceInsufficient="evidence_insufficient",m.ConfigurationUnresolved="configuration_unresolved",m.ModelProviderDenied="model_provider_denied",m.ModelProviderUnavailable="model_provider_unavailable",m.RunnerProviderNotReady="runner_provider_not_ready",m.MergeConflict="merge_conflict",m))(rf||{}),aa=(o=>(o.CiCheck="ci_check",o.TestReport="test_report",o.StaticAnalysis="static_analysis",o.CodeReview="code_review",o.Other="other",o))(aa||{}),nf=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(nf||{}),of=(a=>(a.AuthToken="auth_token",a.Secret="secret",a.DataConnection="data_connection",a.AppNotStarted="app_not_started",a.Login="login",a.ExternalDependency="external_dependency",a.RecordingReplay="recording_replay",a))(of||{});var sf=(n=>(n.Probe="probe",n.Agent="agent",n))(sf||{}),af=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(af||{}),Af=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(Af||{});var zQ=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(zQ||{}),Qr=u.string().trim().min(1),oM=u.object({case:Qr.describe("recommend id this assertion enforces"),evidence:Qr.describe("the exact assertion line from the file that checks that case's observable")}),sM=u.object({route:u.literal("persistence"),url:u.string().url()}).strict(),cf=u.object({kind:u.nativeEnum(af).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Qr.describe("the dependency, endpoint or data it affects"),mechanism:u.nativeEnum(Af).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Qr.describe("what it sets up"),worker:Qr.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:sM.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:Qr.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Qr.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),aM=u.object({file:Qr.describe("staged path under .skyramp/staged/"),source:u.nativeEnum(zQ),language:Qr,covers:u.array(u.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:u.array(oM).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:u.array(cf).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),yX=u.object({schemaVersion:u.literal(1),tests:u.array(aM),deferredUi:u.array(u.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Qr.describe("one paragraph")});var GQ=(s=>(s.Place="place",s.Update="update",s.Regenerate="regenerate",s.Delete="delete",s.Verify="verify",s.None="none",s))(GQ||{}),VQ=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(VQ||{}),tt=u.string().trim().min(1),JQ=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(JQ||{}),AM=u.object({kind:u.nativeEnum(JQ),reason:tt.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),uf=u.array(u.string().url().max(2048).regex(/^https?:\/\//i)).max(50),cM=u.object({case:tt.describe("a covers id \u2014 the recommend case this test realizes"),status:u.nativeEnum(VQ),runtimeTargets:uf.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:tt.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:u.boolean().optional(),testProblem:AM.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:u.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:u.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),uM=u.object({started:u.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:u.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:u.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:u.array(cM).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),lM=u.object({context:u.array(cf).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:u.string().optional().describe("staged path \u2014 required for placements"),file:tt.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:tt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:u.nativeEnum(GQ),covers:u.array(u.string()).optional().describe("recommend ids a placed test covers"),repro:u.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:u.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:u.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:tt.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:tt.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:uM,assertionCount:u.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:u.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:u.array(tt).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:u.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),YQ=(n=>(n.Junit="junit",n.Converter="converter",n))(YQ||{}),dM=tt.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),gM=u.object({results:tt.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:u.nativeEnum(YQ),run:tt.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:u.array(tt).min(1).describe("the items[].file paths this run covered"),cases:u.array(u.object({test:tt.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:tt.describe("the covers id it realizes"),file:dM})).describe("map each reported test name to the case it covers")}),fM=u.object({suites:u.array(gM).min(1)}),vX=u.object({schemaVersion:u.literal(1),items:u.array(lM),runnerResults:fM.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:u.array(u.string()).describe("existing tests assessed and deliberately left untouched"),summary:tt.describe("one paragraph")});var El=lt(XQ(),1),G4=lt(v0(),1);var $r;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})($r||($r={}));var w0;(function(e){e.Accept="accept",e.ContentType="content-type"})(w0||(w0={}));var b0;(function(e){e.ApplicationJson="application/json"})(b0||(b0={}));var D3=[$r.MovedPermanently,$r.ResourceMoved,$r.SeeOther,$r.TemporaryRedirect,$r.PermanentRedirect],R3=[$r.BadGateway,$r.ServiceUnavailable,$r.GatewayTimeout];var S0=require("os"),lA=require("fs"),Lm=function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(l){try{c(i.next(l))}catch(d){s(d)}}function A(l){try{c(i.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):r(l.value).then(a,A)}c((i=i.apply(e,t||[])).next())})},{access:J4,appendFile:Y4,writeFile:H4}=lA.promises,k0="GITHUB_STEP_SUMMARY";var Pm=class{constructor(){this._buffer=""}filePath(){return Lm(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[k0];if(!t)throw new Error(`Unable to find environment variable for $${k0}. Check if your runtime environment supports job summaries.`);try{yield J4(t,lA.constants.R_OK|lA.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath})}wrap(t,n,i={}){let r=Object.entries(i).map(([o,s])=>` ${o}="${s}"`).join("");return n?`<${t}${r}>${n}</${t}>`:`<${t}${r}>`}write(t){return Lm(this,void 0,void 0,function*(){let n=!!t?.overwrite,i=yield this.filePath();return yield(n?H4:Y4)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Lm(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(t,n=!1){return this._buffer+=t,n?this.addEOL():this}addEOL(){return this.addRaw(S0.EOL)}addCodeBlock(t,n){let i=Object.assign({},n&&{lang:n}),r=this.wrap("pre",this.wrap("code",t),i);return this.addRaw(r).addEOL()}addList(t,n=!1){let i=n?"ol":"ul",r=t.map(s=>this.wrap("li",s)).join(""),o=this.wrap(i,r);return this.addRaw(o).addEOL()}addTable(t){let n=t.map(r=>{let o=r.map(s=>{if(typeof s=="string")return this.wrap("td",s);let{header:a,data:A,colspan:c,rowspan:l}=s,d=a?"th":"td",g=Object.assign(Object.assign({},c&&{colspan:c}),l&&{rowspan:l});return this.wrap(d,A,g)}).join("");return this.wrap("tr",o)}).join(""),i=this.wrap("table",n);return this.addRaw(i).addEOL()}addDetails(t,n){let i=this.wrap("details",this.wrap("summary",t)+n);return this.addRaw(i).addEOL()}addImage(t,n,i){let{width:r,height:o}=i||{},s=Object.assign(Object.assign({},r&&{width:r}),o&&{height:o}),a=this.wrap("img",null,Object.assign({src:t,alt:n},s));return this.addRaw(a).addEOL()}addHeading(t,n){let i=`h${n}`,r=["h1","h2","h3","h4","h5","h6"].includes(i)?i:"h1",o=this.wrap(r,t);return this.addRaw(o).addEOL()}addSeparator(){let t=this.wrap("hr",null);return this.addRaw(t).addEOL()}addBreak(){let t=this.wrap("br",null);return this.addRaw(t).addEOL()}addQuote(t,n){let i=Object.assign({},n&&{cite:n}),r=this.wrap("blockquote",t,i);return this.addRaw(r).addEOL()}addLink(t,n){let i=this.wrap("a",t,{href:n});return this.addRaw(i).addEOL()}},O3=new Pm;var Om=lt(require("os"),1);var yl=lt(require("fs"),1);var{chmod:j4,copyFile:q4,lstat:W4,mkdir:Z4,open:V3,readdir:K4,rename:X4,rm:eq,rmdir:J3,stat:tq,symlink:rq,unlink:nq}=yl.promises,iq=process.platform==="win32";var Y3=yl.constants.O_RDONLY;var Z3=process.platform==="win32";var t7=Om.default.platform(),r7=Om.default.arch();var R0;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(R0||(R0={}));function N0(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}var U0=lt(require("path"));var zm=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(zm||{}),lr=u.string().trim().min(1),uq=u.object({url:u.string().optional().describe("the URL probed, if the check is an HTTP request"),command:u.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:u.record(u.string()).optional(),status:u.union([u.number(),u.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:lr.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),lq=u.array(u.object({component:lr.describe("a shared component listed above"),url:lr.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:lr.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),dq=u.object({name:lr.describe("the credential's environment variable name, as listed above; never its value"),component:lr.describe("the component that refused it"),status:u.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:lr.describe("the request or command you tested it with and what came back, never the value")}),S7=u.object({schemaVersion:u.literal(1),baseUrls:u.record(u.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:uq.optional(),teardown:lr.describe("command that tears the SUT down"),dependencies:u.record(u.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:u.nativeEnum(zm).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:u.array(u.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:u.object({command:lr,output:lr}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:u.array(u.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:u.boolean(),startedAt:lr.describe("ISO timestamp"),revisions:lq.optional(),missingSecrets:u.array(u.string().regex(Wg)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:u.array(dq).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:u.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var Ye=u.string().trim().min(1),Cl=Ye,Gm=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(Gm||{}),Vm=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],$0=u.object({schemaVersion:u.literal(1),type:u.nativeEnum(Gm).optional(),repository:Cl.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:u.enum(["ready","blocked"]),environment:mo.optional(),components:u.array(u.object({name:Ye,repository:Ye.describe(`owner/repo, or "${Yr}" for a customer-deployed component no repository builds`),healthy:u.boolean(),url:u.string().min(1).nullable(),...Zg,credentials:u.array(u.string().regex(Br)).max(50).optional(),deployed:Ye.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:u.array(u.object({framework:Ye,file:Ye,result:u.enum(["pass","fail","error"])}).strict()),inputsUsed:u.array(Ye),inputsUsedHow:u.array(u.object({input:Ye,how:Ye}).strict()).optional(),inputsNotUsed:u.array(u.object({input:Ye,reason:Ye}).strict()),blockers:u.array(u.object({component:Ye,problem:Ye,evidence:Ye,fix:Ye}).strict()),replay:u.object({outcome:Ye,durationSeconds:u.number().nonnegative().nullable()}).strict().nullable(),files:u.array(u.object({path:Ye,content:u.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,o)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:u.ZodIssueCode.custom,path:["inputsUsedHow",o,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,o)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:u.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,o)=>{r.components.forEach((s,a)=>{i.has(s)||t.addIssue({code:u.ZodIssueCode.custom,path:["environment","revisionSources",o,"components",a],message:"not one of components"})})}),e.components.forEach((r,o)=>{r.deployed!==void 0!==n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Yr&&!n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"repository"],message:`only a customer_deployed component is ${Yr}`})}),n&&(e.components.forEach((r,o)=>{e.components.findIndex(s=>s.name===r.name)!==o&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:u.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,o)=>{Vm.includes(r.path)&&t.addIssue({code:u.ZodIssueCode.custom,path:["files",o,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(o=>o.components));e.components.forEach((o,s)=>{o.repository!==Yr&&!r.has(o.name)&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",s,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var U7=["clean","recipe-drift"];function Bl(e){let t=U0.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}var Ql=u.object({environmentId:u.string().uuid(),allowed:u.boolean(),revision:u.string().uuid(),updatedAt:u.string().datetime(),updatedBy:u.string().uuid()}).strict();var q0=u.unknown().optional();var dA=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(dA||{}),jm=(o=>(o.Trigger="TRIGGER",o.Baseline="BASELINE",o.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",o.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",o.ManualOverride="MANUAL_OVERRIDE",o))(jm||{}),W0=(s=>(s.PullRequest="pull_request",s.ReadyForReview="ready_for_review",s.Schedule="schedule",s.Manual="manual",s.SutSetup="sut_setup",s.RevisionRead="revision_read",s))(W0||{}),pq=["sut_setup"],hq=["sut_setup","schedule","revision_read"];var Z0=(t=>(t.PullRequest="pull_request",t))(Z0||{}),K0=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(K0||{}),T0=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var X0=(o=>(o.ReportUploaded="report_uploaded",o.NoReport="no_report",o.Cancelled="cancelled",o.RecipeUploaded="recipe_uploaded",o.RevisionsUploaded="revisions_uploaded",o))(X0||{}),e_=(n=>(n.Running="running",n.Ended="ended",n))(e_||{}),t_=(d=>(d.TimedOut="timed_out",d.AgentFailed="agent_failed",d.SetupFailed="setup_failed",d.CredentialMissing="credential_missing",d.RunnerLost="runner_lost",d.CheckoutFailed="checkout_failed",d.EnvironmentUnverified="environment_unverified",d.ModelProviderDenied="model_provider_denied",d.ModelProviderUnavailable="model_provider_unavailable",d.RunnerProviderNotReady="runner_provider_not_ready",d.MergeConflict="merge_conflict",d))(t_||{}),r_=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(r_||{}),qm=(n=>(n.Started="started",n.Finished="finished",n))(qm||{}),n_=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(n_||{});var i_=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(i_||{});var o_=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(o_||{}),Wm=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(Wm||{}),Ym=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(Ym||{});var Zm=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Zm||{}),qt=u.string().regex(/^[1-9][0-9]{0,18}$/),Wt=u.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),Hm=u.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),s_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var Xe=u.string().regex(s_),ot=u.string().regex(/^[0-9a-f]{64}$/),bl=u.object({id:Xe,revision:qt}).strict(),Sl={provider:u.literal("github"),providerAccountId:qt,providerRepositoryId:qt},xl={provider:u.literal("azure-devops"),providerAccountId:Xe,providerRepositoryId:Xe},dr=u.discriminatedUnion("provider",[u.object(Sl).strict(),u.object(xl).strict()]),Y7=u.discriminatedUnion("provider",[u.object(Sl).passthrough(),u.object(xl).passthrough()]),kl=e=>`${e.provider}:${e.providerRepositoryId}`,F0={namespace:u.string().min(1),name:u.string().min(1)},a_=u.discriminatedUnion("provider",[u.object({...Sl,...F0}).strict(),u.object({...xl,...F0}).strict()]),M0=u.object({ref:u.string().min(1),revision:Wt}).strict(),mq=u.object({kind:u.nativeEnum(K0),number:qt.optional(),ref:u.string().min(1),revision:Wt,reason:u.nativeEnum(jm)}).strict(),Iq=u.object({repository:a_,revision:Wt,ref:u.string().nullable(),reason:u.nativeEnum(jm),change:u.object({kind:u.nativeEnum(Z0),number:qt,base:M0.optional()}).strict().nullable(),compareWith:M0.optional(),merge:u.array(mq).min(2).optional()}).strict();function Eq(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[o,s]of t.entries()){if(s.kind==="pull_request"!=(s.number!==void 0))return{path:["merge",o,"number"],message:"a pull request names its number, and a branch none"};if(!T0.includes(s.reason))return{path:["merge",o,"reason"],message:`${s.reason} does not select a merged revision`};if(s.kind==="branch"&&s.reason!=="MANUAL_OVERRIDE")return{path:["merge",o,"reason"],message:"only a person chooses a branch to merge"};if(s.ref===e.ref)return{path:["merge",o,"ref"],message:"the baseline branch is what the source merges onto"};if(s.number!==void 0&&n.has(s.number)||i.has(s.ref))return{path:["merge",o],message:"names a revision the source already merges"};s.number!==void 0&&n.add(s.number),i.add(s.ref)}let r=T0.find(o=>t.some(s=>s.reason===o));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}function yq(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(c=>c!=null).length>1)return"a run compares with one baseline";let o=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return o?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let s=new Set(e.sources.map(c=>kl(c.repository))),a=new Set(r.map(c=>kl(c.repository)));return a.size===r.length&&a.size===s.size&&[...a].every(c=>s.has(c))?null:"names every source of the snapshot, once"}var A_=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,c_=/^[1-9][0-9]{0,18}$/,L0=new RegExp(`${A_.source}|${c_.source}`),P0=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Cq=u.union([u.object({source:u.literal("jira"),site:u.string().regex(P0),key:u.string().regex(A_),updated:u.string().datetime(),contentHash:ot}).strict(),u.object({source:u.literal("confluence"),site:u.string().regex(P0),key:u.string().regex(c_),version:u.number().int().positive(),contentHash:ot}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),contentHash:ot}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),contentHash:ot,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict()]),O0=u.union([u.literal("jira"),u.literal("confluence")]),H7=u.object({schemaVersion:u.literal(1),items:u.array(u.union([u.object({source:O0,site:u.string(),key:u.string().regex(L0),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:O0,site:u.string(),key:u.string().regex(L0),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),state:u.literal("read"),version:ot,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict()])),instructions:u.array(u.string()).optional()}).strict(),Bq=u.object({resultId:u.string().min(1),repository:u.string().min(1),testType:u.string().min(1),path:u.string(),finding:u.string().min(1)}).strict(),Qq=u.object({schemaVersion:u.literal(1),runId:Xe,skyrampOrgId:Xe,target:bl,policy:bl.nullable(),trigger:u.object({kind:u.nativeEnum(W0),requestedAt:u.string().datetime()}).strict(),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:ot}).strict(),baseline:u.object({confirmedRunId:Xe.nullable(),initialBaselineId:Xe.optional(),comparisonBaselineId:Xe.optional(),knownFailures:u.array(Bq).optional(),sources:u.array(u.object({repository:dr,revision:Wt}).strict()).optional()}).strict().optional(),sources:u.array(Iq).min(1).max(1e3),execution:u.object({provider:u.nativeEnum(dA),repository:a_,workflowPath:u.string(),ref:u.string()}).strict(),credentials:u.array(u.object({name:u.string(),purpose:u.nativeEnum(Hg),required:u.boolean()}).strict()),requirements:u.array(Cq).min(1).optional(),instructions:u.object({contentHash:ot}).strict().optional(),deployedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((A,c)=>{let l="fileName"in A?"file":"pasted";A.source==="other"&&A.key!==`${l}-${A.contentHash.slice(0,16)}`&&t.addIssue({code:u.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",c,"key"]});let d=OQ({source:A.source,key:A.key});n.has(d)&&t.addIssue({code:u.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",c,"key"]}),n.add(d)});let i=e.trigger.kind,r=pq.includes(i);r!==(e.policy===null)&&t.addIssue({code:u.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:u.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let o=yq(e);o&&t.addIssue({code:u.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:o}),hq.includes(i)&&e.sources.forEach((A,c)=>{A.reason!=="BASELINE"&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let s=new Set(e.sources.map(A=>kl(A.repository))),a=new Set;(e.deployedRevisions??[]).forEach((A,c)=>{let l=kl(A.repository);s.has(l)?a.has(l)&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"repository appears twice"}):t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"names a repository outside the snapshot"}),a.add(l)}),e.sources.forEach((A,c)=>{A.compareWith&&(A.reason!=="MANUAL_OVERRIDE"||A.change)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(A.change?.base||A.compareWith||A.merge)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let l=Eq(A);l&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,...l.path],message:l.message})})});var u_=(n=>(n.Person="person",n.Policy="policy",n))(u_||{}),vq=u.object({kind:u.nativeEnum(u_),name:u.string().min(1).max(256)}).strict(),wq=u.object({mcp:u.discriminatedUnion("source",[u.object({source:u.literal("npm"),version:u.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),u.object({source:u.literal("github"),ref:u.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:u.object({region:u.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:u.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),j7=u.object({schemaVersion:u.literal(1),attempt:u.object({id:Xe,number:u.number().int().positive(),deadlineAt:u.string().datetime()}).strict(),manifest:Qq,manifestHash:ot,entitlements:u.array(u.string()).optional(),runToken:u.string().min(1).optional(),requestedBy:vq.nullable().optional(),writeAllowed:u.boolean().optional(),claudeCodeVersion:u.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).optional(),statedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).optional(),runSettings:wq.optional()}).strict(),z0={providerRunAttempt:u.number().int().positive(),workflowRef:u.string().min(1)},bq=u.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),q7=u.object({schemaVersion:u.literal(1),runId:Xe,execution:u.discriminatedUnion("provider",[u.object({...z0,provider:u.literal("github"),repository:u.object(Sl).strict(),providerRunId:qt}).strict(),u.object({...z0,provider:u.literal("azure-devops"),repository:u.object(xl).strict(),providerRunId:bq}).strict()]),requester:u.literal(!0).optional(),writeCheck:u.literal(!0).optional(),claudeCodePin:u.literal(!0).optional(),deployedPins:u.literal(!0).optional(),statedPins:u.literal(!0).optional(),runSettings:u.literal(!0).optional()}).strict(),G0=u.object({repository:dr,number:qt,commitSha:Wt.optional()}).strict(),vl=u.array(u.object({repository:dr,reason:u.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),kq=u.object({branch:Hm.optional(),commitSha:Wt.optional()}).strict(),V0=u.object({repository:dr,message:u.string(),...kq.shape}).strict(),Sq=u.discriminatedUnion("status",[u.object({status:u.literal("none"),noTests:vl}).strict(),u.object({status:u.literal("delivered"),noTests:vl,pullRequests:u.array(G0).min(1)}).strict(),u.object({status:u.literal("partial"),noTests:vl,pullRequests:u.array(G0).min(1),failures:u.array(V0).min(1)}).strict(),u.object({status:u.literal("failed"),message:u.string(),noTests:vl,failures:u.array(V0).min(1).optional()}).strict()]),W7=1024*1024,Z7=16*1024*1024,wl=e=>u.array(u.object({[e]:u.string()}).strict()).optional(),xq=u.object({language:u.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:u.string(),validation:u.object({rationale:u.string(),gaps:u.array(u.string())}).strict().optional(),changes:u.array(u.object({id:u.string(),text:u.string()}).strict()).optional(),issuesFound:wl("description"),newTestsCreated:wl("description"),testResults:wl("details"),caveats:wl("text")}).strict(),Dq=u.object({blockedPreflight:u.object({file:u.string().min(1),repository:u.string().min(1).optional(),reason:u.string().min(1).max(300),evidence:u.string().min(1).max(400)}).strict().optional(),sufficiency:u.nativeEnum(tf),rationale:u.string().min(1),gaps:u.array(u.string().min(1)),acceptedEvidence:u.array(u.object({kind:u.nativeEnum(aa),repository:u.string().min(1),revision:Wt,reference:u.string().min(1),summary:u.string().min(1)}).strict()),actionRequired:u.array(u.nativeEnum(rf))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:u.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),Jm=500,Rq=2048,_q=1e3,Nq=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,J0=e=>e.length>0&&e.length<=64&&e===e.trim()&&!Nq.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),l_=e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&J0(n)&&J0(i)},Uq=u.object({testResults:u.array(u.object({resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:u.string().refine(l_,"Invalid"),testType:u.string(),runtimeTargets:uf.optional(),endpoint:u.string(),status:u.enum(["Pass","Fail","Skipped"]),details:u.string(),fileName:u.string().optional(),testId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:u.object({kind:u.nativeEnum(nf),family:u.nativeEnum(of).optional()}).strict().optional(),origin:u.nativeEnum(ef).optional()}).strict()),validation:Dq,changes:u.array(u.object({id:u.string().min(1).max(512),text:u.string().max(16384),source:u.string().max(Rq),testedBy:u.array(u.string().min(1).max(1024)).max(Jm),writtenBy:u.array(u.string().min(1).max(1024)).max(Jm),maintainedBy:u.array(u.string().min(1).max(1024)).max(Jm)}).strict()).max(_q).optional(),traceVersion:u.literal(1),display:xq.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let o of["issuesFound","newTestsCreated","testResults","caveats"]){let s=n?.[o];s&&s.length!==(Array.isArray(i[o])?i[o].length:0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["display",o],message:`has not one row per ${o} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((o,s)=>{let a=o.failureCause;a&&o.status==="Pass"&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),a&&a.kind==="environment"!=(a.family!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let A=["testResults",s,"resultId"],c=o.resultId.slice(`${o.repository}:${o.testType}:`.length);(!o.resultId.startsWith(`${o.repository}:${o.testType}:`)||c===""||c.startsWith("/")||c.startsWith("#"))&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"is not repository:testType:path for this result"}),r.has(o.resultId)&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"stable identity repeated"}),r.add(o.resultId)})});var $q=50,Tq=u.discriminatedUnion("kind",[u.object({kind:u.literal("branch_pushed"),repository:dr,branch:Hm,commit:Wt}).strict(),u.object({kind:u.enum(["pull_request_opened","pull_request_edited"]),repository:dr,number:qt,branch:Hm}).strict()]),Fq=u.object({schemaVersion:u.literal(1),run:u.object({runId:Xe,attemptNumber:u.number().int().positive(),manifestHash:ot}).strict(),target:bl,policy:bl,provenance:u.object({sources:u.array(u.object({repository:dr,revision:Wt}).strict()),firstQualification:u.literal(!0).optional()}).strict(),delivery:u.object({generatedTests:Sq}).strict(),producer:u.object({testbot:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Uq,githubWrites:u.array(Tq).max($q).optional()}).strict(),d_=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(d_||{}),Mq=200,Lq=u.object({cause:u.nativeEnum(d_),credential:u.string().regex(Br).optional(),reason:u.string().trim().min(1).max(Mq).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),Pq=u.object({name:u.string().regex(Br),purpose:u.enum(["sut_access","other"]),required:u.boolean(),how:u.string().trim().min(1).max(qg)}).strict(),K7=Fq.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:$0,check:Lq.optional(),inputs:u.array(Pq).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=(o,s)=>t.addIssue({code:u.ZodIssueCode.custom,path:["recipe",...o],message:s});e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((o,s)=>{Bl(o.path)||n(["files",s,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(o.path)&&n(["files",s,"path"],"file repeated"),i.add(o.path),PQ.test(o.content)&&n(["files",s,"content"],"is not text");let a=Buffer.byteLength(o.content,"utf8");r+=a,a>Kg&&n(["files",s,"content"],`larger than ${Kg} bytes`)}),r>Xg&&n(["files"],`recipe text over ${Xg} bytes in total`)}),X7=u.object({components:u.array(u.object({name:u.string().min(1),repository:u.string().refine(l_,"Invalid"),observedRevision:u.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:u.nativeEnum(sf),evidence:u.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();var eee=u.object({schemaVersion:u.literal(1),stage:u.nativeEnum(r_),event:u.nativeEnum(qm),status:u.nativeEnum(n_).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Dl=100,Oq=5e3,Gi=2e3,Y0=100,g_=/^[A-Za-z0-9_-]{1,64}$/,zq=20,Gq=200,Vq=100,Jq=100,Yq=200,H0="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Hq=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${H0}/${H0})$`),jq=500,qq=50,Wq=10,Zq=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,f_=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Tt=e=>u.string().max(e).refine(t=>t.trim().length>0&&!f_.test(t),"blank, or not text"),Tr={sequence:u.number().int().min(1).max(Oq),at:u.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},p_=u.object({...Tr,kind:u.literal("reply"),to:u.string().uuid(),outcome:u.nativeEnum(o_),accepted:u.boolean(),text:Tt(Gi),note:u.object({source:u.enum(["target","environment"]),quote:Tt(Gi)}).strict().optional(),kept:Tt(Gi).optional()}).strict();function h_(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:u.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}var Kq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),phase:u.nativeEnum(Wm),text:Tt(Gi)}).strict(),u.object({...Tr,kind:u.literal("component"),name:Tt(Y0),repository:Tt(Yq).refine(e=>Hq.test(e)||e===Yr,"not owner/name"),file:Tt(jq).nullable(),status:u.nativeEnum(Zm),version:Tt(Jq).optional()}).strict(),p_,u.object({...Tr,kind:u.literal("question"),id:u.string().regex(g_),type:u.nativeEnum(i_),text:Tt(Gi),component:Tt(Y0).nullable(),choices:u.array(Tt(Gq)).max(zq),placeholder:Tt(Vq).optional()}).strict(),u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Dl)}).strict(),u.object({...Tr,kind:u.literal("credentials"),names:u.array(u.string().regex(Br)).min(1).max(qq),logins:u.array(u.object({key:u.string().regex(Zq),usernameVariable:u.string().regex(Br),passwordVariable:u.string().regex(Br)}).strict()).min(1).max(Wq).optional()}).strict()]).superRefine((e,t)=>{if(h_(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>N0(i.key));new Set(n).size!==n.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let o of["usernameVariable","passwordVariable"])e.names.includes(i[o])||t.addIssue({code:u.ZodIssueCode.custom,path:["logins",r,o],message:"not one of the names"})})}e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),tee=u.object({schemaVersion:u.literal(1),events:u.array(Kq).max(Dl)}).strict(),Xq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),stage:u.nativeEnum(Ym),text:Tt(Gi)}).strict(),p_,u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Dl)}).strict(),u.object({...Tr,kind:u.literal("stage"),stage:u.nativeEnum(Ym),event:u.nativeEnum(qm)}).strict(),u.object({...Tr,kind:u.literal("test"),resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:u.enum(["Pass","Fail","Skipped"]),details:u.string().max(Gi).refine(e=>!f_.test(e),"not text")}).strict()]).superRefine(h_),ree=u.object({schemaVersion:u.literal(1),events:u.array(Xq).max(Dl)}).strict(),j0={id:u.string().uuid(),text:u.string(),by:u.string().nullable(),at:u.string(),replied:u.literal(!0).optional()},m_=u.discriminatedUnion("kind",[u.object({...j0,kind:u.literal("instruction"),question:u.null()}),u.object({...j0,kind:u.literal("answer"),question:u.string().regex(g_)})]),I_=u.string().regex(/^[A-Za-z0-9+/]{43}=$/),eW=u.object({id:u.string().uuid(),revision:u.string(),by:u.string().nullable(),at:u.string(),target:u.string(),own:u.object({source:u.enum(["policy","test_environment"]),text:u.string()}).nullable()}),nee=u.object({schemaVersion:u.literal(1),leftOut:u.array(u.string()),messages:u.array(m_).optional(),stop:u.object({key:I_}).optional(),notes:eW.optional()}),iee=u.object({schemaVersion:u.literal(1),messages:u.array(m_).optional()});var tW=500*1024*1024,E_=u.object({id:qt,name:u.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:qt,expiresAt:u.string().datetime()}).strict(),oee=u.object({schemaVersion:u.literal(1),artifact:E_,sessionId:Xe,contentHash:ot,bytes:u.number().int().min(1).max(tW)}).strict(),see=u.object({schemaVersion:u.literal(1),checkpoint:u.object({artifact:E_,repository:u.object({namespace:u.string().min(1),name:u.string().min(1)}).strict(),sessionId:Xe,contentHash:ot,key:I_}).strict().nullable()}).strict(),rW=200,fs=100,y_=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(y_||{}),nW=u.object({kind:u.nativeEnum(y_),setup:u.object({runId:Xe,endedAt:u.string().nullable(),outcome:u.string().nullable()}).strict(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1),status:u.nativeEnum(Zm)}).strict()).max(fs),credentials:u.array(u.string().min(1)).max(fs),answers:u.array(u.object({question:u.string(),answer:u.string().nullable()}).strict()).max(fs),instructions:u.array(u.object({text:u.string(),reply:u.string().nullable()}).strict()).max(fs),log:u.array(u.object({phase:u.nativeEnum(Wm),text:u.string()}).strict()).max(rW),recipe:u.object({files:u.array(u.object({path:u.string().min(1),content:u.string()}).strict()).max(fs),blockers:u.array(u.object({component:u.string(),problem:u.string(),evidence:u.string(),fix:u.string()}).strict()).max(fs)}).strict().optional()}).strict(),aee=u.object({schemaVersion:u.literal(1),context:nW.nullable()}).strict(),Aee=u.object({schemaVersion:u.literal(1),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:ot}).strict(),capture:u.object({schemaVersion:u.literal(1),settings:u.object({target:u.object({environment:u.unknown()}).passthrough(),timeoutMinutes:u.number().int().positive(),answerWaitMinutes:u.number().int().positive().optional(),testEnvironment:u.object({name:u.string().min(1),address:u.string().min(1).optional(),readyWhen:u.string().min(1).optional(),environmentId:u.string().uuid().optional(),persistentDataPolicy:q0}).passthrough().optional()}).passthrough(),provenance:u.object({}).passthrough(),hash:ot}).strict()}).strict(),cee=u.object({schemaVersion:u.literal(1),environmentId:u.string().uuid().nullable(),environmentAddress:u.string().url().nullable(),persistentDataPolicy:Ql.nullable()}).strict(),iW=mo.extend({environmentId:u.string().uuid().optional(),persistentDataPolicy:q0,version:u.number().int().positive(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1)}).strict()),contentHash:ot.optional(),files:u.array(u.object({path:u.string().refine(e=>Bl(e)&&!Vm.includes(e),"not a file of a customer_deployed plan"),content:u.string()}).strict()).optional()}).strict(),uee=u.object({schemaVersion:u.literal(1),testEnvironment:iW.nullable().optional(),runtimePlan:u.object({version:u.number().int().positive(),contentHash:ot,files:u.array(u.object({path:u.string().refine(Bl,"not a recipe file path"),content:u.string()}).strict()).min(1),repository:Cl.optional(),recipeRepository:Cl.optional(),recipe:u.record(u.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),lee=u.object({schemaVersion:u.literal(1),state:u.nativeEnum(e_),ending:u.nativeEnum(X0).nullable(),cause:u.nativeEnum(t_).nullable(),deadlineAt:u.string().datetime()}).strict();var oW=50,dee=u.object({repository:dr,revisions:u.array(u.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:u.array(u.string().min(1)).min(1).max(oW)}).strict();var aW=".skyramp/sut/deployed-revisions.sh",C_=(n=>(n.Running="running",n.Requested="requested",n))(C_||{});var Bee=new Set(Object.values(C_));var Qee=`Fix ${aW} so it prints the full commit each component runs, then set it up again.`;var qn=lt(require("fs")),jn=lt(require("http")),f8=lt(require("https")),Lg=lt(require("dns")),RT=require("module"),Le=lt(require("net"));var Pg=lt(require("path")),Og=require("stream"),_T=require("stream/promises"),NT=require("timers/promises"),Wn=lt(require("tls"));var Z={};Ir(Z,{$brand:()=>lI,$input:()=>Fy,$output:()=>Ty,INVALID:()=>At,NEVER:()=>uI,TimePrecision:()=>qy,ZodAny:()=>TB,ZodArray:()=>PB,ZodBase64:()=>bg,ZodBase64URL:()=>kg,ZodBigInt:()=>Ks,ZodBigIntFormat:()=>Dg,ZodBoolean:()=>Zs,ZodCIDRv4:()=>vg,ZodCIDRv6:()=>wg,ZodCUID:()=>mg,ZodCUID2:()=>Ig,ZodCatch:()=>aQ,ZodCodec:()=>ac,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,ZodCreditCard:()=>SB,ZodCustom:()=>Ac,ZodCustomStringFormat:()=>so,ZodDate:()=>tc,ZodDefault:()=>tQ,ZodDiscriminatedUnion:()=>zB,ZodE164:()=>Sg,ZodEmail:()=>gg,ZodEmoji:()=>pg,ZodEnum:()=>js,ZodError:()=>kK,ZodExactOptional:()=>Ug,ZodFile:()=>ZB,ZodFirstPartyTypeKind:()=>CQ,ZodFunction:()=>mQ,ZodGUID:()=>fg,ZodIBAN:()=>xB,ZodIPv4:()=>Bg,ZodIPv6:()=>Qg,ZodISODate:()=>Jn,ZodISODateTime:()=>Vn,ZodISODuration:()=>Hn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>yQ,ZodIntersection:()=>GB,ZodIssueCode:()=>DK,ZodJWT:()=>xg,ZodKSUID:()=>Cg,ZodLazy:()=>fQ,ZodLiteral:()=>WB,ZodMAC:()=>kB,ZodMap:()=>jB,ZodNaN:()=>cQ,ZodNanoID:()=>hg,ZodNever:()=>MB,ZodNonOptional:()=>$g,ZodNull:()=>UB,ZodNullable:()=>eQ,ZodNumber:()=>Ws,ZodNumberFormat:()=>ao,ZodObject:()=>nc,ZodOptional:()=>oc,ZodPipe:()=>sc,ZodPrefault:()=>nQ,ZodPreprocess:()=>uQ,ZodPromise:()=>hQ,ZodReadonly:()=>lQ,ZodRealError:()=>vt,ZodRecord:()=>Hs,ZodSet:()=>qB,ZodString:()=>qs,ZodStringFormat:()=>me,ZodSuccess:()=>sQ,ZodSymbol:()=>_B,ZodTemplateLiteral:()=>gQ,ZodTransform:()=>KB,ZodTuple:()=>JB,ZodType:()=>ee,ZodULID:()=>Eg,ZodURL:()=>ec,ZodUUID:()=>Pr,ZodUndefined:()=>NB,ZodUnion:()=>ic,ZodUnknown:()=>FB,ZodVoid:()=>LB,ZodXID:()=>yg,ZodXor:()=>OB,_ZodString:()=>dg,_default:()=>rQ,_function:()=>nT,any:()=>U$,array:()=>rc,base64:()=>f$,base64url:()=>p$,bigint:()=>x$,boolean:()=>RB,catch:()=>AQ,check:()=>iT,cidrv4:()=>d$,cidrv6:()=>g$,clone:()=>ge,codec:()=>X$,coerce:()=>QQ,compile:()=>Oy,config:()=>Re,core:()=>un,creditCard:()=>m$,cuid:()=>i$,cuid2:()=>o$,currencyCode:()=>Q$,custom:()=>oT,date:()=>T$,decode:()=>yB,decodeAsync:()=>BB,deepPartial:()=>IT,describe:()=>sT,discriminatedUnion:()=>z$,e164:()=>h$,email:()=>jU,emoji:()=>r$,encode:()=>EB,encodeAsync:()=>CB,endsWith:()=>Ts,enum:()=>_g,exactOptional:()=>XB,file:()=>q$,flattenError:()=>QA,float32:()=>w$,float64:()=>b$,formatError:()=>vA,fromJSONSchema:()=>hT,function:()=>nT,getDiscriminatedOption:()=>uy,getErrorMap:()=>_K,globalRegistry:()=>je,gt:()=>Mr,gte:()=>Mt,guid:()=>qU,hash:()=>v$,hex:()=>B$,hostname:()=>C$,httpUrl:()=>t$,iban:()=>I$,includes:()=>Us,input:()=>yT,instanceof:()=>AT,int:()=>ug,int32:()=>k$,int64:()=>D$,intersection:()=>VB,invertCodec:()=>eT,ipv4:()=>c$,ipv6:()=>l$,iso:()=>cc,json:()=>uT,jwt:()=>E$,keyof:()=>F$,ksuid:()=>A$,lazy:()=>pQ,length:()=>to,literal:()=>j$,locales:()=>VA,looseObject:()=>P$,looseRecord:()=>V$,lowercase:()=>_s,lt:()=>Fr,lte:()=>Ft,mac:()=>u$,map:()=>J$,maxLength:()=>eo,maxSize:()=>Pn,memoizer:()=>zA,meta:()=>aT,mime:()=>Ms,minLength:()=>cn,minSize:()=>Lr,multipleOf:()=>Ln,nan:()=>K$,nanoid:()=>n$,nativeEnum:()=>H$,negative:()=>Xd,never:()=>Rg,nonnegative:()=>tg,nonoptional:()=>oQ,nonpositive:()=>eg,normalize:()=>Ls,null:()=>$B,nullable:()=>XA,nullish:()=>W$,number:()=>DB,object:()=>M$,optional:()=>io,output:()=>CT,overwrite:()=>pr,parse:()=>pB,parseAsync:()=>hB,partialRecord:()=>G$,pipe:()=>lg,positive:()=>Kd,prefault:()=>iQ,preprocess:()=>lT,prettifyError:()=>hI,promise:()=>rT,properties:()=>Fs,property:()=>rg,readonly:()=>dQ,record:()=>HB,refine:()=>IQ,regex:()=>Rs,regexes:()=>Xt,registry:()=>kd,safeDecode:()=>vB,safeDecodeAsync:()=>bB,safeEncode:()=>QB,safeEncodeAsync:()=>wB,safeParse:()=>mB,safeParseAsync:()=>IB,set:()=>Y$,setErrorMap:()=>RK,size:()=>Xi,slugify:()=>Gs,startsWith:()=>$s,strictObject:()=>L$,string:()=>KA,stringFormat:()=>y$,stringbool:()=>cT,success:()=>Z$,superRefine:()=>EQ,symbol:()=>_$,templateLiteral:()=>tT,toJSONSchema:()=>sg,toLowerCase:()=>Os,toUpperCase:()=>zs,toZod:()=>gA,transform:()=>Ng,treeifyError:()=>pI,trim:()=>Ps,tuple:()=>YB,uint32:()=>S$,uint64:()=>R$,ulid:()=>s$,undefined:()=>N$,union:()=>Xs,unknown:()=>no,uppercase:()=>Ns,url:()=>e$,util:()=>B,uuid:()=>WU,uuidv4:()=>ZU,uuidv6:()=>KU,uuidv7:()=>XU,validate:()=>wA,validateAsync:()=>bA,void:()=>$$,withParser:()=>Sd,xid:()=>a$,xor:()=>O$});var un={};Ir(un,{$ZodAny:()=>ty,$ZodArray:()=>ay,$ZodAsyncError:()=>Bt,$ZodBase64:()=>GE,$ZodBase64URL:()=>VE,$ZodBigInt:()=>gd,$ZodBigIntFormat:()=>ZE,$ZodBoolean:()=>TA,$ZodCIDRv4:()=>OE,$ZodCIDRv6:()=>zE,$ZodCUID:()=>xE,$ZodCUID2:()=>DE,$ZodCatch:()=>by,$ZodCheck:()=>ye,$ZodCheckBigIntFormat:()=>rE,$ZodCheckEndsWith:()=>fE,$ZodCheckGreaterThan:()=>Zl,$ZodCheckIncludes:()=>dE,$ZodCheckLengthEquals:()=>AE,$ZodCheckLessThan:()=>Wl,$ZodCheckLowerCase:()=>uE,$ZodCheckMaxLength:()=>sE,$ZodCheckMaxSize:()=>nE,$ZodCheckMimeType:()=>mE,$ZodCheckMinLength:()=>aE,$ZodCheckMinSize:()=>iE,$ZodCheckMultipleOf:()=>eE,$ZodCheckNumberFormat:()=>tE,$ZodCheckOverwrite:()=>IE,$ZodCheckProperties:()=>hE,$ZodCheckProperty:()=>pE,$ZodCheckRegex:()=>cE,$ZodCheckSizeEquals:()=>oE,$ZodCheckStartsWith:()=>gE,$ZodCheckStringFormat:()=>bs,$ZodCheckUpperCase:()=>lE,$ZodCodec:()=>MA,$ZodCreditCard:()=>YE,$ZodCustom:()=>Ny,$ZodCustomStringFormat:()=>qE,$ZodCyclicError:()=>yd,$ZodDate:()=>oy,$ZodDefault:()=>By,$ZodDiscriminatedUnion:()=>ly,$ZodE164:()=>JE,$ZodEmail:()=>QE,$ZodEmoji:()=>kE,$ZodEncodeError:()=>Fn,$ZodEnum:()=>hy,$ZodError:()=>fI,$ZodExactOptional:()=>yy,$ZodFile:()=>Iy,$ZodFunction:()=>Ry,$ZodGUID:()=>CE,$ZodIBAN:()=>HE,$ZodIPv4:()=>ME,$ZodIPv6:()=>LE,$ZodISODate:()=>$E,$ZodISODateTime:()=>UE,$ZodISODuration:()=>FE,$ZodISOTime:()=>TE,$ZodIntersection:()=>dy,$ZodJWT:()=>jE,$ZodKSUID:()=>NE,$ZodLazy:()=>LA,$ZodLiteral:()=>my,$ZodMAC:()=>PE,$ZodMap:()=>fy,$ZodNaN:()=>ky,$ZodNanoID:()=>SE,$ZodNever:()=>ny,$ZodNonOptional:()=>vy,$ZodNull:()=>ey,$ZodNullable:()=>Cy,$ZodNumber:()=>dd,$ZodNumberFormat:()=>WE,$ZodObject:()=>iN,$ZodObjectJIT:()=>Ay,$ZodOptional:()=>pd,$ZodPipe:()=>hd,$ZodPrefault:()=>Qy,$ZodPreprocess:()=>Sy,$ZodPromise:()=>_y,$ZodReadonly:()=>xy,$ZodRealError:()=>Qt,$ZodRecord:()=>gy,$ZodRegistry:()=>bd,$ZodSet:()=>py,$ZodString:()=>qi,$ZodStringFormat:()=>fe,$ZodSuccess:()=>wy,$ZodSymbol:()=>KE,$ZodTemplateLiteral:()=>Dy,$ZodTransform:()=>Ey,$ZodTuple:()=>fd,$ZodType:()=>W,$ZodULID:()=>RE,$ZodURL:()=>bE,$ZodUUID:()=>BE,$ZodUndefined:()=>XE,$ZodUnion:()=>FA,$ZodUnknown:()=>ry,$ZodVoid:()=>iy,$ZodXID:()=>_E,$ZodXor:()=>cy,$brand:()=>lI,$constructor:()=>I,$input:()=>Fy,$output:()=>Ty,Doc:()=>ji,INVALID:()=>At,JSONSchema:()=>JU,JSONSchemaGenerator:()=>ag,NEVER:()=>uI,TimePrecision:()=>qy,URL_BAD_FORMAT:()=>vE,URL_UNPARSEABLE:()=>RA,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,_any:()=>dC,_array:()=>EC,_base64:()=>jd,_base64url:()=>qd,_bigint:()=>oC,_boolean:()=>nC,_catch:()=>pK,_check:()=>xU,_cidrv4:()=>Yd,_cidrv6:()=>Hd,_coercedBigint:()=>sC,_coercedBoolean:()=>iC,_coercedDate:()=>mC,_coercedNumber:()=>Zy,_coercedString:()=>Jy,_creditCard:()=>Hy,_cuid:()=>Ld,_cuid2:()=>Pd,_custom:()=>CC,_date:()=>hC,_decode:()=>Ll,_decodeAsync:()=>Ol,_default:()=>dK,_discriminatedUnion:()=>eK,_e164:()=>Wd,_email:()=>Rd,_emoji:()=>Fd,_encode:()=>Ml,_encodeAsync:()=>Pl,_endsWith:()=>Ts,_enum:()=>sK,_file:()=>yC,_float32:()=>Xy,_float64:()=>eC,_gt:()=>Mr,_gte:()=>Mt,_guid:()=>_d,_iban:()=>jy,_includes:()=>Us,_int:()=>Ky,_int32:()=>tC,_int64:()=>aC,_intersection:()=>tK,_ipv4:()=>Vd,_ipv6:()=>Jd,_isoDate:()=>HA,_isoDateTime:()=>YA,_isoDuration:()=>qA,_isoTime:()=>jA,_jwt:()=>Zd,_ksuid:()=>Gd,_lazy:()=>EK,_length:()=>to,_literal:()=>AK,_lowercase:()=>_s,_lt:()=>Fr,_lte:()=>Ft,_mac:()=>Yy,_map:()=>iK,_max:()=>Ft,_maxLength:()=>eo,_maxSize:()=>Pn,_mime:()=>Ms,_min:()=>Mt,_minLength:()=>cn,_minSize:()=>Lr,_multipleOf:()=>Ln,_nan:()=>IC,_nanoid:()=>Md,_nativeEnum:()=>aK,_negative:()=>Xd,_never:()=>fC,_nonnegative:()=>tg,_nonoptional:()=>gK,_nonpositive:()=>eg,_normalize:()=>Ls,_null:()=>lC,_nullable:()=>lK,_number:()=>Wy,_optional:()=>uK,_overwrite:()=>pr,_parse:()=>Bs,_parseAsync:()=>Qs,_pipe:()=>hK,_positive:()=>Kd,_promise:()=>yK,_properties:()=>Fs,_property:()=>rg,_readonly:()=>mK,_record:()=>nK,_refine:()=>BC,_regex:()=>Rs,_safeDecode:()=>Gl,_safeDecodeAsync:()=>Jl,_safeEncode:()=>zl,_safeEncodeAsync:()=>Vl,_safeParse:()=>vs,_safeParseAsync:()=>ws,_set:()=>oK,_size:()=>Xi,_slugify:()=>Gs,_startsWith:()=>$s,_string:()=>Vy,_stringFormat:()=>ro,_stringbool:()=>bC,_success:()=>fK,_superRefine:()=>QC,_symbol:()=>cC,_templateLiteral:()=>IK,_toLowerCase:()=>Os,_toUpperCase:()=>zs,_transform:()=>cK,_trim:()=>Ps,_tuple:()=>rK,_uint32:()=>rC,_uint64:()=>AC,_ulid:()=>Od,_undefined:()=>uC,_union:()=>K9,_unknown:()=>gC,_uppercase:()=>Ns,_url:()=>JA,_uuid:()=>Nd,_uuidv4:()=>Ud,_uuidv6:()=>$d,_uuidv7:()=>Td,_void:()=>pC,_xid:()=>zd,_xor:()=>X9,base64Charset:()=>ad,base64urlCharset:()=>$A,canParseURL:()=>wE,clone:()=>ge,compile:()=>Oy,compileFn:()=>xd,config:()=>Re,createStandardJSONSchemaMethod:()=>Vs,createToJSONSchemaMethod:()=>SC,decode:()=>XW,decodeAsync:()=>tZ,describe:()=>vC,encode:()=>KW,encodeAsync:()=>eZ,extractDefs:()=>zn,finalize:()=>Gn,flattenError:()=>QA,formatError:()=>vA,getDiscriminatedOption:()=>uy,globalConfig:()=>ze,globalRegistry:()=>je,handleUnrepresentable:()=>Fe,initializeContext:()=>On,isBackEdge:()=>Bd,isRecursiveSchema:()=>Cd,isValidBase64:()=>UA,isValidBase64URL:()=>Ad,isValidCIDRv6:()=>sd,isValidCreditCard:()=>cd,isValidIBAN:()=>ud,isValidIPv6:()=>NA,isValidJWT:()=>ld,locales:()=>VA,memoizer:()=>zA,mergeValues:()=>ks,meta:()=>wC,parse:()=>Tl,parseAsync:()=>Fl,parseURLObject:()=>tN,prettifyError:()=>hI,process:()=>pe,processSchema:()=>pe,regexes:()=>Xt,registry:()=>kd,safeDecode:()=>nZ,safeDecodeAsync:()=>oZ,safeEncode:()=>rZ,safeEncodeAsync:()=>iZ,safeParse:()=>HW,safeParseAsync:()=>jW,standardProps:()=>rd,stripTabAndNewline:()=>_A,toDotPath:()=>U_,toJSONSchema:()=>sg,toZod:()=>gA,treeifyError:()=>pI,urlHostnameOk:()=>id,urlProtocolOk:()=>od,util:()=>B,validate:()=>wA,validateAsync:()=>bA,validateURL:()=>nd,version:()=>EE,withParser:()=>Sd});var B={};Ir(B,{BIGINT_FORMAT_RANGES:()=>IA,CONSTANT_CATCH:()=>Ul,Class:()=>eI,NUMBER_FORMAT_RANGES:()=>mA,aborted:()=>at,allowsEval:()=>nI,assert:()=>gW,assertEqual:()=>cW,assertIs:()=>lW,assertNever:()=>dW,assertNotEqual:()=>uW,assignProp:()=>He,attachSchema:()=>EA,base64ToUint8Array:()=>S_,base64urlToUint8Array:()=>_W,cached:()=>Is,captureStackTrace:()=>_l,cleanEnum:()=>RW,cleanRegex:()=>an,clone:()=>ge,cloneDef:()=>hW,codePointLength:()=>Yi,constantCatch:()=>AI,createTransparentProxy:()=>BW,defineLazy:()=>tI,defineLazyInternal:()=>re,derived:()=>TW,esc:()=>st,escapeRegex:()=>Kt,explicitlyAborted:()=>sI,extend:()=>wW,finalizeIssue:()=>Ct,floatSafeRemainder:()=>fA,getElementAtPath:()=>mW,getEnumValues:()=>hs,getLengthableOrigin:()=>CA,getParsedType:()=>CW,getSizableOrigin:()=>yA,hexToUint8Array:()=>UW,hide:()=>BA,installLazyProp:()=>PW,isObject:()=>Ji,isPlainObject:()=>Zt,issue:()=>Cs,joinValues:()=>E,jsonStringifyReplacer:()=>ms,members:()=>aI,merge:()=>kW,mergeDefs:()=>gr,normalizeParams:()=>x,nullish:()=>Rl,numKeys:()=>yW,objectClone:()=>fW,omit:()=>vW,optionalKeys:()=>oI,own:()=>Tn,parsedType:()=>v,partial:()=>SW,pick:()=>QW,prefixIssues:()=>yt,primitiveTypes:()=>iI,promiseAllObject:()=>IW,propertyKeyTypes:()=>hA,randomString:()=>EW,rawShape:()=>Es,required:()=>xW,safeExtend:()=>bW,shallowClone:()=>pA,sizeCaps:()=>ys,slugify:()=>rI,stringifyPrimitive:()=>Q,toZod:()=>gA,uint8ArrayToBase64:()=>x_,uint8ArrayToBase64url:()=>NW,uint8ArrayToHex:()=>$W,unwrapMessage:()=>ps});function cW(e){return e}function uW(e){return e}function gA(){return e=>e}function lW(e){}function dW(e){throw new Error("Unexpected value in exhaustive check")}function gW(e){}function hs(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function E(e,t="|"){return e.map(n=>Q(n)).join(t)}function ms(e,t){return typeof t=="bigint"?t.toString():t}var Xm=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Is(e){return new Xm(e)}function Rl(e){return e==null}function an(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function fA(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var v_=Symbol("evaluating");function tI(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==v_)return i===void 0&&(i=v_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function fW(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function He(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Es(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function sn(e){return Es(e._zod.def)??e._zod.def.shape}function w_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return He(this,t,i),i},enumerable:!0,configurable:!0})}function b_(e,t,n){t in e?He(e,t,n):e[t]=n}function Vi(e,t,n,i){let r=sn(t);for(let o of n){let s=Object.getOwnPropertyDescriptor(r,o);s.enumerable&&(s.get?w_(e,o,()=>{let a=t._zod.def.shape[o];return i?i(a,o):a}):b_(e,o,i?i(s.value,o):s.value))}}function pW(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?w_(e,n,()=>t[n]):b_(e,n,i.value))}}function gr(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function hW(e){return gr(e._zod.def)}function mW(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function IW(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function EW(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function st(e){return JSON.stringify(e)}function rI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var _l="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var nI=Is(()=>{if(ze.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Zt(e){if(Ji(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ji(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pA(e){return Zt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function yW(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var CW=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},hA=new Set(["string","number","symbol"]),iI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function BW(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function Q(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function oI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var mA={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},IA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function QW(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Vi(o,e,Nl(e,t)),ge(e,gr(n,{shape:o,checks:[]}))}function Nl(e,t){let n=sn(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function vW(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(Nl(e,t)),s={};return Vi(s,e,Reflect.ownKeys(sn(e)).filter(a=>!o.has(a))),ge(e,gr(n,{shape:s,checks:[]}))}function wW(e,t){if(!Zt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=sn(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ge(e,gr(e._zod.def,{shape:k_(e,t)}))}function k_(e,t){let n={};return Vi(n,e,Reflect.ownKeys(sn(e))),pW(n,t),n}function bW(e,t){if(!Zt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,gr(e._zod.def,{shape:k_(e,t)}))}function kW(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Vi(n,e,Reflect.ownKeys(sn(e))),Vi(n,t,Reflect.ownKeys(sn(t)));let i=gr(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,i)}function SW(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(Nl(t,n)):void 0,A={};return Vi(A,t,Reflect.ownKeys(sn(t)),e&&((c,l)=>a&&!a.has(l)?c:new e({type:"optional",innerType:c}))),ge(t,gr(t._zod.def,{shape:A,checks:[]}))}function xW(e,t,n){let i=n?new Set(Nl(t,n)):void 0,r={};return Vi(r,t,Reflect.ownKeys(sn(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ge(t,gr(t._zod.def,{shape:r}))}function at(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function sI(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function yt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function ps(e){return typeof e=="string"?e:e?.message}function ys(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function EA(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function Ct(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ps(e.inst?._zod.def?.error?.(e))??ps(o?.(e))??ps(t?.error?.(e))??ps(n.customError?.(e))??ps(n.localeError?.(e))??"Invalid input",a={};for(let A of Object.keys(e))A==="inst"||A==="schema"||A==="continue"||A==="input"||A==="__proto__"||(a[A]=e[A]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function yA(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var DW=/[\uD800-\uDBFF]/;function Yi(e){let t=e.length;if(!DW.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function CA(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function v(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Cs(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function RW(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function S_(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function x_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function _W(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return S_(t+n)}function NW(e){return x_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function UW(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function $W(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var eI=class{constructor(...t){}};function aI(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):FW(e,n,i.value)}}function Tn(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function BA(e,t,n){return Tn(e,t,n,!1)}function TW(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Tn(this,n,i(this))},set(r){Tn(this,n,r)}})}return t}function FW(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Tn(this,t,n.bind(this))},set(i){Tn(this,t,i)}})}function MW(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Km,$n=!1,LW={configurable:!0,get(){$n=!0}};function re(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Km!==e._zod){Km=void 0;return}Km=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,LW);let r=$n;$n=!1;try{let o=n(this);return $n?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),$n=$n||r,o}catch(o){throw delete this[t],$n=$n||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function PW(e,t,n,i){let r=MW(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var Ul="~constantCatch";function AI(e){let t=()=>e;return t[Ul]=!0,t}var D_,uI=Object.freeze({status:"aborted"}),cI={value:void 0,enumerable:!1},R_="captureStackTrace"in Error?Error:null;function OW(e){let t=R_;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return R_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function I(e,t,n,i){let r={};function o(g){this.def=g,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function A(g,f){if(g._zod){if(g._zod.traits.has(e))return}else{cI.value=new o(f);try{Object.defineProperty(g,"_zod",cI)}finally{cI.value=void 0}}if(g._zod.traits.add(e),t(g,f),a){let h=Object.getPrototypeOf(g),y=g._zod.constr.prototype,m=h;for(;m&&m!==y;)m=Object.getPrototypeOf(m);let C=m??h;a.has(C)||(a.add(C),aI(C,s))}let p=d.prototype;for(let h in p)Object.prototype.hasOwnProperty.call(p,h)&&(h in g||(g[h]=p[h].bind(g)))}let c=i?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(g){let f=i?.Parent?OW(l):this;A(f,g);let p=f._zod.deferred;if(p){for(let y of p)y();f._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(f),f}return Object.defineProperty(d,"init",{value:A}),Object.defineProperty(d,Symbol.hasInstance,{value:g=>i?.Parent&&g instanceof i.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var lI=Symbol("zod_brand"),Bt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(D_=globalThis).__zod_globalConfig??(D_.__zod_globalConfig={});var ze=globalThis.__zod_globalConfig;function Re(e){return e&&Object.assign(ze,e),ze}function zW(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ms,2)),e.message}function GW(e){this._zod.message=e}var VW={get:zW,set:GW,enumerable:!0,configurable:!0},gI={value:void 0,enumerable:!1},__=new WeakSet([Object.prototype,Error.prototype]),N_=(e,t)=>{e.name="$ZodError",gI.value=t,Object.defineProperty(e,"issues",gI),gI.value=void 0,Object.defineProperty(e,"message",VW);let n=Object.getPrototypeOf(e);__.has(n)||(__.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},fI=I("$ZodError",N_),Qt=I("$ZodError",N_,void 0,{Parent:Error});function JW(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function QA(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?JW(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function vA(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let A=n,c=0;for(;c<a.length;){let l=a[c],d=c===a.length-1;if(l==="_errors"){d&&A._errors.push(t(s)),c++;continue}Object.prototype.hasOwnProperty.call(A,l)||Object.defineProperty(A,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=A[l];d&&g._errors.push(t(s)),A=g,c++}}}};return i(e),n}function pI(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(A=>i({issues:A},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let A=[...o,...a.path];if(A.length===0){n.errors.push(t(a));continue}let c=n,l=0;for(;l<A.length;){let d=A[l],g=l===A.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(s=c.items)[d]??(s[d]={errors:[]}),c=c.items[d]),g&&c.errors.push(t(a)),l++}}};return i(e),n}function U_(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function hI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${U_(i.path)}`);return t.join(`
|
|
46
|
+
${A}`,this.dataLineCount++;return}if(pl(t,r,qj)){Xj(t,o)&&(this.setEventFieldSize("retry",t.length-o),n.retry=t.toString("utf8",o));return}if(pl(t,r,jj)){e4(t,o)&&(this.setEventFieldSize("id",t.length-o),n.id=t.toString("utf8",o));return}pl(t,r,Hj)&&o<t.length&&(this.setEventFieldSize("event",t.length-o),n.event=t.toString("utf8",o))}setEventFieldSize(t,n){let i=this.eventSize-this.eventFieldSizes[t]+n;if(this.maxEventSize>0&&i>this.maxEventSize)throw hl();this.eventSize=i,this.eventFieldSizes[t]=n}processEvent(t){t.retry&&Oj(t.retry)&&(this.state.reconnectionTime=parseInt(t.retry,10)),t.id&&zj(t.id)&&(this.state.lastEventId=t.id),t.data!==void 0&&this.push({type:t.event||"message",options:{data:t.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event.data=void 0,this.event.event=void 0,this.event.id=void 0,this.event.retry=void 0,this.eventSize=0,this.dataLineCount=0,this.eventFieldSizes.data=0,this.eventFieldSizes.event=0,this.eventFieldSizes.id=0,this.eventFieldSizes.retry=0}hasPendingEvent(){return this.event.data!==void 0||this.event.event!==void 0||this.event.id!==void 0||this.event.retry!==void 0}hasCurrentByte(){return this.chunkIndex<this.chunks.length&&this.pos<this.chunks[this.chunkIndex].length}currentByte(){return this.chunks[this.chunkIndex][this.pos]}consumeCurrentByte(){this.advanceCursor(),this.syncLineStartToCursor()}advanceCursor(){for(this.pos++;this.chunkIndex<this.chunks.length&&this.pos>=this.chunks[this.chunkIndex].length;)this.chunkIndex++,this.pos=0}syncLineStartToCursor(){this.lineChunkIndex=this.chunkIndex,this.linePos=this.pos,this.lineLength=0,this.dropConsumedChunks()}dropConsumedChunks(){if(this.lineChunkIndex>0){let t=this.lineChunkIndex;this.chunks.splice(0,t),this.lineChunkIndex=0,this.chunkIndex-=t}this.chunkIndex===this.chunks.length&&(this.chunks.length=0,this.chunkIndex=0,this.pos=0,this.lineChunkIndex=0,this.linePos=0)}readLine(){if(this.lineChunkIndex===this.chunkIndex)return this.chunks[this.chunkIndex].subarray(this.linePos,this.pos);let t=[],n=0;for(let i=this.lineChunkIndex;i<=this.chunkIndex;i++){let r=this.chunks[i],o=i===this.lineChunkIndex?this.linePos:0,s=i===this.chunkIndex?this.pos:r.length,a=r.subarray(o,s);n+=a.length,t.push(a)}return Buffer.concat(t,n)}peekBufferedByte(t){let n=this.lineChunkIndex,i=this.linePos;for(;n<this.chunks.length;){let r=this.chunks[n],o=r.length-i;if(t<o)return r[i+t];t-=o,n++,i=0}}discardLeadingBytes(t){for(;t>0&&this.lineChunkIndex<this.chunks.length;){let i=this.chunks[this.lineChunkIndex].length-this.linePos;t<i?(this.linePos+=t,t=0):(t-=i,this.lineChunkIndex++,this.linePos=0)}this.chunkIndex=this.lineChunkIndex,this.pos=this.linePos,this.dropConsumedChunks()}handleBOM(){let t=this.peekBufferedByte(0),n=this.peekBufferedByte(1),i=this.peekBufferedByte(2);return n===void 0?(t===ls[0]||(this.checkBOM=!1),!0):i===void 0?t===ls[0]&&n===ls[1]?!0:(this.checkBOM=!1,!1):(t===ls[0]&&n===ls[1]&&i===ls[2]&&this.discardLeadingBytes(3),this.checkBOM=!1,!this.hasCurrentByte())}};l0.exports={EventSourceStream:Mm}});var y0=k((k3,E0)=>{"use strict";var{pipeline:t4}=require("node:stream"),{fetching:r4}=Ha(),{makeRequest:n4}=es(),{webidl:on}=Je(),{EventSourceStream:i4}=d0(),{parseMIMEType:o4}=ft(),{createFastMessageEvent:s4}=ss(),{isNetworkError:g0}=Ja(),{delay:a4}=Fm(),{kEnumerableProperty:zi}=ie(),{environmentSettingsObject:f0}=bt(),{getGlobalDispatcher:A4}=za(),p0=!1,h0=3e3,AA=0,m0=1,cA=2,c4="anonymous",u4="use-credentials",ds=class e extends EventTarget{#e={open:null,error:null,message:null};#t=null;#r=!1;#i=AA;#o=null;#n=null;#s;#a;constructor(t,n={}){super(),on.util.markAsUncloneable(this);let i="EventSource constructor";on.argumentLengthCheck(arguments,1,i),p0||(p0=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),t=on.converters.USVString(t,i,"url"),n=on.converters.EventSourceInitDict(n,i,"eventSourceInitDict"),this.#s=n.dispatcher,this.#a={lastEventId:"",reconnectionTime:h0};let r=f0,o;try{o=new URL(t,r.settingsObject.baseUrl),this.#a.origin=o.origin}catch(A){throw new DOMException(A,"SyntaxError")}this.#t=o.href;let s=c4;n.withCredentials&&(s=u4,this.#r=!0);let a={redirect:"follow",keepalive:!0,mode:"cors",credentials:s==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};a.client=f0.settingsObject,a.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],a.cache="no-store",a.initiator="other",a.urlList=[new URL(this.#t)],this.#o=n4(a),this.#c()}get readyState(){return this.#i}get url(){return this.#t}get withCredentials(){return this.#r}#c(){if(this.#i===cA)return;this.#i=AA;let t={request:this.#o,dispatcher:this.#s},n=i=>{g0(i)&&(this.dispatchEvent(new Event("error")),this.close()),this.#A()};t.processResponseEndOfBody=n,t.processResponse=i=>{if(g0(i))if(i.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#A();return}let r=i.headersList.get("content-type",!0),o=r!==null?o4(r):"failure",s=o!=="failure"&&o.essence==="text/event-stream";if(i.status!==200||s===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#i=m0,this.dispatchEvent(new Event("open")),this.#a.origin=i.urlList[i.urlList.length-1].origin;let a=new i4({eventSourceSettings:this.#a,maxEventSize:this.#s.eventSourceOptions?.maxEventSize,push:A=>{this.dispatchEvent(s4(A.type,A.options))}});t4(i.body.stream,a,A=>{A?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#n=r4(t)}async#A(){this.#i!==cA&&(this.#i=AA,this.dispatchEvent(new Event("error")),await a4(this.#a.reconnectionTime),this.#i===AA&&(this.#a.lastEventId.length&&this.#o.headersList.set("last-event-id",this.#a.lastEventId,!0),this.#c()))}close(){on.brandCheck(this,e),this.#i!==cA&&(this.#i=cA,this.#n.abort(),this.#o=null)}get onopen(){return this.#e.open}set onopen(t){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(t){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(t){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}},I0={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:AA,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:m0,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:cA,writable:!1}};Object.defineProperties(ds,I0);Object.defineProperties(ds.prototype,I0);Object.defineProperties(ds.prototype,{close:zi,onerror:zi,onmessage:zi,onopen:zi,readyState:zi,url:zi,withCredentials:zi});on.converters.EventSourceInitDict=on.dictionaryConverter([{key:"withCredentials",converter:on.converters.boolean,defaultValue:()=>!1},{key:"dispatcher",converter:on.converters.any,defaultValue:()=>A4()}]);E0.exports={EventSource:ds,defaultReconnectionTime:h0}});var v0=k((S3,H)=>{"use strict";var l4=Po(),C0=ua(),d4=Oo(),g4=Ck(),f4=zo(),p4=oh(),h4=Jk(),m4=Kk(),B0=ue(),Il=ie(),{InvalidArgumentError:ml}=B0,gs=MS(),I4=da(),E4=Ph(),y4=yx(),C4=Gh(),B4=kh(),Q4=Eu(),{getGlobalDispatcher:Q0,setGlobalDispatcher:v4}=za(),w4=xu(),b4=Au(),k4=cu();Object.assign(C0.prototype,gs);H.exports.Dispatcher=C0;H.exports.Client=l4;H.exports.Pool=d4;H.exports.BalancedPool=g4;H.exports.Agent=f4;H.exports.ProxyAgent=p4;H.exports.EnvHttpProxyAgent=h4;H.exports.RetryAgent=m4;H.exports.RetryHandler=Q4;H.exports.DecoratorHandler=w4;H.exports.RedirectHandler=b4;H.exports.createRedirectInterceptor=k4;H.exports.interceptors={redirect:kx(),retry:xx(),dump:Rx(),dns:Ux()};H.exports.buildConnector=I4;H.exports.errors=B0;H.exports.util={parseHeaders:Il.parseHeaders,headerNameToString:Il.headerNameToString};function uA(e){return(t,n,i)=>{if(typeof n=="function"&&(i=n,n=null),!t||typeof t!="string"&&typeof t!="object"&&!(t instanceof URL))throw new ml("invalid url");if(n!=null&&typeof n!="object")throw new ml("invalid opts");if(n&&n.path!=null){if(typeof n.path!="string")throw new ml("invalid opts.path");let s=n.path;n.path.startsWith("/")||(s=`/${s}`),t=new URL(Il.parseOrigin(t).origin+s)}else n||(n=typeof t=="object"?t:{}),t=Il.parseURL(t);let{agent:r,dispatcher:o=Q0()}=n;if(r)throw new ml("unsupported opts.agent. Did you mean opts.client?");return e.call(o,{...n,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?"PUT":"GET")},i)}}H.exports.setGlobalDispatcher=v4;H.exports.getGlobalDispatcher=Q0;var S4=Ha().fetch;H.exports.fetch=async function(t,n=void 0){try{return await S4(t,n)}catch(i){throw i&&typeof i=="object"&&Error.captureStackTrace(i),i}};H.exports.Headers=$i().Headers;H.exports.Response=Ja().Response;H.exports.Request=es().Request;H.exports.FormData=Ea().FormData;H.exports.File=globalThis.File??require("node:buffer").File;H.exports.FileReader=WD().FileReader;var{setGlobalOrigin:x4,getGlobalOrigin:D4}=ip();H.exports.setGlobalOrigin=x4;H.exports.getGlobalOrigin=D4;var{CacheStorage:R4}=oR(),{kConstruct:_4}=Wu();H.exports.caches=new R4(_4);var{deleteCookie:N4,getCookies:U4,getSetCookies:$4,setCookie:T4}=hR();H.exports.deleteCookie=N4;H.exports.getCookies=U4;H.exports.getSetCookies=$4;H.exports.setCookie=T4;var{parseMIMEType:F4,serializeAMimeType:M4}=ft();H.exports.parseMIMEType=F4;H.exports.serializeAMimeType=M4;var{CloseEvent:L4,ErrorEvent:P4,MessageEvent:O4}=ss();H.exports.WebSocket=c0().WebSocket;H.exports.CloseEvent=L4;H.exports.ErrorEvent=P4;H.exports.MessageEvent=O4;H.exports.request=uA(gs.request);H.exports.stream=uA(gs.stream);H.exports.pipeline=uA(gs.pipeline);H.exports.connect=uA(gs.connect);H.exports.upgrade=uA(gs.upgrade);H.exports.MockClient=E4;H.exports.MockPool=C4;H.exports.MockAgent=y4;H.exports.mockErrors=B4;var{EventSource:z4}=y0();H.exports.EventSource=z4});var ln=lt(require("fs")),dc=lt(require("path")),$T=require("crypto");var u={};Ir(u,{BRAND:()=>gF,DIRTY:()=>Xn,EMPTY_PATH:()=>JT,INVALID:()=>V,NEVER:()=>ZF,OK:()=>We,ParseStatus:()=>Ge,Schema:()=>ne,ZodAny:()=>pn,ZodArray:()=>Jr,ZodBigInt:()=>ti,ZodBoolean:()=>ri,ZodBranded:()=>na,ZodCatch:()=>gi,ZodDate:()=>ni,ZodDefault:()=>di,ZodDiscriminatedUnion:()=>mc,ZodEffects:()=>Gt,ZodEnum:()=>ui,ZodError:()=>dt,ZodFirstPartyTypeKind:()=>Y,ZodFunction:()=>Ec,ZodIntersection:()=>ai,ZodIssueCode:()=>S,ZodLazy:()=>Ai,ZodLiteral:()=>ci,ZodMap:()=>fo,ZodNaN:()=>ho,ZodNativeEnum:()=>li,ZodNever:()=>tr,ZodNull:()=>oi,ZodNullable:()=>Cr,ZodNumber:()=>ei,ZodObject:()=>gt,ZodOptional:()=>Ot,ZodParsedType:()=>U,ZodPipeline:()=>ia,ZodPromise:()=>hn,ZodReadonly:()=>fi,ZodRecord:()=>Ic,ZodSchema:()=>ne,ZodSet:()=>po,ZodString:()=>fn,ZodSymbol:()=>lo,ZodTransformer:()=>Gt,ZodTuple:()=>yr,ZodType:()=>ne,ZodUndefined:()=>ii,ZodUnion:()=>si,ZodUnknown:()=>Vr,ZodVoid:()=>go,addIssueToContext:()=>_,any:()=>BF,array:()=>bF,bigint:()=>mF,boolean:()=>LQ,coerce:()=>WF,custom:()=>TQ,date:()=>IF,datetimeRegex:()=>UQ,defaultErrorMap:()=>zr,discriminatedUnion:()=>DF,effect:()=>zF,enum:()=>LF,function:()=>TF,getErrorMap:()=>Ao,getParsedType:()=>Er,instanceof:()=>pF,intersection:()=>RF,isAborted:()=>pc,isAsync:()=>co,isDirty:()=>hc,isValid:()=>gn,late:()=>fF,lazy:()=>FF,literal:()=>MF,makeIssue:()=>ra,map:()=>UF,nan:()=>hF,nativeEnum:()=>PF,never:()=>vF,null:()=>CF,nullable:()=>VF,number:()=>MQ,object:()=>kF,objectUtil:()=>Vg,oboolean:()=>qF,onumber:()=>jF,optional:()=>GF,ostring:()=>HF,pipeline:()=>YF,preprocess:()=>JF,promise:()=>OF,quotelessJson:()=>zT,record:()=>NF,set:()=>$F,setErrorMap:()=>VT,strictObject:()=>SF,string:()=>FQ,symbol:()=>EF,transformer:()=>zF,tuple:()=>_F,undefined:()=>yF,union:()=>xF,unknown:()=>QF,util:()=>se,void:()=>wF});var se;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let o={};for(let s of r)o[s]=s;return o},e.getValidEnumValues=r=>{let o=e.objectKeys(r).filter(a=>typeof r[r[a]]!="number"),s={};for(let a of o)s[a]=r[a];return e.objectValues(s)},e.objectValues=r=>e.objectKeys(r).map(function(o){return r[o]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let o=[];for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&o.push(s);return o},e.find=(r,o)=>{for(let s of r)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,o=" | "){return r.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=i,e.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(se||(se={}));var Vg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Vg||(Vg={}));var U=se.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Er=e=>{switch(typeof e){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(e)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(e)?U.array:e===null?U.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?U.promise:typeof Map<"u"&&e instanceof Map?U.map:typeof Set<"u"&&e instanceof Set?U.set:typeof Date<"u"&&e instanceof Date?U.date:U.object;default:return U.unknown}};var S=se.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"]),zT=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),dt=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(o){return o.message},i={_errors:[]},r=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)i._errors.push(n(s));else{let a=i,A=0;for(;A<s.path.length;){let c=s.path[A],l=A===s.path.length-1;if(c==="_errors"){l&&a._errors.push(n(s)),A++;continue}Object.prototype.hasOwnProperty.call(a,c)||(c==="__proto__"?Object.defineProperty(a,c,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):a[c]={_errors:[]}),a=a[c],l&&a._errors.push(n(s)),A++}}};return r(this),i}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,se.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];n[o]=n[o]||[],n[o].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};dt.create=e=>new dt(e);var GT=(e,t)=>{let n;switch(e.code){case S.invalid_type:e.received===U.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case S.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,se.jsonStringifyReplacer)}`;break;case S.unrecognized_keys:n=`Unrecognized key(s) in object: ${se.joinValues(e.keys,", ")}`;break;case S.invalid_union:n="Invalid input";break;case S.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${se.joinValues(e.options)}`;break;case S.invalid_enum_value:n=`Invalid enum value. Expected ${se.joinValues(e.options)}, received '${e.received}'`;break;case S.invalid_arguments:n="Invalid function arguments";break;case S.invalid_return_type:n="Invalid function return type";break;case S.invalid_date:n="Invalid date";break;case S.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:se.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case S.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case S.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case S.custom:n="Invalid input";break;case S.invalid_intersection_types:n="Intersection results could not be merged";break;case S.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case S.not_finite:n="Number must be finite";break;default:n=t.defaultError,se.assertNever(e)}return{message:n}},zr=GT;var xQ=zr;function VT(e){xQ=e}function Ao(){return xQ}var ra=e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,o=[...n,...r.path||[]],s={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let a="",A=i.filter(c=>!!c).slice().reverse();for(let c of A)a=c(s,{data:t,defaultError:a}).message;return{...r,path:o,message:a}},JT=[];function _(e,t){let n=Ao(),i=ra({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===zr?void 0:zr].filter(r=>!!r)});e.common.issues.push(i)}var Ge=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return V;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let o=await r.key,s=await r.value;i.push({key:o,value:s})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:o,value:s}=r;if(o.status==="aborted"||s.status==="aborted")return V;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet)&&(i[o.value]=s.value)}return{status:t.value,value:i}}},V=Object.freeze({status:"aborted"}),Xn=e=>({status:"dirty",value:e}),We=e=>({status:"valid",value:e}),pc=e=>e.status==="aborted",hc=e=>e.status==="dirty",gn=e=>e.status==="valid",co=e=>typeof Promise<"u"&&e instanceof Promise;var $;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})($||($={}));var zt=class{constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}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}},DQ=(e,t)=>{if(gn(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 n=new dt(e.common.issues);return this._error=n,this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(s,a)=>{let{message:A}=e;return s.code==="invalid_enum_value"?{message:A??a.defaultError}:typeof a.data>"u"?{message:A??i??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:A??n??a.defaultError}},description:r}}var ne=class{get description(){return this._def.description}_getType(t){return Er(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ge,ctx:{common:t.parent.common,data:t.data,parsedType:Er(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(co(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},r=this._parseSync({data:t,path:i.path,parent:i});return DQ(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return gn(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>gn(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Er(t)},r=this._parse({data:t,path:i.path,parent:i}),o=await(co(r)?r:Promise.resolve(r));return DQ(i,o)}refine(t,n){let i=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,o)=>{let s=t(r),a=()=>o.addIssue({code:S.custom,...i(r)});return typeof Promise<"u"&&s instanceof Promise?s.then(A=>A?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Gt({schema:this,typeName:Y.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:n=>this["~validate"](n)}}optional(){return Ot.create(this,this._def)}nullable(){return Cr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jr.create(this)}promise(){return hn.create(this,this._def)}or(t){return si.create([this,t],this._def)}and(t){return ai.create(this,t,this._def)}transform(t){return new Gt({...X(this._def),schema:this,typeName:Y.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new di({...X(this._def),innerType:this,defaultValue:n,typeName:Y.ZodDefault})}brand(){return new na({typeName:Y.ZodBranded,type:this,...X(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new gi({...X(this._def),innerType:this,catchValue:n,typeName:Y.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ia.create(this,t)}readonly(){return fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},YT=/^c[^\s-]{8,}$/i,HT=/^[0-9a-z]+$/,jT=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qT=/^[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,WT=/^[a-z0-9_-]{21}$/i,ZT=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,KT=/^[-+]?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)?)??$/,XT=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eF="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Jg,tF=/^(?:(?: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])$/,rF=/^(?:(?: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])$/,nF=/^(([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]))$/,iF=/^(([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])$/,oF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_Q="((\\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])))",aF=new RegExp(`^${_Q}$`);function NQ(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function AF(e){return new RegExp(`^${NQ(e)}$`)}function UQ(e){let t=`${_Q}T${NQ(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function cF(e,t){return!!((t==="v4"||!t)&&tF.test(e)||(t==="v6"||!t)&&nF.test(e))}function uF(e,t){if(!ZT.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function lF(e,t){return!!((t==="v4"||!t)&&rF.test(e)||(t==="v6"||!t)&&iF.test(e))}var fn=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==U.string){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.string,received:o.parsedType}),V}let i=new Ge,r;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="max")t.data.length>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),i.dirty());else if(o.kind==="length"){let s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(r=this._getOrReturnCtx(t,r),s?_(r,{code:S.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&_(r,{code:S.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),i.dirty())}else if(o.kind==="email")XT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"email",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="emoji")Jg||(Jg=new RegExp(eF,"u")),Jg.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"emoji",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="uuid")qT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"uuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="nanoid")WT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"nanoid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid")YT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="cuid2")HT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cuid2",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="ulid")jT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ulid",code:S.invalid_string,message:o.message}),i.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),_(r,{validation:"url",code:S.invalid_string,message:o.message}),i.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"regex",code:S.invalid_string,message:o.message}),i.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),i.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)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{startsWith:o.value},message:o.message}),i.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:{endsWith:o.value},message:o.message}),i.dirty()):o.kind==="datetime"?UQ(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"datetime",message:o.message}),i.dirty()):o.kind==="date"?aF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"date",message:o.message}),i.dirty()):o.kind==="time"?AF(o).test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{code:S.invalid_string,validation:"time",message:o.message}),i.dirty()):o.kind==="duration"?KT.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"duration",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="ip"?cF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"ip",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="jwt"?uF(t.data,o.alg)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"jwt",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="cidr"?lF(t.data,o.version)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"cidr",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64"?oF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64",code:S.invalid_string,message:o.message}),i.dirty()):o.kind==="base64url"?sF.test(t.data)||(r=this._getOrReturnCtx(t,r),_(r,{validation:"base64url",code:S.invalid_string,message:o.message}),i.dirty()):se.assertNever(o);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:S.invalid_string,...$.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...$.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...$.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...$.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,...$.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,...$.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...$.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...$.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...$.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...$.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...$.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...$.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...$.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...$.errToObj(n)})}nonempty(t){return this.min(1,$.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};fn.create=e=>new fn({checks:[],typeName:Y.ZodString,coerce:e?.coerce??!1,...X(e)});function dF(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,o=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return o%s/10**r}var ei=class e extends ne{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)!==U.number){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.number,received:o.parsedType}),V}let i,r=new Ge;for(let o of this._def.checks)o.kind==="int"?se.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?dF(t.data,o.value)!==0&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_finite,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:$.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&se.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ei.create=e=>new ei({checks:[],typeName:Y.ZodNumber,coerce:e?.coerce||!1,...X(e)});var ti=class e extends ne{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)!==U.bigint)return this._getInvalidInput(t);let i,r=new Ge;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),_(i,{code:S.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):se.assertNever(o);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.bigint,received:n.parsedType}),V}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:$.toString(r)}]})}_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:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ti.create=e=>new ti({checks:[],typeName:Y.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var ri=class extends ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==U.boolean){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.boolean,received:i.parsedType}),V}return We(t.data)}};ri.create=e=>new ri({typeName:Y.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var ni=class e extends ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==U.date){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_type,expected:U.date,received:o.parsedType}),V}if(Number.isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return _(o,{code:S.invalid_date}),V}let i=new Ge,r;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),i.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(r=this._getOrReturnCtx(t,r),_(r,{code:S.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),i.dirty()):se.assertNever(o);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:$.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:$.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ni.create=e=>new ni({checks:[],coerce:e?.coerce||!1,typeName:Y.ZodDate,...X(e)});var lo=class extends ne{_parse(t){if(this._getType(t)!==U.symbol){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.symbol,received:i.parsedType}),V}return We(t.data)}};lo.create=e=>new lo({typeName:Y.ZodSymbol,...X(e)});var ii=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.undefined,received:i.parsedType}),V}return We(t.data)}};ii.create=e=>new ii({typeName:Y.ZodUndefined,...X(e)});var oi=class extends ne{_parse(t){if(this._getType(t)!==U.null){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.null,received:i.parsedType}),V}return We(t.data)}};oi.create=e=>new oi({typeName:Y.ZodNull,...X(e)});var pn=class extends ne{constructor(){super(...arguments),this._any=!0}_parse(t){return We(t.data)}};pn.create=e=>new pn({typeName:Y.ZodAny,...X(e)});var Vr=class extends ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return We(t.data)}};Vr.create=e=>new Vr({typeName:Y.ZodUnknown,...X(e)});var tr=class extends ne{_parse(t){let n=this._getOrReturnCtx(t);return _(n,{code:S.invalid_type,expected:U.never,received:n.parsedType}),V}};tr.create=e=>new tr({typeName:Y.ZodNever,...X(e)});var go=class extends ne{_parse(t){if(this._getType(t)!==U.undefined){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.void,received:i.parsedType}),V}return We(t.data)}};go.create=e=>new go({typeName:Y.ZodVoid,...X(e)});var Jr=class e extends ne{_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==U.array)return _(n,{code:S.invalid_type,expected:U.array,received:n.parsedType}),V;if(r.exactLength!==null){let s=n.data.length>r.exactLength.value,a=n.data.length<r.exactLength.value;(s||a)&&(_(n,{code:s?S.too_big:S.too_small,minimum:a?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(_(n,{code:S.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(_(n,{code:S.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>r.type._parseAsync(new zt(n,s,n.path,a)))).then(s=>Ge.mergeArray(i,s));let o=[...n.data].map((s,a)=>r.type._parseSync(new zt(n,s,n.path,a)));return Ge.mergeArray(i,o)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(t){return this.min(1,t)}};Jr.create=(e,t)=>new Jr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Y.ZodArray,...X(t)});function uo(e){if(e instanceof gt){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Ot.create(uo(i))}return new gt({...e._def,shape:()=>t})}else return e instanceof Jr?new Jr({...e._def,type:uo(e.element)}):e instanceof Ot?Ot.create(uo(e.unwrap())):e instanceof Cr?Cr.create(uo(e.unwrap())):e instanceof yr?yr.create(e.items.map(t=>uo(t))):e}var gt=class e extends ne{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(),n=se.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==U.object){let c=this._getOrReturnCtx(t);return _(c,{code:S.invalid_type,expected:U.object,received:c.parsedType}),V}let{status:i,ctx:r}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof tr&&this._def.unknownKeys==="strip"))for(let c in r.data)s.includes(c)||a.push(c);let A=[];for(let c of s){let l=o[c],d=r.data[c];A.push({key:{status:"valid",value:c},value:l._parse(new zt(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof tr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)A.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict")a.length>0&&(_(r,{code:S.unrecognized_keys,keys:a}),i.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let d=r.data[l];A.push({key:{status:"valid",value:l},value:c._parse(new zt(r,d,r.path,l)),alwaysSet:l in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of A){let d=await l.key,g=await l.value;c.push({key:d,value:g,alwaysSet:l.alwaysSet})}return c}).then(c=>Ge.mergeObjectSync(i,c)):Ge.mergeObjectSync(i,A)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:$.errToObj(t).message??r}:{message:r}}}:{}})}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:Y.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of se.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let i of se.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:()=>n})}deepPartial(){return uo(this)}partial(t){let n={};for(let i of se.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let i of se.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let o=this.shape[i];for(;o instanceof Ot;)o=o._def.innerType;n[i]=o}return new e({...this._def,shape:()=>n})}keyof(){return $Q(se.objectKeys(this.shape))}};gt.create=(e,t)=>new gt({shape:()=>e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...X(t)});gt.strictCreate=(e,t)=>new gt({shape:()=>e,unknownKeys:"strict",catchall:tr.create(),typeName:Y.ZodObject,...X(t)});gt.lazycreate=(e,t)=>new gt({shape:e,unknownKeys:"strip",catchall:tr.create(),typeName:Y.ZodObject,...X(t)});var si=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(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 n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new dt(a.ctx.common.issues));return _(n,{code:S.invalid_union,unionErrors:s}),V}if(n.common.async)return Promise.all(i.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(r);{let o,s=[];for(let A of i){let c={...n,common:{...n.common,issues:[]},parent:null},l=A._parseSync({data:n.data,path:n.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(A=>new dt(A));return _(n,{code:S.invalid_union,unionErrors:a}),V}}get options(){return this._def.options}};si.create=(e,t)=>new si({options:e,typeName:Y.ZodUnion,...X(t)});var Gr=e=>e instanceof Ai?Gr(e.schema):e instanceof Gt?Gr(e.innerType()):e instanceof ci?[e.value]:e instanceof ui?e.options:e instanceof li?se.objectValues(e.enum):e instanceof di?Gr(e._def.innerType):e instanceof ii?[void 0]:e instanceof oi?[null]:e instanceof Ot?[void 0,...Gr(e.unwrap())]:e instanceof Cr?[null,...Gr(e.unwrap())]:e instanceof na||e instanceof fi?Gr(e.unwrap()):e instanceof gi?Gr(e._def.innerType):[],mc=class e extends ne{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.object)return _(n,{code:S.invalid_type,expected:U.object,received:n.parsedType}),V;let i=this.discriminator,r=n.data[i],o=this.optionsMap.get(r);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(_(n,{code:S.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),V)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let o of n){let s=Gr(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(r.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);r.set(a,o)}}return new e({typeName:Y.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...X(i)})}};function Yg(e,t){let n=Er(e),i=Er(t);if(e===t)return{valid:!0,data:e};if(n===U.object&&i===U.object){let r=se.objectKeys(t),o=se.objectKeys(e).filter(a=>r.indexOf(a)!==-1),s={...e,...t};Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__;for(let a of o){if(a==="__proto__")continue;let A=Yg(e[a],t[a]);if(!A.valid)return{valid:!1};s[a]=A.data}return{valid:!0,data:s}}else if(n===U.array&&i===U.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let o=0;o<e.length;o++){let s=e[o],a=t[o],A=Yg(s,a);if(!A.valid)return{valid:!1};r.push(A.data)}return{valid:!0,data:r}}else return n===U.date&&i===U.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ai=class extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=(o,s)=>{if(pc(o)||pc(s))return V;let a=Yg(o.value,s.value);return a.valid?((hc(o)||hc(s))&&n.dirty(),{status:n.value,value:a.data}):(_(i,{code:S.invalid_intersection_types}),V)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([o,s])=>r(o,s)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ai.create=(e,t,n)=>new ai({left:e,right:t,typeName:Y.ZodIntersection,...X(n)});var yr=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.array)return _(i,{code:S.invalid_type,expected:U.array,received:i.parsedType}),V;if(i.data.length<this._def.items.length)return _(i,{code:S.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&i.data.length>this._def.items.length&&(_(i,{code:S.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...i.data].map((s,a)=>{let A=this._def.items[a]||this._def.rest;return A?A._parse(new zt(i,s,i.path,a)):null}).filter(s=>!!s);return i.common.async?Promise.all(o).then(s=>Ge.mergeArray(n,s)):Ge.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};yr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new yr({items:e,typeName:Y.ZodTuple,rest:null,...X(t)})};var Ic=class e extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.object)return _(i,{code:S.invalid_type,expected:U.object,received:i.parsedType}),V;let r=[],o=this._def.keyType,s=this._def.valueType;for(let a in i.data)r.push({key:o._parse(new zt(i,a,i.path,a)),value:s._parse(new zt(i,i.data[a],i.path,a)),alwaysSet:a in i.data});return i.common.async?Ge.mergeObjectAsync(n,r):Ge.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof ne?new e({keyType:t,valueType:n,typeName:Y.ZodRecord,...X(i)}):new e({keyType:fn.create(),valueType:t,typeName:Y.ZodRecord,...X(n)})}},fo=class extends ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.map)return _(i,{code:S.invalid_type,expected:U.map,received:i.parsedType}),V;let r=this._def.keyType,o=this._def.valueType,s=[...i.data.entries()].map(([a,A],c)=>({key:r._parse(new zt(i,a,i.path,[c,"key"])),value:o._parse(new zt(i,A,i.path,[c,"value"]))}));if(i.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let A of s){let c=await A.key,l=await A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let A of s){let c=A.key,l=A.value;if(c.status==="aborted"||l.status==="aborted")return V;(c.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(c.value,l.value)}return{status:n.value,value:a}}}};fo.create=(e,t,n)=>new fo({valueType:t,keyType:e,typeName:Y.ZodMap,...X(n)});var po=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==U.set)return _(i,{code:S.invalid_type,expected:U.set,received:i.parsedType}),V;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(_(i,{code:S.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(_(i,{code:S.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let o=this._def.valueType;function s(A){let c=new Set;for(let l of A){if(l.status==="aborted")return V;l.status==="dirty"&&n.dirty(),c.add(l.value)}return{status:n.value,value:c}}let a=[...i.data.values()].map((A,c)=>o._parse(new zt(i,A,i.path,c)));return i.common.async?Promise.all(a).then(A=>s(A)):s(a)}min(t,n){return new e({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};po.create=(e,t)=>new po({valueType:e,minSize:null,maxSize:null,typeName:Y.ZodSet,...X(t)});var Ec=class e extends ne{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.function)return _(n,{code:S.invalid_type,expected:U.function,received:n.parsedType}),V;function i(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_arguments,argumentsError:A}})}function r(a,A){return ra({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ao(),zr].filter(c=>!!c),issueData:{code:S.invalid_return_type,returnTypeError:A}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof hn){let a=this;return We(async function(...A){let c=new dt([]),l=await a._def.args.parseAsync(A,o).catch(f=>{throw c.addIssue(i(A,f)),c}),d=await Reflect.apply(s,this,l);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw c.addIssue(r(d,f)),c})})}else{let a=this;return We(function(...A){let c=a._def.args.safeParse(A,o);if(!c.success)throw new dt([i(A,c.error)]);let l=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(l,o);if(!d.success)throw new dt([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:yr.create(t).rest(Vr.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,n,i){return new e({args:t||yr.create([]).rest(Vr.create()),returns:n||Vr.create(),typeName:Y.ZodFunction,...X(i)})}},Ai=class extends ne{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ai.create=(e,t)=>new Ai({getter:e,typeName:Y.ZodLazy,...X(t)});var ci=class extends ne{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return _(n,{received:n.data,code:S.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:t.data}}get value(){return this._def.value}};ci.create=(e,t)=>new ci({value:e,typeName:Y.ZodLiteral,...X(t)});function $Q(e,t){return new ui({values:e,typeName:Y.ZodEnum,...X(t)})}var ui=class e extends ne{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{expected:se.joinValues(i),received:n.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return _(n,{received:n.data,code:S.invalid_enum_value,options:i}),V}return We(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};ui.create=$Q;var li=class extends ne{_parse(t){let n=se.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==U.string&&i.parsedType!==U.number){let r=se.objectValues(n);return _(i,{expected:se.joinValues(r),received:i.parsedType,code:S.invalid_type}),V}if(this._cache||(this._cache=new Set(se.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=se.objectValues(n);return _(i,{received:i.data,code:S.invalid_enum_value,options:r}),V}return We(t.data)}get enum(){return this._def.values}};li.create=(e,t)=>new li({values:e,typeName:Y.ZodNativeEnum,...X(t)});var hn=class extends ne{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==U.promise&&n.common.async===!1)return _(n,{code:S.invalid_type,expected:U.promise,received:n.parsedType}),V;let i=n.parsedType===U.promise?n.data:Promise.resolve(n.data);return We(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};hn.create=(e,t)=>new hn({type:e,typeName:Y.ZodPromise,...X(t)});var Gt=class extends ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,o={addIssue:s=>{_(i,s),s.fatal?n.abort():n.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return V;let A=await this._def.schema._parseAsync({data:a,path:i.path,parent:i});return A.status==="aborted"?V:A.status==="dirty"?Xn(A.value):n.value==="dirty"?Xn(A.value):A});{if(n.value==="aborted")return V;let a=this._def.schema._parseSync({data:s,path:i.path,parent:i});return a.status==="aborted"?V:a.status==="dirty"?Xn(a.value):n.value==="dirty"?Xn(a.value):a}}if(r.type==="refinement"){let s=a=>{let A=r.refinement(a,o);if(i.common.async)return Promise.resolve(A);if(A instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?V:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(r.type==="transform")if(i.common.async===!1){let s=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!gn(s))return V;let a=r.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(s=>gn(s)?Promise.resolve(r.transform(s.value,o)).then(a=>({status:n.value,value:a})):V);se.assertNever(r)}};Gt.create=(e,t,n)=>new Gt({schema:e,typeName:Y.ZodEffects,effect:t,...X(n)});Gt.createWithPreprocess=(e,t,n)=>new Gt({schema:t,effect:{type:"preprocess",transform:e},typeName:Y.ZodEffects,...X(n)});var Ot=class extends ne{_parse(t){return this._getType(t)===U.undefined?We(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ot.create=(e,t)=>new Ot({innerType:e,typeName:Y.ZodOptional,...X(t)});var Cr=class extends ne{_parse(t){return this._getType(t)===U.null?We(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Cr.create=(e,t)=>new Cr({innerType:e,typeName:Y.ZodNullable,...X(t)});var di=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};di.create=(e,t)=>new di({innerType:e,typeName:Y.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...X(t)});var gi=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return co(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new dt(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new dt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};gi.create=(e,t)=>new gi({innerType:e,typeName:Y.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...X(t)});var ho=class extends ne{_parse(t){if(this._getType(t)!==U.nan){let i=this._getOrReturnCtx(t);return _(i,{code:S.invalid_type,expected:U.nan,received:i.parsedType}),V}return{status:"valid",value:t.data}}};ho.create=e=>new ho({typeName:Y.ZodNaN,...X(e)});var gF=Symbol("zod_brand"),na=class extends ne{_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},ia=class e extends ne{_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?V:o.status==="dirty"?(n.dirty(),Xn(o.value)):this._def.out._parseAsync({data:o.value,path:i.path,parent:i})})();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?V:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:Y.ZodPipeline})}},fi=class extends ne{_parse(t){let n=this._def.innerType._parse(t),i=r=>(gn(r)&&(r.value=Object.freeze(r.value)),r);return co(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};fi.create=(e,t)=>new fi({innerType:e,typeName:Y.ZodReadonly,...X(t)});function RQ(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function TQ(e,t={},n){return e?pn.create().superRefine((i,r)=>{let o=e(i);if(o instanceof Promise)return o.then(s=>{if(!s){let a=RQ(t,i),A=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:A})}});if(!o){let s=RQ(t,i),a=s.fatal??n??!0;r.addIssue({code:"custom",...s,fatal:a})}}):pn.create()}var fF={object:gt.lazycreate},Y;(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"})(Y||(Y={}));var pF=(e,t={message:`Input not instance of ${e.name}`})=>TQ(n=>n instanceof e,t),FQ=fn.create,MQ=ei.create,hF=ho.create,mF=ti.create,LQ=ri.create,IF=ni.create,EF=lo.create,yF=ii.create,CF=oi.create,BF=pn.create,QF=Vr.create,vF=tr.create,wF=go.create,bF=Jr.create,kF=gt.create,SF=gt.strictCreate,xF=si.create,DF=mc.create,RF=ai.create,_F=yr.create,NF=Ic.create,UF=fo.create,$F=po.create,TF=Ec.create,FF=Ai.create,MF=ci.create,LF=ui.create,PF=li.create,OF=hn.create,zF=Gt.create,GF=Ot.create,VF=Cr.create,JF=Gt.createWithPreprocess,YF=ia.create,HF=()=>FQ().optional(),jF=()=>MQ().optional(),qF=()=>LQ().optional(),WF={string:(e=>fn.create({...e,coerce:!0})),number:(e=>ei.create({...e,coerce:!0})),boolean:(e=>ri.create({...e,coerce:!0})),bigint:(e=>ti.create({...e,coerce:!0})),date:(e=>ni.create({...e,coerce:!0}))};var ZF=V;var Hg=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(Hg||{}),jg=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(jg||{});var qg=300,xe=u.string().trim().min(1),KF=u.object({action:u.enum(["start","run","wait"]),text:xe,source:u.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:xe.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),Wg=/^[A-Za-z_][A-Za-z0-9_]*$/,Br=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,oa=(s=>(s.VersionEndpoint="version_endpoint",s.DeployWorkflow="deploy_workflow",s.KubernetesLabels="kubernetes_labels",s.Command="command",s.Api="api",s.NotTracked="not_tracked",s))(oa||{}),Yr="shared",XF=xe.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),mo=u.object({address:XF,readyWhen:xe.nullable(),credentials:u.array(u.string().regex(Br)).max(50),revisionSources:u.array(u.object({method:u.nativeEnum(oa),detail:xe.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:u.array(xe).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),Zg={steps:u.array(KF).max(20).optional().describe("how it starts, in order"),kind:u.enum(["web_app","service","database","external_service"]).optional(),from:u.object({file:xe,service:xe.nullable()}).strict().optional(),credentials:u.array(u.string().max(100).regex(Wg)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},eM=u.object({name:xe,repository:xe.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:u.boolean(),...Zg,deployed:xe.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),tM=u.object({name:u.string().regex(Br).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:u.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:u.boolean().describe("false only when the SUT starts without it, with less working"),how:xe.max(qg).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),rM=u.object({component:xe,problem:xe,evidence:xe.describe("the exact command and output that shows it"),fix:xe.describe("what the user must provide, and where")}),nM=u.object({framework:xe,file:xe.describe("the test file run, relative to its repository root"),result:u.enum(["pass","fail","error"])}),iM=u.object({input:xe.describe("the part of the user's SUT input, as given"),reason:xe}),uX=u.object({schemaVersion:u.literal(1),status:u.nativeEnum(jg).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:u.array(eM),suites:u.array(nM).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:u.array(xe).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:u.array(u.object({input:xe.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:xe.describe("what the recipe did with it")})).optional(),inputsNotUsed:u.array(iM).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:u.array(rM).describe("required (non-empty) when status is blocked"),inputs:u.array(tM).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:mo.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward, proxy or client certificate)")});var Kg=64*1024,Xg=512*1024,PQ=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var pX=new TextDecoder("utf-8",{fatal:!0});var sa=(o=>(o.NotFound="not_found",o.NoAccess="no_access",o.Unavailable="unavailable",o.AccessLost="access_lost",o.CannotOpen="cannot_open",o))(sa||{});var OQ=e=>`${e.source}:${e.site??""}:${e.key}`;var yc=/^pasted-[0-9a-f]{16}$/,Cc=/^file-[0-9a-f]{16}$/,Bc=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(Bc||{});var ef=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(ef||{}),tf=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(tf||{}),rf=(m=>(m.RelatedChangeConflict="related_change_conflict",m.ReferenceOutsideTarget="reference_outside_target",m.SourceAccessLost="source_access_lost",m.ConfigurationIncomplete="configuration_incomplete",m.CredentialUnavailable="credential_unavailable",m.WorkflowBindingUnverified="workflow_binding_unverified",m.WorkflowRefUnprotected="workflow_ref_unprotected",m.BedrockWorkflowRequired="bedrock_workflow_required",m.DeploymentReview="deployment_review",m.SutRevisionMismatch="sut_revision_mismatch",m.IsolationUnavailable="isolation_unavailable",m.EvidenceInsufficient="evidence_insufficient",m.ConfigurationUnresolved="configuration_unresolved",m.ModelProviderDenied="model_provider_denied",m.ModelProviderUnavailable="model_provider_unavailable",m.RunnerProviderNotReady="runner_provider_not_ready",m.MergeConflict="merge_conflict",m))(rf||{}),aa=(o=>(o.CiCheck="ci_check",o.TestReport="test_report",o.StaticAnalysis="static_analysis",o.CodeReview="code_review",o.Other="other",o))(aa||{}),nf=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(nf||{}),of=(a=>(a.AuthToken="auth_token",a.Secret="secret",a.DataConnection="data_connection",a.AppNotStarted="app_not_started",a.Login="login",a.ExternalDependency="external_dependency",a.RecordingReplay="recording_replay",a))(of||{});var sf=(n=>(n.Probe="probe",n.Agent="agent",n))(sf||{}),af=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(af||{}),Af=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(Af||{});var zQ=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(zQ||{}),Qr=u.string().trim().min(1),oM=u.object({case:Qr.describe("recommend id this assertion enforces"),evidence:Qr.describe("the exact assertion line from the file that checks that case's observable")}),sM=u.object({route:u.literal("persistence"),url:u.string().url()}).strict(),cf=u.object({kind:u.nativeEnum(af).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Qr.describe("the dependency, endpoint or data it affects"),mechanism:u.nativeEnum(Af).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Qr.describe("what it sets up"),worker:Qr.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:sM.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:Qr.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Qr.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),aM=u.object({file:Qr.describe("staged path under .skyramp/staged/"),source:u.nativeEnum(zQ),language:Qr,covers:u.array(u.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:u.array(oM).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:u.array(cf).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),yX=u.object({schemaVersion:u.literal(1),tests:u.array(aM),deferredUi:u.array(u.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Qr.describe("one paragraph")});var GQ=(s=>(s.Place="place",s.Update="update",s.Regenerate="regenerate",s.Delete="delete",s.Verify="verify",s.None="none",s))(GQ||{}),VQ=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(VQ||{}),tt=u.string().trim().min(1),JQ=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(JQ||{}),AM=u.object({kind:u.nativeEnum(JQ),reason:tt.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),uf=u.array(u.string().url().max(2048).regex(/^https?:\/\//i)).max(50),cM=u.object({case:tt.describe("a covers id \u2014 the recommend case this test realizes"),status:u.nativeEnum(VQ),runtimeTargets:uf.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:tt.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:u.boolean().optional(),testProblem:AM.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:u.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:u.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),uM=u.object({started:u.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:u.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:u.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:u.array(cM).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),lM=u.object({context:u.array(cf).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:u.string().optional().describe("staged path \u2014 required for placements"),file:tt.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:tt.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:u.nativeEnum(GQ),covers:u.array(u.string()).optional().describe("recommend ids a placed test covers"),repro:u.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:u.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:u.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:tt.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:tt.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:uM,assertionCount:u.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:u.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:u.array(tt).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:u.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),YQ=(n=>(n.Junit="junit",n.Converter="converter",n))(YQ||{}),dM=tt.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),gM=u.object({results:tt.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:u.nativeEnum(YQ),run:tt.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:u.array(tt).min(1).describe("the items[].file paths this run covered"),cases:u.array(u.object({test:tt.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:tt.describe("the covers id it realizes"),file:dM})).describe("map each reported test name to the case it covers")}),fM=u.object({suites:u.array(gM).min(1)}),vX=u.object({schemaVersion:u.literal(1),items:u.array(lM),runnerResults:fM.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:u.array(u.string()).describe("existing tests assessed and deliberately left untouched"),summary:tt.describe("one paragraph")});var El=lt(XQ(),1),G4=lt(v0(),1);var $r;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})($r||($r={}));var w0;(function(e){e.Accept="accept",e.ContentType="content-type"})(w0||(w0={}));var b0;(function(e){e.ApplicationJson="application/json"})(b0||(b0={}));var D3=[$r.MovedPermanently,$r.ResourceMoved,$r.SeeOther,$r.TemporaryRedirect,$r.PermanentRedirect],R3=[$r.BadGateway,$r.ServiceUnavailable,$r.GatewayTimeout];var S0=require("os"),lA=require("fs"),Lm=function(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(l){try{c(i.next(l))}catch(d){s(d)}}function A(l){try{c(i.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):r(l.value).then(a,A)}c((i=i.apply(e,t||[])).next())})},{access:J4,appendFile:Y4,writeFile:H4}=lA.promises,k0="GITHUB_STEP_SUMMARY";var Pm=class{constructor(){this._buffer=""}filePath(){return Lm(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[k0];if(!t)throw new Error(`Unable to find environment variable for $${k0}. Check if your runtime environment supports job summaries.`);try{yield J4(t,lA.constants.R_OK|lA.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath})}wrap(t,n,i={}){let r=Object.entries(i).map(([o,s])=>` ${o}="${s}"`).join("");return n?`<${t}${r}>${n}</${t}>`:`<${t}${r}>`}write(t){return Lm(this,void 0,void 0,function*(){let n=!!t?.overwrite,i=yield this.filePath();return yield(n?H4:Y4)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Lm(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(t,n=!1){return this._buffer+=t,n?this.addEOL():this}addEOL(){return this.addRaw(S0.EOL)}addCodeBlock(t,n){let i=Object.assign({},n&&{lang:n}),r=this.wrap("pre",this.wrap("code",t),i);return this.addRaw(r).addEOL()}addList(t,n=!1){let i=n?"ol":"ul",r=t.map(s=>this.wrap("li",s)).join(""),o=this.wrap(i,r);return this.addRaw(o).addEOL()}addTable(t){let n=t.map(r=>{let o=r.map(s=>{if(typeof s=="string")return this.wrap("td",s);let{header:a,data:A,colspan:c,rowspan:l}=s,d=a?"th":"td",g=Object.assign(Object.assign({},c&&{colspan:c}),l&&{rowspan:l});return this.wrap(d,A,g)}).join("");return this.wrap("tr",o)}).join(""),i=this.wrap("table",n);return this.addRaw(i).addEOL()}addDetails(t,n){let i=this.wrap("details",this.wrap("summary",t)+n);return this.addRaw(i).addEOL()}addImage(t,n,i){let{width:r,height:o}=i||{},s=Object.assign(Object.assign({},r&&{width:r}),o&&{height:o}),a=this.wrap("img",null,Object.assign({src:t,alt:n},s));return this.addRaw(a).addEOL()}addHeading(t,n){let i=`h${n}`,r=["h1","h2","h3","h4","h5","h6"].includes(i)?i:"h1",o=this.wrap(r,t);return this.addRaw(o).addEOL()}addSeparator(){let t=this.wrap("hr",null);return this.addRaw(t).addEOL()}addBreak(){let t=this.wrap("br",null);return this.addRaw(t).addEOL()}addQuote(t,n){let i=Object.assign({},n&&{cite:n}),r=this.wrap("blockquote",t,i);return this.addRaw(r).addEOL()}addLink(t,n){let i=this.wrap("a",t,{href:n});return this.addRaw(i).addEOL()}},O3=new Pm;var Om=lt(require("os"),1);var yl=lt(require("fs"),1);var{chmod:j4,copyFile:q4,lstat:W4,mkdir:Z4,open:V3,readdir:K4,rename:X4,rm:eq,rmdir:J3,stat:tq,symlink:rq,unlink:nq}=yl.promises,iq=process.platform==="win32";var Y3=yl.constants.O_RDONLY;var Z3=process.platform==="win32";var t7=Om.default.platform(),r7=Om.default.arch();var R0;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(R0||(R0={}));function N0(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}var U0=lt(require("path"));var zm=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(zm||{}),lr=u.string().trim().min(1),uq=u.object({url:u.string().optional().describe("the URL probed, if the check is an HTTP request"),command:u.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:u.record(u.string()).optional(),status:u.union([u.number(),u.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:lr.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),lq=u.array(u.object({component:lr.describe("a shared component listed above"),url:lr.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:lr.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),dq=u.object({name:lr.describe("the credential's environment variable name, as listed above; never its value"),component:lr.describe("the component that refused it"),status:u.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:lr.describe("the request or command you tested it with and what came back, never the value")}),S7=u.object({schemaVersion:u.literal(1),baseUrls:u.record(u.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:uq.optional(),teardown:lr.describe("command that tears the SUT down"),dependencies:u.record(u.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:u.nativeEnum(zm).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:u.array(u.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:u.object({command:lr,output:lr}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:u.array(u.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:u.boolean(),startedAt:lr.describe("ISO timestamp"),revisions:lq.optional(),missingSecrets:u.array(u.string().regex(Wg)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:u.array(dq).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:u.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var Ye=u.string().trim().min(1),Cl=Ye,Gm=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(Gm||{}),Vm=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],$0=u.object({schemaVersion:u.literal(1),type:u.nativeEnum(Gm).optional(),repository:Cl.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:u.enum(["ready","blocked"]),environment:mo.optional(),components:u.array(u.object({name:Ye,repository:Ye.describe(`owner/repo, or "${Yr}" for a customer-deployed component no repository builds`),healthy:u.boolean(),url:u.string().min(1).nullable(),...Zg,credentials:u.array(u.string().regex(Br)).max(50).optional(),deployed:Ye.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:u.array(u.object({framework:Ye,file:Ye,result:u.enum(["pass","fail","error"])}).strict()),inputsUsed:u.array(Ye),inputsUsedHow:u.array(u.object({input:Ye,how:Ye}).strict()).optional(),inputsNotUsed:u.array(u.object({input:Ye,reason:Ye}).strict()),blockers:u.array(u.object({component:Ye,problem:Ye,evidence:Ye,fix:Ye}).strict()),replay:u.object({outcome:Ye,durationSeconds:u.number().nonnegative().nullable()}).strict().nullable(),files:u.array(u.object({path:Ye,content:u.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,o)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:u.ZodIssueCode.custom,path:["inputsUsedHow",o,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,o)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:u.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,o)=>{r.components.forEach((s,a)=>{i.has(s)||t.addIssue({code:u.ZodIssueCode.custom,path:["environment","revisionSources",o,"components",a],message:"not one of components"})})}),e.components.forEach((r,o)=>{r.deployed!==void 0!==n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Yr&&!n&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"repository"],message:`only a customer_deployed component is ${Yr}`})}),n&&(e.components.forEach((r,o)=>{e.components.findIndex(s=>s.name===r.name)!==o&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",o,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:u.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,o)=>{Vm.includes(r.path)&&t.addIssue({code:u.ZodIssueCode.custom,path:["files",o,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(o=>o.components));e.components.forEach((o,s)=>{o.repository!==Yr&&!r.has(o.name)&&t.addIssue({code:u.ZodIssueCode.custom,path:["components",s,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var U7=["clean","recipe-drift"];function Bl(e){let t=U0.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}var Ql=u.object({environmentId:u.string().uuid(),allowed:u.boolean(),revision:u.string().uuid(),updatedAt:u.string().datetime(),updatedBy:u.string().uuid()}).strict();var q0=u.unknown().optional();var dA=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(dA||{}),jm=(o=>(o.Trigger="TRIGGER",o.Baseline="BASELINE",o.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",o.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",o.ManualOverride="MANUAL_OVERRIDE",o))(jm||{}),W0=(s=>(s.PullRequest="pull_request",s.ReadyForReview="ready_for_review",s.Schedule="schedule",s.Manual="manual",s.SutSetup="sut_setup",s.RevisionRead="revision_read",s))(W0||{}),pq=["sut_setup"],hq=["sut_setup","schedule","revision_read"];var Z0=(t=>(t.PullRequest="pull_request",t))(Z0||{}),K0=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(K0||{}),T0=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var X0=(o=>(o.ReportUploaded="report_uploaded",o.NoReport="no_report",o.Cancelled="cancelled",o.RecipeUploaded="recipe_uploaded",o.RevisionsUploaded="revisions_uploaded",o))(X0||{}),e_=(n=>(n.Running="running",n.Ended="ended",n))(e_||{}),t_=(g=>(g.TimedOut="timed_out",g.AgentFailed="agent_failed",g.SetupFailed="setup_failed",g.CredentialMissing="credential_missing",g.RunnerLost="runner_lost",g.CheckoutFailed="checkout_failed",g.EnvironmentUnverified="environment_unverified",g.ModelProviderDenied="model_provider_denied",g.ModelProviderUnavailable="model_provider_unavailable",g.RunnerProviderNotReady="runner_provider_not_ready",g.MergeConflict="merge_conflict",g.EnvironmentUnavailable="environment_unavailable",g))(t_||{}),r_=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(r_||{}),qm=(n=>(n.Started="started",n.Finished="finished",n))(qm||{}),n_=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(n_||{});var i_=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(i_||{});var o_=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(o_||{}),Wm=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(Wm||{}),Ym=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(Ym||{});var Zm=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(Zm||{}),qt=u.string().regex(/^[1-9][0-9]{0,18}$/),Wt=u.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),Hm=u.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),s_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;var Xe=u.string().regex(s_),ot=u.string().regex(/^[0-9a-f]{64}$/),bl=u.object({id:Xe,revision:qt}).strict(),Sl={provider:u.literal("github"),providerAccountId:qt,providerRepositoryId:qt},xl={provider:u.literal("azure-devops"),providerAccountId:Xe,providerRepositoryId:Xe},dr=u.discriminatedUnion("provider",[u.object(Sl).strict(),u.object(xl).strict()]),Y7=u.discriminatedUnion("provider",[u.object(Sl).passthrough(),u.object(xl).passthrough()]),kl=e=>`${e.provider}:${e.providerRepositoryId}`,F0={namespace:u.string().min(1),name:u.string().min(1)},a_=u.discriminatedUnion("provider",[u.object({...Sl,...F0}).strict(),u.object({...xl,...F0}).strict()]),M0=u.object({ref:u.string().min(1),revision:Wt}).strict(),mq=u.object({kind:u.nativeEnum(K0),number:qt.optional(),ref:u.string().min(1),revision:Wt,reason:u.nativeEnum(jm)}).strict(),Iq=u.object({repository:a_,revision:Wt,ref:u.string().nullable(),reason:u.nativeEnum(jm),change:u.object({kind:u.nativeEnum(Z0),number:qt,base:M0.optional()}).strict().nullable(),compareWith:M0.optional(),merge:u.array(mq).min(2).optional()}).strict();function Eq(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[o,s]of t.entries()){if(s.kind==="pull_request"!=(s.number!==void 0))return{path:["merge",o,"number"],message:"a pull request names its number, and a branch none"};if(!T0.includes(s.reason))return{path:["merge",o,"reason"],message:`${s.reason} does not select a merged revision`};if(s.kind==="branch"&&s.reason!=="MANUAL_OVERRIDE")return{path:["merge",o,"reason"],message:"only a person chooses a branch to merge"};if(s.ref===e.ref)return{path:["merge",o,"ref"],message:"the baseline branch is what the source merges onto"};if(s.number!==void 0&&n.has(s.number)||i.has(s.ref))return{path:["merge",o],message:"names a revision the source already merges"};s.number!==void 0&&n.add(s.number),i.add(s.ref)}let r=T0.find(o=>t.some(s=>s.reason===o));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}function yq(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(c=>c!=null).length>1)return"a run compares with one baseline";let o=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return o?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let s=new Set(e.sources.map(c=>kl(c.repository))),a=new Set(r.map(c=>kl(c.repository)));return a.size===r.length&&a.size===s.size&&[...a].every(c=>s.has(c))?null:"names every source of the snapshot, once"}var A_=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,c_=/^[1-9][0-9]{0,18}$/,L0=new RegExp(`${A_.source}|${c_.source}`),P0=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,Cq=u.union([u.object({source:u.literal("jira"),site:u.string().regex(P0),key:u.string().regex(A_),updated:u.string().datetime(),contentHash:ot}).strict(),u.object({source:u.literal("confluence"),site:u.string().regex(P0),key:u.string().regex(c_),version:u.number().int().positive(),contentHash:ot}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),contentHash:ot}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),contentHash:ot,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict()]),O0=u.union([u.literal("jira"),u.literal("confluence")]),H7=u.object({schemaVersion:u.literal(1),items:u.array(u.union([u.object({source:O0,site:u.string(),key:u.string().regex(L0),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:O0,site:u.string(),key:u.string().regex(L0),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("read"),text:u.string(),version:u.string().min(1),contentMatches:u.boolean()}).strict(),u.object({source:u.literal("other"),key:u.string().regex(yc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),state:u.literal("read"),version:ot,fileName:u.string().min(1).max(255),mediaType:u.nativeEnum(Bc)}).strict(),u.object({source:u.literal("other"),key:u.string().regex(Cc),state:u.literal("not_read"),reason:u.nativeEnum(sa)}).strict()])),instructions:u.array(u.string()).optional()}).strict(),Bq=u.object({resultId:u.string().min(1),repository:u.string().min(1),testType:u.string().min(1),path:u.string(),finding:u.string().min(1)}).strict(),Qq=u.object({schemaVersion:u.literal(1),runId:Xe,skyrampOrgId:Xe,target:bl,policy:bl.nullable(),trigger:u.object({kind:u.nativeEnum(W0),requestedAt:u.string().datetime()}).strict(),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:ot}).strict(),baseline:u.object({confirmedRunId:Xe.nullable(),initialBaselineId:Xe.optional(),comparisonBaselineId:Xe.optional(),knownFailures:u.array(Bq).optional(),sources:u.array(u.object({repository:dr,revision:Wt}).strict()).optional()}).strict().optional(),sources:u.array(Iq).min(1).max(1e3),execution:u.object({provider:u.nativeEnum(dA),repository:a_,workflowPath:u.string(),ref:u.string()}).strict(),credentials:u.array(u.object({name:u.string(),purpose:u.nativeEnum(Hg),required:u.boolean()}).strict()),requirements:u.array(Cq).min(1).optional(),instructions:u.object({contentHash:ot}).strict().optional(),deployedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((A,c)=>{let l="fileName"in A?"file":"pasted";A.source==="other"&&A.key!==`${l}-${A.contentHash.slice(0,16)}`&&t.addIssue({code:u.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",c,"key"]});let d=OQ({source:A.source,key:A.key});n.has(d)&&t.addIssue({code:u.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",c,"key"]}),n.add(d)});let i=e.trigger.kind,r=pq.includes(i);r!==(e.policy===null)&&t.addIssue({code:u.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:u.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let o=yq(e);o&&t.addIssue({code:u.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:o}),hq.includes(i)&&e.sources.forEach((A,c)=>{A.reason!=="BASELINE"&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let s=new Set(e.sources.map(A=>kl(A.repository))),a=new Set;(e.deployedRevisions??[]).forEach((A,c)=>{let l=kl(A.repository);s.has(l)?a.has(l)&&t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"repository appears twice"}):t.addIssue({code:u.ZodIssueCode.custom,path:["deployedRevisions",c,"repository"],message:"names a repository outside the snapshot"}),a.add(l)}),e.sources.forEach((A,c)=>{A.compareWith&&(A.reason!=="MANUAL_OVERRIDE"||A.change)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(A.change?.base||A.compareWith||A.merge)&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let l=Eq(A);l&&t.addIssue({code:u.ZodIssueCode.custom,path:["sources",c,...l.path],message:l.message})})});var u_=(n=>(n.Person="person",n.Policy="policy",n))(u_||{}),vq=u.object({kind:u.nativeEnum(u_),name:u.string().min(1).max(256)}).strict(),wq=u.object({mcp:u.discriminatedUnion("source",[u.object({source:u.literal("npm"),version:u.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),u.object({source:u.literal("github"),ref:u.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:u.object({region:u.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:u.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),j7=u.object({schemaVersion:u.literal(1),attempt:u.object({id:Xe,number:u.number().int().positive(),deadlineAt:u.string().datetime()}).strict(),manifest:Qq,manifestHash:ot,entitlements:u.array(u.string()).optional(),runToken:u.string().min(1).optional(),requestedBy:vq.nullable().optional(),writeAllowed:u.boolean().optional(),claudeCodeVersion:u.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).optional(),statedRevisions:u.array(u.object({repository:dr,revision:Wt}).strict()).optional(),runSettings:wq.optional()}).strict(),z0={providerRunAttempt:u.number().int().positive(),workflowRef:u.string().min(1)},bq=u.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),q7=u.object({schemaVersion:u.literal(1),runId:Xe,execution:u.discriminatedUnion("provider",[u.object({...z0,provider:u.literal("github"),repository:u.object(Sl).strict(),providerRunId:qt}).strict(),u.object({...z0,provider:u.literal("azure-devops"),repository:u.object(xl).strict(),providerRunId:bq}).strict()]),requester:u.literal(!0).optional(),writeCheck:u.literal(!0).optional(),claudeCodePin:u.literal(!0).optional(),deployedPins:u.literal(!0).optional(),statedPins:u.literal(!0).optional(),runSettings:u.literal(!0).optional()}).strict(),G0=u.object({repository:dr,number:qt,commitSha:Wt.optional()}).strict(),vl=u.array(u.object({repository:dr,reason:u.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),kq=u.object({branch:Hm.optional(),commitSha:Wt.optional()}).strict(),V0=u.object({repository:dr,message:u.string(),...kq.shape}).strict(),Sq=u.discriminatedUnion("status",[u.object({status:u.literal("none"),noTests:vl}).strict(),u.object({status:u.literal("delivered"),noTests:vl,pullRequests:u.array(G0).min(1)}).strict(),u.object({status:u.literal("partial"),noTests:vl,pullRequests:u.array(G0).min(1),failures:u.array(V0).min(1)}).strict(),u.object({status:u.literal("failed"),message:u.string(),noTests:vl,failures:u.array(V0).min(1).optional()}).strict()]),W7=1024*1024,Z7=16*1024*1024,wl=e=>u.array(u.object({[e]:u.string()}).strict()).optional(),xq=u.object({language:u.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:u.string(),validation:u.object({rationale:u.string(),gaps:u.array(u.string())}).strict().optional(),changes:u.array(u.object({id:u.string(),text:u.string()}).strict()).optional(),issuesFound:wl("description"),newTestsCreated:wl("description"),testResults:wl("details"),caveats:wl("text")}).strict(),Dq=u.object({blockedPreflight:u.object({file:u.string().min(1),repository:u.string().min(1).optional(),reason:u.string().min(1).max(300),evidence:u.string().min(1).max(400)}).strict().optional(),sufficiency:u.nativeEnum(tf),rationale:u.string().min(1),gaps:u.array(u.string().min(1)),acceptedEvidence:u.array(u.object({kind:u.nativeEnum(aa),repository:u.string().min(1),revision:Wt,reference:u.string().min(1),summary:u.string().min(1)}).strict()),actionRequired:u.array(u.nativeEnum(rf))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:u.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),Jm=500,Rq=2048,_q=1e3,Nq=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,J0=e=>e.length>0&&e.length<=64&&e===e.trim()&&!Nq.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),l_=e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&J0(n)&&J0(i)},Uq=u.object({testResults:u.array(u.object({resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:u.string().refine(l_,"Invalid"),testType:u.string(),runtimeTargets:uf.optional(),endpoint:u.string(),status:u.enum(["Pass","Fail","Skipped"]),details:u.string(),fileName:u.string().optional(),testId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:u.object({kind:u.nativeEnum(nf),family:u.nativeEnum(of).optional()}).strict().optional(),origin:u.nativeEnum(ef).optional()}).strict()),validation:Dq,changes:u.array(u.object({id:u.string().min(1).max(512),text:u.string().max(16384),source:u.string().max(Rq),testedBy:u.array(u.string().min(1).max(1024)).max(Jm),writtenBy:u.array(u.string().min(1).max(1024)).max(Jm),maintainedBy:u.array(u.string().min(1).max(1024)).max(Jm)}).strict()).max(_q).optional(),traceVersion:u.literal(1),display:xq.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let o of["issuesFound","newTestsCreated","testResults","caveats"]){let s=n?.[o];s&&s.length!==(Array.isArray(i[o])?i[o].length:0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["display",o],message:`has not one row per ${o} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((o,s)=>{let a=o.failureCause;a&&o.status==="Pass"&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"a passing result has no failure cause"}),a&&a.kind==="environment"!=(a.family!==void 0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["testResults",s,"failureCause"],message:"an environment cause names its family, and no other cause does"});let A=["testResults",s,"resultId"],c=o.resultId.slice(`${o.repository}:${o.testType}:`.length);(!o.resultId.startsWith(`${o.repository}:${o.testType}:`)||c===""||c.startsWith("/")||c.startsWith("#"))&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"is not repository:testType:path for this result"}),r.has(o.resultId)&&t.addIssue({code:u.ZodIssueCode.custom,path:A,message:"stable identity repeated"}),r.add(o.resultId)})});var $q=50,Tq=u.discriminatedUnion("kind",[u.object({kind:u.literal("branch_pushed"),repository:dr,branch:Hm,commit:Wt}).strict(),u.object({kind:u.enum(["pull_request_opened","pull_request_edited"]),repository:dr,number:qt,branch:Hm}).strict()]),Fq=u.object({schemaVersion:u.literal(1),run:u.object({runId:Xe,attemptNumber:u.number().int().positive(),manifestHash:ot}).strict(),target:bl,policy:bl,provenance:u.object({sources:u.array(u.object({repository:dr,revision:Wt}).strict()),firstQualification:u.literal(!0).optional()}).strict(),delivery:u.object({generatedTests:Sq}).strict(),producer:u.object({testbot:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:u.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Uq,githubWrites:u.array(Tq).max($q).optional()}).strict(),d_=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(d_||{}),Mq=200,Lq=u.object({cause:u.nativeEnum(d_),credential:u.string().regex(Br).optional(),reason:u.string().trim().min(1).max(Mq).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),Pq=u.object({name:u.string().regex(Br),purpose:u.enum(["sut_access","other"]),required:u.boolean(),how:u.string().trim().min(1).max(qg)}).strict(),K7=Fq.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:$0,check:Lq.optional(),inputs:u.array(Pq).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=(o,s)=>t.addIssue({code:u.ZodIssueCode.custom,path:["recipe",...o],message:s});e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((o,s)=>{Bl(o.path)||n(["files",s,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(o.path)&&n(["files",s,"path"],"file repeated"),i.add(o.path),PQ.test(o.content)&&n(["files",s,"content"],"is not text");let a=Buffer.byteLength(o.content,"utf8");r+=a,a>Kg&&n(["files",s,"content"],`larger than ${Kg} bytes`)}),r>Xg&&n(["files"],`recipe text over ${Xg} bytes in total`)}),X7=u.object({components:u.array(u.object({name:u.string().min(1),repository:u.string().refine(l_,"Invalid"),observedRevision:u.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:u.nativeEnum(sf),evidence:u.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();var eee=u.object({schemaVersion:u.literal(1),stage:u.nativeEnum(r_),event:u.nativeEnum(qm),status:u.nativeEnum(n_).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),Dl=100,Oq=5e3,Gi=2e3,Y0=100,g_=/^[A-Za-z0-9_-]{1,64}$/,zq=20,Gq=200,Vq=100,Jq=100,Yq=200,H0="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Hq=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${H0}/${H0})$`),jq=500,qq=50,Wq=10,Zq=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,f_=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,Tt=e=>u.string().max(e).refine(t=>t.trim().length>0&&!f_.test(t),"blank, or not text"),Tr={sequence:u.number().int().min(1).max(Oq),at:u.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},p_=u.object({...Tr,kind:u.literal("reply"),to:u.string().uuid(),outcome:u.nativeEnum(o_),accepted:u.boolean(),text:Tt(Gi),note:u.object({source:u.enum(["target","environment"]),quote:Tt(Gi)}).strict().optional(),kept:Tt(Gi).optional()}).strict();function h_(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:u.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:u.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}var Kq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),phase:u.nativeEnum(Wm),text:Tt(Gi)}).strict(),u.object({...Tr,kind:u.literal("component"),name:Tt(Y0),repository:Tt(Yq).refine(e=>Hq.test(e)||e===Yr,"not owner/name"),file:Tt(jq).nullable(),status:u.nativeEnum(Zm),version:Tt(Jq).optional()}).strict(),p_,u.object({...Tr,kind:u.literal("question"),id:u.string().regex(g_),type:u.nativeEnum(i_),text:Tt(Gi),component:Tt(Y0).nullable(),choices:u.array(Tt(Gq)).max(zq),placeholder:Tt(Vq).optional()}).strict(),u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Dl)}).strict(),u.object({...Tr,kind:u.literal("credentials"),names:u.array(u.string().regex(Br)).min(1).max(qq),logins:u.array(u.object({key:u.string().regex(Zq),usernameVariable:u.string().regex(Br),passwordVariable:u.string().regex(Br)}).strict()).min(1).max(Wq).optional()}).strict()]).superRefine((e,t)=>{if(h_(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>N0(i.key));new Set(n).size!==n.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let o of["usernameVariable","passwordVariable"])e.names.includes(i[o])||t.addIssue({code:u.ZodIssueCode.custom,path:["logins",r,o],message:"not one of the names"})})}e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:u.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),tee=u.object({schemaVersion:u.literal(1),events:u.array(Kq).max(Dl)}).strict(),Xq=u.discriminatedUnion("kind",[u.object({...Tr,kind:u.literal("log"),stage:u.nativeEnum(Ym),text:Tt(Gi)}).strict(),p_,u.object({...Tr,kind:u.literal("delivered"),ids:u.array(u.string().uuid()).max(Dl)}).strict(),u.object({...Tr,kind:u.literal("stage"),stage:u.nativeEnum(Ym),event:u.nativeEnum(qm)}).strict(),u.object({...Tr,kind:u.literal("test"),resultId:u.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:u.enum(["Pass","Fail","Skipped"]),details:u.string().max(Gi).refine(e=>!f_.test(e),"not text")}).strict()]).superRefine(h_),ree=u.object({schemaVersion:u.literal(1),events:u.array(Xq).max(Dl)}).strict(),j0={id:u.string().uuid(),text:u.string(),by:u.string().nullable(),at:u.string(),replied:u.literal(!0).optional()},m_=u.discriminatedUnion("kind",[u.object({...j0,kind:u.literal("instruction"),question:u.null()}),u.object({...j0,kind:u.literal("answer"),question:u.string().regex(g_)})]),I_=u.string().regex(/^[A-Za-z0-9+/]{43}=$/),eW=u.object({id:u.string().uuid(),revision:u.string(),by:u.string().nullable(),at:u.string(),target:u.string(),own:u.object({source:u.enum(["policy","test_environment"]),text:u.string()}).nullable()}),nee=u.object({schemaVersion:u.literal(1),leftOut:u.array(u.string()),messages:u.array(m_).optional(),stop:u.object({key:I_}).optional(),notes:eW.optional()}),iee=u.object({schemaVersion:u.literal(1),messages:u.array(m_).optional()});var tW=500*1024*1024,E_=u.object({id:qt,name:u.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:qt,expiresAt:u.string().datetime()}).strict(),oee=u.object({schemaVersion:u.literal(1),artifact:E_,sessionId:Xe,contentHash:ot,bytes:u.number().int().min(1).max(tW)}).strict(),see=u.object({schemaVersion:u.literal(1),checkpoint:u.object({artifact:E_,repository:u.object({namespace:u.string().min(1),name:u.string().min(1)}).strict(),sessionId:Xe,contentHash:ot,key:I_}).strict().nullable()}).strict(),rW=200,fs=100,y_=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(y_||{}),nW=u.object({kind:u.nativeEnum(y_),setup:u.object({runId:Xe,endedAt:u.string().nullable(),outcome:u.string().nullable()}).strict(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1),status:u.nativeEnum(Zm)}).strict()).max(fs),credentials:u.array(u.string().min(1)).max(fs),answers:u.array(u.object({question:u.string(),answer:u.string().nullable()}).strict()).max(fs),instructions:u.array(u.object({text:u.string(),reply:u.string().nullable()}).strict()).max(fs),log:u.array(u.object({phase:u.nativeEnum(Wm),text:u.string()}).strict()).max(rW),recipe:u.object({files:u.array(u.object({path:u.string().min(1),content:u.string()}).strict()).max(fs),blockers:u.array(u.object({component:u.string(),problem:u.string(),evidence:u.string(),fix:u.string()}).strict()).max(fs)}).strict().optional()}).strict(),aee=u.object({schemaVersion:u.literal(1),context:nW.nullable()}).strict(),Aee=u.object({schemaVersion:u.literal(1),configuration:u.object({captureId:Xe,revision:qt.nullable(),hash:ot}).strict(),capture:u.object({schemaVersion:u.literal(1),settings:u.object({target:u.object({environment:u.unknown()}).passthrough(),timeoutMinutes:u.number().int().positive(),answerWaitMinutes:u.number().int().positive().optional(),testEnvironment:u.object({name:u.string().min(1),address:u.string().min(1).optional(),readyWhen:u.string().min(1).optional(),environmentId:u.string().uuid().optional(),persistentDataPolicy:q0}).passthrough().optional()}).passthrough(),provenance:u.object({}).passthrough(),hash:ot}).strict()}).strict(),cee=u.object({schemaVersion:u.literal(1),environmentId:u.string().uuid().nullable(),environmentAddress:u.string().url().nullable(),persistentDataPolicy:Ql.nullable()}).strict(),iW=mo.extend({environmentId:u.string().uuid().optional(),persistentDataPolicy:q0,version:u.number().int().positive(),components:u.array(u.object({name:u.string().min(1),repository:u.string().min(1)}).strict()),contentHash:ot.optional(),files:u.array(u.object({path:u.string().refine(e=>Bl(e)&&!Vm.includes(e),"not a file of a customer_deployed plan"),content:u.string()}).strict()).optional()}).strict(),uee=u.object({schemaVersion:u.literal(1),testEnvironment:iW.nullable().optional(),runtimePlan:u.object({version:u.number().int().positive(),contentHash:ot,files:u.array(u.object({path:u.string().refine(Bl,"not a recipe file path"),content:u.string()}).strict()).min(1),repository:Cl.optional(),recipeRepository:Cl.optional(),recipe:u.record(u.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),lee=u.object({schemaVersion:u.literal(1),state:u.nativeEnum(e_),ending:u.nativeEnum(X0).nullable(),cause:u.nativeEnum(t_).nullable(),deadlineAt:u.string().datetime()}).strict();var oW=50,dee=u.object({repository:dr,revisions:u.array(u.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:u.array(u.string().min(1)).min(1).max(oW)}).strict();var aW=".skyramp/sut/deployed-revisions.sh",C_=(n=>(n.Running="running",n.Requested="requested",n))(C_||{});var Bee=new Set(Object.values(C_));var Qee=`Fix ${aW} so it prints the full commit each component runs, then set it up again.`;var qn=lt(require("fs")),jn=lt(require("http")),f8=lt(require("https")),Lg=lt(require("dns")),RT=require("module"),Le=lt(require("net"));var Pg=lt(require("path")),Og=require("stream"),_T=require("stream/promises"),NT=require("timers/promises"),Wn=lt(require("tls"));var Z={};Ir(Z,{$brand:()=>lI,$input:()=>Fy,$output:()=>Ty,INVALID:()=>At,NEVER:()=>uI,TimePrecision:()=>qy,ZodAny:()=>TB,ZodArray:()=>PB,ZodBase64:()=>bg,ZodBase64URL:()=>kg,ZodBigInt:()=>Ks,ZodBigIntFormat:()=>Dg,ZodBoolean:()=>Zs,ZodCIDRv4:()=>vg,ZodCIDRv6:()=>wg,ZodCUID:()=>mg,ZodCUID2:()=>Ig,ZodCatch:()=>aQ,ZodCodec:()=>ac,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,ZodCreditCard:()=>SB,ZodCustom:()=>Ac,ZodCustomStringFormat:()=>so,ZodDate:()=>tc,ZodDefault:()=>tQ,ZodDiscriminatedUnion:()=>zB,ZodE164:()=>Sg,ZodEmail:()=>gg,ZodEmoji:()=>pg,ZodEnum:()=>js,ZodError:()=>kK,ZodExactOptional:()=>Ug,ZodFile:()=>ZB,ZodFirstPartyTypeKind:()=>CQ,ZodFunction:()=>mQ,ZodGUID:()=>fg,ZodIBAN:()=>xB,ZodIPv4:()=>Bg,ZodIPv6:()=>Qg,ZodISODate:()=>Jn,ZodISODateTime:()=>Vn,ZodISODuration:()=>Hn,ZodISOTime:()=>Yn,ZodInstanceOf:()=>yQ,ZodIntersection:()=>GB,ZodIssueCode:()=>DK,ZodJWT:()=>xg,ZodKSUID:()=>Cg,ZodLazy:()=>fQ,ZodLiteral:()=>WB,ZodMAC:()=>kB,ZodMap:()=>jB,ZodNaN:()=>cQ,ZodNanoID:()=>hg,ZodNever:()=>MB,ZodNonOptional:()=>$g,ZodNull:()=>UB,ZodNullable:()=>eQ,ZodNumber:()=>Ws,ZodNumberFormat:()=>ao,ZodObject:()=>nc,ZodOptional:()=>oc,ZodPipe:()=>sc,ZodPrefault:()=>nQ,ZodPreprocess:()=>uQ,ZodPromise:()=>hQ,ZodReadonly:()=>lQ,ZodRealError:()=>vt,ZodRecord:()=>Hs,ZodSet:()=>qB,ZodString:()=>qs,ZodStringFormat:()=>me,ZodSuccess:()=>sQ,ZodSymbol:()=>_B,ZodTemplateLiteral:()=>gQ,ZodTransform:()=>KB,ZodTuple:()=>JB,ZodType:()=>ee,ZodULID:()=>Eg,ZodURL:()=>ec,ZodUUID:()=>Pr,ZodUndefined:()=>NB,ZodUnion:()=>ic,ZodUnknown:()=>FB,ZodVoid:()=>LB,ZodXID:()=>yg,ZodXor:()=>OB,_ZodString:()=>dg,_default:()=>rQ,_function:()=>nT,any:()=>U$,array:()=>rc,base64:()=>f$,base64url:()=>p$,bigint:()=>x$,boolean:()=>RB,catch:()=>AQ,check:()=>iT,cidrv4:()=>d$,cidrv6:()=>g$,clone:()=>ge,codec:()=>X$,coerce:()=>QQ,compile:()=>Oy,config:()=>Re,core:()=>un,creditCard:()=>m$,cuid:()=>i$,cuid2:()=>o$,currencyCode:()=>Q$,custom:()=>oT,date:()=>T$,decode:()=>yB,decodeAsync:()=>BB,deepPartial:()=>IT,describe:()=>sT,discriminatedUnion:()=>z$,e164:()=>h$,email:()=>jU,emoji:()=>r$,encode:()=>EB,encodeAsync:()=>CB,endsWith:()=>Ts,enum:()=>_g,exactOptional:()=>XB,file:()=>q$,flattenError:()=>QA,float32:()=>w$,float64:()=>b$,formatError:()=>vA,fromJSONSchema:()=>hT,function:()=>nT,getDiscriminatedOption:()=>uy,getErrorMap:()=>_K,globalRegistry:()=>je,gt:()=>Mr,gte:()=>Mt,guid:()=>qU,hash:()=>v$,hex:()=>B$,hostname:()=>C$,httpUrl:()=>t$,iban:()=>I$,includes:()=>Us,input:()=>yT,instanceof:()=>AT,int:()=>ug,int32:()=>k$,int64:()=>D$,intersection:()=>VB,invertCodec:()=>eT,ipv4:()=>c$,ipv6:()=>l$,iso:()=>cc,json:()=>uT,jwt:()=>E$,keyof:()=>F$,ksuid:()=>A$,lazy:()=>pQ,length:()=>to,literal:()=>j$,locales:()=>VA,looseObject:()=>P$,looseRecord:()=>V$,lowercase:()=>_s,lt:()=>Fr,lte:()=>Ft,mac:()=>u$,map:()=>J$,maxLength:()=>eo,maxSize:()=>Pn,memoizer:()=>zA,meta:()=>aT,mime:()=>Ms,minLength:()=>cn,minSize:()=>Lr,multipleOf:()=>Ln,nan:()=>K$,nanoid:()=>n$,nativeEnum:()=>H$,negative:()=>Xd,never:()=>Rg,nonnegative:()=>tg,nonoptional:()=>oQ,nonpositive:()=>eg,normalize:()=>Ls,null:()=>$B,nullable:()=>XA,nullish:()=>W$,number:()=>DB,object:()=>M$,optional:()=>io,output:()=>CT,overwrite:()=>pr,parse:()=>pB,parseAsync:()=>hB,partialRecord:()=>G$,pipe:()=>lg,positive:()=>Kd,prefault:()=>iQ,preprocess:()=>lT,prettifyError:()=>hI,promise:()=>rT,properties:()=>Fs,property:()=>rg,readonly:()=>dQ,record:()=>HB,refine:()=>IQ,regex:()=>Rs,regexes:()=>Xt,registry:()=>kd,safeDecode:()=>vB,safeDecodeAsync:()=>bB,safeEncode:()=>QB,safeEncodeAsync:()=>wB,safeParse:()=>mB,safeParseAsync:()=>IB,set:()=>Y$,setErrorMap:()=>RK,size:()=>Xi,slugify:()=>Gs,startsWith:()=>$s,strictObject:()=>L$,string:()=>KA,stringFormat:()=>y$,stringbool:()=>cT,success:()=>Z$,superRefine:()=>EQ,symbol:()=>_$,templateLiteral:()=>tT,toJSONSchema:()=>sg,toLowerCase:()=>Os,toUpperCase:()=>zs,toZod:()=>gA,transform:()=>Ng,treeifyError:()=>pI,trim:()=>Ps,tuple:()=>YB,uint32:()=>S$,uint64:()=>R$,ulid:()=>s$,undefined:()=>N$,union:()=>Xs,unknown:()=>no,uppercase:()=>Ns,url:()=>e$,util:()=>B,uuid:()=>WU,uuidv4:()=>ZU,uuidv6:()=>KU,uuidv7:()=>XU,validate:()=>wA,validateAsync:()=>bA,void:()=>$$,withParser:()=>Sd,xid:()=>a$,xor:()=>O$});var un={};Ir(un,{$ZodAny:()=>ty,$ZodArray:()=>ay,$ZodAsyncError:()=>Bt,$ZodBase64:()=>GE,$ZodBase64URL:()=>VE,$ZodBigInt:()=>gd,$ZodBigIntFormat:()=>ZE,$ZodBoolean:()=>TA,$ZodCIDRv4:()=>OE,$ZodCIDRv6:()=>zE,$ZodCUID:()=>xE,$ZodCUID2:()=>DE,$ZodCatch:()=>by,$ZodCheck:()=>ye,$ZodCheckBigIntFormat:()=>rE,$ZodCheckEndsWith:()=>fE,$ZodCheckGreaterThan:()=>Zl,$ZodCheckIncludes:()=>dE,$ZodCheckLengthEquals:()=>AE,$ZodCheckLessThan:()=>Wl,$ZodCheckLowerCase:()=>uE,$ZodCheckMaxLength:()=>sE,$ZodCheckMaxSize:()=>nE,$ZodCheckMimeType:()=>mE,$ZodCheckMinLength:()=>aE,$ZodCheckMinSize:()=>iE,$ZodCheckMultipleOf:()=>eE,$ZodCheckNumberFormat:()=>tE,$ZodCheckOverwrite:()=>IE,$ZodCheckProperties:()=>hE,$ZodCheckProperty:()=>pE,$ZodCheckRegex:()=>cE,$ZodCheckSizeEquals:()=>oE,$ZodCheckStartsWith:()=>gE,$ZodCheckStringFormat:()=>bs,$ZodCheckUpperCase:()=>lE,$ZodCodec:()=>MA,$ZodCreditCard:()=>YE,$ZodCustom:()=>Ny,$ZodCustomStringFormat:()=>qE,$ZodCyclicError:()=>yd,$ZodDate:()=>oy,$ZodDefault:()=>By,$ZodDiscriminatedUnion:()=>ly,$ZodE164:()=>JE,$ZodEmail:()=>QE,$ZodEmoji:()=>kE,$ZodEncodeError:()=>Fn,$ZodEnum:()=>hy,$ZodError:()=>fI,$ZodExactOptional:()=>yy,$ZodFile:()=>Iy,$ZodFunction:()=>Ry,$ZodGUID:()=>CE,$ZodIBAN:()=>HE,$ZodIPv4:()=>ME,$ZodIPv6:()=>LE,$ZodISODate:()=>$E,$ZodISODateTime:()=>UE,$ZodISODuration:()=>FE,$ZodISOTime:()=>TE,$ZodIntersection:()=>dy,$ZodJWT:()=>jE,$ZodKSUID:()=>NE,$ZodLazy:()=>LA,$ZodLiteral:()=>my,$ZodMAC:()=>PE,$ZodMap:()=>fy,$ZodNaN:()=>ky,$ZodNanoID:()=>SE,$ZodNever:()=>ny,$ZodNonOptional:()=>vy,$ZodNull:()=>ey,$ZodNullable:()=>Cy,$ZodNumber:()=>dd,$ZodNumberFormat:()=>WE,$ZodObject:()=>iN,$ZodObjectJIT:()=>Ay,$ZodOptional:()=>pd,$ZodPipe:()=>hd,$ZodPrefault:()=>Qy,$ZodPreprocess:()=>Sy,$ZodPromise:()=>_y,$ZodReadonly:()=>xy,$ZodRealError:()=>Qt,$ZodRecord:()=>gy,$ZodRegistry:()=>bd,$ZodSet:()=>py,$ZodString:()=>qi,$ZodStringFormat:()=>fe,$ZodSuccess:()=>wy,$ZodSymbol:()=>KE,$ZodTemplateLiteral:()=>Dy,$ZodTransform:()=>Ey,$ZodTuple:()=>fd,$ZodType:()=>W,$ZodULID:()=>RE,$ZodURL:()=>bE,$ZodUUID:()=>BE,$ZodUndefined:()=>XE,$ZodUnion:()=>FA,$ZodUnknown:()=>ry,$ZodVoid:()=>iy,$ZodXID:()=>_E,$ZodXor:()=>cy,$brand:()=>lI,$constructor:()=>I,$input:()=>Fy,$output:()=>Ty,Doc:()=>ji,INVALID:()=>At,JSONSchema:()=>JU,JSONSchemaGenerator:()=>ag,NEVER:()=>uI,TimePrecision:()=>qy,URL_BAD_FORMAT:()=>vE,URL_UNPARSEABLE:()=>RA,ZodCompileAsyncError:()=>fr,ZodCompileUnsupportedError:()=>oe,_any:()=>dC,_array:()=>EC,_base64:()=>jd,_base64url:()=>qd,_bigint:()=>oC,_boolean:()=>nC,_catch:()=>pK,_check:()=>xU,_cidrv4:()=>Yd,_cidrv6:()=>Hd,_coercedBigint:()=>sC,_coercedBoolean:()=>iC,_coercedDate:()=>mC,_coercedNumber:()=>Zy,_coercedString:()=>Jy,_creditCard:()=>Hy,_cuid:()=>Ld,_cuid2:()=>Pd,_custom:()=>CC,_date:()=>hC,_decode:()=>Ll,_decodeAsync:()=>Ol,_default:()=>dK,_discriminatedUnion:()=>eK,_e164:()=>Wd,_email:()=>Rd,_emoji:()=>Fd,_encode:()=>Ml,_encodeAsync:()=>Pl,_endsWith:()=>Ts,_enum:()=>sK,_file:()=>yC,_float32:()=>Xy,_float64:()=>eC,_gt:()=>Mr,_gte:()=>Mt,_guid:()=>_d,_iban:()=>jy,_includes:()=>Us,_int:()=>Ky,_int32:()=>tC,_int64:()=>aC,_intersection:()=>tK,_ipv4:()=>Vd,_ipv6:()=>Jd,_isoDate:()=>HA,_isoDateTime:()=>YA,_isoDuration:()=>qA,_isoTime:()=>jA,_jwt:()=>Zd,_ksuid:()=>Gd,_lazy:()=>EK,_length:()=>to,_literal:()=>AK,_lowercase:()=>_s,_lt:()=>Fr,_lte:()=>Ft,_mac:()=>Yy,_map:()=>iK,_max:()=>Ft,_maxLength:()=>eo,_maxSize:()=>Pn,_mime:()=>Ms,_min:()=>Mt,_minLength:()=>cn,_minSize:()=>Lr,_multipleOf:()=>Ln,_nan:()=>IC,_nanoid:()=>Md,_nativeEnum:()=>aK,_negative:()=>Xd,_never:()=>fC,_nonnegative:()=>tg,_nonoptional:()=>gK,_nonpositive:()=>eg,_normalize:()=>Ls,_null:()=>lC,_nullable:()=>lK,_number:()=>Wy,_optional:()=>uK,_overwrite:()=>pr,_parse:()=>Bs,_parseAsync:()=>Qs,_pipe:()=>hK,_positive:()=>Kd,_promise:()=>yK,_properties:()=>Fs,_property:()=>rg,_readonly:()=>mK,_record:()=>nK,_refine:()=>BC,_regex:()=>Rs,_safeDecode:()=>Gl,_safeDecodeAsync:()=>Jl,_safeEncode:()=>zl,_safeEncodeAsync:()=>Vl,_safeParse:()=>vs,_safeParseAsync:()=>ws,_set:()=>oK,_size:()=>Xi,_slugify:()=>Gs,_startsWith:()=>$s,_string:()=>Vy,_stringFormat:()=>ro,_stringbool:()=>bC,_success:()=>fK,_superRefine:()=>QC,_symbol:()=>cC,_templateLiteral:()=>IK,_toLowerCase:()=>Os,_toUpperCase:()=>zs,_transform:()=>cK,_trim:()=>Ps,_tuple:()=>rK,_uint32:()=>rC,_uint64:()=>AC,_ulid:()=>Od,_undefined:()=>uC,_union:()=>K9,_unknown:()=>gC,_uppercase:()=>Ns,_url:()=>JA,_uuid:()=>Nd,_uuidv4:()=>Ud,_uuidv6:()=>$d,_uuidv7:()=>Td,_void:()=>pC,_xid:()=>zd,_xor:()=>X9,base64Charset:()=>ad,base64urlCharset:()=>$A,canParseURL:()=>wE,clone:()=>ge,compile:()=>Oy,compileFn:()=>xd,config:()=>Re,createStandardJSONSchemaMethod:()=>Vs,createToJSONSchemaMethod:()=>SC,decode:()=>XW,decodeAsync:()=>tZ,describe:()=>vC,encode:()=>KW,encodeAsync:()=>eZ,extractDefs:()=>zn,finalize:()=>Gn,flattenError:()=>QA,formatError:()=>vA,getDiscriminatedOption:()=>uy,globalConfig:()=>ze,globalRegistry:()=>je,handleUnrepresentable:()=>Fe,initializeContext:()=>On,isBackEdge:()=>Bd,isRecursiveSchema:()=>Cd,isValidBase64:()=>UA,isValidBase64URL:()=>Ad,isValidCIDRv6:()=>sd,isValidCreditCard:()=>cd,isValidIBAN:()=>ud,isValidIPv6:()=>NA,isValidJWT:()=>ld,locales:()=>VA,memoizer:()=>zA,mergeValues:()=>ks,meta:()=>wC,parse:()=>Tl,parseAsync:()=>Fl,parseURLObject:()=>tN,prettifyError:()=>hI,process:()=>pe,processSchema:()=>pe,regexes:()=>Xt,registry:()=>kd,safeDecode:()=>nZ,safeDecodeAsync:()=>oZ,safeEncode:()=>rZ,safeEncodeAsync:()=>iZ,safeParse:()=>HW,safeParseAsync:()=>jW,standardProps:()=>rd,stripTabAndNewline:()=>_A,toDotPath:()=>U_,toJSONSchema:()=>sg,toZod:()=>gA,treeifyError:()=>pI,urlHostnameOk:()=>id,urlProtocolOk:()=>od,util:()=>B,validate:()=>wA,validateAsync:()=>bA,validateURL:()=>nd,version:()=>EE,withParser:()=>Sd});var B={};Ir(B,{BIGINT_FORMAT_RANGES:()=>IA,CONSTANT_CATCH:()=>Ul,Class:()=>eI,NUMBER_FORMAT_RANGES:()=>mA,aborted:()=>at,allowsEval:()=>nI,assert:()=>gW,assertEqual:()=>cW,assertIs:()=>lW,assertNever:()=>dW,assertNotEqual:()=>uW,assignProp:()=>He,attachSchema:()=>EA,base64ToUint8Array:()=>S_,base64urlToUint8Array:()=>_W,cached:()=>Is,captureStackTrace:()=>_l,cleanEnum:()=>RW,cleanRegex:()=>an,clone:()=>ge,cloneDef:()=>hW,codePointLength:()=>Yi,constantCatch:()=>AI,createTransparentProxy:()=>BW,defineLazy:()=>tI,defineLazyInternal:()=>re,derived:()=>TW,esc:()=>st,escapeRegex:()=>Kt,explicitlyAborted:()=>sI,extend:()=>wW,finalizeIssue:()=>Ct,floatSafeRemainder:()=>fA,getElementAtPath:()=>mW,getEnumValues:()=>hs,getLengthableOrigin:()=>CA,getParsedType:()=>CW,getSizableOrigin:()=>yA,hexToUint8Array:()=>UW,hide:()=>BA,installLazyProp:()=>PW,isObject:()=>Ji,isPlainObject:()=>Zt,issue:()=>Cs,joinValues:()=>E,jsonStringifyReplacer:()=>ms,members:()=>aI,merge:()=>kW,mergeDefs:()=>gr,normalizeParams:()=>x,nullish:()=>Rl,numKeys:()=>yW,objectClone:()=>fW,omit:()=>vW,optionalKeys:()=>oI,own:()=>Tn,parsedType:()=>v,partial:()=>SW,pick:()=>QW,prefixIssues:()=>yt,primitiveTypes:()=>iI,promiseAllObject:()=>IW,propertyKeyTypes:()=>hA,randomString:()=>EW,rawShape:()=>Es,required:()=>xW,safeExtend:()=>bW,shallowClone:()=>pA,sizeCaps:()=>ys,slugify:()=>rI,stringifyPrimitive:()=>Q,toZod:()=>gA,uint8ArrayToBase64:()=>x_,uint8ArrayToBase64url:()=>NW,uint8ArrayToHex:()=>$W,unwrapMessage:()=>ps});function cW(e){return e}function uW(e){return e}function gA(){return e=>e}function lW(e){}function dW(e){throw new Error("Unexpected value in exhaustive check")}function gW(e){}function hs(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function E(e,t="|"){return e.map(n=>Q(n)).join(t)}function ms(e,t){return typeof t=="bigint"?t.toString():t}var Xm=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Is(e){return new Xm(e)}function Rl(e){return e==null}function an(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function fA(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}var v_=Symbol("evaluating");function tI(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==v_)return i===void 0&&(i=v_,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function fW(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function He(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Es(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function sn(e){return Es(e._zod.def)??e._zod.def.shape}function w_(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return He(this,t,i),i},enumerable:!0,configurable:!0})}function b_(e,t,n){t in e?He(e,t,n):e[t]=n}function Vi(e,t,n,i){let r=sn(t);for(let o of n){let s=Object.getOwnPropertyDescriptor(r,o);s.enumerable&&(s.get?w_(e,o,()=>{let a=t._zod.def.shape[o];return i?i(a,o):a}):b_(e,o,i?i(s.value,o):s.value))}}function pW(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?w_(e,n,()=>t[n]):b_(e,n,i.value))}}function gr(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}function hW(e){return gr(e._zod.def)}function mW(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}function IW(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let o=0;o<t.length;o++)r[t[o]]=i[o];return r})}function EW(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}function st(e){return JSON.stringify(e)}function rI(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var _l="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ji(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var nI=Is(()=>{if(ze.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Zt(e){if(Ji(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ji(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pA(e){return Zt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function yW(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var CW=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},hA=new Set(["string","number","symbol"]),iI=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ge(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function BW(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,o){return t??(t=e()),Reflect.set(t,i,r,o)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}function Q(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function oI(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var mA={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},IA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function QW(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let o={};return Vi(o,e,Nl(e,t)),ge(e,gr(n,{shape:o,checks:[]}))}function Nl(e,t){let n=sn(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}function vW(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let o=new Set(Nl(e,t)),s={};return Vi(s,e,Reflect.ownKeys(sn(e)).filter(a=>!o.has(a))),ge(e,gr(n,{shape:s,checks:[]}))}function wW(e,t){if(!Zt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=sn(e);for(let o of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ge(e,gr(e._zod.def,{shape:k_(e,t)}))}function k_(e,t){let n={};return Vi(n,e,Reflect.ownKeys(sn(e))),pW(n,t),n}function bW(e,t){if(!Zt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ge(e,gr(e._zod.def,{shape:k_(e,t)}))}function kW(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Vi(n,e,Reflect.ownKeys(sn(e))),Vi(n,t,Reflect.ownKeys(sn(t)));let i=gr(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ge(e,i)}function SW(e,t,n,i="partial"){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let a=n?new Set(Nl(t,n)):void 0,A={};return Vi(A,t,Reflect.ownKeys(sn(t)),e&&((c,l)=>a&&!a.has(l)?c:new e({type:"optional",innerType:c}))),ge(t,gr(t._zod.def,{shape:A,checks:[]}))}function xW(e,t,n){let i=n?new Set(Nl(t,n)):void 0,r={};return Vi(r,t,Reflect.ownKeys(sn(t)),(o,s)=>i&&!i.has(s)?o:new e({type:"nonoptional",innerType:o})),ge(t,gr(t._zod.def,{shape:r}))}function at(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function sI(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function yt(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function ps(e){return typeof e=="string"?e:e?.message}function ys(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}function EA(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}function Ct(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let o=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ps(e.inst?._zod.def?.error?.(e))??ps(o?.(e))??ps(t?.error?.(e))??ps(n.customError?.(e))??ps(n.localeError?.(e))??"Invalid input",a={};for(let A of Object.keys(e))A==="inst"||A==="schema"||A==="continue"||A==="input"||A==="__proto__"||(a[A]=e[A]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function yA(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var DW=/[\uD800-\uDBFF]/;function Yi(e){let t=e.length;if(!DW.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}function CA(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function v(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Cs(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}function RW(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function S_(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function x_(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function _W(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return S_(t+n)}function NW(e){return x_(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function UW(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}function $W(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var eI=class{constructor(...t){}};function aI(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):FW(e,n,i.value)}}function Tn(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}function BA(e,t,n){return Tn(e,t,n,!1)}function TW(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Tn(this,n,i(this))},set(r){Tn(this,n,r)}})}return t}function FW(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Tn(this,t,n.bind(this))},set(i){Tn(this,t,i)}})}function MW(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Km,$n=!1,LW={configurable:!0,get(){$n=!0}};function re(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&Km!==e._zod){Km=void 0;return}Km=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,LW);let r=$n;$n=!1;try{let o=n(this);return $n?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o}),$n=$n||r,o}catch(o){throw delete this[t],$n=$n||r,o}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}function PW(e,t,n,i){let r=MW(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let o={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,o),o.value=n(this),Object.defineProperty(this,t,o),o.value},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:o})}})}var Ul="~constantCatch";function AI(e){let t=()=>e;return t[Ul]=!0,t}var D_,uI=Object.freeze({status:"aborted"}),cI={value:void 0,enumerable:!1},R_="captureStackTrace"in Error?Error:null;function OW(e){let t=R_;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return R_=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function I(e,t,n,i){let r={};function o(g){this.def=g,this.constr=d,this.traits=new Set}o.prototype=r;let s=n,a=s&&new WeakSet;function A(g,f){if(g._zod){if(g._zod.traits.has(e))return}else{cI.value=new o(f);try{Object.defineProperty(g,"_zod",cI)}finally{cI.value=void 0}}if(g._zod.traits.add(e),t(g,f),a){let h=Object.getPrototypeOf(g),y=g._zod.constr.prototype,m=h;for(;m&&m!==y;)m=Object.getPrototypeOf(m);let C=m??h;a.has(C)||(a.add(C),aI(C,s))}let p=d.prototype;for(let h in p)Object.prototype.hasOwnProperty.call(p,h)&&(h in g||(g[h]=p[h].bind(g)))}let c=i?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(g){let f=i?.Parent?OW(l):this;A(f,g);let p=f._zod.deferred;if(p){for(let y of p)y();f._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(f),f}return Object.defineProperty(d,"init",{value:A}),Object.defineProperty(d,Symbol.hasInstance,{value:g=>i?.Parent&&g instanceof i.Parent?!0:g?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var lI=Symbol("zod_brand"),Bt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Fn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(D_=globalThis).__zod_globalConfig??(D_.__zod_globalConfig={});var ze=globalThis.__zod_globalConfig;function Re(e){return e&&Object.assign(ze,e),ze}function zW(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ms,2)),e.message}function GW(e){this._zod.message=e}var VW={get:zW,set:GW,enumerable:!0,configurable:!0},gI={value:void 0,enumerable:!1},__=new WeakSet([Object.prototype,Error.prototype]),N_=(e,t)=>{e.name="$ZodError",gI.value=t,Object.defineProperty(e,"issues",gI),gI.value=void 0,Object.defineProperty(e,"message",VW);let n=Object.getPrototypeOf(e);__.has(n)||(__.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},fI=I("$ZodError",N_),Qt=I("$ZodError",N_,void 0,{Parent:Error});function JW(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function QA(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?JW(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}function vA(e,t=n=>n.message){let n={_errors:[]},i=(r,o=[])=>{for(let s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>i({issues:a},[...o,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...o,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...o,...s.path]);else{let a=[...o,...s.path];if(a.length===0)n._errors.push(t(s));else{let A=n,c=0;for(;c<a.length;){let l=a[c],d=c===a.length-1;if(l==="_errors"){d&&A._errors.push(t(s)),c++;continue}Object.prototype.hasOwnProperty.call(A,l)||Object.defineProperty(A,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let g=A[l];d&&g._errors.push(t(s)),A=g,c++}}}};return i(e),n}function pI(e,t=n=>n.message){let n={errors:[]},i=(r,o=[])=>{var s;for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(A=>i({issues:A},[...o,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...o,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...o,...a.path]);else{let A=[...o,...a.path];if(A.length===0){n.errors.push(t(a));continue}let c=n,l=0;for(;l<A.length;){let d=A[l],g=l===A.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(s=c.items)[d]??(s[d]={errors:[]}),c=c.items[d]),g&&c.errors.push(t(a)),l++}}};return i(e),n}function U_(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function hI(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${U_(i.path)}`);return t.join(`
|
|
47
47
|
`)}function $l(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Bs=e=>{let t=(n,i,r,o)=>{let s=r?{...r,async:!1}:{async:!1},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new Bt;if(a.issues.length){let A=new(o?.Err??e)(a.issues.map(c=>Ct(c,s,Re())));throw _l(A,o?.callee??t),A}return a.value};return t},Tl=Bs(Qt),Qs=e=>{let t=async(n,i,r,o)=>{let s=r?{...r,async:!0}:{async:!0},a=n._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let A=new(o?.Err??e)(a.issues.map(c=>Ct(c,s,Re())));throw _l(A,o?.callee??t),A}return a.value};return t},Fl=Qs(Qt),vs=e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new Bt;return o.issues.length?$_(e,o.issues,r):{success:!0,data:o.value}},HW=vs(Qt);function $_(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>Ct(r,n,Re()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}var ws=e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?$_(e,o.issues,r):{success:!0,data:o.value}},jW=ws(Qt),qW=Symbol.for("zod.compile.invalid"),WW=Symbol.for("zod.compile.fallback"),wA=((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==qW)return!0;if(i.definite===!0&&n===void 0)return!1}return ZW(e,t,n)});function ZW(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,o;if(r?(i[WW]=!0,o=r({value:t,issues:[]},i)):o=e._zod.run({value:t,issues:[]},i),o instanceof Promise)throw new Bt;return o.issues.length===0}var bA=async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},Ml=e=>{let t=Bs(e),n=(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return t(i,r,a,$l(n,s))};return n},KW=Ml(Qt),Ll=e=>{let t=Bs(e),n=(i,r,o,s)=>t(i,r,o,$l(n,s));return n},XW=Ll(Qt),Pl=e=>{let t=Qs(e),n=async(i,r,o,s)=>{let a=o?{...o,direction:"backward"}:{direction:"backward"};return await t(i,r,a,$l(n,s))};return n},eZ=Pl(Qt),Ol=e=>{let t=Qs(e),n=async(i,r,o,s)=>await t(i,r,o,$l(n,s));return n},tZ=Ol(Qt),zl=e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return vs(e)(t,n,r)},rZ=zl(Qt),Gl=e=>(t,n,i)=>vs(e)(t,n,i),nZ=Gl(Qt),Vl=e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return ws(e)(t,n,r)},iZ=Vl(Qt),Jl=e=>async(t,n,i)=>ws(e)(t,n,i),oZ=Jl(Qt);var Xt={};Ir(Xt,{anyString:()=>GI,base64:()=>UI,base64url:()=>$I,bigint:()=>JI,boolean:()=>YI,browserEmail:()=>gZ,cidrv4:()=>_I,cidrv6:()=>NI,creditCard:()=>Yl,cuid:()=>II,cuid2:()=>EI,currencyCode:()=>LI,date:()=>PI,datetime:()=>zI,domain:()=>FI,duration:()=>wI,e164:()=>MI,email:()=>kI,emoji:()=>SI,extendedDuration:()=>sZ,guid:()=>bI,hex:()=>ZI,hostname:()=>TI,html5Email:()=>uZ,httpProtocol:()=>kA,iban:()=>Hl,idnEmail:()=>dZ,integer:()=>SA,ipv4:()=>xI,ipv6:()=>DI,ksuid:()=>BI,lowercase:()=>qI,mac:()=>RI,md5_base64:()=>mZ,md5_base64url:()=>IZ,md5_hex:()=>hZ,nanoid:()=>QI,nanoidOfLength:()=>vI,null:()=>HI,number:()=>An,rfc5322Email:()=>lZ,sha1_base64:()=>yZ,sha1_base64url:()=>CZ,sha1_hex:()=>EZ,sha256_base64:()=>QZ,sha256_base64url:()=>vZ,sha256_hex:()=>BZ,sha384_base64:()=>bZ,sha384_base64url:()=>kZ,sha384_hex:()=>wZ,sha512_base64:()=>xZ,sha512_base64url:()=>DZ,sha512_hex:()=>SZ,string:()=>VI,time:()=>OI,ulid:()=>yI,undefined:()=>jI,unicodeEmail:()=>T_,uppercase:()=>WI,uuid:()=>Hi,uuid4:()=>aZ,uuid6:()=>AZ,uuid7:()=>cZ,xid:()=>CI});var II=/^[cC][0-9a-z]{6,}$/,EI=/^[0-9a-z]+$/,yI=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,CI=/^[0-9a-vA-V]{20}$/,BI=/^[A-Za-z0-9]{27}$/,QI=/^[a-zA-Z0-9_-]{21}$/;function vI(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var wI=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sZ=/^[-+]?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)?)??$/,bI=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Hi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,aZ=Hi(4),AZ=Hi(6),cZ=Hi(7),kI=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uZ=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,lZ=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,T_=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dZ=T_,gZ=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,fZ="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function SI(){return new RegExp(fZ,"u")}var xI=/^(?:(?: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])$/,DI=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,RI=e=>{let t=Kt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_I=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,NI=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,$I=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,TI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,FI=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,kA=/^https?$/,MI=/^\+[1-9]\d{6,14}$/,Yl=/^\d(?:[ -]?\d){11,18}$/,LI=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Hl=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,F_="(?:(?:\\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])))";function pZ(e){return new RegExp(`^${e}$`)}var PI=pZ(F_);function mI(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function OI(e){return new RegExp(`^${mI(e)}$`)}function zI(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${mI({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${mI({precision:e.precision})}`:n;return new RegExp(`^${F_}T(?:${i})$`)}var GI=/^[\s\S]{0,}$/,VI=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},JI=/^-?\d+n?$/,SA=/^-?\d+$/,An=/^-?\d+(?:\.\d+)?$/,YI=/^(?:true|false)$/i,HI=/^null$/i;var jI=/^undefined$/i;var qI=/^[^A-Z]*$/,WI=/^[^a-z]*$/,ZI=/^[0-9a-fA-F]*$/;function xA(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function DA(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var hZ=/^[0-9a-fA-F]{32}$/,mZ=xA(22,"=="),IZ=DA(22),EZ=/^[0-9a-fA-F]{40}$/,yZ=xA(27,"="),CZ=DA(27),BZ=/^[0-9a-fA-F]{64}$/,QZ=xA(43,"="),vZ=DA(43),wZ=/^[0-9a-fA-F]{96}$/,bZ=xA(64,""),kZ=DA(64),SZ=/^[0-9a-fA-F]{128}$/,xZ=xA(86,"=="),DZ=DA(86);var ye=I("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),KI=e=>{let t=e.value;return!Rl(t)&&t.size!==void 0},XI=e=>{let t=e.value;return!Rl(t)&&t.length!==void 0},jl={number:"number",bigint:"bigint",object:"date"},Wl=I("$ZodCheckLessThan",(e,t)=>{ye.init(e,t);let n=jl[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:jl[typeof i.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zl=I("$ZodCheckGreaterThan",(e,t)=>{ye.init(e,t);let n=jl[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:jl[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),eE=I("$ZodCheckMultipleOf",(e,t)=>{ye.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):fA(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),tE=I("$ZodCheckNumberFormat",(e,t)=>{ye.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,o]=mA[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),rE=I("$ZodCheckBigIntFormat",(e,t)=>{ye.init(e,t);let[n,i]=IA[t.format];e._zod.check=r=>{let o=r.value;o<n&&r.issues.push({origin:"bigint",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>i&&r.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),nE=I("$ZodCheckMaxSize",(e,t)=>{var n;ye.init(e,t),(n=e._zod.def).when??(n.when=KI),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:yA(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),iE=I("$ZodCheckMinSize",(e,t)=>{var n;ye.init(e,t),(n=e._zod.def).when??(n.when=KI),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:yA(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),oE=I("$ZodCheckSizeEquals",(e,t)=>{var n;ye.init(e,t),(n=e._zod.def).when??(n.when=KI),e._zod.check=i=>{let r=i.value,o=r.size;if(o===t.size)return;let s=o>t.size;i.issues.push({origin:yA(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),sE=I("$ZodCheckMaxLength",(e,t)=>{var n;ye.init(e,t),(n=e._zod.def).when??(n.when=XI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>t.maximum?Yi(r):o)<=t.maximum)return;let a=CA(r);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),aE=I("$ZodCheckMinLength",(e,t)=>{var n;ye.init(e,t),(n=e._zod.def).when??(n.when=XI),e._zod.check=i=>{let r=i.value,o=r.length;if((typeof r=="string"&&o>=t.minimum&&o<t.minimum*2?Yi(r):o)>=t.minimum)return;let a=CA(r);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),AE=I("$ZodCheckLengthEquals",(e,t)=>{var n;ye.init(e,t),(n=e._zod.def).when??(n.when=XI),e._zod.check=i=>{let r=i.value,o=r.length,s=typeof r=="string"&&o>=t.length&&o<=t.length*2?Yi(r):o;if(s===t.length)return;let a=CA(r),A=s>t.length;i.issues.push({origin:a,...A?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),bs=I("$ZodCheckStringFormat",(e,t)=>{var n,i;ye.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),cE=I("$ZodCheckRegex",(e,t)=>{bs.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),uE=I("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qI),bs.init(e,t)}),lE=I("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=WI),bs.init(e,t)}),dE=I("$ZodCheckIncludes",(e,t)=>{ye.init(e,t);let n=Kt(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),gE=I("$ZodCheckStartsWith",(e,t)=>{ye.init(e,t);let n=new RegExp(`^${Kt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),fE=I("$ZodCheckEndsWith",(e,t)=>{ye.init(e,t);let n=new RegExp(`.*${Kt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function ql(e,t,n){e.issues.length&&t.issues.push(...yt(n,e.issues))}var pE=I("$ZodCheckProperty",(e,t)=>{ye.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>ql(r,n,t.property));ql(i,n,t.property)}}),hE=I("$ZodCheckProperties",(e,t)=>{ye.init(e,t),BA(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let r=i.value,o;for(let[s,a]of n){let A=a._zod.run({value:r[s],issues:[]},{});A instanceof Promise?(o??(o=[]),o.push(A.then(c=>ql(c,i,s)))):ql(A,i,s)}if(o)return Promise.all(o).then(()=>{})}}),mE=I("$ZodCheckMimeType",(e,t)=>{ye.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),IE=I("$ZodCheckOverwrite",(e,t)=>{ye.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ji=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
48
48
|
`).filter(s=>s),r=Math.min(...i.map(s=>s.length-s.trimStart().length)),o=i.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
49
49
|
${n.join(`
|