@eui/mcp 23.0.0-alpha.2 → 23.0.0-alpha.4

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/main.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- var dx=Object.create;var Ra=Object.defineProperty;var fx=Object.getOwnPropertyDescriptor;var px=Object.getOwnPropertyNames;var mx=Object.getPrototypeOf,hx=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},of=(t,e)=>{for(var r in e)Ra(t,r,{get:e[r],enumerable:!0})},gx=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of px(e))!hx.call(t,o)&&o!==r&&Ra(t,o,{get:()=>e[o],enumerable:!(n=fx(e,o))||n.enumerable});return t};var mt=(t,e,r)=>(r=t!=null?dx(mx(t)):{},gx(e||!t||!t.__esModule?Ra(r,"default",{value:t,enumerable:!0}):r,t));var ec=$((Zj,Uf)=>{"use strict";var no=t=>t&&typeof t.message=="string",Xa=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return no(r)?r:void 0}else return no(e)?e:void 0},qf=(t,e)=>{if(!no(t))return"";let r=t.stack||"";if(e.has(t))return r+`
3
- causes have become circular...`;let n=Xa(t);return n?(e.add(t),r+`
4
- caused by: `+qf(n,e)):r},Q0=t=>qf(t,new Set),Ff=(t,e,r)=>{if(!no(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let o=Xa(t);if(o){e.add(t);let s=typeof t.cause=="function";return n+(s?"":": ")+Ff(o,e,s)}else return n},X0=t=>Ff(t,new Set);Uf.exports={isErrorLike:no,getErrorCause:Xa,stackWithCauses:Q0,messageWithCauses:X0}});var tc=$((Lj,Bf)=>{"use strict";var eS=Symbol("circular-ref-tag"),Ds=Symbol("pino-raw-err-ref"),Vf=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Ds]},set:function(t){this[Ds]=t}}});Object.defineProperty(Vf,Ds,{writable:!0,value:{}});Bf.exports={pinoErrProto:Vf,pinoErrorSymbols:{seen:eS,rawSymbol:Ds}}});var Gf=$((qj,Wf)=>{"use strict";Wf.exports=nc;var{messageWithCauses:tS,stackWithCauses:rS,isErrorLike:Hf}=ec(),{pinoErrProto:nS,pinoErrorSymbols:oS}=tc(),{seen:rc}=oS,{toString:sS}=Object.prototype;function nc(t){if(!Hf(t))return t;t[rc]=void 0;let e=Object.create(nS);e.type=sS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=tS(t),e.stack=rS(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>nc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Hf(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,rc)&&(e[r]=nc(n)):e[r]=n}return delete t[rc],e.raw=t,e}});var Kf=$((Fj,Jf)=>{"use strict";Jf.exports=Ms;var{isErrorLike:oc}=ec(),{pinoErrProto:iS,pinoErrorSymbols:aS}=tc(),{seen:js}=aS,{toString:cS}=Object.prototype;function Ms(t){if(!oc(t))return t;t[js]=void 0;let e=Object.create(iS);e.type=cS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Ms(r))),oc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,js)&&(e.cause=Ms(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];oc(n)?Object.prototype.hasOwnProperty.call(n,js)||(e[r]=Ms(n)):e[r]=n}return delete t[js],e.raw=t,e}});var ep=$((Uj,Xf)=>{"use strict";Xf.exports={mapHttpRequest:uS,reqSerializer:Qf};var sc=Symbol("pino-raw-req-ref"),Yf=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[sc]},set:function(t){this[sc]=t}}});Object.defineProperty(Yf,sc,{writable:!0,value:{}});function Qf(t){let e=t.info||t.socket,r=Object.create(Yf);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function uS(t){return{req:Qf(t)}}});var op=$((Vj,np)=>{"use strict";np.exports={mapHttpResponse:lS,resSerializer:rp};var ic=Symbol("pino-raw-res-ref"),tp=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[ic]},set:function(t){this[ic]=t}}});Object.defineProperty(tp,ic,{writable:!0,value:{}});function rp(t){let e=Object.create(tp);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function lS(t){return{res:rp(t)}}});var cc=$((Bj,sp)=>{"use strict";var ac=Gf(),dS=Kf(),Zs=ep(),Ls=op();sp.exports={err:ac,errWithCause:dS,mapHttpRequest:Zs.mapHttpRequest,mapHttpResponse:Ls.mapHttpResponse,req:Zs.reqSerializer,res:Ls.resSerializer,wrapErrorSerializer:function(e){return e===ac?e:function(n){return e(ac(n))}},wrapRequestSerializer:function(e){return e===Zs.reqSerializer?e:function(n){return e(Zs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Ls.resSerializer?e:function(n){return e(Ls.resSerializer(n))}}}});var uc=$((Hj,ip)=>{"use strict";function fS(t,e){return e}ip.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=fS;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),o=[];for(let s of n)s&&o.push(s.getFileName());return o}});var fp=$((Wj,dp)=>{"use strict";function lc(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=lc(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=lc(t[r]));return e}return t}function ap(t){let e=[],r="",n=!1,o=!1,s="";for(let i=0;i<t.length;i++){let a=t[i];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,o=!1):(a==='"'||a==="'")&&n?o?a===s?(o=!1,s=""):r+=a:(o=!0,s=a):r+=a}return r&&e.push(r),e}function cp(t,e,r){let n=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof n!="object"||n===null||!(i in n)||typeof n[i]!="object"||n[i]===null)return!1;n=n[i]}let o=e[e.length-1];if(o==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=r;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r)}else typeof n=="object"&&n!==null&&o in n&&Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=r);return!0}function up(t,e){let r=t;for(let o=0;o<e.length-1;o++){let s=e[o];if(typeof r!="object"||r===null||!(s in r)||typeof r[s]!="object"||r[s]===null)return!1;r=r[s]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let o=0;o<r.length;o++)r[o]=void 0;else if(typeof r=="object"&&r!==null)for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&delete r[o]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var qs=Symbol("PATH_NOT_FOUND");function pS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return qs;r=r[n]}return r}function mS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function hS(t,e,r,n=!1){for(let o of e){let s=ap(o);if(s.includes("*"))lp(t,s,r,o,n);else if(n)up(t,s);else{let i=pS(t,s);if(i===qs)continue;let a=typeof r=="function"?r(i,s):r;cp(t,s,a)}}}function lp(t,e,r,n,o=!1){let s=e.indexOf("*");if(s===e.length-1){let i=e.slice(0,-1),a=t;for(let c of i){if(a==null||typeof a!="object"||a===null)return;a=a[c]}if(Array.isArray(a))if(o)for(let c=0;c<a.length;c++)a[c]=void 0;else for(let c=0;c<a.length;c++){let u=[...i,c.toString()],l=typeof r=="function"?r(a[c],u):r;a[c]=l}else if(typeof a=="object"&&a!==null)if(o){let c=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&c.push(u);for(let u of c)delete a[u]}else for(let c in a){let u=[...i,c],l=typeof r=="function"?r(a[c],u):r;a[c]=l}}else gS(t,e,r,s,n,o)}function gS(t,e,r,n,o,s=!1){let i=e.slice(0,n),a=e.slice(n+1),c=[];function u(l,d){if(d===i.length){if(Array.isArray(l))for(let m=0;m<l.length;m++)c[d]=m.toString(),u(l[m],d+1);else if(typeof l=="object"&&l!==null)for(let m in l)c[d]=m,u(l[m],d+1)}else if(d<i.length){let m=i[d];l&&typeof l=="object"&&l!==null&&m in l&&(c[d]=m,u(l[m],d+1))}else if(a.includes("*"))lp(l,a,typeof r=="function"?(p,f)=>{let h=[...c.slice(0,d),...f];return r(p,h)}:r,o,s);else if(s)up(l,a);else{let m=typeof r=="function"?r(mS(l,a),[...c.slice(0,d),...a]):r;cp(l,a,m)}}if(i.length===0)u(t,0);else{let l=t;for(let d=0;d<i.length;d++){let m=i[d];if(l==null||typeof l!="object"||l===null)return;l=l[m],c[d]=m}l!=null&&u(l,i.length)}}function yS(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=ap(r),o=e;for(let s=0;s<n.length;s++){let i=n[s];o.has(i)||o.set(i,new Map),o=o.get(i)}}return e}function _S(t,e){if(!e)return t;function r(n,o,s=0){if(!o||o.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let c=0;c<n.length;c++){let u=c.toString();o.has(u)||o.has("*")?a[c]=r(n[c],o.get(u)||o.get("*")):a[c]=n[c]}return a}let i=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o.has(a)||o.has("*")?i[a]=r(n[a],o.get(a)||o.get("*")):i[a]=n[a]);return i}return r(t,e)}function vS(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let o=0;o<t.length;o++){let s=t[o];if((s==='"'||s==="'")&&e>0)r?s===n&&(r=!1,n=""):(r=!0,n=s);else if(s==="["&&!r)e++;else if(s==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function bS(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)vS(e)}function wS(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:o=!0,remove:s=!1}=t;bS(e);let i=yS(e);return function(c){if(o&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let u=_S(c,i),l=c,d=r;return typeof r=="function"&&(d=r),hS(u,e,d,s),n===!1?(u.restore=function(){return lc(l)},u):typeof n=="function"?n(u):JSON.stringify(u)}}dp.exports=wS});var an=$((Gj,pp)=>{"use strict";var xS=Symbol("pino.setLevel"),SS=Symbol("pino.getLevel"),$S=Symbol("pino.levelVal"),kS=Symbol("pino.levelComp"),ES=Symbol("pino.useLevelLabels"),zS=Symbol("pino.useOnlyCustomLevels"),PS=Symbol("pino.mixin"),TS=Symbol("pino.lsCache"),CS=Symbol("pino.chindings"),OS=Symbol("pino.asJson"),IS=Symbol("pino.write"),RS=Symbol("pino.redactFmt"),NS=Symbol("pino.time"),AS=Symbol("pino.timeSliceIndex"),DS=Symbol("pino.stream"),jS=Symbol("pino.stringify"),MS=Symbol("pino.stringifySafe"),ZS=Symbol("pino.stringifiers"),LS=Symbol("pino.end"),qS=Symbol("pino.formatOpts"),FS=Symbol("pino.messageKey"),US=Symbol("pino.errorKey"),VS=Symbol("pino.nestedKey"),BS=Symbol("pino.nestedKeyStr"),HS=Symbol("pino.mixinMergeStrategy"),WS=Symbol("pino.msgPrefix"),GS=Symbol("pino.wildcardFirst"),JS=Symbol.for("pino.serializers"),KS=Symbol.for("pino.formatters"),YS=Symbol.for("pino.hooks"),QS=Symbol.for("pino.metadata");pp.exports={setLevelSym:xS,getLevelSym:SS,levelValSym:$S,levelCompSym:kS,useLevelLabelsSym:ES,mixinSym:PS,lsCacheSym:TS,chindingsSym:CS,asJsonSym:OS,writeSym:IS,serializersSym:JS,redactFmtSym:RS,timeSym:NS,timeSliceIndexSym:AS,streamSym:DS,stringifySym:jS,stringifySafeSym:MS,stringifiersSym:ZS,endSym:LS,formatOptsSym:qS,messageKeySym:FS,errorKeySym:US,nestedKeySym:VS,wildcardFirstSym:GS,needsMetadataGsym:QS,useOnlyCustomLevelsSym:zS,formattersSym:KS,hooksSym:YS,nestedKeyStrSym:BS,mixinMergeStrategySym:HS,msgPrefixSym:WS}});var fc=$((Jj,yp)=>{"use strict";var mp=fp(),{redactFmtSym:XS,wildcardFirstSym:Fs}=an(),dc=/[^.[\]]+|\[([^[\]]*?)\]/g,hp="[Redacted]",gp=!1;function e$(t,e){let{paths:r,censor:n,remove:o}=t$(t),s=r.reduce((c,u)=>{dc.lastIndex=0;let l=dc.exec(u),d=dc.exec(u),m=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(m==="*"&&(m=Fs),d===null)return c[m]=null,c;if(c[m]===null)return c;let{index:p}=d,f=`${u.substr(p,u.length-1)}`;return c[m]=c[m]||[],m!==Fs&&c[m].length===0&&c[m].push(...c[Fs]||[]),m===Fs&&Object.keys(c).forEach(function(h){c[h]&&c[h].push(f)}),c[m].push(f),c},{}),i={[XS]:mp({paths:r,censor:n,serialize:e,strict:gp,remove:o})},a=(...c)=>e(typeof n=="function"?n(...c):n);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((c,u)=>{if(s[u]===null)c[u]=l=>a(l,[u]);else{let l=typeof n=="function"?(d,m)=>n(d,[u,...m]):n;c[u]=mp({paths:s[u],censor:l,serialize:e,strict:gp,remove:o})}return c},i)}function t$(t){if(Array.isArray(t))return t={paths:t,censor:hp},t;let{paths:e,censor:r=hp,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}yp.exports=e$});var bp=$((Kj,vp)=>{"use strict";var r$=()=>"",n$=()=>`,"time":${Date.now()}`,o$=()=>`,"time":${Math.round(Date.now()/1e3)}`,s$=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,i$=1000000n,_p=1000000000n,a$=BigInt(Date.now())*i$,c$=process.hrtime.bigint(),u$=()=>{let t=process.hrtime.bigint()-c$,e=a$+t,r=e/_p,n=e%_p,o=Number(r*1000n+n/1000000n),s=new Date(o),i=s.getUTCFullYear(),a=(s.getUTCMonth()+1).toString().padStart(2,"0"),c=s.getUTCDate().toString().padStart(2,"0"),u=s.getUTCHours().toString().padStart(2,"0"),l=s.getUTCMinutes().toString().padStart(2,"0"),d=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${i}-${a}-${c}T${u}:${l}:${d}.${n.toString().padStart(9,"0")}Z"`};vp.exports={nullTime:r$,epochTime:n$,unixTime:o$,isoTime:s$,isoTimeNano:u$}});var xp=$((Yj,wp)=>{"use strict";function l$(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}wp.exports=d$;function d$(t,e,r){var n=r&&r.stringify||l$,o=1;if(typeof t=="object"&&t!==null){var s=e.length+o;if(s===1)return t;var i=new Array(s);i[0]=n(t);for(var a=1;a<s;a++)i[a]=n(e[a]);return i.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var u="",l=1-o,d=-1,m=t&&t.length||0,p=0;p<m;){if(t.charCodeAt(p)===37&&p+1<m){switch(d=d>-1?d:0,t.charCodeAt(p+1)){case 100:case 102:if(l>=c||e[l]==null)break;d<p&&(u+=t.slice(d,p)),u+=Number(e[l]),d=p+2,p++;break;case 105:if(l>=c||e[l]==null)break;d<p&&(u+=t.slice(d,p)),u+=Math.floor(Number(e[l])),d=p+2,p++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;d<p&&(u+=t.slice(d,p));var f=typeof e[l];if(f==="string"){u+="'"+e[l]+"'",d=p+2,p++;break}if(f==="function"){u+=e[l].name||"<anonymous>",d=p+2,p++;break}u+=n(e[l]),d=p+2,p++;break;case 115:if(l>=c)break;d<p&&(u+=t.slice(d,p)),u+=String(e[l]),d=p+2,p++;break;case 37:d<p&&(u+=t.slice(d,p)),u+="%",d=p+2,p++,l--;break}++l}++p}return d===-1?t:(d<m&&(u+=t.slice(d)),u)}});var mc=$((Qj,pc)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));pc.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};pc.exports=t}});var Cp=$((Xj,Tp)=>{"use strict";var ue=require("fs"),f$=require("events"),p$=require("util").inherits,Sp=require("path"),gc=mc(),m$=require("assert"),Us=100,Vs=Buffer.allocUnsafe(0),h$=16*1024,$p="buffer",kp="utf8",[g$,y$]=(process.versions.node||"0.0").split(".").map(Number),_$=g$>=22&&y$>=7;function Ep(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(s,i){if(s){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",s)}):e.emit("error",s);return}let a=e._reopening;e.fd=i,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",o=e.mode;if(e.sync)try{e.mkdir&&ue.mkdirSync(Sp.dirname(t),{recursive:!0});let s=ue.openSync(t,n,o);r(null,s)}catch(s){throw r(s),s}else e.mkdir?ue.mkdir(Sp.dirname(t),{recursive:!0},s=>{if(s)return r(s);ue.open(t,n,o,r)}):ue.open(t,n,o,r)}function vt(t){if(!(this instanceof vt))return new vt(t);let{fd:e,dest:r,minLength:n,maxLength:o,maxWrite:s,periodicFlush:i,sync:a,append:c=!0,mkdir:u,retryEAGAIN:l,fsync:d,contentMode:m,mode:p}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=o||0,this.maxWrite=s||h$,this._periodicFlush=i||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=d||!1,this.append=c||!1,this.mode=p,this.retryEAGAIN=l||(()=>!0),this.mkdir=u||!1;let f,h;if(m===$p)this._writingBuf=Vs,this.write=w$,this.flush=S$,this.flushSync=k$,this._actualWrite=z$,f=()=>ue.writeSync(this.fd,this._writingBuf),h=()=>ue.write(this.fd,this._writingBuf,this.release);else if(m===void 0||m===kp)this._writingBuf="",this.write=b$,this.flush=x$,this.flushSync=$$,this._actualWrite=E$,f=()=>Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8"),h=()=>Buffer.isBuffer(this._writingBuf)?ue.write(this.fd,this._writingBuf,this.release):ue.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${kp}" and "${$p}", but passed ${m}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Ep(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,_)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{gc(Us),this.release(void 0,0)}catch(S){this.release(S)}else setTimeout(h,Us);else this._writing=!1,this.emit("error",g);return}this.emit("write",_);let x=hc(this._writingBuf,this._len,_);if(this._len=x.len,this._writingBuf=x.writingBuf,this._writingBuf.length){if(!this.sync){h();return}try{do{let S=f(),k=hc(this._writingBuf,this._len,S);this._len=k.len,this._writingBuf=k.writingBuf}while(this._writingBuf.length)}catch(S){this.release(S);return}}this._fsync&&ue.fsyncSync(this.fd);let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?this._actualWrite():this._ending?w>0?this._actualWrite():(this._writing=!1,Bs(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(v$,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function hc(t,e,r){return typeof t=="string"&&(t=Buffer.from(t)),e=Math.max(e-r,0),t=t.subarray(r),{writingBuf:t,len:e}}function v$(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}p$(vt,f$);function zp(t,e){return t.length===0?Vs:t.length===1?t[0]:Buffer.concat(t,e)}function b$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");t=""+t;let e=Buffer.byteLength(t),r=this._len+e,n=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(n.length===0||Buffer.byteLength(n[n.length-1])+e>this.maxWrite?n.push(t):n[n.length-1]+=t,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function w$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Pp(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{ue.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function x$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Pp.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function S$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Pp.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}vt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&ue.close(e,r=>{if(r)return this.emit("error",r)})}),Ep(this.file,this)};vt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():Bs(this)))};function $$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?ue.writeSync(this.fd,t):ue.writeSync(this.fd,t,"utf8"),r=hc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;gc(Us)}}try{ue.fsyncSync(this.fd)}catch{}}function k$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Vs);let t=Vs;for(;this._bufs.length||t.length;){t.length<=0&&(t=zp(this._bufs[0],this._lens[0]));try{let e=ue.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;gc(Us)}}}vt.prototype.destroy=function(){this.destroyed||Bs(this)};function E$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let e=Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else ue.write(this.fd,this._writingBuf,t)}function z$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:zp(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=ue.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else _$&&(this._writingBuf=Buffer.from(this._writingBuf)),ue.write(this.fd,this._writingBuf,t)}function Bs(t){if(t.fd===-1){t.once("ready",Bs.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],m$(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{ue.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?ue.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}vt.SonicBoom=vt;vt.default=vt;Tp.exports=vt});var yc=$((e1,Ap)=>{"use strict";var bt={exit:[],beforeExit:[]},Op={exit:C$,beforeExit:O$},cn;function P$(){cn===void 0&&(cn=new FinalizationRegistry(I$))}function T$(t){bt[t].length>0||process.on(t,Op[t])}function Ip(t){bt[t].length>0||(process.removeListener(t,Op[t]),bt.exit.length===0&&bt.beforeExit.length===0&&(cn=void 0))}function C$(){Rp("exit")}function O$(){Rp("beforeExit")}function Rp(t){for(let e of bt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}bt[t]=[]}function I$(t){for(let e of["exit","beforeExit"]){let r=bt[e].indexOf(t);bt[e].splice(r,r+1),Ip(e)}}function Np(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");T$(t);let n=new WeakRef(e);n.fn=r,P$(),cn.register(e,n),bt[t].push(n)}function R$(t,e){Np("exit",t,e)}function N$(t,e){Np("beforeExit",t,e)}function A$(t){if(cn!==void 0){cn.unregister(t);for(let e of["exit","beforeExit"])bt[e]=bt[e].filter(r=>{let n=r.deref();return n&&n!==t}),Ip(e)}}Ap.exports={register:R$,registerBeforeExit:N$,unregister:A$}});var Dp=$((t1,D$)=>{D$.exports={name:"thread-stream",version:"4.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^1.0.0"},devDependencies:{"@types/node":"^25.0.2","@yao-pkg/pkg":"^6.0.0",borp:"^1.0.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",neostandard:"^0.13.0","pino-elasticsearch":"^9.0.0","sonic-boom":"^5.0.0","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:'npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:ci":'npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:yarn":'npm run transpile && borp --pattern "test/*.test.js"',transpile:"sh ./test/ts/transpile.sh"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Mp=$((r1,jp)=>{"use strict";function j$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{let a=Atomics.load(t,e);if(a===r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,a,c);u.async?u.value.then(i):setImmediate(i)};i()}function M$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{if(Atomics.load(t,e)!==r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,r,c);u.async?u.value.then(l=>{if(l==="ok"){o(null,"ok");return}i()}):setImmediate(i)};i()}jp.exports={wait:j$,waitDiff:M$}});var Lp=$((n1,Zp)=>{"use strict";Zp.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var Qp=$((o1,Yp)=>{"use strict";var{version:Z$}=Dp(),{EventEmitter:L$}=require("events"),{Worker:q$}=require("worker_threads"),{join:F$}=require("path"),{pathToFileURL:U$}=require("url"),{wait:V$}=Mp(),{WRITE_INDEX:Lt,READ_INDEX:Rr,SEQ_INDEX:_c}=Lp(),B$=require("buffer"),H$=require("assert"),b=Symbol("kImpl"),W$=B$.constants.MAX_STRING_LENGTH;function qp(){}function xc(t,e){Atomics.add(t[b].state,_c,1),e(),Atomics.add(t[b].state,_c,1),Atomics.notify(t[b].state,_c)}function Fp(t){xc(t,()=>{Atomics.store(t[b].state,Rr,0),Atomics.store(t[b].state,Lt,0)})}var oo=class{constructor(e){this._value=e}deref(){return this._value}},Hs=class{register(){}unregister(){}},G$=process.env.NODE_V8_COVERAGE?Hs:global.FinalizationRegistry||Hs,J$=process.env.NODE_V8_COVERAGE?oo:global.WeakRef||oo,Up=new G$(t=>{t.exited||t.terminate()});function K$(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||F$(__dirname,"lib","worker.js"),i=new q$(s,{...e.workerOpts,name:e.workerOpts?.name||"thread-stream",trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:U$(r).href,dataBuf:t[b].dataBuf,stateBuf:t[b].stateBuf,workerData:{$context:{threadStreamVersion:Z$},...n}}});return i.stream=new oo(t),i.on("message",Y$),i.on("exit",Hp),Up.register(t,i),i}function Vp(t){H$(!t[b].sync),t[b].needDrain&&(t[b].needDrain=!1,t.emit("drain"))}function Bp(t){for(;;){let e=Atomics.load(t[b].state,Lt),r=t[b].data.length-e;if(r>0){if(t[b].bufLen===0){t[b].flushing=!1,t[b].ending?Sc(t):t[b].needDrain&&process.nextTick(Vp,t);return}Jp(t,r,qp);continue}if(r===0){if(e===0&&t[b].bufLen===0)return;Ws(t,()=>{t.destroyed||(Fp(t),Bp(t))});return}st(t,new Error("overwritten"));return}}function Y$(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}if(t?.code!=null)switch(t.code){case"READY":this.stream=new J$(e),Ws(e,()=>{e[b].ready=!0,e.emit("ready")});break;case"ERROR":st(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"FLUSHED":{if(t.context!=="thread-stream"){st(e,new Error("this should not happen: "+t.code));break}let r=e[b].flushCallbacks.get(t.id);r&&(e[b].flushCallbacks.delete(t.id),process.nextTick(r));break}case"WARNING":process.emitWarning(t.err);break;default:st(e,new Error("this should not happen: "+t.code))}}function Hp(t){let e=this.stream.deref();e!==void 0&&(Up.unregister(e),e.worker.exited=!0,e.worker.off("exit",Hp),st(e,t!==0?new Error("the worker thread exited"):null))}var bc=class extends L${constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[b]={},this[b].stateBuf=new SharedArrayBuffer(128),this[b].state=new Int32Array(this[b].stateBuf),this[b].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[b].data=Buffer.from(this[b].dataBuf),this[b].sync=e.sync||!1,this[b].ending=!1,this[b].ended=!1,this[b].needDrain=!1,this[b].destroyed=!1,this[b].flushing=!1,this[b].ready=!1,this[b].finished=!1,this[b].errored=null,this[b].closed=!1,this[b].buf=[],this[b].bufHead=0,this[b].bufLen=0,this[b].flushCallbacks=new Map,this[b].nextFlushId=0,this.worker=K$(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){let r=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[b].destroyed)return wc(this,new Error("the worker has exited")),!1;if(this[b].ending)return wc(this,new Error("the worker is ending")),!1;if(this[b].flushing&&this[b].bufLen+r.length>=W$)try{vc(this),this[b].flushing=!0}catch(n){return st(this,n),!1}if(this[b].buf.push(r),this[b].bufLen+=r.length,this[b].sync)try{return vc(this),!0}catch(n){return st(this,n),!1}return this[b].flushing||(this[b].flushing=!0,setImmediate(Bp,this)),this[b].needDrain=this[b].data.length-this[b].bufLen-Atomics.load(this[b].state,Lt)<=0,!this[b].needDrain}end(){this[b].destroyed||(this[b].ending=!0,Sc(this))}flush(e){e=typeof e=="function"?e:qp,Wp(this,r=>{if(r){process.nextTick(e,r);return}Gp(this,e)})}flushSync(){this[b].destroyed||(vc(this),Kp(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[b].ready}get destroyed(){return this[b].destroyed}get closed(){return this[b].closed}get writable(){return!this[b].destroyed&&!this[b].ending}get writableEnded(){return this[b].ending}get writableFinished(){return this[b].finished}get writableNeedDrain(){return this[b].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[b].errored}};function Wp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].sync&&(t[b].flushing||t[b].bufLen>0)){setImmediate(Wp,t,e);return}Ws(t,e)}function Ws(t,e){let r=Atomics.load(t[b].state,Lt);V$(t[b].state,Rr,r,1/0,(n,o)=>{if(n){st(t,n),e(n);return}if(o!=="ok"){Ws(t,e);return}e()})}function Gp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].ready){let n=()=>{s(),Gp(t,e)},o=()=>{s(),process.nextTick(e,new Error("the worker has exited"))},s=()=>{t.off("ready",n),t.off("close",o)};t.once("ready",n),t.once("close",o);return}let r=++t[b].nextFlushId;t[b].flushCallbacks.set(r,e);try{t.worker.postMessage({code:"FLUSH",context:"thread-stream",id:r})}catch(n){t[b].flushCallbacks.delete(r),st(t,n),process.nextTick(e,n)}}function Q$(t,e){let r=t[b].flushCallbacks;if(r.size===0)return;let n=e||new Error("the worker has exited");for(let o of r.values())process.nextTick(o,n);r.clear()}function wc(t,e){setImmediate(()=>{t.emit("error",e)})}function st(t,e){t[b].destroyed||(t[b].destroyed=!0,Q$(t,e),e&&(t[b].errored=e,wc(t,e)),t.worker.exited?setImmediate(()=>{t[b].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[b].closed=!0,t.emit("close")}))}function Jp(t,e,r){let o=Atomics.load(t[b].state,Lt),s=e;for(;s>0&&t[b].bufLen!==0;){let i=t[b].bufHead,a=t[b].buf[i];if(a.length<=s){a.copy(t[b].data,o),o+=a.length,s-=a.length,t[b].bufLen-=a.length,t[b].bufHead=i+1,t[b].bufHead===t[b].buf.length?(t[b].buf.length=0,t[b].bufHead=0):t[b].bufHead>=1024&&t[b].bufHead*2>=t[b].buf.length&&(t[b].buf.splice(0,t[b].bufHead),t[b].bufHead=0);continue}a.copy(t[b].data,o,0,s),t[b].buf[i]=a.subarray(s),t[b].bufLen-=s,o+=s,s=0}return xc(t,()=>{Atomics.store(t[b].state,Lt,o)}),r(),!0}function Sc(t){if(!(t[b].ended||!t[b].ending||t[b].flushing)){t[b].ended=!0;try{t.flushSync();let e=Atomics.load(t[b].state,Rr);xc(t,()=>{Atomics.store(t[b].state,Lt,-1)});let r=0;for(;e!==-1;){if(Atomics.wait(t[b].state,Rr,e,1e3),e=Atomics.load(t[b].state,Rr),e===-2){st(t,new Error("end() failed"));return}if(++r===10){st(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[b].finished=!0,t.emit("finish")})}catch(e){st(t,e)}}}function vc(t){let e=()=>{t[b].ending?Sc(t):t[b].needDrain&&process.nextTick(Vp,t)};for(t[b].flushing=!1;t[b].bufLen!==0;){let r=Atomics.load(t[b].state,Lt),n=t[b].data.length-r;if(n===0){Kp(t),Fp(t);continue}else if(n<0)throw new Error("overwritten");Jp(t,n,e)}}function Kp(t){if(t[b].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[b].state,Lt),r=0;for(;;){let n=Atomics.load(t[b].state,Rr);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[b].state,Rr,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Yp.exports=bc});var Ec=$((s1,tm)=>{"use strict";var{createRequire:X$}=require("module"),{existsSync:ek}=require("node:fs"),tk=uc(),{join:$c,isAbsolute:em,sep:rk}=require("node:path"),{fileURLToPath:nk}=require("node:url"),ok=mc(),kc=yc(),sk=Qp();function ik(t){kc.register(t,dk),kc.registerBeforeExit(t,fk),t.on("close",function(){kc.unregister(t)})}function ak(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function ck(t){let e=t.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!e)return t;let r=[],n=!1;for(let o=0;o<e.length;o++){let s=e[o];if(s==="--require"||s==="-r"||s==="--import"){let i=e[o+1];if(i&&Xp(i)){n=!0,o++;continue}r.push(s),i&&(r.push(i),o++);continue}if(s.startsWith("--require=")||s.startsWith("-r=")||s.startsWith("--import=")){let i=s.slice(s.indexOf("=")+1);if(Xp(i)){n=!0;continue}}r.push(s)}return n?r.join(" "):t}function Xp(t){let e=uk(t);if(!e)return!1;let r=e;if(r.startsWith("file://"))try{r=nk(r)}catch{return!1}return em(r)&&!ek(r)}function uk(t){let e=t[0],r=t[t.length-1];return e==='"'&&r==='"'||e==="'"&&r==="'"?t.slice(1,-1):t}function lk(t,e,r,n,o){if(!r.execArgv&&ak()&&require.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=ck(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:o};let s=new sk({filename:t,workerData:e,workerOpts:r,sync:n});s.on("ready",i),s.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function i(){process.removeListener("exit",a),s.unref(),r.autoEnd!==!1&&ik(s)}function a(){s.closed||(s.flushSync(),ok(100),s.end())}return s}function dk(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function fk(t){t.flushSync()}function pk(t){let{pipeline:e,targets:r,levels:n,dedupe:o,worker:s={},caller:i=tk(),sync:a=!1}=t,c={...t.options},u=typeof i=="string"?[i]:i,l=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),d=t.target;if(d&&r)throw new Error("only one of target or targets can be specified");r?(d=l["pino-worker"]||$c(__dirname,"worker.js"),c.targets=r.filter(f=>f.target).map(f=>({...f,target:p(f.target)})),c.pipelines=r.filter(f=>f.pipeline).map(f=>f.pipeline.map(h=>({...h,level:f.level,target:p(h.target)})))):e&&(d=l["pino-worker"]||$c(__dirname,"worker.js"),c.pipelines=[e.map(f=>({...f,target:p(f.target)}))]),n&&(c.levels=n),o&&(c.dedupe=o),c.pinoWillSendConfig=!0;let m=r||e?"pino.transport":d;return lk(p(d),c,s,a,m);function p(f){if(f=l[f]||f,em(f)||f.indexOf("file://")===0)return f;if(f==="pino/file")return $c(__dirname,"..","file.js");let h;for(let g of u)try{let _=g==="node:repl"?process.cwd()+rk:g;h=X$(_).resolve(f);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${f}"`);return h}}tm.exports=pk});var Ks=$((i1,mm)=>{"use strict";var mk=require("node:diagnostics_channel"),rm=xp(),{mapHttpRequest:hk,mapHttpResponse:gk}=cc(),Pc=Cp(),nm=yc(),{lsCacheSym:yk,chindingsSym:cm,writeSym:om,serializersSym:um,formatOptsSym:sm,endSym:_k,stringifiersSym:lm,stringifySym:dm,stringifySafeSym:Tc,wildcardFirstSym:fm,nestedKeySym:vk,formattersSym:pm,messageKeySym:bk,errorKeySym:wk,nestedKeyStrSym:xk,msgPrefixSym:Gs}=an(),{isMainThread:Sk}=require("worker_threads"),$k=Ec(),[kk]=process.versions.node.split(".").map(t=>Number(t)),im=mk.tracingChannel("pino_asJson"),zc=kk>=25?t=>JSON.stringify(t):zk;function un(){}function Ek(t,e){if(!e)return r;return function(...o){e.call(this,o,r,t)};function r(n,...o){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=hk(n):typeof n.setHeader=="function"&&(n=gk(n)));let i;s===null&&o.length===0?i=[null]:(s=o.shift(),i=o),typeof this[Gs]=="string"&&s!==void 0&&s!==null&&(s=this[Gs]+s),this[om](n,rm(s,i,this[sm]),t)}else{let s=n===void 0?o.shift():n;typeof this[Gs]=="string"&&s!==void 0&&s!==null&&(s=this[Gs]+s),this[om](null,rm(s,o,this[sm]),t)}}}function zk(t){let e="",r=0,n=!1,o=255,s=t.length;if(s>100)return JSON.stringify(t);for(var i=0;i<s&&o>=32;i++)o=t.charCodeAt(i),(o===34||o===92)&&(e+=t.slice(r,i)+"\\",r=i,n=!0);return n?e+=t.slice(r):e=t,o<32?JSON.stringify(t):'"'+e+'"'}function Pk(t,e,r,n){if(im.hasSubscribers===!1)return am.call(this,t,e,r,n);let o={instance:this,arguments};return im.traceSync(am,o,this,t,e,r,n)}function am(t,e,r,n){let o=this[dm],s=this[Tc],i=this[lm],a=this[_k],c=this[cm],u=this[um],l=this[pm],d=this[bk],m=this[wk],p=this[yk][r]+n;p=p+c;let f;l.log&&(t=l.log(t));let h=i[fm],g="";for(let x in t)if(f=t[x],Object.prototype.hasOwnProperty.call(t,x)&&f!==void 0){u[x]?f=u[x](f):x===m&&u.err&&(f=u.err(f));let w=i[x]||h;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":w&&(f=w(f));break;case"string":f=(w||zc)(f);break;default:f=(w||o)(f,s)}if(f===void 0)continue;let S=zc(x);g+=","+S+":"+f}let _="";if(e!==void 0){f=u[d]?u[d](e):e;let x=i[d]||h;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":x&&(f=x(f)),_=',"'+d+'":'+f;break;case"string":f=(x||zc)(f),_=',"'+d+'":'+f;break;default:f=(x||o)(f,s),_=',"'+d+'":'+f}}return this[vk]&&g?p+this[xk]+g.slice(1)+"}"+_+a:p+g+_+a}function Tk(t,e){let r,n=t[cm],o=t[dm],s=t[Tc],i=t[lm],a=i[fm],c=t[um],u=t[pm].bindings;e=u(e);for(let l in e)if(r=e[l],((l.length<5||l!=="level"&&l!=="serializers"&&l!=="formatters"&&l!=="customLevels")&&e.hasOwnProperty(l)&&r!==void 0)===!0){if(r=c[l]?c[l](r):r,r=(i[l]||a||o)(r,s),r===void 0)continue;n+=',"'+l+'":'+r}return n}function Ck(t){return t.write!==t.constructor.prototype.write}function Js(t){let e=new Pc(t);return e.on("error",r),!t.sync&&Sk&&(nm.register(e,Ok),e.on("close",function(){nm.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=un,e.end=un,e.flushSync=un,e.destroy=un;return}e.removeListener("error",r),e.emit("error",n)}}function Ok(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Ik(t){return function(r,n,o={},s){if(typeof o=="string")s=Js({dest:o}),o={};else if(typeof s=="string"){if(o&&o.transport)throw Error("only one of option.transport or stream can be specified");s=Js({dest:s})}else if(o instanceof Pc||o.writable||o._writableState)s=o,o={};else if(o.transport){if(o.transport instanceof Pc||o.transport.writable||o.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(o.transport.targets&&o.transport.targets.length&&o.formatters&&typeof o.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;o.customLevels&&(c=o.useOnlyCustomLevels?o.customLevels:Object.assign({},o.levels,o.customLevels)),s=$k({caller:n,...o.transport,levels:c})}if(o=Object.assign({},t,o),o.serializers=Object.assign({},t.serializers,o.serializers),o.formatters=Object.assign({},t.formatters,o.formatters),o.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:i,onChild:a}=o;return i===!1&&(o.level="silent"),a||(o.onChild=un),s||(Ck(process.stdout)?s=process.stdout:s=Js({fd:process.stdout.fd||1})),{opts:o,stream:s}}}function Rk(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Tc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Nk(t,e,r){return{level:t,bindings:e,log:r}}function Ak(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}mm.exports={noop:un,buildSafeSonicBoom:Js,asChindings:Tk,asJson:Pk,genLog:Ek,createArgsNormalizer:Ik,stringify:Rk,buildFormatters:Nk,normalizeDestFileDescriptor:Ak}});var Ys=$((a1,hm)=>{var Dk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},jk={ASC:"ASC",DESC:"DESC"};hm.exports={DEFAULT_LEVELS:Dk,SORTING_ORDER:jk}});var Ic=$((c1,vm)=>{"use strict";var{lsCacheSym:Mk,levelValSym:Cc,useOnlyCustomLevelsSym:Zk,streamSym:Lk,formattersSym:qk,hooksSym:Fk,levelCompSym:gm}=an(),{noop:Uk,genLog:Nr}=Ks(),{DEFAULT_LEVELS:Pt,SORTING_ORDER:ym}=Ys(),_m={fatal:t=>{let e=Nr(Pt.fatal,t);return function(...r){let n=this[Lk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>Nr(Pt.error,t),warn:t=>Nr(Pt.warn,t),info:t=>Nr(Pt.info,t),debug:t=>Nr(Pt.debug,t),trace:t=>Nr(Pt.trace,t)},Oc=Object.keys(Pt).reduce((t,e)=>(t[Pt[e]]=e,t),{}),Vk=Object.keys(Oc).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Bk(t){let e=t[qk].level,{labels:r}=t.levels,n={};for(let o in r){let s=e(r[o],Number(o));n[o]=JSON.stringify(s).slice(0,-1)}return t[Mk]=n,t}function Hk(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Wk(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Cc],o=this[Cc]=r[t],s=this[Zk],i=this[gm],a=this[Fk].logMethod;for(let c in r){if(i(r[c],o)===!1){this[c]=Uk;continue}this[c]=Hk(c,s)?_m[c](a):Nr(r[c],a)}this.emit("level-change",t,o,e[n],n,this)}function Gk(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function Jk(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[gm](r,this[Cc])}function Kk(t,e,r){return t===ym.DESC?e<=r:e>=r}function Yk(t){return typeof t=="string"?Kk.bind(null,t):t}function Qk(t=null,e=!1){let r=t?Object.keys(t).reduce((s,i)=>(s[t[i]]=i,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Oc,r),o=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Pt,t);return{labels:n,values:o}}function Xk(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Oc).map(s=>+s),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Pt,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function eE(t,e){let{labels:r,values:n}=t;for(let o in e){if(o in n)throw Error("levels cannot be overridden");if(e[o]in r)throw Error("pre-existing level values cannot be used for new levels")}}function tE(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(ym).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}vm.exports={initialLsCache:Vk,genLsCache:Bk,levelMethods:_m,getLevel:Gk,setLevel:Wk,isLevelEnabled:Jk,mappings:Qk,assertNoLevelCollisions:eE,assertDefaultLevelFound:Xk,genLevelComparison:Yk,assertLevelComparison:tE}});var Rc=$((u1,bm)=>{"use strict";bm.exports={version:"10.3.1"}});var Pm=$((d1,zm)=>{"use strict";var{EventEmitter:rE}=require("node:events"),{lsCacheSym:nE,levelValSym:oE,setLevelSym:Ac,getLevelSym:wm,chindingsSym:Xs,mixinSym:sE,asJsonSym:Sm,writeSym:iE,mixinMergeStrategySym:aE,timeSym:cE,timeSliceIndexSym:uE,streamSym:$m,serializersSym:Ar,formattersSym:so,errorKeySym:lE,messageKeySym:dE,useOnlyCustomLevelsSym:fE,needsMetadataGsym:pE,redactFmtSym:mE,stringifySym:hE,formatOptsSym:gE,stringifiersSym:yE,msgPrefixSym:Dc,hooksSym:_E}=an(),{getLevel:vE,setLevel:bE,isLevelEnabled:wE,mappings:xE,initialLsCache:SE,genLsCache:$E,assertNoLevelCollisions:kE}=Ic(),{asChindings:jc,asJson:EE,buildFormatters:Nc,stringify:xm,noop:km}=Ks(),{version:zE}=Rc(),PE=fc(),TE=class{},Em={constructor:TE,child:CE,bindings:OE,setBindings:IE,flush:AE,isLevelEnabled:wE,version:zE,get level(){return this[wm]()},set level(t){this[Ac](t)},get levelVal(){return this[oE]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[Dc]},get[Symbol.toStringTag](){return"Pino"},[nE]:SE,[iE]:NE,[Sm]:EE,[wm]:vE,[Ac]:bE};Object.setPrototypeOf(Em,rE.prototype);zm.exports=function(){return Object.create(Em)};var Qs=t=>t;function CE(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[Ar],n=this[so],o=Object.create(this);if(e==null)return o[so].bindings!==Qs&&(o[so]=Nc(n.level,Qs,n.log)),o[Xs]=jc(o,t),this.onChild!==km&&this.onChild(o),o;if(e.hasOwnProperty("serializers")===!0){o[Ar]=Object.create(null);for(let u in r)o[Ar][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++){let u=a[s];o[Ar][u]=r[u]}for(let u in e.serializers)o[Ar][u]=e.serializers[u];let c=Object.getOwnPropertySymbols(e.serializers);for(var i=0;i<c.length;i++){let u=c[i];o[Ar][u]=e.serializers[u]}}else o[Ar]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:c,log:u}=e.formatters;o[so]=Nc(a||n.level,c||Qs,u||n.log)}else o[so]=Nc(n.level,Qs,n.log);if(e.hasOwnProperty("customLevels")===!0&&(kE(this.levels,e.customLevels),o.levels=xE(e.customLevels,o[fE]),$E(o)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){o.redact=e.redact;let a=PE(o.redact,xm),c={stringify:a[mE]};o[hE]=xm,o[yE]=a,o[gE]=c}if(typeof e.msgPrefix=="string"&&(o[Dc]=(this[Dc]||"")+e.msgPrefix),o[Xs]=jc(o,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;o[Ac](a)}return this.onChild(o),o}function OE(){let e=`{${this[Xs].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function IE(t){let e=jc(this,t);this[Xs]=e}function RE(t,e){return Object.assign(e,t)}function NE(t,e,r){let n=this[cE](),o=this[sE],s=this[lE],i=this[dE],a=this[aE]||RE,c,u=this[_E].streamWrite;t==null?c={}:t instanceof Error?(c={[s]:t},e===void 0&&(e=t.message)):(c=t,e===void 0&&t[i]===void 0&&t[s]&&(e=t[s].message)),o&&(c=a(c,o(c,r,this)));let l=this[Sm](c,e,r,n),d=this[$m];d[pE]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=e,d.lastTime=n.slice(this[uE]),d.lastLogger=this),d.write(u?u(l):l)}function AE(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[$m];typeof e.flush=="function"?e.flush(t||km):t&&t()}});var Im=$((qc,Om)=>{"use strict";var{hasOwnProperty:io}=Object.prototype,jr=Lc();jr.configure=Lc;jr.stringify=jr;jr.default=jr;qc.stringify=jr;qc.configure=Lc;Om.exports=jr;var DE=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function er(t){return t.length<5e3&&!DE.test(t)?`"${t}"`:JSON.stringify(t)}function Mc(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],o=r;for(;o!==0&&t[o-1]>n;)t[o]=t[o-1],o--;t[o]=n}return t}var jE=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Zc(t){return jE.call(t)!==void 0&&t.length!==0}function Tm(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",o=`"0":${n}${t[0]}`;for(let s=1;s<r;s++)o+=`${e}"${s}":${n}${t[s]}`;return o}function ME(t){if(io.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function ZE(t){let e;if(io.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function LE(t,e){let r;if(io.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function Cm(t,e){let r;if(io.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function Dr(t){return t===1?"1 item":`${t} items`}function qE(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function FE(t){if(io.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Lc(t){t={...t};let e=FE(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=ME(t),n=LE(t,"bigint"),o=ZE(t),s=typeof o=="function"?o:void 0,i=Cm(t,"maximumDepth"),a=Cm(t,"maximumBreadth");function c(p,f,h,g,_,x){let w=f[p];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(p)),w=g.call(f,p,w),typeof w){case"string":return er(w);case"object":{if(w===null)return"null";if(h.indexOf(w)!==-1)return r;let S="",k=",",W=x;if(Array.isArray(w)){if(w.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(w),_!==""&&(x+=_,S+=`
2
+ var fx=Object.create;var Aa=Object.defineProperty;var px=Object.getOwnPropertyDescriptor;var mx=Object.getOwnPropertyNames;var hx=Object.getPrototypeOf,gx=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},sf=(t,e)=>{for(var r in e)Aa(t,r,{get:e[r],enumerable:!0})},yx=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mx(e))!gx.call(t,o)&&o!==r&&Aa(t,o,{get:()=>e[o],enumerable:!(n=px(e,o))||n.enumerable});return t};var mt=(t,e,r)=>(r=t!=null?fx(hx(t)):{},yx(e||!t||!t.__esModule?Aa(r,"default",{value:t,enumerable:!0}):r,t));var tc=$((qj,Uf)=>{"use strict";var so=t=>t&&typeof t.message=="string",ec=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return so(r)?r:void 0}else return so(e)?e:void 0},qf=(t,e)=>{if(!so(t))return"";let r=t.stack||"";if(e.has(t))return r+`
3
+ causes have become circular...`;let n=ec(t);return n?(e.add(t),r+`
4
+ caused by: `+qf(n,e)):r},eS=t=>qf(t,new Set),Ff=(t,e,r)=>{if(!so(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let o=ec(t);if(o){e.add(t);let s=typeof t.cause=="function";return n+(s?"":": ")+Ff(o,e,s)}else return n},tS=t=>Ff(t,new Set);Uf.exports={isErrorLike:so,getErrorCause:ec,stackWithCauses:eS,messageWithCauses:tS}});var rc=$((Fj,Bf)=>{"use strict";var rS=Symbol("circular-ref-tag"),Zs=Symbol("pino-raw-err-ref"),Vf=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Zs]},set:function(t){this[Zs]=t}}});Object.defineProperty(Vf,Zs,{writable:!0,value:{}});Bf.exports={pinoErrProto:Vf,pinoErrorSymbols:{seen:rS,rawSymbol:Zs}}});var Gf=$((Uj,Wf)=>{"use strict";Wf.exports=oc;var{messageWithCauses:nS,stackWithCauses:oS,isErrorLike:Hf}=tc(),{pinoErrProto:sS,pinoErrorSymbols:iS}=rc(),{seen:nc}=iS,{toString:aS}=Object.prototype;function oc(t){if(!Hf(t))return t;t[nc]=void 0;let e=Object.create(sS);e.type=aS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=nS(t),e.stack=oS(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>oc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Hf(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,nc)&&(e[r]=oc(n)):e[r]=n}return delete t[nc],e.raw=t,e}});var Kf=$((Vj,Jf)=>{"use strict";Jf.exports=qs;var{isErrorLike:sc}=tc(),{pinoErrProto:cS,pinoErrorSymbols:uS}=rc(),{seen:Ls}=uS,{toString:lS}=Object.prototype;function qs(t){if(!sc(t))return t;t[Ls]=void 0;let e=Object.create(cS);e.type=lS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>qs(r))),sc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Ls)&&(e.cause=qs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];sc(n)?Object.prototype.hasOwnProperty.call(n,Ls)||(e[r]=qs(n)):e[r]=n}return delete t[Ls],e.raw=t,e}});var ep=$((Bj,Xf)=>{"use strict";Xf.exports={mapHttpRequest:dS,reqSerializer:Qf};var ic=Symbol("pino-raw-req-ref"),Yf=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[ic]},set:function(t){this[ic]=t}}});Object.defineProperty(Yf,ic,{writable:!0,value:{}});function Qf(t){let e=t.info||t.socket,r=Object.create(Yf);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function dS(t){return{req:Qf(t)}}});var op=$((Hj,np)=>{"use strict";np.exports={mapHttpResponse:fS,resSerializer:rp};var ac=Symbol("pino-raw-res-ref"),tp=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[ac]},set:function(t){this[ac]=t}}});Object.defineProperty(tp,ac,{writable:!0,value:{}});function rp(t){let e=Object.create(tp);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function fS(t){return{res:rp(t)}}});var uc=$((Wj,sp)=>{"use strict";var cc=Gf(),pS=Kf(),Fs=ep(),Us=op();sp.exports={err:cc,errWithCause:pS,mapHttpRequest:Fs.mapHttpRequest,mapHttpResponse:Us.mapHttpResponse,req:Fs.reqSerializer,res:Us.resSerializer,wrapErrorSerializer:function(e){return e===cc?e:function(n){return e(cc(n))}},wrapRequestSerializer:function(e){return e===Fs.reqSerializer?e:function(n){return e(Fs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Us.resSerializer?e:function(n){return e(Us.resSerializer(n))}}}});var lc=$((Gj,ip)=>{"use strict";function mS(t,e){return e}ip.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=mS;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),o=[];for(let s of n)s&&o.push(s.getFileName());return o}});var fp=$((Jj,dp)=>{"use strict";function dc(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=dc(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=dc(t[r]));return e}return t}function ap(t){let e=[],r="",n=!1,o=!1,s="";for(let i=0;i<t.length;i++){let a=t[i];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,o=!1):(a==='"'||a==="'")&&n?o?a===s?(o=!1,s=""):r+=a:(o=!0,s=a):r+=a}return r&&e.push(r),e}function cp(t,e,r){let n=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof n!="object"||n===null||!(i in n)||typeof n[i]!="object"||n[i]===null)return!1;n=n[i]}let o=e[e.length-1];if(o==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=r;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r)}else typeof n=="object"&&n!==null&&o in n&&Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=r);return!0}function up(t,e){let r=t;for(let o=0;o<e.length-1;o++){let s=e[o];if(typeof r!="object"||r===null||!(s in r)||typeof r[s]!="object"||r[s]===null)return!1;r=r[s]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let o=0;o<r.length;o++)r[o]=void 0;else if(typeof r=="object"&&r!==null)for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&delete r[o]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var Vs=Symbol("PATH_NOT_FOUND");function hS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return Vs;r=r[n]}return r}function gS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function yS(t,e,r,n=!1){for(let o of e){let s=ap(o);if(s.includes("*"))lp(t,s,r,o,n);else if(n)up(t,s);else{let i=hS(t,s);if(i===Vs)continue;let a=typeof r=="function"?r(i,s):r;cp(t,s,a)}}}function lp(t,e,r,n,o=!1){let s=e.indexOf("*");if(s===e.length-1){let i=e.slice(0,-1),a=t;for(let c of i){if(a==null||typeof a!="object"||a===null)return;a=a[c]}if(Array.isArray(a))if(o)for(let c=0;c<a.length;c++)a[c]=void 0;else for(let c=0;c<a.length;c++){let u=[...i,c.toString()],l=typeof r=="function"?r(a[c],u):r;a[c]=l}else if(typeof a=="object"&&a!==null)if(o){let c=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&c.push(u);for(let u of c)delete a[u]}else for(let c in a){let u=[...i,c],l=typeof r=="function"?r(a[c],u):r;a[c]=l}}else _S(t,e,r,s,n,o)}function _S(t,e,r,n,o,s=!1){let i=e.slice(0,n),a=e.slice(n+1),c=[];function u(l,d){if(d===i.length){if(Array.isArray(l))for(let m=0;m<l.length;m++)c[d]=m.toString(),u(l[m],d+1);else if(typeof l=="object"&&l!==null)for(let m in l)c[d]=m,u(l[m],d+1)}else if(d<i.length){let m=i[d];l&&typeof l=="object"&&l!==null&&m in l&&(c[d]=m,u(l[m],d+1))}else if(a.includes("*"))lp(l,a,typeof r=="function"?(p,f)=>{let h=[...c.slice(0,d),...f];return r(p,h)}:r,o,s);else if(s)up(l,a);else{let m=typeof r=="function"?r(gS(l,a),[...c.slice(0,d),...a]):r;cp(l,a,m)}}if(i.length===0)u(t,0);else{let l=t;for(let d=0;d<i.length;d++){let m=i[d];if(l==null||typeof l!="object"||l===null)return;l=l[m],c[d]=m}l!=null&&u(l,i.length)}}function vS(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=ap(r),o=e;for(let s=0;s<n.length;s++){let i=n[s];o.has(i)||o.set(i,new Map),o=o.get(i)}}return e}function bS(t,e){if(!e)return t;function r(n,o,s=0){if(!o||o.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let c=0;c<n.length;c++){let u=c.toString();o.has(u)||o.has("*")?a[c]=r(n[c],o.get(u)||o.get("*")):a[c]=n[c]}return a}let i=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o.has(a)||o.has("*")?i[a]=r(n[a],o.get(a)||o.get("*")):i[a]=n[a]);return i}return r(t,e)}function wS(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let o=0;o<t.length;o++){let s=t[o];if((s==='"'||s==="'")&&e>0)r?s===n&&(r=!1,n=""):(r=!0,n=s);else if(s==="["&&!r)e++;else if(s==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function xS(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)wS(e)}function SS(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:o=!0,remove:s=!1}=t;xS(e);let i=vS(e);return function(c){if(o&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let u=bS(c,i),l=c,d=r;return typeof r=="function"&&(d=r),yS(u,e,d,s),n===!1?(u.restore=function(){return dc(l)},u):typeof n=="function"?n(u):JSON.stringify(u)}}dp.exports=SS});var cn=$((Kj,pp)=>{"use strict";var $S=Symbol("pino.setLevel"),kS=Symbol("pino.getLevel"),ES=Symbol("pino.levelVal"),zS=Symbol("pino.levelComp"),PS=Symbol("pino.useLevelLabels"),TS=Symbol("pino.useOnlyCustomLevels"),CS=Symbol("pino.mixin"),OS=Symbol("pino.lsCache"),IS=Symbol("pino.chindings"),RS=Symbol("pino.asJson"),NS=Symbol("pino.write"),AS=Symbol("pino.redactFmt"),DS=Symbol("pino.time"),jS=Symbol("pino.timeSliceIndex"),MS=Symbol("pino.stream"),ZS=Symbol("pino.stringify"),LS=Symbol("pino.stringifySafe"),qS=Symbol("pino.stringifiers"),FS=Symbol("pino.end"),US=Symbol("pino.formatOpts"),VS=Symbol("pino.messageKey"),BS=Symbol("pino.errorKey"),HS=Symbol("pino.nestedKey"),WS=Symbol("pino.nestedKeyStr"),GS=Symbol("pino.mixinMergeStrategy"),JS=Symbol("pino.msgPrefix"),KS=Symbol("pino.wildcardFirst"),YS=Symbol.for("pino.serializers"),QS=Symbol.for("pino.formatters"),XS=Symbol.for("pino.hooks"),e$=Symbol.for("pino.metadata");pp.exports={setLevelSym:$S,getLevelSym:kS,levelValSym:ES,levelCompSym:zS,useLevelLabelsSym:PS,mixinSym:CS,lsCacheSym:OS,chindingsSym:IS,asJsonSym:RS,writeSym:NS,serializersSym:YS,redactFmtSym:AS,timeSym:DS,timeSliceIndexSym:jS,streamSym:MS,stringifySym:ZS,stringifySafeSym:LS,stringifiersSym:qS,endSym:FS,formatOptsSym:US,messageKeySym:VS,errorKeySym:BS,nestedKeySym:HS,wildcardFirstSym:KS,needsMetadataGsym:e$,useOnlyCustomLevelsSym:TS,formattersSym:QS,hooksSym:XS,nestedKeyStrSym:WS,mixinMergeStrategySym:GS,msgPrefixSym:JS}});var pc=$((Yj,yp)=>{"use strict";var mp=fp(),{redactFmtSym:t$,wildcardFirstSym:Bs}=cn(),fc=/[^.[\]]+|\[([^[\]]*?)\]/g,hp="[Redacted]",gp=!1;function r$(t,e){let{paths:r,censor:n,remove:o}=n$(t),s=r.reduce((c,u)=>{fc.lastIndex=0;let l=fc.exec(u),d=fc.exec(u),m=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(m==="*"&&(m=Bs),d===null)return c[m]=null,c;if(c[m]===null)return c;let{index:p}=d,f=`${u.substr(p,u.length-1)}`;return c[m]=c[m]||[],m!==Bs&&c[m].length===0&&c[m].push(...c[Bs]||[]),m===Bs&&Object.keys(c).forEach(function(h){c[h]&&c[h].push(f)}),c[m].push(f),c},{}),i={[t$]:mp({paths:r,censor:n,serialize:e,strict:gp,remove:o})},a=(...c)=>e(typeof n=="function"?n(...c):n);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((c,u)=>{if(s[u]===null)c[u]=l=>a(l,[u]);else{let l=typeof n=="function"?(d,m)=>n(d,[u,...m]):n;c[u]=mp({paths:s[u],censor:l,serialize:e,strict:gp,remove:o})}return c},i)}function n$(t){if(Array.isArray(t))return t={paths:t,censor:hp},t;let{paths:e,censor:r=hp,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}yp.exports=r$});var bp=$((Qj,vp)=>{"use strict";var o$=()=>"",s$=()=>`,"time":${Date.now()}`,i$=()=>`,"time":${Math.round(Date.now()/1e3)}`,a$=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,c$=1000000n,_p=1000000000n,u$=BigInt(Date.now())*c$,l$=process.hrtime.bigint(),d$=()=>{let t=process.hrtime.bigint()-l$,e=u$+t,r=e/_p,n=e%_p,o=Number(r*1000n+n/1000000n),s=new Date(o),i=s.getUTCFullYear(),a=(s.getUTCMonth()+1).toString().padStart(2,"0"),c=s.getUTCDate().toString().padStart(2,"0"),u=s.getUTCHours().toString().padStart(2,"0"),l=s.getUTCMinutes().toString().padStart(2,"0"),d=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${i}-${a}-${c}T${u}:${l}:${d}.${n.toString().padStart(9,"0")}Z"`};vp.exports={nullTime:o$,epochTime:s$,unixTime:i$,isoTime:a$,isoTimeNano:d$}});var xp=$((Xj,wp)=>{"use strict";function f$(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}wp.exports=p$;function p$(t,e,r){var n=r&&r.stringify||f$,o=1;if(typeof t=="object"&&t!==null){var s=e.length+o;if(s===1)return t;var i=new Array(s);i[0]=n(t);for(var a=1;a<s;a++)i[a]=n(e[a]);return i.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var u="",l=1-o,d=-1,m=t&&t.length||0,p=0;p<m;){if(t.charCodeAt(p)===37&&p+1<m){switch(d=d>-1?d:0,t.charCodeAt(p+1)){case 100:case 102:if(l>=c||e[l]==null)break;d<p&&(u+=t.slice(d,p)),u+=Number(e[l]),d=p+2,p++;break;case 105:if(l>=c||e[l]==null)break;d<p&&(u+=t.slice(d,p)),u+=Math.floor(Number(e[l])),d=p+2,p++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;d<p&&(u+=t.slice(d,p));var f=typeof e[l];if(f==="string"){u+="'"+e[l]+"'",d=p+2,p++;break}if(f==="function"){u+=e[l].name||"<anonymous>",d=p+2,p++;break}u+=n(e[l]),d=p+2,p++;break;case 115:if(l>=c)break;d<p&&(u+=t.slice(d,p)),u+=String(e[l]),d=p+2,p++;break;case 37:d<p&&(u+=t.slice(d,p)),u+="%",d=p+2,p++,l--;break}++l}++p}return d===-1?t:(d<m&&(u+=t.slice(d)),u)}});var hc=$((e1,mc)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));mc.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};mc.exports=t}});var Cp=$((t1,Tp)=>{"use strict";var ue=require("fs"),m$=require("events"),h$=require("util").inherits,Sp=require("path"),yc=hc(),g$=require("assert"),Hs=100,Ws=Buffer.allocUnsafe(0),y$=16*1024,$p="buffer",kp="utf8",[_$,v$]=(process.versions.node||"0.0").split(".").map(Number),b$=_$>=22&&v$>=7;function Ep(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(s,i){if(s){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",s)}):e.emit("error",s);return}let a=e._reopening;e.fd=i,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",o=e.mode;if(e.sync)try{e.mkdir&&ue.mkdirSync(Sp.dirname(t),{recursive:!0});let s=ue.openSync(t,n,o);r(null,s)}catch(s){throw r(s),s}else e.mkdir?ue.mkdir(Sp.dirname(t),{recursive:!0},s=>{if(s)return r(s);ue.open(t,n,o,r)}):ue.open(t,n,o,r)}function vt(t){if(!(this instanceof vt))return new vt(t);let{fd:e,dest:r,minLength:n,maxLength:o,maxWrite:s,periodicFlush:i,sync:a,append:c=!0,mkdir:u,retryEAGAIN:l,fsync:d,contentMode:m,mode:p}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=o||0,this.maxWrite=s||y$,this._periodicFlush=i||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=d||!1,this.append=c||!1,this.mode=p,this.retryEAGAIN=l||(()=>!0),this.mkdir=u||!1;let f,h;if(m===$p)this._writingBuf=Ws,this.write=S$,this.flush=k$,this.flushSync=z$,this._actualWrite=T$,f=()=>ue.writeSync(this.fd,this._writingBuf),h=()=>ue.write(this.fd,this._writingBuf,this.release);else if(m===void 0||m===kp)this._writingBuf="",this.write=x$,this.flush=$$,this.flushSync=E$,this._actualWrite=P$,f=()=>Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8"),h=()=>Buffer.isBuffer(this._writingBuf)?ue.write(this.fd,this._writingBuf,this.release):ue.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${kp}" and "${$p}", but passed ${m}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Ep(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,_)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{yc(Hs),this.release(void 0,0)}catch(S){this.release(S)}else setTimeout(h,Hs);else this._writing=!1,this.emit("error",g);return}this.emit("write",_);let x=gc(this._writingBuf,this._len,_);if(this._len=x.len,this._writingBuf=x.writingBuf,this._writingBuf.length){if(!this.sync){h();return}try{do{let S=f(),k=gc(this._writingBuf,this._len,S);this._len=k.len,this._writingBuf=k.writingBuf}while(this._writingBuf.length)}catch(S){this.release(S);return}}this._fsync&&ue.fsyncSync(this.fd);let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?this._actualWrite():this._ending?w>0?this._actualWrite():(this._writing=!1,Gs(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(w$,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function gc(t,e,r){return typeof t=="string"&&(t=Buffer.from(t)),e=Math.max(e-r,0),t=t.subarray(r),{writingBuf:t,len:e}}function w$(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}h$(vt,m$);function zp(t,e){return t.length===0?Ws:t.length===1?t[0]:Buffer.concat(t,e)}function x$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");t=""+t;let e=Buffer.byteLength(t),r=this._len+e,n=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(n.length===0||Buffer.byteLength(n[n.length-1])+e>this.maxWrite?n.push(t):n[n.length-1]+=t,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function S$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Pp(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{ue.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function $$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Pp.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function k$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Pp.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}vt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&ue.close(e,r=>{if(r)return this.emit("error",r)})}),Ep(this.file,this)};vt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():Gs(this)))};function E$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?ue.writeSync(this.fd,t):ue.writeSync(this.fd,t,"utf8"),r=gc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;yc(Hs)}}try{ue.fsyncSync(this.fd)}catch{}}function z$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Ws);let t=Ws;for(;this._bufs.length||t.length;){t.length<=0&&(t=zp(this._bufs[0],this._lens[0]));try{let e=ue.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;yc(Hs)}}}vt.prototype.destroy=function(){this.destroyed||Gs(this)};function P$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let e=Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else ue.write(this.fd,this._writingBuf,t)}function T$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:zp(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=ue.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else b$&&(this._writingBuf=Buffer.from(this._writingBuf)),ue.write(this.fd,this._writingBuf,t)}function Gs(t){if(t.fd===-1){t.once("ready",Gs.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],g$(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{ue.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?ue.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}vt.SonicBoom=vt;vt.default=vt;Tp.exports=vt});var _c=$((r1,Ap)=>{"use strict";var bt={exit:[],beforeExit:[]},Op={exit:I$,beforeExit:R$},un;function C$(){un===void 0&&(un=new FinalizationRegistry(N$))}function O$(t){bt[t].length>0||process.on(t,Op[t])}function Ip(t){bt[t].length>0||(process.removeListener(t,Op[t]),bt.exit.length===0&&bt.beforeExit.length===0&&(un=void 0))}function I$(){Rp("exit")}function R$(){Rp("beforeExit")}function Rp(t){for(let e of bt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}bt[t]=[]}function N$(t){for(let e of["exit","beforeExit"]){let r=bt[e].indexOf(t);bt[e].splice(r,r+1),Ip(e)}}function Np(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");O$(t);let n=new WeakRef(e);n.fn=r,C$(),un.register(e,n),bt[t].push(n)}function A$(t,e){Np("exit",t,e)}function D$(t,e){Np("beforeExit",t,e)}function j$(t){if(un!==void 0){un.unregister(t);for(let e of["exit","beforeExit"])bt[e]=bt[e].filter(r=>{let n=r.deref();return n&&n!==t}),Ip(e)}}Ap.exports={register:A$,registerBeforeExit:D$,unregister:j$}});var Dp=$((n1,M$)=>{M$.exports={name:"thread-stream",version:"4.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^1.0.0"},devDependencies:{"@types/node":"^25.0.2","@yao-pkg/pkg":"^6.0.0",borp:"^1.0.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",neostandard:"^0.13.0","pino-elasticsearch":"^9.0.0","sonic-boom":"^5.0.0","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:'npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:ci":'npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:yarn":'npm run transpile && borp --pattern "test/*.test.js"',transpile:"sh ./test/ts/transpile.sh"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Mp=$((o1,jp)=>{"use strict";function Z$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{let a=Atomics.load(t,e);if(a===r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,a,c);u.async?u.value.then(i):setImmediate(i)};i()}function L$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{if(Atomics.load(t,e)!==r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,r,c);u.async?u.value.then(l=>{if(l==="ok"){o(null,"ok");return}i()}):setImmediate(i)};i()}jp.exports={wait:Z$,waitDiff:L$}});var Lp=$((s1,Zp)=>{"use strict";Zp.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var Qp=$((i1,Yp)=>{"use strict";var{version:q$}=Dp(),{EventEmitter:F$}=require("events"),{Worker:U$}=require("worker_threads"),{join:V$}=require("path"),{pathToFileURL:B$}=require("url"),{wait:H$}=Mp(),{WRITE_INDEX:Lt,READ_INDEX:Rr,SEQ_INDEX:vc}=Lp(),W$=require("buffer"),G$=require("assert"),b=Symbol("kImpl"),J$=W$.constants.MAX_STRING_LENGTH;function qp(){}function Sc(t,e){Atomics.add(t[b].state,vc,1),e(),Atomics.add(t[b].state,vc,1),Atomics.notify(t[b].state,vc)}function Fp(t){Sc(t,()=>{Atomics.store(t[b].state,Rr,0),Atomics.store(t[b].state,Lt,0)})}var io=class{constructor(e){this._value=e}deref(){return this._value}},Js=class{register(){}unregister(){}},K$=process.env.NODE_V8_COVERAGE?Js:global.FinalizationRegistry||Js,Y$=process.env.NODE_V8_COVERAGE?io:global.WeakRef||io,Up=new K$(t=>{t.exited||t.terminate()});function Q$(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||V$(__dirname,"lib","worker.js"),i=new U$(s,{...e.workerOpts,name:e.workerOpts?.name||"thread-stream",trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:B$(r).href,dataBuf:t[b].dataBuf,stateBuf:t[b].stateBuf,workerData:{$context:{threadStreamVersion:q$},...n}}});return i.stream=new io(t),i.on("message",X$),i.on("exit",Hp),Up.register(t,i),i}function Vp(t){G$(!t[b].sync),t[b].needDrain&&(t[b].needDrain=!1,t.emit("drain"))}function Bp(t){for(;;){let e=Atomics.load(t[b].state,Lt),r=t[b].data.length-e;if(r>0){if(t[b].bufLen===0){t[b].flushing=!1,t[b].ending?$c(t):t[b].needDrain&&process.nextTick(Vp,t);return}Jp(t,r,qp);continue}if(r===0){if(e===0&&t[b].bufLen===0)return;Ks(t,()=>{t.destroyed||(Fp(t),Bp(t))});return}st(t,new Error("overwritten"));return}}function X$(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}if(t?.code!=null)switch(t.code){case"READY":this.stream=new Y$(e),Ks(e,()=>{e[b].ready=!0,e.emit("ready")});break;case"ERROR":st(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"FLUSHED":{if(t.context!=="thread-stream"){st(e,new Error("this should not happen: "+t.code));break}let r=e[b].flushCallbacks.get(t.id);r&&(e[b].flushCallbacks.delete(t.id),process.nextTick(r));break}case"WARNING":process.emitWarning(t.err);break;default:st(e,new Error("this should not happen: "+t.code))}}function Hp(t){let e=this.stream.deref();e!==void 0&&(Up.unregister(e),e.worker.exited=!0,e.worker.off("exit",Hp),st(e,t!==0?new Error("the worker thread exited"):null))}var wc=class extends F${constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[b]={},this[b].stateBuf=new SharedArrayBuffer(128),this[b].state=new Int32Array(this[b].stateBuf),this[b].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[b].data=Buffer.from(this[b].dataBuf),this[b].sync=e.sync||!1,this[b].ending=!1,this[b].ended=!1,this[b].needDrain=!1,this[b].destroyed=!1,this[b].flushing=!1,this[b].ready=!1,this[b].finished=!1,this[b].errored=null,this[b].closed=!1,this[b].buf=[],this[b].bufHead=0,this[b].bufLen=0,this[b].flushCallbacks=new Map,this[b].nextFlushId=0,this.worker=Q$(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){let r=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[b].destroyed)return xc(this,new Error("the worker has exited")),!1;if(this[b].ending)return xc(this,new Error("the worker is ending")),!1;if(this[b].flushing&&this[b].bufLen+r.length>=J$)try{bc(this),this[b].flushing=!0}catch(n){return st(this,n),!1}if(this[b].buf.push(r),this[b].bufLen+=r.length,this[b].sync)try{return bc(this),!0}catch(n){return st(this,n),!1}return this[b].flushing||(this[b].flushing=!0,setImmediate(Bp,this)),this[b].needDrain=this[b].data.length-this[b].bufLen-Atomics.load(this[b].state,Lt)<=0,!this[b].needDrain}end(){this[b].destroyed||(this[b].ending=!0,$c(this))}flush(e){e=typeof e=="function"?e:qp,Wp(this,r=>{if(r){process.nextTick(e,r);return}Gp(this,e)})}flushSync(){this[b].destroyed||(bc(this),Kp(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[b].ready}get destroyed(){return this[b].destroyed}get closed(){return this[b].closed}get writable(){return!this[b].destroyed&&!this[b].ending}get writableEnded(){return this[b].ending}get writableFinished(){return this[b].finished}get writableNeedDrain(){return this[b].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[b].errored}};function Wp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].sync&&(t[b].flushing||t[b].bufLen>0)){setImmediate(Wp,t,e);return}Ks(t,e)}function Ks(t,e){let r=Atomics.load(t[b].state,Lt);H$(t[b].state,Rr,r,1/0,(n,o)=>{if(n){st(t,n),e(n);return}if(o!=="ok"){Ks(t,e);return}e()})}function Gp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].ready){let n=()=>{s(),Gp(t,e)},o=()=>{s(),process.nextTick(e,new Error("the worker has exited"))},s=()=>{t.off("ready",n),t.off("close",o)};t.once("ready",n),t.once("close",o);return}let r=++t[b].nextFlushId;t[b].flushCallbacks.set(r,e);try{t.worker.postMessage({code:"FLUSH",context:"thread-stream",id:r})}catch(n){t[b].flushCallbacks.delete(r),st(t,n),process.nextTick(e,n)}}function ek(t,e){let r=t[b].flushCallbacks;if(r.size===0)return;let n=e||new Error("the worker has exited");for(let o of r.values())process.nextTick(o,n);r.clear()}function xc(t,e){setImmediate(()=>{t.emit("error",e)})}function st(t,e){t[b].destroyed||(t[b].destroyed=!0,ek(t,e),e&&(t[b].errored=e,xc(t,e)),t.worker.exited?setImmediate(()=>{t[b].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[b].closed=!0,t.emit("close")}))}function Jp(t,e,r){let o=Atomics.load(t[b].state,Lt),s=e;for(;s>0&&t[b].bufLen!==0;){let i=t[b].bufHead,a=t[b].buf[i];if(a.length<=s){a.copy(t[b].data,o),o+=a.length,s-=a.length,t[b].bufLen-=a.length,t[b].bufHead=i+1,t[b].bufHead===t[b].buf.length?(t[b].buf.length=0,t[b].bufHead=0):t[b].bufHead>=1024&&t[b].bufHead*2>=t[b].buf.length&&(t[b].buf.splice(0,t[b].bufHead),t[b].bufHead=0);continue}a.copy(t[b].data,o,0,s),t[b].buf[i]=a.subarray(s),t[b].bufLen-=s,o+=s,s=0}return Sc(t,()=>{Atomics.store(t[b].state,Lt,o)}),r(),!0}function $c(t){if(!(t[b].ended||!t[b].ending||t[b].flushing)){t[b].ended=!0;try{t.flushSync();let e=Atomics.load(t[b].state,Rr);Sc(t,()=>{Atomics.store(t[b].state,Lt,-1)});let r=0;for(;e!==-1;){if(Atomics.wait(t[b].state,Rr,e,1e3),e=Atomics.load(t[b].state,Rr),e===-2){st(t,new Error("end() failed"));return}if(++r===10){st(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[b].finished=!0,t.emit("finish")})}catch(e){st(t,e)}}}function bc(t){let e=()=>{t[b].ending?$c(t):t[b].needDrain&&process.nextTick(Vp,t)};for(t[b].flushing=!1;t[b].bufLen!==0;){let r=Atomics.load(t[b].state,Lt),n=t[b].data.length-r;if(n===0){Kp(t),Fp(t);continue}else if(n<0)throw new Error("overwritten");Jp(t,n,e)}}function Kp(t){if(t[b].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[b].state,Lt),r=0;for(;;){let n=Atomics.load(t[b].state,Rr);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[b].state,Rr,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Yp.exports=wc});var zc=$((a1,tm)=>{"use strict";var{createRequire:tk}=require("module"),{existsSync:rk}=require("node:fs"),nk=lc(),{join:kc,isAbsolute:em,sep:ok}=require("node:path"),{fileURLToPath:sk}=require("node:url"),ik=hc(),Ec=_c(),ak=Qp();function ck(t){Ec.register(t,pk),Ec.registerBeforeExit(t,mk),t.on("close",function(){Ec.unregister(t)})}function uk(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function lk(t){let e=t.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!e)return t;let r=[],n=!1;for(let o=0;o<e.length;o++){let s=e[o];if(s==="--require"||s==="-r"||s==="--import"){let i=e[o+1];if(i&&Xp(i)){n=!0,o++;continue}r.push(s),i&&(r.push(i),o++);continue}if(s.startsWith("--require=")||s.startsWith("-r=")||s.startsWith("--import=")){let i=s.slice(s.indexOf("=")+1);if(Xp(i)){n=!0;continue}}r.push(s)}return n?r.join(" "):t}function Xp(t){let e=dk(t);if(!e)return!1;let r=e;if(r.startsWith("file://"))try{r=sk(r)}catch{return!1}return em(r)&&!rk(r)}function dk(t){let e=t[0],r=t[t.length-1];return e==='"'&&r==='"'||e==="'"&&r==="'"?t.slice(1,-1):t}function fk(t,e,r,n,o){if(!r.execArgv&&uk()&&require.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=lk(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:o};let s=new ak({filename:t,workerData:e,workerOpts:r,sync:n});s.on("ready",i),s.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function i(){process.removeListener("exit",a),s.unref(),r.autoEnd!==!1&&ck(s)}function a(){s.closed||(s.flushSync(),ik(100),s.end())}return s}function pk(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function mk(t){t.flushSync()}function hk(t){let{pipeline:e,targets:r,levels:n,dedupe:o,worker:s={},caller:i=nk(),sync:a=!1}=t,c={...t.options},u=typeof i=="string"?[i]:i,l=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),d=t.target;if(d&&r)throw new Error("only one of target or targets can be specified");r?(d=l["pino-worker"]||kc(__dirname,"worker.js"),c.targets=r.filter(f=>f.target).map(f=>({...f,target:p(f.target)})),c.pipelines=r.filter(f=>f.pipeline).map(f=>f.pipeline.map(h=>({...h,level:f.level,target:p(h.target)})))):e&&(d=l["pino-worker"]||kc(__dirname,"worker.js"),c.pipelines=[e.map(f=>({...f,target:p(f.target)}))]),n&&(c.levels=n),o&&(c.dedupe=o),c.pinoWillSendConfig=!0;let m=r||e?"pino.transport":d;return fk(p(d),c,s,a,m);function p(f){if(f=l[f]||f,em(f)||f.indexOf("file://")===0)return f;if(f==="pino/file")return kc(__dirname,"..","file.js");let h;for(let g of u)try{let _=g==="node:repl"?process.cwd()+ok:g;h=tk(_).resolve(f);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${f}"`);return h}}tm.exports=hk});var Xs=$((c1,mm)=>{"use strict";var gk=require("node:diagnostics_channel"),rm=xp(),{mapHttpRequest:yk,mapHttpResponse:_k}=uc(),Tc=Cp(),nm=_c(),{lsCacheSym:vk,chindingsSym:cm,writeSym:om,serializersSym:um,formatOptsSym:sm,endSym:bk,stringifiersSym:lm,stringifySym:dm,stringifySafeSym:Cc,wildcardFirstSym:fm,nestedKeySym:wk,formattersSym:pm,messageKeySym:xk,errorKeySym:Sk,nestedKeyStrSym:$k,msgPrefixSym:Ys}=cn(),{isMainThread:kk}=require("worker_threads"),Ek=zc(),[zk]=process.versions.node.split(".").map(t=>Number(t)),im=gk.tracingChannel("pino_asJson"),Pc=zk>=25?t=>JSON.stringify(t):Tk;function ln(){}function Pk(t,e){if(!e)return r;return function(...o){e.call(this,o,r,t)};function r(n,...o){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=yk(n):typeof n.setHeader=="function"&&(n=_k(n)));let i;s===null&&o.length===0?i=[null]:(s=o.shift(),i=o),typeof this[Ys]=="string"&&s!==void 0&&s!==null&&(s=this[Ys]+s),this[om](n,rm(s,i,this[sm]),t)}else{let s=n===void 0?o.shift():n;typeof this[Ys]=="string"&&s!==void 0&&s!==null&&(s=this[Ys]+s),this[om](null,rm(s,o,this[sm]),t)}}}function Tk(t){let e="",r=0,n=!1,o=255,s=t.length;if(s>100)return JSON.stringify(t);for(var i=0;i<s&&o>=32;i++)o=t.charCodeAt(i),(o===34||o===92)&&(e+=t.slice(r,i)+"\\",r=i,n=!0);return n?e+=t.slice(r):e=t,o<32?JSON.stringify(t):'"'+e+'"'}function Ck(t,e,r,n){if(im.hasSubscribers===!1)return am.call(this,t,e,r,n);let o={instance:this,arguments};return im.traceSync(am,o,this,t,e,r,n)}function am(t,e,r,n){let o=this[dm],s=this[Cc],i=this[lm],a=this[bk],c=this[cm],u=this[um],l=this[pm],d=this[xk],m=this[Sk],p=this[vk][r]+n;p=p+c;let f;l.log&&(t=l.log(t));let h=i[fm],g="";for(let x in t)if(f=t[x],Object.prototype.hasOwnProperty.call(t,x)&&f!==void 0){u[x]?f=u[x](f):x===m&&u.err&&(f=u.err(f));let w=i[x]||h;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":w&&(f=w(f));break;case"string":f=(w||Pc)(f);break;default:f=(w||o)(f,s)}if(f===void 0)continue;let S=Pc(x);g+=","+S+":"+f}let _="";if(e!==void 0){f=u[d]?u[d](e):e;let x=i[d]||h;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":x&&(f=x(f)),_=',"'+d+'":'+f;break;case"string":f=(x||Pc)(f),_=',"'+d+'":'+f;break;default:f=(x||o)(f,s),_=',"'+d+'":'+f}}return this[wk]&&g?p+this[$k]+g.slice(1)+"}"+_+a:p+g+_+a}function Ok(t,e){let r,n=t[cm],o=t[dm],s=t[Cc],i=t[lm],a=i[fm],c=t[um],u=t[pm].bindings;e=u(e);for(let l in e)if(r=e[l],((l.length<5||l!=="level"&&l!=="serializers"&&l!=="formatters"&&l!=="customLevels")&&e.hasOwnProperty(l)&&r!==void 0)===!0){if(r=c[l]?c[l](r):r,r=(i[l]||a||o)(r,s),r===void 0)continue;n+=',"'+l+'":'+r}return n}function Ik(t){return t.write!==t.constructor.prototype.write}function Qs(t){let e=new Tc(t);return e.on("error",r),!t.sync&&kk&&(nm.register(e,Rk),e.on("close",function(){nm.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=ln,e.end=ln,e.flushSync=ln,e.destroy=ln;return}e.removeListener("error",r),e.emit("error",n)}}function Rk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Nk(t){return function(r,n,o={},s){if(typeof o=="string")s=Qs({dest:o}),o={};else if(typeof s=="string"){if(o&&o.transport)throw Error("only one of option.transport or stream can be specified");s=Qs({dest:s})}else if(o instanceof Tc||o.writable||o._writableState)s=o,o={};else if(o.transport){if(o.transport instanceof Tc||o.transport.writable||o.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(o.transport.targets&&o.transport.targets.length&&o.formatters&&typeof o.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;o.customLevels&&(c=o.useOnlyCustomLevels?o.customLevels:Object.assign({},o.levels,o.customLevels)),s=Ek({caller:n,...o.transport,levels:c})}if(o=Object.assign({},t,o),o.serializers=Object.assign({},t.serializers,o.serializers),o.formatters=Object.assign({},t.formatters,o.formatters),o.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:i,onChild:a}=o;return i===!1&&(o.level="silent"),a||(o.onChild=ln),s||(Ik(process.stdout)?s=process.stdout:s=Qs({fd:process.stdout.fd||1})),{opts:o,stream:s}}}function Ak(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Cc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Dk(t,e,r){return{level:t,bindings:e,log:r}}function jk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}mm.exports={noop:ln,buildSafeSonicBoom:Qs,asChindings:Ok,asJson:Ck,genLog:Pk,createArgsNormalizer:Nk,stringify:Ak,buildFormatters:Dk,normalizeDestFileDescriptor:jk}});var ei=$((u1,hm)=>{var Mk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Zk={ASC:"ASC",DESC:"DESC"};hm.exports={DEFAULT_LEVELS:Mk,SORTING_ORDER:Zk}});var Rc=$((l1,vm)=>{"use strict";var{lsCacheSym:Lk,levelValSym:Oc,useOnlyCustomLevelsSym:qk,streamSym:Fk,formattersSym:Uk,hooksSym:Vk,levelCompSym:gm}=cn(),{noop:Bk,genLog:Nr}=Xs(),{DEFAULT_LEVELS:Pt,SORTING_ORDER:ym}=ei(),_m={fatal:t=>{let e=Nr(Pt.fatal,t);return function(...r){let n=this[Fk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>Nr(Pt.error,t),warn:t=>Nr(Pt.warn,t),info:t=>Nr(Pt.info,t),debug:t=>Nr(Pt.debug,t),trace:t=>Nr(Pt.trace,t)},Ic=Object.keys(Pt).reduce((t,e)=>(t[Pt[e]]=e,t),{}),Hk=Object.keys(Ic).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Wk(t){let e=t[Uk].level,{labels:r}=t.levels,n={};for(let o in r){let s=e(r[o],Number(o));n[o]=JSON.stringify(s).slice(0,-1)}return t[Lk]=n,t}function Gk(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Jk(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Oc],o=this[Oc]=r[t],s=this[qk],i=this[gm],a=this[Vk].logMethod;for(let c in r){if(i(r[c],o)===!1){this[c]=Bk;continue}this[c]=Gk(c,s)?_m[c](a):Nr(r[c],a)}this.emit("level-change",t,o,e[n],n,this)}function Kk(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function Yk(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[gm](r,this[Oc])}function Qk(t,e,r){return t===ym.DESC?e<=r:e>=r}function Xk(t){return typeof t=="string"?Qk.bind(null,t):t}function eE(t=null,e=!1){let r=t?Object.keys(t).reduce((s,i)=>(s[t[i]]=i,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Ic,r),o=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Pt,t);return{labels:n,values:o}}function tE(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Ic).map(s=>+s),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Pt,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function rE(t,e){let{labels:r,values:n}=t;for(let o in e){if(o in n)throw Error("levels cannot be overridden");if(e[o]in r)throw Error("pre-existing level values cannot be used for new levels")}}function nE(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(ym).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}vm.exports={initialLsCache:Hk,genLsCache:Wk,levelMethods:_m,getLevel:Kk,setLevel:Jk,isLevelEnabled:Yk,mappings:eE,assertNoLevelCollisions:rE,assertDefaultLevelFound:tE,genLevelComparison:Xk,assertLevelComparison:nE}});var Nc=$((d1,bm)=>{"use strict";bm.exports={version:"10.3.1"}});var Pm=$((p1,zm)=>{"use strict";var{EventEmitter:oE}=require("node:events"),{lsCacheSym:sE,levelValSym:iE,setLevelSym:Dc,getLevelSym:wm,chindingsSym:ri,mixinSym:aE,asJsonSym:Sm,writeSym:cE,mixinMergeStrategySym:uE,timeSym:lE,timeSliceIndexSym:dE,streamSym:$m,serializersSym:Ar,formattersSym:ao,errorKeySym:fE,messageKeySym:pE,useOnlyCustomLevelsSym:mE,needsMetadataGsym:hE,redactFmtSym:gE,stringifySym:yE,formatOptsSym:_E,stringifiersSym:vE,msgPrefixSym:jc,hooksSym:bE}=cn(),{getLevel:wE,setLevel:xE,isLevelEnabled:SE,mappings:$E,initialLsCache:kE,genLsCache:EE,assertNoLevelCollisions:zE}=Rc(),{asChindings:Mc,asJson:PE,buildFormatters:Ac,stringify:xm,noop:km}=Xs(),{version:TE}=Nc(),CE=pc(),OE=class{},Em={constructor:OE,child:IE,bindings:RE,setBindings:NE,flush:jE,isLevelEnabled:SE,version:TE,get level(){return this[wm]()},set level(t){this[Dc](t)},get levelVal(){return this[iE]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[jc]},get[Symbol.toStringTag](){return"Pino"},[sE]:kE,[cE]:DE,[Sm]:PE,[wm]:wE,[Dc]:xE};Object.setPrototypeOf(Em,oE.prototype);zm.exports=function(){return Object.create(Em)};var ti=t=>t;function IE(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[Ar],n=this[ao],o=Object.create(this);if(e==null)return o[ao].bindings!==ti&&(o[ao]=Ac(n.level,ti,n.log)),o[ri]=Mc(o,t),this.onChild!==km&&this.onChild(o),o;if(e.hasOwnProperty("serializers")===!0){o[Ar]=Object.create(null);for(let u in r)o[Ar][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++){let u=a[s];o[Ar][u]=r[u]}for(let u in e.serializers)o[Ar][u]=e.serializers[u];let c=Object.getOwnPropertySymbols(e.serializers);for(var i=0;i<c.length;i++){let u=c[i];o[Ar][u]=e.serializers[u]}}else o[Ar]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:c,log:u}=e.formatters;o[ao]=Ac(a||n.level,c||ti,u||n.log)}else o[ao]=Ac(n.level,ti,n.log);if(e.hasOwnProperty("customLevels")===!0&&(zE(this.levels,e.customLevels),o.levels=$E(e.customLevels,o[mE]),EE(o)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){o.redact=e.redact;let a=CE(o.redact,xm),c={stringify:a[gE]};o[yE]=xm,o[vE]=a,o[_E]=c}if(typeof e.msgPrefix=="string"&&(o[jc]=(this[jc]||"")+e.msgPrefix),o[ri]=Mc(o,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;o[Dc](a)}return this.onChild(o),o}function RE(){let e=`{${this[ri].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function NE(t){let e=Mc(this,t);this[ri]=e}function AE(t,e){return Object.assign(e,t)}function DE(t,e,r){let n=this[lE](),o=this[aE],s=this[fE],i=this[pE],a=this[uE]||AE,c,u=this[bE].streamWrite;t==null?c={}:t instanceof Error?(c={[s]:t},e===void 0&&(e=t.message)):(c=t,e===void 0&&t[i]===void 0&&t[s]&&(e=t[s].message)),o&&(c=a(c,o(c,r,this)));let l=this[Sm](c,e,r,n),d=this[$m];d[hE]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=e,d.lastTime=n.slice(this[dE]),d.lastLogger=this),d.write(u?u(l):l)}function jE(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[$m];typeof e.flush=="function"?e.flush(t||km):t&&t()}});var Im=$((Fc,Om)=>{"use strict";var{hasOwnProperty:co}=Object.prototype,jr=qc();jr.configure=qc;jr.stringify=jr;jr.default=jr;Fc.stringify=jr;Fc.configure=qc;Om.exports=jr;var ME=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function er(t){return t.length<5e3&&!ME.test(t)?`"${t}"`:JSON.stringify(t)}function Zc(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],o=r;for(;o!==0&&t[o-1]>n;)t[o]=t[o-1],o--;t[o]=n}return t}var ZE=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Lc(t){return ZE.call(t)!==void 0&&t.length!==0}function Tm(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",o=`"0":${n}${t[0]}`;for(let s=1;s<r;s++)o+=`${e}"${s}":${n}${t[s]}`;return o}function LE(t){if(co.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function qE(t){let e;if(co.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function FE(t,e){let r;if(co.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function Cm(t,e){let r;if(co.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function Dr(t){return t===1?"1 item":`${t} items`}function UE(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function VE(t){if(co.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function qc(t){t={...t};let e=VE(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=LE(t),n=FE(t,"bigint"),o=qE(t),s=typeof o=="function"?o:void 0,i=Cm(t,"maximumDepth"),a=Cm(t,"maximumBreadth");function c(p,f,h,g,_,x){let w=f[p];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(p)),w=g.call(f,p,w),typeof w){case"string":return er(w);case"object":{if(w===null)return"null";if(h.indexOf(w)!==-1)return r;let S="",k=",",W=x;if(Array.isArray(w)){if(w.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(w),_!==""&&(x+=_,S+=`
5
5
  ${x}`,k=`,
6
6
  ${x}`);let xe=Math.min(w.length,a),Ze=0;for(;Ze<xe-1;Ze++){let yr=c(String(Ze),w,h,g,_,x);S+=yr!==void 0?yr:"null",S+=k}let Be=c(String(Ze),w,h,g,_,x);if(S+=Be!==void 0?Be:"null",w.length-1>a){let yr=w.length-a-1;S+=`${k}"... ${Dr(yr)} not stringified"`}return _!==""&&(S+=`
7
7
  ${W}`),h.pop(),`[${S}]`}let Z=Object.keys(w),re=Z.length;if(re===0)return"{}";if(i<h.length+1)return'"[Object]"';let U="",me="";_!==""&&(x+=_,k=`,
8
- ${x}`,U=" ");let Ee=Math.min(re,a);o&&!Zc(w)&&(Z=Mc(Z,s)),h.push(w);for(let xe=0;xe<Ee;xe++){let Ze=Z[xe],Be=c(Ze,w,h,g,_,x);Be!==void 0&&(S+=`${me}${er(Ze)}:${U}${Be}`,me=k)}if(re>a){let xe=re-a;S+=`${me}"...":${U}"${Dr(xe)} not stringified"`,me=k}return _!==""&&me.length>1&&(S=`
8
+ ${x}`,U=" ");let Ee=Math.min(re,a);o&&!Lc(w)&&(Z=Zc(Z,s)),h.push(w);for(let xe=0;xe<Ee;xe++){let Ze=Z[xe],Be=c(Ze,w,h,g,_,x);Be!==void 0&&(S+=`${me}${er(Ze)}:${U}${Be}`,me=k)}if(re>a){let xe=re-a;S+=`${me}"...":${U}"${Dr(xe)} not stringified"`,me=k}return _!==""&&me.length>1&&(S=`
9
9
  ${x}${S}
10
10
  ${W}`),h.pop(),`{${S}}`}case"number":return isFinite(w)?String(w):e?e(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return e?e(w):void 0}}function u(p,f,h,g,_,x){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(p)),typeof f){case"string":return er(f);case"object":{if(f===null)return"null";if(h.indexOf(f)!==-1)return r;let w=x,S="",k=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),_!==""&&(x+=_,S+=`
11
11
  ${x}`,k=`,
@@ -17,23 +17,23 @@ ${w}`),h.pop(),`{${S}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";
17
17
  ${_}`,me=`,
18
18
  ${_}`,Ee=Math.min(f.length,a),xe=0;for(;xe<Ee-1;xe++){let Be=l(String(xe),f[xe],h,g,_);U+=Be!==void 0?Be:"null",U+=me}let Ze=l(String(xe),f[xe],h,g,_);if(U+=Ze!==void 0?Ze:"null",f.length-1>a){let Be=f.length-a-1;U+=`${me}"... ${Dr(Be)} not stringified"`}return U+=`
19
19
  ${x}`,h.pop(),`[${U}]`}let w=Object.keys(f),S=w.length;if(S===0)return"{}";if(i<h.length+1)return'"[Object]"';_+=g;let k=`,
20
- ${_}`,W="",Z="",re=Math.min(S,a);Zc(f)&&(W+=Tm(f,k,a),w=w.slice(f.length),re-=f.length,Z=k),o&&(w=Mc(w,s)),h.push(f);for(let U=0;U<re;U++){let me=w[U],Ee=l(me,f[me],h,g,_);Ee!==void 0&&(W+=`${Z}${er(me)}: ${Ee}`,Z=k)}if(S>a){let U=S-a;W+=`${Z}"...": "${Dr(U)} not stringified"`,Z=k}return Z!==""&&(W=`
20
+ ${_}`,W="",Z="",re=Math.min(S,a);Lc(f)&&(W+=Tm(f,k,a),w=w.slice(f.length),re-=f.length,Z=k),o&&(w=Zc(w,s)),h.push(f);for(let U=0;U<re;U++){let me=w[U],Ee=l(me,f[me],h,g,_);Ee!==void 0&&(W+=`${Z}${er(me)}: ${Ee}`,Z=k)}if(S>a){let U=S-a;W+=`${Z}"...": "${Dr(U)} not stringified"`,Z=k}return Z!==""&&(W=`
21
21
  ${_}${W}
22
- ${x}`),h.pop(),`{${W}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function d(p,f,h){switch(typeof f){case"string":return er(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(p),typeof f!="object")return d(p,f,h);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let g="",_=f.length!==void 0;if(_&&Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f);let W=Math.min(f.length,a),Z=0;for(;Z<W-1;Z++){let U=d(String(Z),f[Z],h);g+=U!==void 0?U:"null",g+=","}let re=d(String(Z),f[Z],h);if(g+=re!==void 0?re:"null",f.length-1>a){let U=f.length-a-1;g+=`,"... ${Dr(U)} not stringified"`}return h.pop(),`[${g}]`}let x=Object.keys(f),w=x.length;if(w===0)return"{}";if(i<h.length+1)return'"[Object]"';let S="",k=Math.min(w,a);_&&Zc(f)&&(g+=Tm(f,",",a),x=x.slice(f.length),k-=f.length,S=","),o&&(x=Mc(x,s)),h.push(f);for(let W=0;W<k;W++){let Z=x[W],re=d(Z,f[Z],h);re!==void 0&&(g+=`${S}${er(Z)}:${re}`,S=",")}if(w>a){let W=w-a;g+=`${S}"...":"${Dr(W)} not stringified"`}return h.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function m(p,f,h){if(arguments.length>1){let g="";if(typeof h=="number"?g=" ".repeat(Math.min(h,10)):typeof h=="string"&&(g=h.slice(0,10)),f!=null){if(typeof f=="function")return c("",{"":p},[],f,g,"");if(Array.isArray(f))return u("",p,[],qE(f),g,"")}if(g.length!==0)return l("",p,[],g,"")}return d("",p,[])}return m}});var Dm=$((f1,Am)=>{"use strict";var Fc=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Nm}=Ys(),UE=Nm.info;function VE(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(Nm);r.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(d=>{r[d]=e.levels[d]});let n={write:o,add:a,remove:c,emit:s,flushSync:i,end:u,minLevel:0,lastId:0,streams:[],clone:l,[Fc]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function o(d){let m,p=this.lastLevel,{streams:f}=this,h=0,g;for(let _=BE(f.length,e.dedupe);WE(_,f.length,e.dedupe);_=HE(_,e.dedupe))if(m=f[_],m.level<=p){if(h!==0&&h!==m.level)break;if(g=m.stream,g[Fc]){let{lastTime:x,lastMsg:w,lastObj:S,lastLogger:k}=this;g.lastLevel=p,g.lastTime=x,g.lastMsg=w,g.lastObj=S,g.lastLogger=k}g.write(d),e.dedupe&&(h=m.level)}else if(!e.dedupe)break}function s(...d){for(let{stream:m}of this.streams)typeof m.emit=="function"&&m.emit(...d)}function i(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync()}function a(d){if(!d)return n;let m=typeof d.write=="function"||d.stream,p=d.write?d:d.stream;if(!m)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:h}=this,g;typeof d.levelVal=="number"?g=d.levelVal:typeof d.level=="string"?g=h[d.level]:typeof d.level=="number"?g=d.level:g=UE;let _={stream:p,level:g,levelVal:void 0,id:++n.lastId};return f.unshift(_),f.sort(Rm),this.minLevel=f[0].level,n}function c(d){let{streams:m}=this,p=m.findIndex(f=>f.id===d);return p>=0&&(m.splice(p,1),m.sort(Rm),this.minLevel=m.length>0?m[0].level:-1),n}function u(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync(),d.end()}function l(d){let m=new Array(this.streams.length);for(let p=0;p<m.length;p++)m[p]={level:d,stream:this.streams[p].stream};return{write:o,add:a,remove:c,minLevel:d,streams:m,clone:l,emit:s,flushSync:i,[Fc]:!0}}}function Rm(t,e){return t.level-e.level}function BE(t,e){return e?t-1:0}function HE(t,e){return e?t-1:t+1}function WE(t,e,r){return r?t>=0:t<e}Am.exports=VE});var Km=$((p1,it)=>{"use strict";var GE=require("node:os"),Vm=cc(),JE=uc(),KE=fc(),Bm=bp(),YE=Pm(),Hm=an(),{configure:QE}=Im(),{assertDefaultLevelFound:XE,mappings:Wm,genLsCache:ez,genLevelComparison:tz,assertLevelComparison:rz}=Ic(),{DEFAULT_LEVELS:Gm,SORTING_ORDER:nz}=Ys(),{createArgsNormalizer:oz,asChindings:sz,buildSafeSonicBoom:jm,buildFormatters:iz,stringify:Uc,normalizeDestFileDescriptor:Mm,noop:az}=Ks(),{version:cz}=Rc(),{chindingsSym:Zm,redactFmtSym:uz,serializersSym:Lm,timeSym:lz,timeSliceIndexSym:dz,streamSym:fz,stringifySym:qm,stringifySafeSym:Vc,stringifiersSym:Fm,setLevelSym:pz,endSym:mz,formatOptsSym:hz,messageKeySym:gz,errorKeySym:yz,nestedKeySym:_z,mixinSym:vz,levelCompSym:bz,useOnlyCustomLevelsSym:wz,formattersSym:Um,hooksSym:xz,nestedKeyStrSym:Sz,mixinMergeStrategySym:$z,msgPrefixSym:kz}=Hm,{epochTime:Jm,nullTime:Ez}=Bm,{pid:zz}=process,Pz=GE.hostname(),Tz=Vm.err,Cz={level:"info",levelComparison:nz.ASC,levels:Gm,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:zz,hostname:Pz},serializers:Object.assign(Object.create(null),{err:Tz}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Jm,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Oz=oz(Cz),Iz=Object.assign(Object.create(null),Vm);function Bc(...t){let e={},{opts:r,stream:n}=Oz(e,JE(),...t);r.level&&typeof r.level=="string"&&Gm[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:o,crlf:s,serializers:i,timestamp:a,messageKey:c,errorKey:u,nestedKey:l,base:d,name:m,level:p,customLevels:f,levelComparison:h,mixin:g,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:w,hooks:S,depthLimit:k,edgeLimit:W,onChild:Z,msgPrefix:re}=r,U=QE({maximumDepth:k,maximumBreadth:W}),me=iz(w.level,w.bindings,w.log),Ee=Uc.bind({[Vc]:U}),xe=o?KE(o,Ee):{},Ze=o?{stringify:xe[uz]}:{stringify:Ee},Be="}"+(s?`\r
22
+ ${x}`),h.pop(),`{${W}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function d(p,f,h){switch(typeof f){case"string":return er(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(p),typeof f!="object")return d(p,f,h);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let g="",_=f.length!==void 0;if(_&&Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f);let W=Math.min(f.length,a),Z=0;for(;Z<W-1;Z++){let U=d(String(Z),f[Z],h);g+=U!==void 0?U:"null",g+=","}let re=d(String(Z),f[Z],h);if(g+=re!==void 0?re:"null",f.length-1>a){let U=f.length-a-1;g+=`,"... ${Dr(U)} not stringified"`}return h.pop(),`[${g}]`}let x=Object.keys(f),w=x.length;if(w===0)return"{}";if(i<h.length+1)return'"[Object]"';let S="",k=Math.min(w,a);_&&Lc(f)&&(g+=Tm(f,",",a),x=x.slice(f.length),k-=f.length,S=","),o&&(x=Zc(x,s)),h.push(f);for(let W=0;W<k;W++){let Z=x[W],re=d(Z,f[Z],h);re!==void 0&&(g+=`${S}${er(Z)}:${re}`,S=",")}if(w>a){let W=w-a;g+=`${S}"...":"${Dr(W)} not stringified"`}return h.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function m(p,f,h){if(arguments.length>1){let g="";if(typeof h=="number"?g=" ".repeat(Math.min(h,10)):typeof h=="string"&&(g=h.slice(0,10)),f!=null){if(typeof f=="function")return c("",{"":p},[],f,g,"");if(Array.isArray(f))return u("",p,[],UE(f),g,"")}if(g.length!==0)return l("",p,[],g,"")}return d("",p,[])}return m}});var Dm=$((m1,Am)=>{"use strict";var Uc=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Nm}=ei(),BE=Nm.info;function HE(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(Nm);r.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(d=>{r[d]=e.levels[d]});let n={write:o,add:a,remove:c,emit:s,flushSync:i,end:u,minLevel:0,lastId:0,streams:[],clone:l,[Uc]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function o(d){let m,p=this.lastLevel,{streams:f}=this,h=0,g;for(let _=WE(f.length,e.dedupe);JE(_,f.length,e.dedupe);_=GE(_,e.dedupe))if(m=f[_],m.level<=p){if(h!==0&&h!==m.level)break;if(g=m.stream,g[Uc]){let{lastTime:x,lastMsg:w,lastObj:S,lastLogger:k}=this;g.lastLevel=p,g.lastTime=x,g.lastMsg=w,g.lastObj=S,g.lastLogger=k}g.write(d),e.dedupe&&(h=m.level)}else if(!e.dedupe)break}function s(...d){for(let{stream:m}of this.streams)typeof m.emit=="function"&&m.emit(...d)}function i(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync()}function a(d){if(!d)return n;let m=typeof d.write=="function"||d.stream,p=d.write?d:d.stream;if(!m)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:h}=this,g;typeof d.levelVal=="number"?g=d.levelVal:typeof d.level=="string"?g=h[d.level]:typeof d.level=="number"?g=d.level:g=BE;let _={stream:p,level:g,levelVal:void 0,id:++n.lastId};return f.unshift(_),f.sort(Rm),this.minLevel=f[0].level,n}function c(d){let{streams:m}=this,p=m.findIndex(f=>f.id===d);return p>=0&&(m.splice(p,1),m.sort(Rm),this.minLevel=m.length>0?m[0].level:-1),n}function u(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync(),d.end()}function l(d){let m=new Array(this.streams.length);for(let p=0;p<m.length;p++)m[p]={level:d,stream:this.streams[p].stream};return{write:o,add:a,remove:c,minLevel:d,streams:m,clone:l,emit:s,flushSync:i,[Uc]:!0}}}function Rm(t,e){return t.level-e.level}function WE(t,e){return e?t-1:0}function GE(t,e){return e?t-1:t+1}function JE(t,e,r){return r?t>=0:t<e}Am.exports=HE});var Km=$((h1,it)=>{"use strict";var KE=require("node:os"),Vm=uc(),YE=lc(),QE=pc(),Bm=bp(),XE=Pm(),Hm=cn(),{configure:ez}=Im(),{assertDefaultLevelFound:tz,mappings:Wm,genLsCache:rz,genLevelComparison:nz,assertLevelComparison:oz}=Rc(),{DEFAULT_LEVELS:Gm,SORTING_ORDER:sz}=ei(),{createArgsNormalizer:iz,asChindings:az,buildSafeSonicBoom:jm,buildFormatters:cz,stringify:Vc,normalizeDestFileDescriptor:Mm,noop:uz}=Xs(),{version:lz}=Nc(),{chindingsSym:Zm,redactFmtSym:dz,serializersSym:Lm,timeSym:fz,timeSliceIndexSym:pz,streamSym:mz,stringifySym:qm,stringifySafeSym:Bc,stringifiersSym:Fm,setLevelSym:hz,endSym:gz,formatOptsSym:yz,messageKeySym:_z,errorKeySym:vz,nestedKeySym:bz,mixinSym:wz,levelCompSym:xz,useOnlyCustomLevelsSym:Sz,formattersSym:Um,hooksSym:$z,nestedKeyStrSym:kz,mixinMergeStrategySym:Ez,msgPrefixSym:zz}=Hm,{epochTime:Jm,nullTime:Pz}=Bm,{pid:Tz}=process,Cz=KE.hostname(),Oz=Vm.err,Iz={level:"info",levelComparison:sz.ASC,levels:Gm,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Tz,hostname:Cz},serializers:Object.assign(Object.create(null),{err:Oz}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Jm,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Rz=iz(Iz),Nz=Object.assign(Object.create(null),Vm);function Hc(...t){let e={},{opts:r,stream:n}=Rz(e,YE(),...t);r.level&&typeof r.level=="string"&&Gm[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:o,crlf:s,serializers:i,timestamp:a,messageKey:c,errorKey:u,nestedKey:l,base:d,name:m,level:p,customLevels:f,levelComparison:h,mixin:g,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:w,hooks:S,depthLimit:k,edgeLimit:W,onChild:Z,msgPrefix:re}=r,U=ez({maximumDepth:k,maximumBreadth:W}),me=cz(w.level,w.bindings,w.log),Ee=Vc.bind({[Bc]:U}),xe=o?QE(o,Ee):{},Ze=o?{stringify:xe[dz]}:{stringify:Ee},Be="}"+(s?`\r
23
23
  `:`
24
- `),yr=sz.bind(null,{[Zm]:"",[Lm]:i,[Fm]:xe,[qm]:Uc,[Vc]:U,[Um]:me}),Ia="";d!==null&&(m===void 0?Ia=yr(d):Ia=yr(Object.assign({},d,{name:m})));let rf=a instanceof Function?a:a?Jm:Ez,ux=rf().indexOf(":")+1;if(x&&!f)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(re&&typeof re!="string")throw Error(`Unknown msgPrefix type "${typeof re}" - expected "string"`);XE(p,f,x);let nf=Wm(f,x);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:nf,messageKey:c,errorKey:u}}),rz(h);let lx=tz(h);return Object.assign(e,{levels:nf,[bz]:lx,[wz]:x,[fz]:n,[lz]:rf,[dz]:ux,[qm]:Uc,[Vc]:U,[Fm]:xe,[mz]:Be,[hz]:Ze,[gz]:c,[yz]:u,[_z]:l,[Sz]:l?`,${JSON.stringify(l)}:{`:"",[Lm]:i,[vz]:g,[$z]:_,[Zm]:Ia,[Um]:me,[xz]:S,silent:az,onChild:Z,[kz]:re}),Object.setPrototypeOf(e,YE()),ez(e),e[pz](p),e}it.exports=Bc;it.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Mm(t.dest||process.stdout.fd),jm(t)):jm({dest:Mm(t),minLength:0});it.exports.transport=Ec();it.exports.multistream=Dm();it.exports.levels=Wm();it.exports.stdSerializers=Iz;it.exports.stdTimeFunctions=Object.assign({},Bm);it.exports.symbols=Hm;it.exports.version=cz;it.exports.default=Bc;it.exports.pino=Bc});var Fo=$(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.regexpCode=ee.getEsmExportName=ee.getProperty=ee.safeStringify=ee.stringify=ee.strConcat=ee.addCodeArg=ee.str=ee._=ee.nil=ee._Code=ee.Name=ee.IDENTIFIER=ee._CodeOrName=void 0;var Lo=class{};ee._CodeOrName=Lo;ee.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Lr=class extends Lo{constructor(e){if(super(),!ee.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ee.Name=Lr;var lt=class extends Lo{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Lr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ee._Code=lt;ee.nil=new lt("");function fv(t,...e){let r=[t[0]],n=0;for(;n<e.length;)ul(r,e[n]),r.push(t[++n]);return new lt(r)}ee._=fv;var cl=new lt("+");function pv(t,...e){let r=[qo(t[0])],n=0;for(;n<e.length;)r.push(cl),ul(r,e[n]),r.push(cl,qo(t[++n]));return nO(r),new lt(r)}ee.str=pv;function ul(t,e){e instanceof lt?t.push(...e._items):e instanceof Lr?t.push(e):t.push(iO(e))}ee.addCodeArg=ul;function nO(t){let e=1;for(;e<t.length-1;){if(t[e]===cl){let r=oO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function oO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Lr||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Lr))return`"${t}${e.slice(1)}`}function sO(t,e){return e.emptyStr()?t:t.emptyStr()?e:pv`${t}${e}`}ee.strConcat=sO;function iO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:qo(Array.isArray(t)?t.join(","):t)}function aO(t){return new lt(qo(t))}ee.stringify=aO;function qo(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ee.safeStringify=qo;function cO(t){return typeof t=="string"&&ee.IDENTIFIER.test(t)?new lt(`.${t}`):fv`[${t}]`}ee.getProperty=cO;function uO(t){if(typeof t=="string"&&ee.IDENTIFIER.test(t))return new lt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ee.getEsmExportName=uO;function lO(t){return new lt(t.toString())}ee.regexpCode=lO});var fl=$(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.ValueScope=Je.ValueScopeName=Je.Scope=Je.varKinds=Je.UsedValueState=void 0;var Ge=Fo(),ll=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ui;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ui||(Je.UsedValueState=Ui={}));Je.varKinds={const:new Ge.Name("const"),let:new Ge.Name("let"),var:new Ge.Name("var")};var Vi=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ge.Name?e:this.name(e)}name(e){return new Ge.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Je.Scope=Vi;var Bi=class extends Ge.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ge._)`.${new Ge.Name(r)}[${n}]`}};Je.ValueScopeName=Bi;var dO=(0,Ge._)`\n`,dl=class extends Vi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?dO:Ge.nil}}get(){return this._scope}name(e){return new Bi(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ge._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Ge.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Ui.Started);let l=r(u);if(l){let d=this.opts.es5?Je.varKinds.var:Je.varKinds.const;s=(0,Ge._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))s=(0,Ge._)`${s}${l}${this.opts._n}`;else throw new ll(u);c.set(u,Ui.Completed)})}return s}};Je.ValueScope=dl});var F=$(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var K=Fo(),xt=fl(),cr=Fo();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return cr._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return cr.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return cr.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return cr.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return cr.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return cr.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return cr.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return cr.Name}});var Ji=fl();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Ji.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Ji.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Ji.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Ji.varKinds}});V.operators={GT:new K._Code(">"),GTE:new K._Code(">="),LT:new K._Code("<"),LTE:new K._Code("<="),EQ:new K._Code("==="),NEQ:new K._Code("!=="),NOT:new K._Code("!"),OR:new K._Code("||"),AND:new K._Code("&&"),ADD:new K._Code("+")};var Bt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},pl=class extends Bt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?xt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=xn(this.rhs,e,r)),this}get names(){return this.rhs instanceof K._CodeOrName?this.rhs.names:{}}},Hi=class extends Bt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof K.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=xn(this.rhs,e,r),this}get names(){let e=this.lhs instanceof K.Name?{}:{...this.lhs.names};return Gi(e,this.rhs)}},ml=class extends Hi{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},hl=class extends Bt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},gl=class extends Bt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},yl=class extends Bt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},_l=class extends Bt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=xn(this.code,e,r),this}get names(){return this.code instanceof K._CodeOrName?this.code.names:{}}},Uo=class extends Bt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(fO(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ur(e,r.names),{})}},Ht=class extends Uo{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},vl=class extends Uo{},wn=class extends Ht{};wn.kind="else";var qr=class t extends Ht{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new wn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(mv(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=xn(this.condition,e,r),this}get names(){let e=super.names;return Gi(e,this.condition),this.else&&Ur(e,this.else.names),e}};qr.kind="if";var Fr=class extends Ht{};Fr.kind="for";var bl=class extends Fr{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=xn(this.iteration,e,r),this}get names(){return Ur(super.names,this.iteration.names)}},wl=class extends Fr{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?xt.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Gi(super.names,this.from);return Gi(e,this.to)}},Wi=class extends Fr{constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=xn(this.iterable,e,r),this}get names(){return Ur(super.names,this.iterable.names)}},Vo=class extends Ht{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Vo.kind="func";var Bo=class extends Uo{render(e){return"return "+super.render(e)}};Bo.kind="return";var xl=class extends Ht{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ur(e,this.catch.names),this.finally&&Ur(e,this.finally.names),e}},Ho=class extends Ht{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Ho.kind="catch";var Wo=class extends Ht{render(e){return"finally"+super.render(e)}};Wo.kind="finally";var Sl=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
25
- `:""},this._extScope=e,this._scope=new xt.Scope({parent:e}),this._nodes=[new vl]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new pl(e,s,n)),s}const(e,r,n){return this._def(xt.varKinds.const,e,r,n)}let(e,r,n){return this._def(xt.varKinds.let,e,r,n)}var(e,r,n){return this._def(xt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Hi(e,r,n))}add(e,r){return this._leafNode(new ml(e,V.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==K.nil&&this._leafNode(new _l(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,K.addCodeArg)(r,o));return r.push("}"),new K._Code(r)}if(e,r,n){if(this._blockNode(new qr(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new qr(e))}else(){return this._elseNode(new wn)}endIf(){return this._endBlockNode(qr,wn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new bl(e),r)}forRange(e,r,n,o,s=this.opts.es5?xt.varKinds.var:xt.varKinds.let){let i=this._scope.toName(e);return this._for(new wl(s,i,r,n),()=>o(i))}forOf(e,r,n,o=xt.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof K.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,K._)`${i}.length`,a=>{this.var(s,(0,K._)`${i}[${a}]`),n(s)})}return this._for(new Wi("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?xt.varKinds.var:xt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,K._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Wi("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Fr)}label(e){return this._leafNode(new hl(e))}break(e){return this._leafNode(new gl(e))}return(e){let r=new Bo;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Bo)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new xl;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new Ho(s),r(s)}return n&&(this._currNode=o.finally=new Wo,this.code(n)),this._endBlockNode(Ho,Wo)}throw(e){return this._leafNode(new yl(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=K.nil,n,o){return this._blockNode(new Vo(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Vo)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof qr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};V.CodeGen=Sl;function Ur(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Gi(t,e){return e instanceof K._CodeOrName?Ur(t,e.names):t}function xn(t,e,r){if(t instanceof K.Name)return n(t);if(!o(t))return t;return new K._Code(t._items.reduce((s,i)=>(i instanceof K.Name&&(i=n(i)),i instanceof K._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function o(s){return s instanceof K._Code&&s._items.some(i=>i instanceof K.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function fO(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function mv(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,K._)`!${$l(t)}`}V.not=mv;var pO=hv(V.operators.AND);function mO(...t){return t.reduce(pO)}V.and=mO;var hO=hv(V.operators.OR);function gO(...t){return t.reduce(hO)}V.or=gO;function hv(t){return(e,r)=>e===K.nil?r:r===K.nil?e:(0,K._)`${$l(e)} ${t} ${$l(r)}`}function $l(t){return t instanceof K.Name?t:(0,K._)`(${t})`}});var Q=$(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.checkStrictMode=B.getErrorPath=B.Type=B.useFunc=B.setEvaluated=B.evaluatedPropsToName=B.mergeEvaluated=B.eachItem=B.unescapeJsonPointer=B.escapeJsonPointer=B.escapeFragment=B.unescapeFragment=B.schemaRefOrVal=B.schemaHasRulesButRef=B.schemaHasRules=B.checkUnknownRules=B.alwaysValidSchema=B.toHash=void 0;var ae=F(),yO=Fo();function _O(t){let e={};for(let r of t)e[r]=!0;return e}B.toHash=_O;function vO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(_v(t,e),!vv(e,t.self.RULES.all))}B.alwaysValidSchema=vO;function _v(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||xv(t,`unknown keyword: "${s}"`)}B.checkUnknownRules=_v;function vv(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}B.schemaHasRules=vv;function bO(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}B.schemaHasRulesButRef=bO;function wO({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ae._)`${r}`}return(0,ae._)`${t}${e}${(0,ae.getProperty)(n)}`}B.schemaRefOrVal=wO;function xO(t){return bv(decodeURIComponent(t))}B.unescapeFragment=xO;function SO(t){return encodeURIComponent(El(t))}B.escapeFragment=SO;function El(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=El;function bv(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=bv;function $O(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}B.eachItem=$O;function gv({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof ae.Name?(s instanceof ae.Name?t(o,s,i):e(o,s,i),i):s instanceof ae.Name?(e(o,i,s),s):r(s,i);return a===ae.Name&&!(c instanceof ae.Name)?n(o,c):c}}B.mergeEvaluated={props:gv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ae._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ae._)`${r} || {}`).code((0,ae._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ae._)`${r} || {}`),zl(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:wv}),items:gv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ae._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ae._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function wv(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ae._)`{}`);return e!==void 0&&zl(t,r,e),r}B.evaluatedPropsToName=wv;function zl(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ae._)`${e}${(0,ae.getProperty)(n)}`,!0))}B.setEvaluated=zl;var yv={};function kO(t,e){return t.scopeValue("func",{ref:e,code:yv[e.code]||(yv[e.code]=new yO._Code(e.code))})}B.useFunc=kO;var kl;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(kl||(B.Type=kl={}));function EO(t,e,r){if(t instanceof ae.Name){let n=e===kl.Num;return r?n?(0,ae._)`"[" + ${t} + "]"`:(0,ae._)`"['" + ${t} + "']"`:n?(0,ae._)`"/" + ${t}`:(0,ae._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ae.getProperty)(t).toString():"/"+El(t)}B.getErrorPath=EO;function xv(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}B.checkStrictMode=xv});var Wt=$(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});var De=F(),zO={data:new De.Name("data"),valCxt:new De.Name("valCxt"),instancePath:new De.Name("instancePath"),parentData:new De.Name("parentData"),parentDataProperty:new De.Name("parentDataProperty"),rootData:new De.Name("rootData"),dynamicAnchors:new De.Name("dynamicAnchors"),vErrors:new De.Name("vErrors"),errors:new De.Name("errors"),this:new De.Name("this"),self:new De.Name("self"),scope:new De.Name("scope"),json:new De.Name("json"),jsonPos:new De.Name("jsonPos"),jsonLen:new De.Name("jsonLen"),jsonPart:new De.Name("jsonPart")};Pl.default=zO});var Go=$(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.extendErrors=je.resetErrorsCount=je.reportExtraError=je.reportError=je.keyword$DataError=je.keywordError=void 0;var X=F(),Ki=Q(),Ue=Wt();je.keywordError={message:({keyword:t})=>(0,X.str)`must pass "${t}" keyword validation`};je.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,X.str)`"${t}" keyword must be ${e} ($data)`:(0,X.str)`"${t}" keyword is invalid ($data)`};function PO(t,e=je.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=kv(t,e,r);n??(i||a)?Sv(s,c):$v(o,(0,X._)`[${c}]`)}je.reportError=PO;function TO(t,e=je.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=kv(t,e,r);Sv(o,a),s||i||$v(n,Ue.default.vErrors)}je.reportExtraError=TO;function CO(t,e){t.assign(Ue.default.errors,e),t.if((0,X._)`${Ue.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,X._)`${Ue.default.vErrors}.length`,e),()=>t.assign(Ue.default.vErrors,null)))}je.resetErrorsCount=CO;function OO({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",o,Ue.default.errors,a=>{t.const(i,(0,X._)`${Ue.default.vErrors}[${a}]`),t.if((0,X._)`${i}.instancePath === undefined`,()=>t.assign((0,X._)`${i}.instancePath`,(0,X.strConcat)(Ue.default.instancePath,s.errorPath))),t.assign((0,X._)`${i}.schemaPath`,(0,X.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,X._)`${i}.schema`,r),t.assign((0,X._)`${i}.data`,n))})}je.extendErrors=OO;function Sv(t,e){let r=t.const("err",e);t.if((0,X._)`${Ue.default.vErrors} === null`,()=>t.assign(Ue.default.vErrors,(0,X._)`[${r}]`),(0,X._)`${Ue.default.vErrors}.push(${r})`),t.code((0,X._)`${Ue.default.errors}++`)}function $v(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,X._)`new ${t.ValidationError}(${e})`):(r.assign((0,X._)`${n}.errors`,e),r.return(!1))}var Vr={keyword:new X.Name("keyword"),schemaPath:new X.Name("schemaPath"),params:new X.Name("params"),propertyName:new X.Name("propertyName"),message:new X.Name("message"),schema:new X.Name("schema"),parentSchema:new X.Name("parentSchema")};function kv(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,X._)`{}`:IO(t,e,r)}function IO(t,e,r={}){let{gen:n,it:o}=t,s=[RO(o,r),NO(t,r)];return AO(t,e,s),n.object(...s)}function RO({errorPath:t},{instancePath:e}){let r=e?(0,X.str)`${t}${(0,Ki.getErrorPath)(e,Ki.Type.Str)}`:t;return[Ue.default.instancePath,(0,X.strConcat)(Ue.default.instancePath,r)]}function NO({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,X.str)`${e}/${t}`;return r&&(o=(0,X.str)`${o}${(0,Ki.getErrorPath)(r,Ki.Type.Str)}`),[Vr.schemaPath,o]}function AO(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([Vr.keyword,o],[Vr.params,typeof e=="function"?e(t):e||(0,X._)`{}`]),c.messages&&n.push([Vr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Vr.schema,i],[Vr.parentSchema,(0,X._)`${l}${d}`],[Ue.default.data,s]),u&&n.push([Vr.propertyName,u])}});var zv=$(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.boolOrEmptySchema=Sn.topBoolOrEmptySchema=void 0;var DO=Go(),jO=F(),MO=Wt(),ZO={message:"boolean schema is false"};function LO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Ev(t,!1):typeof r=="object"&&r.$async===!0?e.return(MO.default.data):(e.assign((0,jO._)`${n}.errors`,null),e.return(!0))}Sn.topBoolOrEmptySchema=LO;function qO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Ev(t)):r.var(e,!0)}Sn.boolOrEmptySchema=qO;function Ev(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,DO.reportError)(o,ZO,void 0,e)}});var Tl=$($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.getRules=$n.isJSONType=void 0;var FO=["string","number","integer","boolean","null","object","array"],UO=new Set(FO);function VO(t){return typeof t=="string"&&UO.has(t)}$n.isJSONType=VO;function BO(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}$n.getRules=BO});var Cl=$(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.shouldUseRule=ur.shouldUseGroup=ur.schemaHasRulesForType=void 0;function HO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Pv(t,n)}ur.schemaHasRulesForType=HO;function Pv(t,e){return e.rules.some(r=>Tv(t,r))}ur.shouldUseGroup=Pv;function Tv(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ur.shouldUseRule=Tv});var Jo=$(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.reportTypeError=Me.checkDataTypes=Me.checkDataType=Me.coerceAndCheckDataType=Me.getJSONTypes=Me.getSchemaTypes=Me.DataType=void 0;var WO=Tl(),GO=Cl(),JO=Go(),q=F(),Cv=Q(),kn;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(kn||(Me.DataType=kn={}));function KO(t){let e=Ov(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Me.getSchemaTypes=KO;function Ov(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(WO.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Me.getJSONTypes=Ov;function YO(t,e){let{gen:r,data:n,opts:o}=t,s=QO(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,GO.schemaHasRulesForType)(t,e[0]));if(i){let a=Il(e,n,o.strictNumbers,kn.Wrong);r.if(a,()=>{s.length?XO(t,e,s):Rl(t)})}return i}Me.coerceAndCheckDataType=YO;var Iv=new Set(["string","number","integer","boolean","null"]);function QO(t,e){return e?t.filter(r=>Iv.has(r)||e==="array"&&r==="array"):[]}function XO(t,e,r){let{gen:n,data:o,opts:s}=t,i=n.let("dataType",(0,q._)`typeof ${o}`),a=n.let("coerced",(0,q._)`undefined`);s.coerceTypes==="array"&&n.if((0,q._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,q._)`${o}[0]`).assign(i,(0,q._)`typeof ${o}`).if(Il(e,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,q._)`${a} !== undefined`);for(let u of r)(Iv.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Rl(t),n.endIf(),n.if((0,q._)`${a} !== undefined`,()=>{n.assign(o,a),eI(t,a)});function c(u){switch(u){case"string":n.elseIf((0,q._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,q._)`"" + ${o}`).elseIf((0,q._)`${o} === null`).assign(a,(0,q._)`""`);return;case"number":n.elseIf((0,q._)`${i} == "boolean" || ${o} === null
24
+ `),yr=az.bind(null,{[Zm]:"",[Lm]:i,[Fm]:xe,[qm]:Vc,[Bc]:U,[Um]:me}),Na="";d!==null&&(m===void 0?Na=yr(d):Na=yr(Object.assign({},d,{name:m})));let nf=a instanceof Function?a:a?Jm:Pz,lx=nf().indexOf(":")+1;if(x&&!f)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(re&&typeof re!="string")throw Error(`Unknown msgPrefix type "${typeof re}" - expected "string"`);tz(p,f,x);let of=Wm(f,x);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:of,messageKey:c,errorKey:u}}),oz(h);let dx=nz(h);return Object.assign(e,{levels:of,[xz]:dx,[Sz]:x,[mz]:n,[fz]:nf,[pz]:lx,[qm]:Vc,[Bc]:U,[Fm]:xe,[gz]:Be,[yz]:Ze,[_z]:c,[vz]:u,[bz]:l,[kz]:l?`,${JSON.stringify(l)}:{`:"",[Lm]:i,[wz]:g,[Ez]:_,[Zm]:Na,[Um]:me,[$z]:S,silent:uz,onChild:Z,[zz]:re}),Object.setPrototypeOf(e,XE()),rz(e),e[hz](p),e}it.exports=Hc;it.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Mm(t.dest||process.stdout.fd),jm(t)):jm({dest:Mm(t),minLength:0});it.exports.transport=zc();it.exports.multistream=Dm();it.exports.levels=Wm();it.exports.stdSerializers=Nz;it.exports.stdTimeFunctions=Object.assign({},Bm);it.exports.symbols=Hm;it.exports.version=lz;it.exports.default=Hc;it.exports.pino=Hc});var Bo=$(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.regexpCode=ee.getEsmExportName=ee.getProperty=ee.safeStringify=ee.stringify=ee.strConcat=ee.addCodeArg=ee.str=ee._=ee.nil=ee._Code=ee.Name=ee.IDENTIFIER=ee._CodeOrName=void 0;var Uo=class{};ee._CodeOrName=Uo;ee.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Lr=class extends Uo{constructor(e){if(super(),!ee.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ee.Name=Lr;var lt=class extends Uo{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Lr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ee._Code=lt;ee.nil=new lt("");function pv(t,...e){let r=[t[0]],n=0;for(;n<e.length;)ll(r,e[n]),r.push(t[++n]);return new lt(r)}ee._=pv;var ul=new lt("+");function mv(t,...e){let r=[Vo(t[0])],n=0;for(;n<e.length;)r.push(ul),ll(r,e[n]),r.push(ul,Vo(t[++n]));return sO(r),new lt(r)}ee.str=mv;function ll(t,e){e instanceof lt?t.push(...e._items):e instanceof Lr?t.push(e):t.push(cO(e))}ee.addCodeArg=ll;function sO(t){let e=1;for(;e<t.length-1;){if(t[e]===ul){let r=iO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function iO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Lr||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Lr))return`"${t}${e.slice(1)}`}function aO(t,e){return e.emptyStr()?t:t.emptyStr()?e:mv`${t}${e}`}ee.strConcat=aO;function cO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Vo(Array.isArray(t)?t.join(","):t)}function uO(t){return new lt(Vo(t))}ee.stringify=uO;function Vo(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ee.safeStringify=Vo;function lO(t){return typeof t=="string"&&ee.IDENTIFIER.test(t)?new lt(`.${t}`):pv`[${t}]`}ee.getProperty=lO;function dO(t){if(typeof t=="string"&&ee.IDENTIFIER.test(t))return new lt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ee.getEsmExportName=dO;function fO(t){return new lt(t.toString())}ee.regexpCode=fO});var pl=$(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.ValueScope=Je.ValueScopeName=Je.Scope=Je.varKinds=Je.UsedValueState=void 0;var Ge=Bo(),dl=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Bi;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Bi||(Je.UsedValueState=Bi={}));Je.varKinds={const:new Ge.Name("const"),let:new Ge.Name("let"),var:new Ge.Name("var")};var Hi=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ge.Name?e:this.name(e)}name(e){return new Ge.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Je.Scope=Hi;var Wi=class extends Ge.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ge._)`.${new Ge.Name(r)}[${n}]`}};Je.ValueScopeName=Wi;var pO=(0,Ge._)`\n`,fl=class extends Hi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?pO:Ge.nil}}get(){return this._scope}name(e){return new Wi(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ge._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Ge.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Bi.Started);let l=r(u);if(l){let d=this.opts.es5?Je.varKinds.var:Je.varKinds.const;s=(0,Ge._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))s=(0,Ge._)`${s}${l}${this.opts._n}`;else throw new dl(u);c.set(u,Bi.Completed)})}return s}};Je.ValueScope=fl});var F=$(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var K=Bo(),xt=pl(),cr=Bo();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return cr._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return cr.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return cr.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return cr.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return cr.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return cr.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return cr.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return cr.Name}});var Yi=pl();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Yi.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Yi.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Yi.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Yi.varKinds}});V.operators={GT:new K._Code(">"),GTE:new K._Code(">="),LT:new K._Code("<"),LTE:new K._Code("<="),EQ:new K._Code("==="),NEQ:new K._Code("!=="),NOT:new K._Code("!"),OR:new K._Code("||"),AND:new K._Code("&&"),ADD:new K._Code("+")};var Bt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ml=class extends Bt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?xt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Sn(this.rhs,e,r)),this}get names(){return this.rhs instanceof K._CodeOrName?this.rhs.names:{}}},Gi=class extends Bt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof K.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Sn(this.rhs,e,r),this}get names(){let e=this.lhs instanceof K.Name?{}:{...this.lhs.names};return Ki(e,this.rhs)}},hl=class extends Gi{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},gl=class extends Bt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},yl=class extends Bt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},_l=class extends Bt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},vl=class extends Bt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Sn(this.code,e,r),this}get names(){return this.code instanceof K._CodeOrName?this.code.names:{}}},Ho=class extends Bt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(mO(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ur(e,r.names),{})}},Ht=class extends Ho{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},bl=class extends Ho{},xn=class extends Ht{};xn.kind="else";var qr=class t extends Ht{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new xn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(hv(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Sn(this.condition,e,r),this}get names(){let e=super.names;return Ki(e,this.condition),this.else&&Ur(e,this.else.names),e}};qr.kind="if";var Fr=class extends Ht{};Fr.kind="for";var wl=class extends Fr{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Sn(this.iteration,e,r),this}get names(){return Ur(super.names,this.iteration.names)}},xl=class extends Fr{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?xt.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Ki(super.names,this.from);return Ki(e,this.to)}},Ji=class extends Fr{constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Sn(this.iterable,e,r),this}get names(){return Ur(super.names,this.iterable.names)}},Wo=class extends Ht{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Wo.kind="func";var Go=class extends Ho{render(e){return"return "+super.render(e)}};Go.kind="return";var Sl=class extends Ht{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ur(e,this.catch.names),this.finally&&Ur(e,this.finally.names),e}},Jo=class extends Ht{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Jo.kind="catch";var Ko=class extends Ht{render(e){return"finally"+super.render(e)}};Ko.kind="finally";var $l=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
25
+ `:""},this._extScope=e,this._scope=new xt.Scope({parent:e}),this._nodes=[new bl]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new ml(e,s,n)),s}const(e,r,n){return this._def(xt.varKinds.const,e,r,n)}let(e,r,n){return this._def(xt.varKinds.let,e,r,n)}var(e,r,n){return this._def(xt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Gi(e,r,n))}add(e,r){return this._leafNode(new hl(e,V.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==K.nil&&this._leafNode(new vl(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,K.addCodeArg)(r,o));return r.push("}"),new K._Code(r)}if(e,r,n){if(this._blockNode(new qr(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new qr(e))}else(){return this._elseNode(new xn)}endIf(){return this._endBlockNode(qr,xn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new wl(e),r)}forRange(e,r,n,o,s=this.opts.es5?xt.varKinds.var:xt.varKinds.let){let i=this._scope.toName(e);return this._for(new xl(s,i,r,n),()=>o(i))}forOf(e,r,n,o=xt.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof K.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,K._)`${i}.length`,a=>{this.var(s,(0,K._)`${i}[${a}]`),n(s)})}return this._for(new Ji("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?xt.varKinds.var:xt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,K._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Ji("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Fr)}label(e){return this._leafNode(new gl(e))}break(e){return this._leafNode(new yl(e))}return(e){let r=new Go;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Go)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Sl;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new Jo(s),r(s)}return n&&(this._currNode=o.finally=new Ko,this.code(n)),this._endBlockNode(Jo,Ko)}throw(e){return this._leafNode(new _l(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=K.nil,n,o){return this._blockNode(new Wo(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Wo)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof qr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};V.CodeGen=$l;function Ur(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Ki(t,e){return e instanceof K._CodeOrName?Ur(t,e.names):t}function Sn(t,e,r){if(t instanceof K.Name)return n(t);if(!o(t))return t;return new K._Code(t._items.reduce((s,i)=>(i instanceof K.Name&&(i=n(i)),i instanceof K._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function o(s){return s instanceof K._Code&&s._items.some(i=>i instanceof K.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function mO(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function hv(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,K._)`!${kl(t)}`}V.not=hv;var hO=gv(V.operators.AND);function gO(...t){return t.reduce(hO)}V.and=gO;var yO=gv(V.operators.OR);function _O(...t){return t.reduce(yO)}V.or=_O;function gv(t){return(e,r)=>e===K.nil?r:r===K.nil?e:(0,K._)`${kl(e)} ${t} ${kl(r)}`}function kl(t){return t instanceof K.Name?t:(0,K._)`(${t})`}});var Q=$(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.checkStrictMode=B.getErrorPath=B.Type=B.useFunc=B.setEvaluated=B.evaluatedPropsToName=B.mergeEvaluated=B.eachItem=B.unescapeJsonPointer=B.escapeJsonPointer=B.escapeFragment=B.unescapeFragment=B.schemaRefOrVal=B.schemaHasRulesButRef=B.schemaHasRules=B.checkUnknownRules=B.alwaysValidSchema=B.toHash=void 0;var ae=F(),vO=Bo();function bO(t){let e={};for(let r of t)e[r]=!0;return e}B.toHash=bO;function wO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(vv(t,e),!bv(e,t.self.RULES.all))}B.alwaysValidSchema=wO;function vv(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||Sv(t,`unknown keyword: "${s}"`)}B.checkUnknownRules=vv;function bv(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}B.schemaHasRules=bv;function xO(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}B.schemaHasRulesButRef=xO;function SO({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ae._)`${r}`}return(0,ae._)`${t}${e}${(0,ae.getProperty)(n)}`}B.schemaRefOrVal=SO;function $O(t){return wv(decodeURIComponent(t))}B.unescapeFragment=$O;function kO(t){return encodeURIComponent(zl(t))}B.escapeFragment=kO;function zl(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=zl;function wv(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=wv;function EO(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}B.eachItem=EO;function yv({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof ae.Name?(s instanceof ae.Name?t(o,s,i):e(o,s,i),i):s instanceof ae.Name?(e(o,i,s),s):r(s,i);return a===ae.Name&&!(c instanceof ae.Name)?n(o,c):c}}B.mergeEvaluated={props:yv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ae._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ae._)`${r} || {}`).code((0,ae._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ae._)`${r} || {}`),Pl(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:xv}),items:yv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ae._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ae._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function xv(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ae._)`{}`);return e!==void 0&&Pl(t,r,e),r}B.evaluatedPropsToName=xv;function Pl(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ae._)`${e}${(0,ae.getProperty)(n)}`,!0))}B.setEvaluated=Pl;var _v={};function zO(t,e){return t.scopeValue("func",{ref:e,code:_v[e.code]||(_v[e.code]=new vO._Code(e.code))})}B.useFunc=zO;var El;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(El||(B.Type=El={}));function PO(t,e,r){if(t instanceof ae.Name){let n=e===El.Num;return r?n?(0,ae._)`"[" + ${t} + "]"`:(0,ae._)`"['" + ${t} + "']"`:n?(0,ae._)`"/" + ${t}`:(0,ae._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ae.getProperty)(t).toString():"/"+zl(t)}B.getErrorPath=PO;function Sv(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}B.checkStrictMode=Sv});var Wt=$(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});var De=F(),TO={data:new De.Name("data"),valCxt:new De.Name("valCxt"),instancePath:new De.Name("instancePath"),parentData:new De.Name("parentData"),parentDataProperty:new De.Name("parentDataProperty"),rootData:new De.Name("rootData"),dynamicAnchors:new De.Name("dynamicAnchors"),vErrors:new De.Name("vErrors"),errors:new De.Name("errors"),this:new De.Name("this"),self:new De.Name("self"),scope:new De.Name("scope"),json:new De.Name("json"),jsonPos:new De.Name("jsonPos"),jsonLen:new De.Name("jsonLen"),jsonPart:new De.Name("jsonPart")};Tl.default=TO});var Yo=$(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.extendErrors=je.resetErrorsCount=je.reportExtraError=je.reportError=je.keyword$DataError=je.keywordError=void 0;var X=F(),Qi=Q(),Ue=Wt();je.keywordError={message:({keyword:t})=>(0,X.str)`must pass "${t}" keyword validation`};je.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,X.str)`"${t}" keyword must be ${e} ($data)`:(0,X.str)`"${t}" keyword is invalid ($data)`};function CO(t,e=je.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=Ev(t,e,r);n??(i||a)?$v(s,c):kv(o,(0,X._)`[${c}]`)}je.reportError=CO;function OO(t,e=je.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=Ev(t,e,r);$v(o,a),s||i||kv(n,Ue.default.vErrors)}je.reportExtraError=OO;function IO(t,e){t.assign(Ue.default.errors,e),t.if((0,X._)`${Ue.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,X._)`${Ue.default.vErrors}.length`,e),()=>t.assign(Ue.default.vErrors,null)))}je.resetErrorsCount=IO;function RO({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",o,Ue.default.errors,a=>{t.const(i,(0,X._)`${Ue.default.vErrors}[${a}]`),t.if((0,X._)`${i}.instancePath === undefined`,()=>t.assign((0,X._)`${i}.instancePath`,(0,X.strConcat)(Ue.default.instancePath,s.errorPath))),t.assign((0,X._)`${i}.schemaPath`,(0,X.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,X._)`${i}.schema`,r),t.assign((0,X._)`${i}.data`,n))})}je.extendErrors=RO;function $v(t,e){let r=t.const("err",e);t.if((0,X._)`${Ue.default.vErrors} === null`,()=>t.assign(Ue.default.vErrors,(0,X._)`[${r}]`),(0,X._)`${Ue.default.vErrors}.push(${r})`),t.code((0,X._)`${Ue.default.errors}++`)}function kv(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,X._)`new ${t.ValidationError}(${e})`):(r.assign((0,X._)`${n}.errors`,e),r.return(!1))}var Vr={keyword:new X.Name("keyword"),schemaPath:new X.Name("schemaPath"),params:new X.Name("params"),propertyName:new X.Name("propertyName"),message:new X.Name("message"),schema:new X.Name("schema"),parentSchema:new X.Name("parentSchema")};function Ev(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,X._)`{}`:NO(t,e,r)}function NO(t,e,r={}){let{gen:n,it:o}=t,s=[AO(o,r),DO(t,r)];return jO(t,e,s),n.object(...s)}function AO({errorPath:t},{instancePath:e}){let r=e?(0,X.str)`${t}${(0,Qi.getErrorPath)(e,Qi.Type.Str)}`:t;return[Ue.default.instancePath,(0,X.strConcat)(Ue.default.instancePath,r)]}function DO({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,X.str)`${e}/${t}`;return r&&(o=(0,X.str)`${o}${(0,Qi.getErrorPath)(r,Qi.Type.Str)}`),[Vr.schemaPath,o]}function jO(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([Vr.keyword,o],[Vr.params,typeof e=="function"?e(t):e||(0,X._)`{}`]),c.messages&&n.push([Vr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Vr.schema,i],[Vr.parentSchema,(0,X._)`${l}${d}`],[Ue.default.data,s]),u&&n.push([Vr.propertyName,u])}});var Pv=$($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.boolOrEmptySchema=$n.topBoolOrEmptySchema=void 0;var MO=Yo(),ZO=F(),LO=Wt(),qO={message:"boolean schema is false"};function FO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?zv(t,!1):typeof r=="object"&&r.$async===!0?e.return(LO.default.data):(e.assign((0,ZO._)`${n}.errors`,null),e.return(!0))}$n.topBoolOrEmptySchema=FO;function UO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),zv(t)):r.var(e,!0)}$n.boolOrEmptySchema=UO;function zv(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,MO.reportError)(o,qO,void 0,e)}});var Cl=$(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.getRules=kn.isJSONType=void 0;var VO=["string","number","integer","boolean","null","object","array"],BO=new Set(VO);function HO(t){return typeof t=="string"&&BO.has(t)}kn.isJSONType=HO;function WO(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}kn.getRules=WO});var Ol=$(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.shouldUseRule=ur.shouldUseGroup=ur.schemaHasRulesForType=void 0;function GO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Tv(t,n)}ur.schemaHasRulesForType=GO;function Tv(t,e){return e.rules.some(r=>Cv(t,r))}ur.shouldUseGroup=Tv;function Cv(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ur.shouldUseRule=Cv});var Qo=$(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.reportTypeError=Me.checkDataTypes=Me.checkDataType=Me.coerceAndCheckDataType=Me.getJSONTypes=Me.getSchemaTypes=Me.DataType=void 0;var JO=Cl(),KO=Ol(),YO=Yo(),q=F(),Ov=Q(),En;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(En||(Me.DataType=En={}));function QO(t){let e=Iv(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Me.getSchemaTypes=QO;function Iv(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(JO.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Me.getJSONTypes=Iv;function XO(t,e){let{gen:r,data:n,opts:o}=t,s=eI(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,KO.schemaHasRulesForType)(t,e[0]));if(i){let a=Rl(e,n,o.strictNumbers,En.Wrong);r.if(a,()=>{s.length?tI(t,e,s):Nl(t)})}return i}Me.coerceAndCheckDataType=XO;var Rv=new Set(["string","number","integer","boolean","null"]);function eI(t,e){return e?t.filter(r=>Rv.has(r)||e==="array"&&r==="array"):[]}function tI(t,e,r){let{gen:n,data:o,opts:s}=t,i=n.let("dataType",(0,q._)`typeof ${o}`),a=n.let("coerced",(0,q._)`undefined`);s.coerceTypes==="array"&&n.if((0,q._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,q._)`${o}[0]`).assign(i,(0,q._)`typeof ${o}`).if(Rl(e,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,q._)`${a} !== undefined`);for(let u of r)(Rv.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Nl(t),n.endIf(),n.if((0,q._)`${a} !== undefined`,()=>{n.assign(o,a),rI(t,a)});function c(u){switch(u){case"string":n.elseIf((0,q._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,q._)`"" + ${o}`).elseIf((0,q._)`${o} === null`).assign(a,(0,q._)`""`);return;case"number":n.elseIf((0,q._)`${i} == "boolean" || ${o} === null
26
26
  || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,q._)`+${o}`);return;case"integer":n.elseIf((0,q._)`${i} === "boolean" || ${o} === null
27
27
  || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,q._)`+${o}`);return;case"boolean":n.elseIf((0,q._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,q._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,q._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,q._)`${i} === "string" || ${i} === "number"
28
- || ${i} === "boolean" || ${o} === null`).assign(a,(0,q._)`[${o}]`)}}}function eI({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,q._)`${e} !== undefined`,()=>t.assign((0,q._)`${e}[${r}]`,n))}function Ol(t,e,r,n=kn.Correct){let o=n===kn.Correct?q.operators.EQ:q.operators.NEQ,s;switch(t){case"null":return(0,q._)`${e} ${o} null`;case"array":s=(0,q._)`Array.isArray(${e})`;break;case"object":s=(0,q._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,q._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,q._)`typeof ${e} ${o} ${t}`}return n===kn.Correct?s:(0,q.not)(s);function i(a=q.nil){return(0,q.and)((0,q._)`typeof ${e} == "number"`,a,r?(0,q._)`isFinite(${e})`:q.nil)}}Me.checkDataType=Ol;function Il(t,e,r,n){if(t.length===1)return Ol(t[0],e,r,n);let o,s=(0,Cv.toHash)(t);if(s.array&&s.object){let i=(0,q._)`typeof ${e} != "object"`;o=s.null?i:(0,q._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else o=q.nil;s.number&&delete s.integer;for(let i in s)o=(0,q.and)(o,Ol(i,e,r,n));return o}Me.checkDataTypes=Il;var tI={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,q._)`{type: ${t}}`:(0,q._)`{type: ${e}}`};function Rl(t){let e=rI(t);(0,JO.reportError)(e,tI)}Me.reportTypeError=Rl;function rI(t){let{gen:e,data:r,schema:n}=t,o=(0,Cv.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var Nv=$(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.assignDefaults=void 0;var En=F(),nI=Q();function oI(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Rv(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Rv(t,s,o.default))}Yi.assignDefaults=oI;function Rv(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let a=(0,En._)`${s}${(0,En.getProperty)(e)}`;if(o){(0,nI.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,En._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,En._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,En._)`${a} = ${(0,En.stringify)(r)}`)}});var dt=$(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.validateUnion=ie.validateArray=ie.usePattern=ie.callValidateCode=ie.schemaProperties=ie.allSchemaProperties=ie.noPropertyInData=ie.propertyInData=ie.isOwnProperty=ie.hasPropFunc=ie.reportMissingProp=ie.checkMissingProp=ie.checkReportMissingProp=void 0;var fe=F(),Nl=Q(),lr=Wt(),sI=Q();function iI(t,e){let{gen:r,data:n,it:o}=t;r.if(Dl(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fe._)`${e}`},!0),t.error()})}ie.checkReportMissingProp=iI;function aI({gen:t,data:e,it:{opts:r}},n,o){return(0,fe.or)(...n.map(s=>(0,fe.and)(Dl(t,e,s,r.ownProperties),(0,fe._)`${o} = ${s}`)))}ie.checkMissingProp=aI;function cI(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=cI;function Av(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fe._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=Av;function Al(t,e,r){return(0,fe._)`${Av(t)}.call(${e}, ${r})`}ie.isOwnProperty=Al;function uI(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} !== undefined`;return n?(0,fe._)`${o} && ${Al(t,e,r)}`:o}ie.propertyInData=uI;function Dl(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} === undefined`;return n?(0,fe.or)(o,(0,fe.not)(Al(t,e,r))):o}ie.noPropertyInData=Dl;function Dv(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=Dv;function lI(t,e){return Dv(e).filter(r=>!(0,Nl.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=lI;function dI({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,c,u){let l=u?(0,fe._)`${t}, ${e}, ${n}${o}`:e,d=[[lr.default.instancePath,(0,fe.strConcat)(lr.default.instancePath,s)],[lr.default.parentData,i.parentData],[lr.default.parentDataProperty,i.parentDataProperty],[lr.default.rootData,lr.default.rootData]];i.opts.dynamicRef&&d.push([lr.default.dynamicAnchors,lr.default.dynamicAnchors]);let m=(0,fe._)`${l}, ${r.object(...d)}`;return c!==fe.nil?(0,fe._)`${a}.call(${c}, ${m})`:(0,fe._)`${a}(${m})`}ie.callValidateCode=dI;var fI=(0,fe._)`new RegExp`;function pI({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,fe._)`${o.code==="new RegExp"?fI:(0,sI.useFunc)(t,o)}(${r}, ${n})`})}ie.usePattern=pI;function mI(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(s,!0),i(()=>e.break()),s;function i(a){let c=e.const("len",(0,fe._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Nl.Type.Num},s),e.if((0,fe.not)(s),a)})}}ie.validateArray=mI;function hI(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Nl.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,fe._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,fe.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}ie.validateUnion=hI});var Zv=$(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validateKeywordUsage=Ct.validSchemaType=Ct.funcKeywordCode=Ct.macroKeywordCode=void 0;var Ve=F(),Br=Wt(),gI=dt(),yI=Go();function _I(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Mv(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:Ve.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Ct.macroKeywordCode=_I;function vI(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;wI(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Mv(n,o,u),d=n.let("valid");t.block$data(d,m),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function m(){if(e.errors===!1)h(),e.modifying&&jv(t),g(()=>t.error());else{let _=e.async?p():f();e.modifying&&jv(t),g(()=>bI(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>h((0,Ve._)`await `),x=>n.assign(d,!1).if((0,Ve._)`${x} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Ve._)`${x}.errors`),()=>n.throw(x))),_}function f(){let _=(0,Ve._)`${l}.errors`;return n.assign(_,null),h(Ve.nil),_}function h(_=e.async?(0,Ve._)`await `:Ve.nil){let x=c.opts.passContext?Br.default.this:Br.default.self,w=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Ve._)`${_}${(0,gI.callValidateCode)(t,l,x,w)}`,e.modifying)}function g(_){var x;n.if((0,Ve.not)((x=e.valid)!==null&&x!==void 0?x:d),_)}}Ct.funcKeywordCode=vI;function jv(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ve._)`${n.parentData}[${n.parentDataProperty}]`))}function bI(t,e){let{gen:r}=t;r.if((0,Ve._)`Array.isArray(${e})`,()=>{r.assign(Br.default.vErrors,(0,Ve._)`${Br.default.vErrors} === null ? ${e} : ${Br.default.vErrors}.concat(${e})`).assign(Br.default.errors,(0,Ve._)`${Br.default.vErrors}.length`),(0,yI.extendErrors)(t)},()=>t.error())}function wI({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Mv(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ve.stringify)(r)})}function xI(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ct.validSchemaType=xI;function SI({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ct.validateKeywordUsage=SI});var qv=$(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.extendSubschemaMode=dr.extendSubschemaData=dr.getSubschema=void 0;var Ot=F(),Lv=Q();function $I(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ot._)`${t.schemaPath}${(0,Ot.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ot._)`${t.schemaPath}${(0,Ot.getProperty)(e)}${(0,Ot.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Lv.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}dr.getSubschema=$I;function kI(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,m=a.let("data",(0,Ot._)`${e.data}${(0,Ot.getProperty)(r)}`,!0);c(m),t.errorPath=(0,Ot.str)`${u}${(0,Lv.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ot._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof Ot.Name?o:a.let("data",o,!0);c(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}dr.extendSubschemaData=kI;function EI(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}dr.extendSubschemaMode=EI});var jl=$((d9,Fv)=>{"use strict";Fv.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Vv=$((f9,Uv)=>{"use strict";var fr=Uv.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};Qi(e,n,o,t,"",t)};fr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};fr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};fr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};fr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Qi(t,e,r,n,o,s,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,i,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in fr.arrayKeywords)for(var m=0;m<d.length;m++)Qi(t,e,r,d[m],o+"/"+l+"/"+m,s,o,l,n,m)}else if(l in fr.propsKeywords){if(d&&typeof d=="object")for(var p in d)Qi(t,e,r,d[p],o+"/"+l+"/"+zI(p),s,o,l,n,p)}else(l in fr.keywords||t.allKeys&&!(l in fr.skipKeywords))&&Qi(t,e,r,d,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,c,u)}}function zI(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ko=$(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getSchemaRefs=Ke.resolveUrl=Ke.normalizeId=Ke._getFullPath=Ke.getFullPath=Ke.inlineRef=void 0;var PI=Q(),TI=jl(),CI=Vv(),OI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function II(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ml(t):e?Bv(t)<=e:!1}Ke.inlineRef=II;var RI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ml(t){for(let e in t){if(RI.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Ml)||typeof r=="object"&&Ml(r))return!0}return!1}function Bv(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!OI.has(r)&&(typeof t[r]=="object"&&(0,PI.eachItem)(t[r],n=>e+=Bv(n)),e===1/0))return 1/0}return e}function Hv(t,e="",r){r!==!1&&(e=zn(e));let n=t.parse(e);return Wv(t,n)}Ke.getFullPath=Hv;function Wv(t,e){return t.serialize(e).split("#")[0]+"#"}Ke._getFullPath=Wv;var NI=/#\/?$/;function zn(t){return t?t.replace(NI,""):""}Ke.normalizeId=zn;function AI(t,e,r){return r=zn(r),t.resolve(e,r)}Ke.resolveUrl=AI;var DI=/^[a-z_][-a-z0-9._]*$/i;function jI(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=zn(t[r]||e),s={"":o},i=Hv(n,o,!1),a={},c=new Set;return CI(t,{allKeys:!0},(d,m,p,f)=>{if(f===void 0)return;let h=i+m,g=s[f];typeof d[r]=="string"&&(g=_.call(this,d[r])),x.call(this,d.$anchor),x.call(this,d.$dynamicAnchor),s[m]=g;function _(w){let S=this.opts.uriResolver.resolve;if(w=zn(g?S(g,w):w),c.has(w))throw l(w);c.add(w);let k=this.refs[w];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?u(d,k.schema,w):w!==zn(h)&&(w[0]==="#"?(u(d,a[w],w),a[w]=d):this.refs[w]=h),w}function x(w){if(typeof w=="string"){if(!DI.test(w))throw new Error(`invalid anchor "${w}"`);_.call(this,`#${w}`)}}}),a;function u(d,m,p){if(m!==void 0&&!TI(d,m))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ke.getSchemaRefs=jI});var Xo=$(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.getData=pr.KeywordCxt=pr.validateFunctionCode=void 0;var Qv=zv(),Gv=Jo(),Ll=Cl(),Xi=Jo(),MI=Nv(),Qo=Zv(),Zl=qv(),O=F(),A=Wt(),ZI=Ko(),Gt=Q(),Yo=Go();function LI(t){if(tb(t)&&(rb(t),eb(t))){UI(t);return}Xv(t,()=>(0,Qv.topBoolOrEmptySchema)(t))}pr.validateFunctionCode=LI;function Xv({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,O._)`${A.default.data}, ${A.default.valCxt}`,n.$async,()=>{t.code((0,O._)`"use strict"; ${Jv(r,o)}`),FI(t,o),t.code(s)}):t.func(e,(0,O._)`${A.default.data}, ${qI(o)}`,n.$async,()=>t.code(Jv(r,o)).code(s))}function qI(t){return(0,O._)`{${A.default.instancePath}="", ${A.default.parentData}, ${A.default.parentDataProperty}, ${A.default.rootData}=${A.default.data}${t.dynamicRef?(0,O._)`, ${A.default.dynamicAnchors}={}`:O.nil}}={}`}function FI(t,e){t.if(A.default.valCxt,()=>{t.var(A.default.instancePath,(0,O._)`${A.default.valCxt}.${A.default.instancePath}`),t.var(A.default.parentData,(0,O._)`${A.default.valCxt}.${A.default.parentData}`),t.var(A.default.parentDataProperty,(0,O._)`${A.default.valCxt}.${A.default.parentDataProperty}`),t.var(A.default.rootData,(0,O._)`${A.default.valCxt}.${A.default.rootData}`),e.dynamicRef&&t.var(A.default.dynamicAnchors,(0,O._)`${A.default.valCxt}.${A.default.dynamicAnchors}`)},()=>{t.var(A.default.instancePath,(0,O._)`""`),t.var(A.default.parentData,(0,O._)`undefined`),t.var(A.default.parentDataProperty,(0,O._)`undefined`),t.var(A.default.rootData,A.default.data),e.dynamicRef&&t.var(A.default.dynamicAnchors,(0,O._)`{}`)})}function UI(t){let{schema:e,opts:r,gen:n}=t;Xv(t,()=>{r.$comment&&e.$comment&&ob(t),GI(t),n.let(A.default.vErrors,null),n.let(A.default.errors,0),r.unevaluated&&VI(t),nb(t),YI(t)})}function VI(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,O._)`${r}.evaluated`),e.if((0,O._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,O._)`${t.evaluated}.props`,(0,O._)`undefined`)),e.if((0,O._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,O._)`${t.evaluated}.items`,(0,O._)`undefined`))}function Jv(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}function BI(t,e){if(tb(t)&&(rb(t),eb(t))){HI(t,e);return}(0,Qv.boolOrEmptySchema)(t,e)}function eb({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function tb(t){return typeof t.schema!="boolean"}function HI(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&ob(t),JI(t),KI(t);let s=n.const("_errs",A.default.errors);nb(t,s),n.var(e,(0,O._)`${s} === ${A.default.errors}`)}function rb(t){(0,Gt.checkUnknownRules)(t),WI(t)}function nb(t,e){if(t.opts.jtd)return Kv(t,[],!1,e);let r=(0,Gv.getSchemaTypes)(t.schema),n=(0,Gv.coerceAndCheckDataType)(t,r);Kv(t,r,!n,e)}function WI(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Gt.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function GI(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Gt.checkStrictMode)(t,"default is ignored in the schema root")}function JI(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,ZI.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function KI(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function ob({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,O._)`${A.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,O.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,O._)`${A.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function YI(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,O._)`${A.default.errors} === 0`,()=>e.return(A.default.data),()=>e.throw((0,O._)`new ${o}(${A.default.vErrors})`)):(e.assign((0,O._)`${n}.errors`,A.default.vErrors),s.unevaluated&&QI(t),e.return((0,O._)`${A.default.errors} === 0`))}function QI({gen:t,evaluated:e,props:r,items:n}){r instanceof O.Name&&t.assign((0,O._)`${e}.props`,r),n instanceof O.Name&&t.assign((0,O._)`${e}.items`,n)}function Kv(t,e,r,n){let{gen:o,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Gt.schemaHasRulesButRef)(s,l))){o.block(()=>ib(t,"$ref",l.all.$ref.definition));return}c.jtd||XI(t,e),o.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){(0,Ll.shouldUseGroup)(s,m)&&(m.type?(o.if((0,Xi.checkDataType)(m.type,i,c.strictNumbers)),Yv(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,Xi.reportTypeError)(t)),o.endIf()):Yv(t,m),a||o.if((0,O._)`${A.default.errors} === ${n||0}`))}}function Yv(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,MI.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Ll.shouldUseRule)(n,s)&&ib(t,s.keyword,s.definition,e.type)})}function XI(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(eR(t,e),t.opts.allowUnionTypes||tR(t,e),rR(t,t.dataTypes))}function eR(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{sb(t.dataTypes,r)||ql(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),oR(t,e)}}function tR(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&ql(t,"use allowUnionTypes to allow union type keyword")}function rR(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Ll.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>nR(e,i))&&ql(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function nR(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function sb(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function oR(t,e){let r=[];for(let n of t.dataTypes)sb(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function ql(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Gt.checkStrictMode)(t,e,t.opts.strictTypes)}var ea=class{constructor(e,r,n){if((0,Qo.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Gt.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",ab(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qo.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",A.default.errors))}result(e,r,n){this.failResult((0,O.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,O.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?Yo.reportExtraError:Yo.reportError)(this,this.def.error,r)}$dataError(){(0,Yo.reportError)(this,this.def.$dataError||Yo.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,Yo.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=O.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,O.or)((0,O._)`${o} === undefined`,r)),e!==O.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==O.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,O.or)(i(),a());function i(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,O._)`${(0,Xi.checkDataTypes)(c,r,s.opts.strictNumbers,Xi.DataType.Wrong)}`}return O.nil}function a(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,O._)`!${c}(${r})`}return O.nil}}subschema(e,r){let n=(0,Zl.getSubschema)(this.it,e);(0,Zl.extendSubschemaData)(n,this.it,e),(0,Zl.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return BI(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Gt.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Gt.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,O.Name)),!0}};pr.KeywordCxt=ea;function ib(t,e,r,n){let o=new ea(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,Qo.funcKeywordCode)(o,r):"macro"in r?(0,Qo.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,Qo.funcKeywordCode)(o,r)}var sR=/^\/(?:[^~]|~0|~1)*$/,iR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ab(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return A.default.rootData;if(t[0]==="/"){if(!sR.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=A.default.rootData}else{let u=iR.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!o)return s}let i=s,a=o.split("/");for(let u of a)u&&(s=(0,O._)`${s}${(0,O.getProperty)((0,Gt.unescapeJsonPointer)(u))}`,i=(0,O._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}pr.getData=ab});var ta=$(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var Fl=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Ul.default=Fl});var es=$(Hl=>{"use strict";Object.defineProperty(Hl,"__esModule",{value:!0});var Vl=Ko(),Bl=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Vl.resolveUrl)(e,r,n),this.missingSchema=(0,Vl.normalizeId)((0,Vl.getFullPath)(e,this.missingRef))}};Hl.default=Bl});var na=$(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.resolveSchema=ft.getCompilingSchema=ft.resolveRef=ft.compileSchema=ft.SchemaEnv=void 0;var St=F(),aR=ta(),Hr=Wt(),$t=Ko(),cb=Q(),cR=Xo(),Pn=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,$t.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ft.SchemaEnv=Pn;function Gl(t){let e=ub.call(this,t);if(e)return e;let r=(0,$t.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new St.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:aR.default,code:(0,St._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Hr.default.data,parentData:Hr.default.parentData,parentDataProperty:Hr.default.parentDataProperty,dataNames:[Hr.default.data],dataPathArr:[St.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,St.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:St.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,St._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,cR.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(Hr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let p=new Function(`${Hr.default.self}`,`${Hr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:h}=u;p.evaluated={props:f instanceof St.Name?void 0:f,items:h instanceof St.Name?void 0:h,dynamicProps:f instanceof St.Name,dynamicItems:h instanceof St.Name},p.source&&(p.source.evaluated=(0,St.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}ft.compileSchema=Gl;function uR(t,e,r){var n;r=(0,$t.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=fR.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(s=new Pn({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=lR.call(this,s)}ft.resolveRef=uR;function lR(t){return(0,$t.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Gl.call(this,t)}function ub(t){for(let e of this._compilations)if(dR(e,t))return e}ft.getCompilingSchema=ub;function dR(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function fR(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||ra.call(this,t,e)}function ra(t,e){let r=this.opts.uriResolver.parse(e),n=(0,$t._getFullPath)(this.opts.uriResolver,r),o=(0,$t.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Wl.call(this,r,t);let s=(0,$t.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=ra.call(this,t,i);return typeof a?.schema!="object"?void 0:Wl.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||Gl.call(this,i),s===(0,$t.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,$t.resolveUrl)(this.opts.uriResolver,o,u)),new Pn({schema:a,schemaId:c,root:t,baseId:o})}return Wl.call(this,r,i)}}ft.resolveSchema=ra;var pR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Wl(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,cb.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!pR.has(a)&&u&&(e=(0,$t.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,cb.schemaHasRulesButRef)(r,this.RULES)){let a=(0,$t.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=ra.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new Pn({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var lb=$((_9,mR)=>{mR.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Yl=$((v9,gb)=>{"use strict";var hR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),fb=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Jl=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),pb=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),gR=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Kl(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var yR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function db(t){return t.length=0,!0}function _R(t,e,r){if(t.length){let n=Kl(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function vR(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=_R;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(i=!0),!a(o,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=db}else{o.push(u);continue}}return o.length&&(a===db?r.zone=o.join(""):i?n.push(o.join("")):n.push(Kl(o))),r.address=n.join(""),r}function mb(t){if(bR(t,":")<2)return{host:t,isIPV6:!1};let e=vR(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function bR(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function wR(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var xR={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},SR=/[@/?#:]/g,$R=/[@/?#]/g;function hb(t,e){let r=e?$R:SR;return r.lastIndex=0,t.replace(r,n=>xR[n])}function kR(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(Jl(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&pb(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function ER(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Jl(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));s!=="."&&pb(s)?e+=s:e+="%"+o,r+=2;continue}}gR(t[r])?e+=t[r]:e+=escape(t[r])}return e}function zR(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Jl(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function PR(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!fb(r)){let n=mb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=hb(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}gb.exports={nonSimpleDomain:yR,recomposeAuthority:PR,reescapeHostDelimiters:hb,normalizePercentEncoding:kR,normalizePathEncoding:ER,escapePreservingEscapes:zR,removeDotSegments:wR,isIPv4:fb,isUUID:hR,normalizeIPv6:mb,stringArrayToHexStripped:Kl}});var wb=$((b9,bb)=>{"use strict";var{isUUID:TR}=Yl(),CR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,OR=["http","https","ws","wss","urn","urn:uuid"];function IR(t){return OR.indexOf(t)!==-1}function Ql(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function yb(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function _b(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function RR(t){return t.secure=Ql(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function NR(t){if((t.port===(Ql(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function AR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(CR);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=Xl(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function DR(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=Xl(o);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${n||e.nid}:${a}`,e.skipEscape=!0,i}function jR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!TR(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function MR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var vb={scheme:"http",domainHost:!0,parse:yb,serialize:_b},ZR={scheme:"https",domainHost:vb.domainHost,parse:yb,serialize:_b},oa={scheme:"ws",domainHost:!0,parse:RR,serialize:NR},LR={scheme:"wss",domainHost:oa.domainHost,parse:oa.parse,serialize:oa.serialize},qR={scheme:"urn",parse:AR,serialize:DR,skipNormalize:!0},FR={scheme:"urn:uuid",parse:jR,serialize:MR,skipNormalize:!0},sa={http:vb,https:ZR,ws:oa,wss:LR,urn:qR,"urn:uuid":FR};Object.setPrototypeOf(sa,null);function Xl(t){return t&&(sa[t]||sa[t.toLowerCase()])||void 0}bb.exports={wsIsSecure:Ql,SCHEMES:sa,isValidSchemeName:IR,getSchemeHandler:Xl}});var zb=$((w9,ia)=>{"use strict";var{normalizeIPv6:UR,removeDotSegments:ts,recomposeAuthority:VR,normalizePercentEncoding:BR,normalizePathEncoding:HR,escapePreservingEscapes:WR,reescapeHostDelimiters:GR,isIPv4:JR,nonSimpleDomain:KR}=Yl(),{SCHEMES:YR,getSchemeHandler:Sb}=wb();function QR(t,e){return typeof t=="string"?t=nN(t,e):typeof t=="object"&&(t=Tn(Wr(t,e),e)),t}function XR(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=$b(Tn(t,n),Tn(e,n),n,!0);return n.skipEscape=!0,Wr(o,n)}function $b(t,e,r,n){let o={};return n||(t=Tn(Wr(t,r),r),e=Tn(Wr(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=ts(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=ts(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=ts(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=ts(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}function eN(t,e,r){let n=xb(t,r),o=xb(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Wr(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=Sb(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=BR(r.path):(r.path=WR(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=VR(r);if(i!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(i),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=ts(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var tN=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function rN(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function kb(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(tN);if(i){n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]);let a=rN(n,i);if(a!==void 0&&(n.error=n.error||a,o=!0),n.host)if(JR(n.host)===!1){let l=UR(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=Sb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&KR(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=GR(unescape(n.host),s))),n.path&&(n.path=HR(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function Tn(t,e){return kb(t,e).parsed}function nN(t,e){return Eb(t,e).normalized}function Eb(t,e){let{parsed:r,malformedAuthorityOrPort:n}=kb(t,e);return{normalized:n?t:Wr(r,e),malformedAuthorityOrPort:n}}function xb(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Eb(t,e);return n?void 0:r}if(typeof t=="object")return Wr(t,e)}var ed={SCHEMES:YR,normalize:QR,resolve:XR,resolveComponent:$b,equal:eN,serialize:Wr,parse:Tn};ia.exports=ed;ia.exports.default=ed;ia.exports.fastUri=ed});var Tb=$(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});var Pb=zb();Pb.code='require("ajv/dist/runtime/uri").default';td.default=Pb});var jb=$(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.CodeGen=Re.Name=Re.nil=Re.stringify=Re.str=Re._=Re.KeywordCxt=void 0;var oN=Xo();Object.defineProperty(Re,"KeywordCxt",{enumerable:!0,get:function(){return oN.KeywordCxt}});var Cn=F();Object.defineProperty(Re,"_",{enumerable:!0,get:function(){return Cn._}});Object.defineProperty(Re,"str",{enumerable:!0,get:function(){return Cn.str}});Object.defineProperty(Re,"stringify",{enumerable:!0,get:function(){return Cn.stringify}});Object.defineProperty(Re,"nil",{enumerable:!0,get:function(){return Cn.nil}});Object.defineProperty(Re,"Name",{enumerable:!0,get:function(){return Cn.Name}});Object.defineProperty(Re,"CodeGen",{enumerable:!0,get:function(){return Cn.CodeGen}});var sN=ta(),Nb=es(),iN=Tl(),rs=na(),aN=F(),ns=Ko(),aa=Jo(),nd=Q(),Cb=lb(),cN=Tb(),Ab=(t,e)=>new RegExp(t,e);Ab.code="new RegExp";var uN=["removeAdditional","useDefaults","coerceTypes"],lN=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),dN={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},fN={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ob=200;function pN(t){var e,r,n,o,s,i,a,c,u,l,d,m,p,f,h,g,_,x,w,S,k,W,Z,re,U;let me=t.strict,Ee=(e=t.code)===null||e===void 0?void 0:e.optimize,xe=Ee===!0||Ee===void 0?1:Ee||0,Ze=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Ab,Be=(o=t.uriResolver)!==null&&o!==void 0?o:cN.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:me)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:me)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:me)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=t.strictTuples)!==null&&d!==void 0?d:me)!==null&&m!==void 0?m:"log",strictRequired:(f=(p=t.strictRequired)!==null&&p!==void 0?p:me)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:xe,regExp:Ze}:{optimize:xe,regExp:Ze},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Ob,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Ob,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(x=t.messages)!==null&&x!==void 0?x:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(k=t.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(W=t.validateSchema)!==null&&W!==void 0?W:!0,validateFormats:(Z=t.validateFormats)!==null&&Z!==void 0?Z:!0,unicodeRegExp:(re=t.unicodeRegExp)!==null&&re!==void 0?re:!0,int32range:(U=t.int32range)!==null&&U!==void 0?U:!0,uriResolver:Be}}var os=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...pN(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new aN.ValueScope({scope:{},prefixes:lN,es5:r,lines:n}),this.logger=vN(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,iN.getRules)(),Ib.call(this,dN,e,"NOT SUPPORTED"),Ib.call(this,fN,e,"DEPRECATED","warn"),this._metaOpts=yN.call(this),e.formats&&hN.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&gN.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),mN.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Cb;n==="id"&&(o={...Cb},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(l,d){await s.call(this,l.$schema);let m=this._addSchema(l,d);return m.validate||i.call(this,m)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Nb.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await s.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,ns.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=Rb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new rs.SchemaEnv({schema:{},schemaId:n});if(r=rs.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Rb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,ns.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(wN.call(this,n,r),!r)return(0,nd.eachItem)(n,s=>rd.call(this,s)),this;SN.call(this,r);let o={...r,type:(0,aa.getJSONTypes)(r.type),schemaType:(0,aa.getJSONTypes)(r.schemaType)};return(0,nd.eachItem)(n,o.type.length===0?s=>rd.call(this,s,o):s=>o.type.forEach(i=>rd.call(this,s,o,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=Db(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,ns.normalizeId)(i||n);let u=ns.getSchemaRefs.call(this,e,n);return c=new rs.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):rs.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{rs.compileSchema.call(this,e)}finally{this.opts=r}}};os.ValidationError=sN.default;os.MissingRefError=Nb.default;Re.default=os;function Ib(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}function Rb(t){return t=(0,ns.normalizeId)(t),this.schemas[t]||this.refs[t]}function mN(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function hN(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function gN(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function yN(){let t={...this.opts};for(let e of uN)delete t[e];return t}var _N={log(){},warn(){},error(){}};function vN(t){if(t===!1)return _N;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var bN=/^[a-z_$][a-z0-9_$:-]*$/i;function wN(t,e){let{RULES:r}=this;if((0,nd.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!bN.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function rd(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,aa.getJSONTypes)(e.type),schemaType:(0,aa.getJSONTypes)(e.schemaType)}};e.before?xN.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function xN(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function SN(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Db(e)),t.validateSchema=this.compile(e,!0))}var $N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Db(t){return{anyOf:[t,$N]}}});var Mb=$(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});var kN={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};od.default=kN});var Fb=$(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.callRef=Gr.getValidate=void 0;var EN=es(),Zb=dt(),Ye=F(),On=Wt(),Lb=na(),ca=Q(),zN={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:c}=n,{root:u}=s;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=Lb.resolveRef.call(c,u,o,r);if(l===void 0)throw new EN.default(n.opts.uriResolver,o,r);if(l instanceof Lb.SchemaEnv)return m(l);return p(l);function d(){if(s===u)return ua(t,i,s,s.$async);let f=e.scopeValue("root",{ref:u});return ua(t,(0,Ye._)`${f}.validate`,u,u.$async)}function m(f){let h=qb(t,f);ua(t,h,f,f.$async)}function p(f){let h=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,Ye.stringify)(f)}:{ref:f}),g=e.name("valid"),_=t.subschema({schema:f,dataTypes:[],schemaPath:Ye.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function qb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ye._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Gr.getValidate=qb;function ua(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?On.default.this:Ye.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{o.code((0,Ye._)`await ${(0,Zb.callValidateCode)(t,e,u)}`),p(e),i||o.assign(f,!0)},h=>{o.if((0,Ye._)`!(${h} instanceof ${s.ValidationError})`,()=>o.throw(h)),m(h),i||o.assign(f,!1)}),t.ok(f)}function d(){t.result((0,Zb.callValidateCode)(t,e,u),()=>p(e),()=>m(e))}function m(f){let h=(0,Ye._)`${f}.errors`;o.assign(On.default.vErrors,(0,Ye._)`${On.default.vErrors} === null ? ${h} : ${On.default.vErrors}.concat(${h})`),o.assign(On.default.errors,(0,Ye._)`${On.default.vErrors}.length`)}function p(f){var h;if(!s.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=ca.mergeEvaluated.props(o,g.props,s.props));else{let _=o.var("props",(0,Ye._)`${f}.evaluated.props`);s.props=ca.mergeEvaluated.props(o,_,s.props,Ye.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=ca.mergeEvaluated.items(o,g.items,s.items));else{let _=o.var("items",(0,Ye._)`${f}.evaluated.items`);s.items=ca.mergeEvaluated.items(o,_,s.items,Ye.Name)}}}Gr.callRef=ua;Gr.default=zN});var Ub=$(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var PN=Mb(),TN=Fb(),CN=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",PN.default,TN.default];sd.default=CN});var Vb=$(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});var la=F(),mr=la.operators,da={maximum:{okStr:"<=",ok:mr.LTE,fail:mr.GT},minimum:{okStr:">=",ok:mr.GTE,fail:mr.LT},exclusiveMaximum:{okStr:"<",ok:mr.LT,fail:mr.GTE},exclusiveMinimum:{okStr:">",ok:mr.GT,fail:mr.LTE}},ON={message:({keyword:t,schemaCode:e})=>(0,la.str)`must be ${da[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,la._)`{comparison: ${da[t].okStr}, limit: ${e}}`},IN={keyword:Object.keys(da),type:"number",schemaType:"number",$data:!0,error:ON,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,la._)`${r} ${da[e].fail} ${n} || isNaN(${r})`)}};id.default=IN});var Bb=$(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var ss=F(),RN={message:({schemaCode:t})=>(0,ss.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ss._)`{multipleOf: ${t}}`},NN={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:RN,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,ss._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,ss._)`${i} !== parseInt(${i})`;t.fail$data((0,ss._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};ad.default=NN});var Wb=$(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});function Hb(t){let e=t.length,r=0,n=0,o;for(;n<e;)r++,o=t.charCodeAt(n++),o>=55296&&o<=56319&&n<e&&(o=t.charCodeAt(n),(o&64512)===56320&&n++);return r}cd.default=Hb;Hb.code='require("ajv/dist/runtime/ucs2length").default'});var Gb=$(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});var Jr=F(),AN=Q(),DN=Wb(),jN={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Jr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Jr._)`{limit: ${t}}`},MN={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:jN,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Jr.operators.GT:Jr.operators.LT,i=o.opts.unicode===!1?(0,Jr._)`${r}.length`:(0,Jr._)`${(0,AN.useFunc)(t.gen,DN.default)}(${r})`;t.fail$data((0,Jr._)`${i} ${s} ${n}`)}};ud.default=MN});var Jb=$(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var ZN=dt(),LN=Q(),In=F(),qN={message:({schemaCode:t})=>(0,In.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,In._)`{pattern: ${t}}`},FN={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:qN,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,In._)`new RegExp`:(0,LN.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,In._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,In._)`!${l}`)}else{let c=(0,ZN.usePattern)(t,o);t.fail$data((0,In._)`!${c}.test(${r})`)}}};ld.default=FN});var Kb=$(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var is=F(),UN={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,is.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,is._)`{limit: ${t}}`},VN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:UN,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?is.operators.GT:is.operators.LT;t.fail$data((0,is._)`Object.keys(${r}).length ${o} ${n}`)}};dd.default=VN});var Yb=$(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var as=dt(),cs=F(),BN=Q(),HN={message:({params:{missingProperty:t}})=>(0,cs.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,cs._)`{missingProperty: ${t}}`},WN={keyword:"required",type:"object",schemaType:"array",$data:!0,error:HN,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:i}=t,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?u():l(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:f}=t.it;for(let h of r)if(p?.[h]===void 0&&!f.has(h)){let g=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,BN.checkStrictMode)(i,_,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(cs.nil,d);else for(let p of r)(0,as.checkReportMissingProp)(t,p)}function l(){let p=e.let("missing");if(c||s){let f=e.let("valid",!0);t.block$data(f,()=>m(p,f)),t.ok(f)}else e.if((0,as.checkMissingProp)(t,r,p)),(0,as.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,as.noPropertyInData)(e,o,p,a.ownProperties),()=>t.error())})}function m(p,f){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(f,(0,as.propertyInData)(e,o,p,a.ownProperties)),e.if((0,cs.not)(f),()=>{t.error(),e.break()})},cs.nil)}}};fd.default=WN});var Qb=$(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var us=F(),GN={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,us.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,us._)`{limit: ${t}}`},JN={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:GN,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?us.operators.GT:us.operators.LT;t.fail$data((0,us._)`${r}.length ${o} ${n}`)}};pd.default=JN});var fa=$(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});var Xb=jl();Xb.code='require("ajv/dist/runtime/equal").default';md.default=Xb});var ew=$(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var hd=Jo(),Ne=F(),KN=Q(),YN=fa(),QN={message:({params:{i:t,j:e}})=>(0,Ne.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ne._)`{i: ${t}, j: ${e}}`},XN={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:QN,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:a}=t;if(!n&&!o)return;let c=e.let("valid"),u=s.items?(0,hd.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,Ne._)`${i} === false`),t.ok(c);function l(){let f=e.let("i",(0,Ne._)`${r}.length`),h=e.let("j");t.setParams({i:f,j:h}),e.assign(c,!0),e.if((0,Ne._)`${f} > 1`,()=>(d()?m:p)(f,h))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function m(f,h){let g=e.name("item"),_=(0,hd.checkDataTypes)(u,g,a.opts.strictNumbers,hd.DataType.Wrong),x=e.const("indices",(0,Ne._)`{}`);e.for((0,Ne._)`;${f}--;`,()=>{e.let(g,(0,Ne._)`${r}[${f}]`),e.if(_,(0,Ne._)`continue`),u.length>1&&e.if((0,Ne._)`typeof ${g} == "string"`,(0,Ne._)`${g} += "_"`),e.if((0,Ne._)`typeof ${x}[${g}] == "number"`,()=>{e.assign(h,(0,Ne._)`${x}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,Ne._)`${x}[${g}] = ${f}`)})}function p(f,h){let g=(0,KN.useFunc)(e,YN.default),_=e.name("outer");e.label(_).for((0,Ne._)`;${f}--;`,()=>e.for((0,Ne._)`${h} = ${f}; ${h}--;`,()=>e.if((0,Ne._)`${g}(${r}[${f}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};gd.default=XN});var tw=$(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var yd=F(),eA=Q(),tA=fa(),rA={message:"must be equal to constant",params:({schemaCode:t})=>(0,yd._)`{allowedValue: ${t}}`},nA={keyword:"const",$data:!0,error:rA,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,yd._)`!${(0,eA.useFunc)(e,tA.default)}(${r}, ${o})`):t.fail((0,yd._)`${s} !== ${r}`)}};_d.default=nA});var rw=$(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var ls=F(),oA=Q(),sA=fa(),iA={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ls._)`{allowedValues: ${t}}`},aA={keyword:"enum",schemaType:"array",$data:!0,error:iA,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,oA.useFunc)(e,sA.default)),l;if(a||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let p=e.const("vSchema",s);l=(0,ls.or)(...o.map((f,h)=>m(p,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,p=>e.if((0,ls._)`${u()}(${r}, ${p})`,()=>e.assign(l,!0).break()))}function m(p,f){let h=o[f];return typeof h=="object"&&h!==null?(0,ls._)`${u()}(${r}, ${p}[${f}])`:(0,ls._)`${r} === ${h}`}}};vd.default=aA});var nw=$(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var cA=Vb(),uA=Bb(),lA=Gb(),dA=Jb(),fA=Kb(),pA=Yb(),mA=Qb(),hA=ew(),gA=tw(),yA=rw(),_A=[cA.default,uA.default,lA.default,dA.default,fA.default,pA.default,mA.default,hA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gA.default,yA.default];bd.default=_A});var xd=$(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.validateAdditionalItems=void 0;var Kr=F(),wd=Q(),vA={message:({params:{len:t}})=>(0,Kr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Kr._)`{limit: ${t}}`},bA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:vA,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,wd.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}ow(t,n)}};function ow(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Kr._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Kr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,wd.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,Kr._)`${a} <= ${e.length}`);r.if((0,Kr.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:wd.Type.Num},u),i.allErrors||r.if((0,Kr.not)(u),()=>r.break())})}}ds.validateAdditionalItems=ow;ds.default=bA});var Sd=$(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.validateTuple=void 0;var sw=F(),pa=Q(),wA=dt(),xA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return iw(t,"additionalItems",e);r.items=!0,!(0,pa.alwaysValidSchema)(r,e)&&t.ok((0,wA.validateArray)(t))}};function iw(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:a}=t;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=pa.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,sw._)`${s}.length`);r.forEach((d,m)=>{(0,pa.alwaysValidSchema)(a,d)||(n.if((0,sw._)`${u} > ${m}`,()=>t.subschema({keyword:i,schemaProp:m,dataProp:m},c)),t.ok(c))});function l(d){let{opts:m,errSchemaPath:p}=a,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(m.strictTuples&&!h){let g=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,pa.checkStrictMode)(a,g,m.strictTuples)}}}fs.validateTuple=iw;fs.default=xA});var aw=$($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var SA=Sd(),$A={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,SA.validateTuple)(t,"items")};$d.default=$A});var uw=$(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var cw=F(),kA=Q(),EA=dt(),zA=xd(),PA={message:({params:{len:t}})=>(0,cw.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,cw._)`{limit: ${t}}`},TA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:PA,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,kA.alwaysValidSchema)(n,e)&&(o?(0,zA.validateAdditionalItems)(t,o):t.ok((0,EA.validateArray)(t)))}};kd.default=TA});var lw=$(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var pt=F(),ma=Q(),CA={message:({params:{min:t,max:e}})=>e===void 0?(0,pt.str)`must contain at least ${t} valid item(s)`:(0,pt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,pt._)`{minContains: ${t}}`:(0,pt._)`{minContains: ${t}, maxContains: ${e}}`},OA={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:CA,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,i,a,{minContains:c,maxContains:u}=n;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,pt._)`${o}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,ma.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,ma.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ma.alwaysValidSchema)(s,r)){let h=(0,pt._)`${l} >= ${i}`;a!==void 0&&(h=(0,pt._)`${h} && ${l} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?p(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,pt._)`${o}.length > 0`,m)):(e.let(d,!1),m()),t.result(d,()=>t.reset());function m(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>f(g)))}function p(h,g){e.forRange("i",0,l,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:ma.Type.Num,compositeRule:!0},h),g()})}function f(h){e.code((0,pt._)`${h}++`),a===void 0?e.if((0,pt._)`${h} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,pt._)`${h} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,pt._)`${h} >= ${i}`,()=>e.assign(d,!0)))}}};Ed.default=OA});var pw=$(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateSchemaDeps=It.validatePropertyDeps=It.error=void 0;var zd=F(),IA=Q(),ps=dt();It.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,zd.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,zd._)`{property: ${t},
28
+ || ${i} === "boolean" || ${o} === null`).assign(a,(0,q._)`[${o}]`)}}}function rI({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,q._)`${e} !== undefined`,()=>t.assign((0,q._)`${e}[${r}]`,n))}function Il(t,e,r,n=En.Correct){let o=n===En.Correct?q.operators.EQ:q.operators.NEQ,s;switch(t){case"null":return(0,q._)`${e} ${o} null`;case"array":s=(0,q._)`Array.isArray(${e})`;break;case"object":s=(0,q._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,q._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,q._)`typeof ${e} ${o} ${t}`}return n===En.Correct?s:(0,q.not)(s);function i(a=q.nil){return(0,q.and)((0,q._)`typeof ${e} == "number"`,a,r?(0,q._)`isFinite(${e})`:q.nil)}}Me.checkDataType=Il;function Rl(t,e,r,n){if(t.length===1)return Il(t[0],e,r,n);let o,s=(0,Ov.toHash)(t);if(s.array&&s.object){let i=(0,q._)`typeof ${e} != "object"`;o=s.null?i:(0,q._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else o=q.nil;s.number&&delete s.integer;for(let i in s)o=(0,q.and)(o,Il(i,e,r,n));return o}Me.checkDataTypes=Rl;var nI={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,q._)`{type: ${t}}`:(0,q._)`{type: ${e}}`};function Nl(t){let e=oI(t);(0,YO.reportError)(e,nI)}Me.reportTypeError=Nl;function oI(t){let{gen:e,data:r,schema:n}=t,o=(0,Ov.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var Av=$(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.assignDefaults=void 0;var zn=F(),sI=Q();function iI(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Nv(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Nv(t,s,o.default))}Xi.assignDefaults=iI;function Nv(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let a=(0,zn._)`${s}${(0,zn.getProperty)(e)}`;if(o){(0,sI.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,zn._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,zn._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,zn._)`${a} = ${(0,zn.stringify)(r)}`)}});var dt=$(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.validateUnion=ie.validateArray=ie.usePattern=ie.callValidateCode=ie.schemaProperties=ie.allSchemaProperties=ie.noPropertyInData=ie.propertyInData=ie.isOwnProperty=ie.hasPropFunc=ie.reportMissingProp=ie.checkMissingProp=ie.checkReportMissingProp=void 0;var fe=F(),Al=Q(),lr=Wt(),aI=Q();function cI(t,e){let{gen:r,data:n,it:o}=t;r.if(jl(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fe._)`${e}`},!0),t.error()})}ie.checkReportMissingProp=cI;function uI({gen:t,data:e,it:{opts:r}},n,o){return(0,fe.or)(...n.map(s=>(0,fe.and)(jl(t,e,s,r.ownProperties),(0,fe._)`${o} = ${s}`)))}ie.checkMissingProp=uI;function lI(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=lI;function Dv(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fe._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=Dv;function Dl(t,e,r){return(0,fe._)`${Dv(t)}.call(${e}, ${r})`}ie.isOwnProperty=Dl;function dI(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} !== undefined`;return n?(0,fe._)`${o} && ${Dl(t,e,r)}`:o}ie.propertyInData=dI;function jl(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} === undefined`;return n?(0,fe.or)(o,(0,fe.not)(Dl(t,e,r))):o}ie.noPropertyInData=jl;function jv(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=jv;function fI(t,e){return jv(e).filter(r=>!(0,Al.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=fI;function pI({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,c,u){let l=u?(0,fe._)`${t}, ${e}, ${n}${o}`:e,d=[[lr.default.instancePath,(0,fe.strConcat)(lr.default.instancePath,s)],[lr.default.parentData,i.parentData],[lr.default.parentDataProperty,i.parentDataProperty],[lr.default.rootData,lr.default.rootData]];i.opts.dynamicRef&&d.push([lr.default.dynamicAnchors,lr.default.dynamicAnchors]);let m=(0,fe._)`${l}, ${r.object(...d)}`;return c!==fe.nil?(0,fe._)`${a}.call(${c}, ${m})`:(0,fe._)`${a}(${m})`}ie.callValidateCode=pI;var mI=(0,fe._)`new RegExp`;function hI({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,fe._)`${o.code==="new RegExp"?mI:(0,aI.useFunc)(t,o)}(${r}, ${n})`})}ie.usePattern=hI;function gI(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(s,!0),i(()=>e.break()),s;function i(a){let c=e.const("len",(0,fe._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Al.Type.Num},s),e.if((0,fe.not)(s),a)})}}ie.validateArray=gI;function yI(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Al.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,fe._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,fe.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}ie.validateUnion=yI});var Lv=$(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validateKeywordUsage=Ct.validSchemaType=Ct.funcKeywordCode=Ct.macroKeywordCode=void 0;var Ve=F(),Br=Wt(),_I=dt(),vI=Yo();function bI(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Zv(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:Ve.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Ct.macroKeywordCode=bI;function wI(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;SI(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Zv(n,o,u),d=n.let("valid");t.block$data(d,m),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function m(){if(e.errors===!1)h(),e.modifying&&Mv(t),g(()=>t.error());else{let _=e.async?p():f();e.modifying&&Mv(t),g(()=>xI(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>h((0,Ve._)`await `),x=>n.assign(d,!1).if((0,Ve._)`${x} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Ve._)`${x}.errors`),()=>n.throw(x))),_}function f(){let _=(0,Ve._)`${l}.errors`;return n.assign(_,null),h(Ve.nil),_}function h(_=e.async?(0,Ve._)`await `:Ve.nil){let x=c.opts.passContext?Br.default.this:Br.default.self,w=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Ve._)`${_}${(0,_I.callValidateCode)(t,l,x,w)}`,e.modifying)}function g(_){var x;n.if((0,Ve.not)((x=e.valid)!==null&&x!==void 0?x:d),_)}}Ct.funcKeywordCode=wI;function Mv(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ve._)`${n.parentData}[${n.parentDataProperty}]`))}function xI(t,e){let{gen:r}=t;r.if((0,Ve._)`Array.isArray(${e})`,()=>{r.assign(Br.default.vErrors,(0,Ve._)`${Br.default.vErrors} === null ? ${e} : ${Br.default.vErrors}.concat(${e})`).assign(Br.default.errors,(0,Ve._)`${Br.default.vErrors}.length`),(0,vI.extendErrors)(t)},()=>t.error())}function SI({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Zv(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ve.stringify)(r)})}function $I(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ct.validSchemaType=$I;function kI({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ct.validateKeywordUsage=kI});var Fv=$(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.extendSubschemaMode=dr.extendSubschemaData=dr.getSubschema=void 0;var Ot=F(),qv=Q();function EI(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ot._)`${t.schemaPath}${(0,Ot.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ot._)`${t.schemaPath}${(0,Ot.getProperty)(e)}${(0,Ot.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,qv.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}dr.getSubschema=EI;function zI(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,m=a.let("data",(0,Ot._)`${e.data}${(0,Ot.getProperty)(r)}`,!0);c(m),t.errorPath=(0,Ot.str)`${u}${(0,qv.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ot._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof Ot.Name?o:a.let("data",o,!0);c(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}dr.extendSubschemaData=zI;function PI(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}dr.extendSubschemaMode=PI});var Ml=$((p9,Uv)=>{"use strict";Uv.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Bv=$((m9,Vv)=>{"use strict";var fr=Vv.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};ea(e,n,o,t,"",t)};fr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};fr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};fr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};fr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ea(t,e,r,n,o,s,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,i,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in fr.arrayKeywords)for(var m=0;m<d.length;m++)ea(t,e,r,d[m],o+"/"+l+"/"+m,s,o,l,n,m)}else if(l in fr.propsKeywords){if(d&&typeof d=="object")for(var p in d)ea(t,e,r,d[p],o+"/"+l+"/"+TI(p),s,o,l,n,p)}else(l in fr.keywords||t.allKeys&&!(l in fr.skipKeywords))&&ea(t,e,r,d,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,c,u)}}function TI(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Xo=$(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getSchemaRefs=Ke.resolveUrl=Ke.normalizeId=Ke._getFullPath=Ke.getFullPath=Ke.inlineRef=void 0;var CI=Q(),OI=Ml(),II=Bv(),RI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function NI(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Zl(t):e?Hv(t)<=e:!1}Ke.inlineRef=NI;var AI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Zl(t){for(let e in t){if(AI.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Zl)||typeof r=="object"&&Zl(r))return!0}return!1}function Hv(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!RI.has(r)&&(typeof t[r]=="object"&&(0,CI.eachItem)(t[r],n=>e+=Hv(n)),e===1/0))return 1/0}return e}function Wv(t,e="",r){r!==!1&&(e=Pn(e));let n=t.parse(e);return Gv(t,n)}Ke.getFullPath=Wv;function Gv(t,e){return t.serialize(e).split("#")[0]+"#"}Ke._getFullPath=Gv;var DI=/#\/?$/;function Pn(t){return t?t.replace(DI,""):""}Ke.normalizeId=Pn;function jI(t,e,r){return r=Pn(r),t.resolve(e,r)}Ke.resolveUrl=jI;var MI=/^[a-z_][-a-z0-9._]*$/i;function ZI(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Pn(t[r]||e),s={"":o},i=Wv(n,o,!1),a={},c=new Set;return II(t,{allKeys:!0},(d,m,p,f)=>{if(f===void 0)return;let h=i+m,g=s[f];typeof d[r]=="string"&&(g=_.call(this,d[r])),x.call(this,d.$anchor),x.call(this,d.$dynamicAnchor),s[m]=g;function _(w){let S=this.opts.uriResolver.resolve;if(w=Pn(g?S(g,w):w),c.has(w))throw l(w);c.add(w);let k=this.refs[w];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?u(d,k.schema,w):w!==Pn(h)&&(w[0]==="#"?(u(d,a[w],w),a[w]=d):this.refs[w]=h),w}function x(w){if(typeof w=="string"){if(!MI.test(w))throw new Error(`invalid anchor "${w}"`);_.call(this,`#${w}`)}}}),a;function u(d,m,p){if(m!==void 0&&!OI(d,m))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ke.getSchemaRefs=ZI});var rs=$(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.getData=pr.KeywordCxt=pr.validateFunctionCode=void 0;var Xv=Pv(),Jv=Qo(),ql=Ol(),ta=Qo(),LI=Av(),ts=Lv(),Ll=Fv(),O=F(),A=Wt(),qI=Xo(),Gt=Q(),es=Yo();function FI(t){if(rb(t)&&(nb(t),tb(t))){BI(t);return}eb(t,()=>(0,Xv.topBoolOrEmptySchema)(t))}pr.validateFunctionCode=FI;function eb({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,O._)`${A.default.data}, ${A.default.valCxt}`,n.$async,()=>{t.code((0,O._)`"use strict"; ${Kv(r,o)}`),VI(t,o),t.code(s)}):t.func(e,(0,O._)`${A.default.data}, ${UI(o)}`,n.$async,()=>t.code(Kv(r,o)).code(s))}function UI(t){return(0,O._)`{${A.default.instancePath}="", ${A.default.parentData}, ${A.default.parentDataProperty}, ${A.default.rootData}=${A.default.data}${t.dynamicRef?(0,O._)`, ${A.default.dynamicAnchors}={}`:O.nil}}={}`}function VI(t,e){t.if(A.default.valCxt,()=>{t.var(A.default.instancePath,(0,O._)`${A.default.valCxt}.${A.default.instancePath}`),t.var(A.default.parentData,(0,O._)`${A.default.valCxt}.${A.default.parentData}`),t.var(A.default.parentDataProperty,(0,O._)`${A.default.valCxt}.${A.default.parentDataProperty}`),t.var(A.default.rootData,(0,O._)`${A.default.valCxt}.${A.default.rootData}`),e.dynamicRef&&t.var(A.default.dynamicAnchors,(0,O._)`${A.default.valCxt}.${A.default.dynamicAnchors}`)},()=>{t.var(A.default.instancePath,(0,O._)`""`),t.var(A.default.parentData,(0,O._)`undefined`),t.var(A.default.parentDataProperty,(0,O._)`undefined`),t.var(A.default.rootData,A.default.data),e.dynamicRef&&t.var(A.default.dynamicAnchors,(0,O._)`{}`)})}function BI(t){let{schema:e,opts:r,gen:n}=t;eb(t,()=>{r.$comment&&e.$comment&&sb(t),KI(t),n.let(A.default.vErrors,null),n.let(A.default.errors,0),r.unevaluated&&HI(t),ob(t),XI(t)})}function HI(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,O._)`${r}.evaluated`),e.if((0,O._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,O._)`${t.evaluated}.props`,(0,O._)`undefined`)),e.if((0,O._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,O._)`${t.evaluated}.items`,(0,O._)`undefined`))}function Kv(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}function WI(t,e){if(rb(t)&&(nb(t),tb(t))){GI(t,e);return}(0,Xv.boolOrEmptySchema)(t,e)}function tb({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function rb(t){return typeof t.schema!="boolean"}function GI(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&sb(t),YI(t),QI(t);let s=n.const("_errs",A.default.errors);ob(t,s),n.var(e,(0,O._)`${s} === ${A.default.errors}`)}function nb(t){(0,Gt.checkUnknownRules)(t),JI(t)}function ob(t,e){if(t.opts.jtd)return Yv(t,[],!1,e);let r=(0,Jv.getSchemaTypes)(t.schema),n=(0,Jv.coerceAndCheckDataType)(t,r);Yv(t,r,!n,e)}function JI(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Gt.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function KI(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Gt.checkStrictMode)(t,"default is ignored in the schema root")}function YI(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,qI.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function QI(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function sb({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,O._)`${A.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,O.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,O._)`${A.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function XI(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,O._)`${A.default.errors} === 0`,()=>e.return(A.default.data),()=>e.throw((0,O._)`new ${o}(${A.default.vErrors})`)):(e.assign((0,O._)`${n}.errors`,A.default.vErrors),s.unevaluated&&eR(t),e.return((0,O._)`${A.default.errors} === 0`))}function eR({gen:t,evaluated:e,props:r,items:n}){r instanceof O.Name&&t.assign((0,O._)`${e}.props`,r),n instanceof O.Name&&t.assign((0,O._)`${e}.items`,n)}function Yv(t,e,r,n){let{gen:o,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Gt.schemaHasRulesButRef)(s,l))){o.block(()=>ab(t,"$ref",l.all.$ref.definition));return}c.jtd||tR(t,e),o.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){(0,ql.shouldUseGroup)(s,m)&&(m.type?(o.if((0,ta.checkDataType)(m.type,i,c.strictNumbers)),Qv(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,ta.reportTypeError)(t)),o.endIf()):Qv(t,m),a||o.if((0,O._)`${A.default.errors} === ${n||0}`))}}function Qv(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,LI.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,ql.shouldUseRule)(n,s)&&ab(t,s.keyword,s.definition,e.type)})}function tR(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(rR(t,e),t.opts.allowUnionTypes||nR(t,e),oR(t,t.dataTypes))}function rR(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{ib(t.dataTypes,r)||Fl(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),iR(t,e)}}function nR(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Fl(t,"use allowUnionTypes to allow union type keyword")}function oR(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,ql.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>sR(e,i))&&Fl(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function sR(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function ib(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function iR(t,e){let r=[];for(let n of t.dataTypes)ib(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Fl(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Gt.checkStrictMode)(t,e,t.opts.strictTypes)}var ra=class{constructor(e,r,n){if((0,ts.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Gt.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",cb(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ts.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",A.default.errors))}result(e,r,n){this.failResult((0,O.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,O.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?es.reportExtraError:es.reportError)(this,this.def.error,r)}$dataError(){(0,es.reportError)(this,this.def.$dataError||es.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,es.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=O.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,O.or)((0,O._)`${o} === undefined`,r)),e!==O.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==O.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,O.or)(i(),a());function i(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,O._)`${(0,ta.checkDataTypes)(c,r,s.opts.strictNumbers,ta.DataType.Wrong)}`}return O.nil}function a(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,O._)`!${c}(${r})`}return O.nil}}subschema(e,r){let n=(0,Ll.getSubschema)(this.it,e);(0,Ll.extendSubschemaData)(n,this.it,e),(0,Ll.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return WI(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Gt.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Gt.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,O.Name)),!0}};pr.KeywordCxt=ra;function ab(t,e,r,n){let o=new ra(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ts.funcKeywordCode)(o,r):"macro"in r?(0,ts.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ts.funcKeywordCode)(o,r)}var aR=/^\/(?:[^~]|~0|~1)*$/,cR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function cb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return A.default.rootData;if(t[0]==="/"){if(!aR.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=A.default.rootData}else{let u=cR.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!o)return s}let i=s,a=o.split("/");for(let u of a)u&&(s=(0,O._)`${s}${(0,O.getProperty)((0,Gt.unescapeJsonPointer)(u))}`,i=(0,O._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}pr.getData=cb});var na=$(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var Ul=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Vl.default=Ul});var ns=$(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var Bl=Xo(),Hl=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Bl.resolveUrl)(e,r,n),this.missingSchema=(0,Bl.normalizeId)((0,Bl.getFullPath)(e,this.missingRef))}};Wl.default=Hl});var sa=$(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.resolveSchema=ft.getCompilingSchema=ft.resolveRef=ft.compileSchema=ft.SchemaEnv=void 0;var St=F(),uR=na(),Hr=Wt(),$t=Xo(),ub=Q(),lR=rs(),Tn=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,$t.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ft.SchemaEnv=Tn;function Jl(t){let e=lb.call(this,t);if(e)return e;let r=(0,$t.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new St.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:uR.default,code:(0,St._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Hr.default.data,parentData:Hr.default.parentData,parentDataProperty:Hr.default.parentDataProperty,dataNames:[Hr.default.data],dataPathArr:[St.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,St.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:St.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,St._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,lR.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(Hr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let p=new Function(`${Hr.default.self}`,`${Hr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:h}=u;p.evaluated={props:f instanceof St.Name?void 0:f,items:h instanceof St.Name?void 0:h,dynamicProps:f instanceof St.Name,dynamicItems:h instanceof St.Name},p.source&&(p.source.evaluated=(0,St.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}ft.compileSchema=Jl;function dR(t,e,r){var n;r=(0,$t.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=mR.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(s=new Tn({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=fR.call(this,s)}ft.resolveRef=dR;function fR(t){return(0,$t.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Jl.call(this,t)}function lb(t){for(let e of this._compilations)if(pR(e,t))return e}ft.getCompilingSchema=lb;function pR(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function mR(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||oa.call(this,t,e)}function oa(t,e){let r=this.opts.uriResolver.parse(e),n=(0,$t._getFullPath)(this.opts.uriResolver,r),o=(0,$t.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Gl.call(this,r,t);let s=(0,$t.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=oa.call(this,t,i);return typeof a?.schema!="object"?void 0:Gl.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||Jl.call(this,i),s===(0,$t.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,$t.resolveUrl)(this.opts.uriResolver,o,u)),new Tn({schema:a,schemaId:c,root:t,baseId:o})}return Gl.call(this,r,i)}}ft.resolveSchema=oa;var hR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Gl(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,ub.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!hR.has(a)&&u&&(e=(0,$t.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,ub.schemaHasRulesButRef)(r,this.RULES)){let a=(0,$t.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=oa.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new Tn({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var db=$((b9,gR)=>{gR.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ql=$((w9,yb)=>{"use strict";var yR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),pb=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Kl=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),mb=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),_R=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Yl(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var vR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function fb(t){return t.length=0,!0}function bR(t,e,r){if(t.length){let n=Yl(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function wR(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=bR;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(i=!0),!a(o,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=fb}else{o.push(u);continue}}return o.length&&(a===fb?r.zone=o.join(""):i?n.push(o.join("")):n.push(Yl(o))),r.address=n.join(""),r}function hb(t){if(xR(t,":")<2)return{host:t,isIPV6:!1};let e=wR(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function xR(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function SR(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var $R={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},kR=/[@/?#:]/g,ER=/[@/?#]/g;function gb(t,e){let r=e?ER:kR;return r.lastIndex=0,t.replace(r,n=>$R[n])}function zR(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(Kl(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&mb(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function PR(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Kl(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));s!=="."&&mb(s)?e+=s:e+="%"+o,r+=2;continue}}_R(t[r])?e+=t[r]:e+=escape(t[r])}return e}function TR(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Kl(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function CR(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!pb(r)){let n=hb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=gb(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}yb.exports={nonSimpleDomain:vR,recomposeAuthority:CR,reescapeHostDelimiters:gb,normalizePercentEncoding:zR,normalizePathEncoding:PR,escapePreservingEscapes:TR,removeDotSegments:SR,isIPv4:pb,isUUID:yR,normalizeIPv6:hb,stringArrayToHexStripped:Yl}});var xb=$((x9,wb)=>{"use strict";var{isUUID:OR}=Ql(),IR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,RR=["http","https","ws","wss","urn","urn:uuid"];function NR(t){return RR.indexOf(t)!==-1}function Xl(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function _b(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function vb(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function AR(t){return t.secure=Xl(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function DR(t){if((t.port===(Xl(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function jR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(IR);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=ed(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function MR(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=ed(o);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${n||e.nid}:${a}`,e.skipEscape=!0,i}function ZR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!OR(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function LR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var bb={scheme:"http",domainHost:!0,parse:_b,serialize:vb},qR={scheme:"https",domainHost:bb.domainHost,parse:_b,serialize:vb},ia={scheme:"ws",domainHost:!0,parse:AR,serialize:DR},FR={scheme:"wss",domainHost:ia.domainHost,parse:ia.parse,serialize:ia.serialize},UR={scheme:"urn",parse:jR,serialize:MR,skipNormalize:!0},VR={scheme:"urn:uuid",parse:ZR,serialize:LR,skipNormalize:!0},aa={http:bb,https:qR,ws:ia,wss:FR,urn:UR,"urn:uuid":VR};Object.setPrototypeOf(aa,null);function ed(t){return t&&(aa[t]||aa[t.toLowerCase()])||void 0}wb.exports={wsIsSecure:Xl,SCHEMES:aa,isValidSchemeName:NR,getSchemeHandler:ed}});var Pb=$((S9,ca)=>{"use strict";var{normalizeIPv6:BR,removeDotSegments:os,recomposeAuthority:HR,normalizePercentEncoding:WR,normalizePathEncoding:GR,escapePreservingEscapes:JR,reescapeHostDelimiters:KR,isIPv4:YR,nonSimpleDomain:QR}=Ql(),{SCHEMES:XR,getSchemeHandler:$b}=xb();function eN(t,e){return typeof t=="string"?t=sN(t,e):typeof t=="object"&&(t=Cn(Wr(t,e),e)),t}function tN(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=kb(Cn(t,n),Cn(e,n),n,!0);return n.skipEscape=!0,Wr(o,n)}function kb(t,e,r,n){let o={};return n||(t=Cn(Wr(t,r),r),e=Cn(Wr(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=os(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=os(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=os(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=os(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}function rN(t,e,r){let n=Sb(t,r),o=Sb(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Wr(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=$b(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=WR(r.path):(r.path=JR(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=HR(r);if(i!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(i),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=os(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var nN=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function oN(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Eb(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(nN);if(i){n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]);let a=oN(n,i);if(a!==void 0&&(n.error=n.error||a,o=!0),n.host)if(YR(n.host)===!1){let l=BR(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=$b(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&QR(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=KR(unescape(n.host),s))),n.path&&(n.path=GR(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function Cn(t,e){return Eb(t,e).parsed}function sN(t,e){return zb(t,e).normalized}function zb(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Eb(t,e);return{normalized:n?t:Wr(r,e),malformedAuthorityOrPort:n}}function Sb(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=zb(t,e);return n?void 0:r}if(typeof t=="object")return Wr(t,e)}var td={SCHEMES:XR,normalize:eN,resolve:tN,resolveComponent:kb,equal:rN,serialize:Wr,parse:Cn};ca.exports=td;ca.exports.default=td;ca.exports.fastUri=td});var Cb=$(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});var Tb=Pb();Tb.code='require("ajv/dist/runtime/uri").default';rd.default=Tb});var Mb=$(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.CodeGen=Re.Name=Re.nil=Re.stringify=Re.str=Re._=Re.KeywordCxt=void 0;var iN=rs();Object.defineProperty(Re,"KeywordCxt",{enumerable:!0,get:function(){return iN.KeywordCxt}});var On=F();Object.defineProperty(Re,"_",{enumerable:!0,get:function(){return On._}});Object.defineProperty(Re,"str",{enumerable:!0,get:function(){return On.str}});Object.defineProperty(Re,"stringify",{enumerable:!0,get:function(){return On.stringify}});Object.defineProperty(Re,"nil",{enumerable:!0,get:function(){return On.nil}});Object.defineProperty(Re,"Name",{enumerable:!0,get:function(){return On.Name}});Object.defineProperty(Re,"CodeGen",{enumerable:!0,get:function(){return On.CodeGen}});var aN=na(),Ab=ns(),cN=Cl(),ss=sa(),uN=F(),is=Xo(),ua=Qo(),od=Q(),Ob=db(),lN=Cb(),Db=(t,e)=>new RegExp(t,e);Db.code="new RegExp";var dN=["removeAdditional","useDefaults","coerceTypes"],fN=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),pN={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},mN={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ib=200;function hN(t){var e,r,n,o,s,i,a,c,u,l,d,m,p,f,h,g,_,x,w,S,k,W,Z,re,U;let me=t.strict,Ee=(e=t.code)===null||e===void 0?void 0:e.optimize,xe=Ee===!0||Ee===void 0?1:Ee||0,Ze=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Db,Be=(o=t.uriResolver)!==null&&o!==void 0?o:lN.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:me)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:me)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:me)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=t.strictTuples)!==null&&d!==void 0?d:me)!==null&&m!==void 0?m:"log",strictRequired:(f=(p=t.strictRequired)!==null&&p!==void 0?p:me)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:xe,regExp:Ze}:{optimize:xe,regExp:Ze},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Ib,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Ib,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(x=t.messages)!==null&&x!==void 0?x:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(k=t.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(W=t.validateSchema)!==null&&W!==void 0?W:!0,validateFormats:(Z=t.validateFormats)!==null&&Z!==void 0?Z:!0,unicodeRegExp:(re=t.unicodeRegExp)!==null&&re!==void 0?re:!0,int32range:(U=t.int32range)!==null&&U!==void 0?U:!0,uriResolver:Be}}var as=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...hN(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new uN.ValueScope({scope:{},prefixes:fN,es5:r,lines:n}),this.logger=wN(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,cN.getRules)(),Rb.call(this,pN,e,"NOT SUPPORTED"),Rb.call(this,mN,e,"DEPRECATED","warn"),this._metaOpts=vN.call(this),e.formats&&yN.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_N.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),gN.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Ob;n==="id"&&(o={...Ob},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(l,d){await s.call(this,l.$schema);let m=this._addSchema(l,d);return m.validate||i.call(this,m)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Ab.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await s.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,is.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=Nb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new ss.SchemaEnv({schema:{},schemaId:n});if(r=ss.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Nb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,is.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(SN.call(this,n,r),!r)return(0,od.eachItem)(n,s=>nd.call(this,s)),this;kN.call(this,r);let o={...r,type:(0,ua.getJSONTypes)(r.type),schemaType:(0,ua.getJSONTypes)(r.schemaType)};return(0,od.eachItem)(n,o.type.length===0?s=>nd.call(this,s,o):s=>o.type.forEach(i=>nd.call(this,s,o,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=jb(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,is.normalizeId)(i||n);let u=is.getSchemaRefs.call(this,e,n);return c=new ss.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ss.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{ss.compileSchema.call(this,e)}finally{this.opts=r}}};as.ValidationError=aN.default;as.MissingRefError=Ab.default;Re.default=as;function Rb(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}function Nb(t){return t=(0,is.normalizeId)(t),this.schemas[t]||this.refs[t]}function gN(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function yN(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function _N(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function vN(){let t={...this.opts};for(let e of dN)delete t[e];return t}var bN={log(){},warn(){},error(){}};function wN(t){if(t===!1)return bN;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var xN=/^[a-z_$][a-z0-9_$:-]*$/i;function SN(t,e){let{RULES:r}=this;if((0,od.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!xN.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function nd(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,ua.getJSONTypes)(e.type),schemaType:(0,ua.getJSONTypes)(e.schemaType)}};e.before?$N.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function $N(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function kN(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=jb(e)),t.validateSchema=this.compile(e,!0))}var EN={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jb(t){return{anyOf:[t,EN]}}});var Zb=$(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var zN={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};sd.default=zN});var Ub=$(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.callRef=Gr.getValidate=void 0;var PN=ns(),Lb=dt(),Ye=F(),In=Wt(),qb=sa(),la=Q(),TN={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:c}=n,{root:u}=s;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=qb.resolveRef.call(c,u,o,r);if(l===void 0)throw new PN.default(n.opts.uriResolver,o,r);if(l instanceof qb.SchemaEnv)return m(l);return p(l);function d(){if(s===u)return da(t,i,s,s.$async);let f=e.scopeValue("root",{ref:u});return da(t,(0,Ye._)`${f}.validate`,u,u.$async)}function m(f){let h=Fb(t,f);da(t,h,f,f.$async)}function p(f){let h=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,Ye.stringify)(f)}:{ref:f}),g=e.name("valid"),_=t.subschema({schema:f,dataTypes:[],schemaPath:Ye.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function Fb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ye._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Gr.getValidate=Fb;function da(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?In.default.this:Ye.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{o.code((0,Ye._)`await ${(0,Lb.callValidateCode)(t,e,u)}`),p(e),i||o.assign(f,!0)},h=>{o.if((0,Ye._)`!(${h} instanceof ${s.ValidationError})`,()=>o.throw(h)),m(h),i||o.assign(f,!1)}),t.ok(f)}function d(){t.result((0,Lb.callValidateCode)(t,e,u),()=>p(e),()=>m(e))}function m(f){let h=(0,Ye._)`${f}.errors`;o.assign(In.default.vErrors,(0,Ye._)`${In.default.vErrors} === null ? ${h} : ${In.default.vErrors}.concat(${h})`),o.assign(In.default.errors,(0,Ye._)`${In.default.vErrors}.length`)}function p(f){var h;if(!s.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=la.mergeEvaluated.props(o,g.props,s.props));else{let _=o.var("props",(0,Ye._)`${f}.evaluated.props`);s.props=la.mergeEvaluated.props(o,_,s.props,Ye.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=la.mergeEvaluated.items(o,g.items,s.items));else{let _=o.var("items",(0,Ye._)`${f}.evaluated.items`);s.items=la.mergeEvaluated.items(o,_,s.items,Ye.Name)}}}Gr.callRef=da;Gr.default=TN});var Vb=$(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});var CN=Zb(),ON=Ub(),IN=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",CN.default,ON.default];id.default=IN});var Bb=$(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var fa=F(),mr=fa.operators,pa={maximum:{okStr:"<=",ok:mr.LTE,fail:mr.GT},minimum:{okStr:">=",ok:mr.GTE,fail:mr.LT},exclusiveMaximum:{okStr:"<",ok:mr.LT,fail:mr.GTE},exclusiveMinimum:{okStr:">",ok:mr.GT,fail:mr.LTE}},RN={message:({keyword:t,schemaCode:e})=>(0,fa.str)`must be ${pa[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,fa._)`{comparison: ${pa[t].okStr}, limit: ${e}}`},NN={keyword:Object.keys(pa),type:"number",schemaType:"number",$data:!0,error:RN,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,fa._)`${r} ${pa[e].fail} ${n} || isNaN(${r})`)}};ad.default=NN});var Hb=$(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var cs=F(),AN={message:({schemaCode:t})=>(0,cs.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,cs._)`{multipleOf: ${t}}`},DN={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:AN,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,cs._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,cs._)`${i} !== parseInt(${i})`;t.fail$data((0,cs._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};cd.default=DN});var Gb=$(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});function Wb(t){let e=t.length,r=0,n=0,o;for(;n<e;)r++,o=t.charCodeAt(n++),o>=55296&&o<=56319&&n<e&&(o=t.charCodeAt(n),(o&64512)===56320&&n++);return r}ud.default=Wb;Wb.code='require("ajv/dist/runtime/ucs2length").default'});var Jb=$(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var Jr=F(),jN=Q(),MN=Gb(),ZN={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Jr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Jr._)`{limit: ${t}}`},LN={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ZN,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Jr.operators.GT:Jr.operators.LT,i=o.opts.unicode===!1?(0,Jr._)`${r}.length`:(0,Jr._)`${(0,jN.useFunc)(t.gen,MN.default)}(${r})`;t.fail$data((0,Jr._)`${i} ${s} ${n}`)}};ld.default=LN});var Kb=$(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var qN=dt(),FN=Q(),Rn=F(),UN={message:({schemaCode:t})=>(0,Rn.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Rn._)`{pattern: ${t}}`},VN={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:UN,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,Rn._)`new RegExp`:(0,FN.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Rn._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Rn._)`!${l}`)}else{let c=(0,qN.usePattern)(t,o);t.fail$data((0,Rn._)`!${c}.test(${r})`)}}};dd.default=VN});var Yb=$(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var us=F(),BN={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,us.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,us._)`{limit: ${t}}`},HN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:BN,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?us.operators.GT:us.operators.LT;t.fail$data((0,us._)`Object.keys(${r}).length ${o} ${n}`)}};fd.default=HN});var Qb=$(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var ls=dt(),ds=F(),WN=Q(),GN={message:({params:{missingProperty:t}})=>(0,ds.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ds._)`{missingProperty: ${t}}`},JN={keyword:"required",type:"object",schemaType:"array",$data:!0,error:GN,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:i}=t,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?u():l(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:f}=t.it;for(let h of r)if(p?.[h]===void 0&&!f.has(h)){let g=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,WN.checkStrictMode)(i,_,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(ds.nil,d);else for(let p of r)(0,ls.checkReportMissingProp)(t,p)}function l(){let p=e.let("missing");if(c||s){let f=e.let("valid",!0);t.block$data(f,()=>m(p,f)),t.ok(f)}else e.if((0,ls.checkMissingProp)(t,r,p)),(0,ls.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,ls.noPropertyInData)(e,o,p,a.ownProperties),()=>t.error())})}function m(p,f){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(f,(0,ls.propertyInData)(e,o,p,a.ownProperties)),e.if((0,ds.not)(f),()=>{t.error(),e.break()})},ds.nil)}}};pd.default=JN});var Xb=$(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});var fs=F(),KN={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,fs.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,fs._)`{limit: ${t}}`},YN={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:KN,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?fs.operators.GT:fs.operators.LT;t.fail$data((0,fs._)`${r}.length ${o} ${n}`)}};md.default=YN});var ma=$(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var ew=Ml();ew.code='require("ajv/dist/runtime/equal").default';hd.default=ew});var tw=$(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var gd=Qo(),Ne=F(),QN=Q(),XN=ma(),eA={message:({params:{i:t,j:e}})=>(0,Ne.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ne._)`{i: ${t}, j: ${e}}`},tA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:eA,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:a}=t;if(!n&&!o)return;let c=e.let("valid"),u=s.items?(0,gd.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,Ne._)`${i} === false`),t.ok(c);function l(){let f=e.let("i",(0,Ne._)`${r}.length`),h=e.let("j");t.setParams({i:f,j:h}),e.assign(c,!0),e.if((0,Ne._)`${f} > 1`,()=>(d()?m:p)(f,h))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function m(f,h){let g=e.name("item"),_=(0,gd.checkDataTypes)(u,g,a.opts.strictNumbers,gd.DataType.Wrong),x=e.const("indices",(0,Ne._)`{}`);e.for((0,Ne._)`;${f}--;`,()=>{e.let(g,(0,Ne._)`${r}[${f}]`),e.if(_,(0,Ne._)`continue`),u.length>1&&e.if((0,Ne._)`typeof ${g} == "string"`,(0,Ne._)`${g} += "_"`),e.if((0,Ne._)`typeof ${x}[${g}] == "number"`,()=>{e.assign(h,(0,Ne._)`${x}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,Ne._)`${x}[${g}] = ${f}`)})}function p(f,h){let g=(0,QN.useFunc)(e,XN.default),_=e.name("outer");e.label(_).for((0,Ne._)`;${f}--;`,()=>e.for((0,Ne._)`${h} = ${f}; ${h}--;`,()=>e.if((0,Ne._)`${g}(${r}[${f}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};yd.default=tA});var rw=$(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var _d=F(),rA=Q(),nA=ma(),oA={message:"must be equal to constant",params:({schemaCode:t})=>(0,_d._)`{allowedValue: ${t}}`},sA={keyword:"const",$data:!0,error:oA,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,_d._)`!${(0,rA.useFunc)(e,nA.default)}(${r}, ${o})`):t.fail((0,_d._)`${s} !== ${r}`)}};vd.default=sA});var nw=$(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var ps=F(),iA=Q(),aA=ma(),cA={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ps._)`{allowedValues: ${t}}`},uA={keyword:"enum",schemaType:"array",$data:!0,error:cA,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,iA.useFunc)(e,aA.default)),l;if(a||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let p=e.const("vSchema",s);l=(0,ps.or)(...o.map((f,h)=>m(p,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,p=>e.if((0,ps._)`${u()}(${r}, ${p})`,()=>e.assign(l,!0).break()))}function m(p,f){let h=o[f];return typeof h=="object"&&h!==null?(0,ps._)`${u()}(${r}, ${p}[${f}])`:(0,ps._)`${r} === ${h}`}}};bd.default=uA});var ow=$(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var lA=Bb(),dA=Hb(),fA=Jb(),pA=Kb(),mA=Yb(),hA=Qb(),gA=Xb(),yA=tw(),_A=rw(),vA=nw(),bA=[lA.default,dA.default,fA.default,pA.default,mA.default,hA.default,gA.default,yA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_A.default,vA.default];wd.default=bA});var Sd=$(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.validateAdditionalItems=void 0;var Kr=F(),xd=Q(),wA={message:({params:{len:t}})=>(0,Kr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Kr._)`{limit: ${t}}`},xA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:wA,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,xd.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}sw(t,n)}};function sw(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Kr._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Kr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,xd.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,Kr._)`${a} <= ${e.length}`);r.if((0,Kr.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:xd.Type.Num},u),i.allErrors||r.if((0,Kr.not)(u),()=>r.break())})}}ms.validateAdditionalItems=sw;ms.default=xA});var $d=$(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.validateTuple=void 0;var iw=F(),ha=Q(),SA=dt(),$A={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return aw(t,"additionalItems",e);r.items=!0,!(0,ha.alwaysValidSchema)(r,e)&&t.ok((0,SA.validateArray)(t))}};function aw(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:a}=t;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=ha.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,iw._)`${s}.length`);r.forEach((d,m)=>{(0,ha.alwaysValidSchema)(a,d)||(n.if((0,iw._)`${u} > ${m}`,()=>t.subschema({keyword:i,schemaProp:m,dataProp:m},c)),t.ok(c))});function l(d){let{opts:m,errSchemaPath:p}=a,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(m.strictTuples&&!h){let g=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,ha.checkStrictMode)(a,g,m.strictTuples)}}}hs.validateTuple=aw;hs.default=$A});var cw=$(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var kA=$d(),EA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,kA.validateTuple)(t,"items")};kd.default=EA});var lw=$(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var uw=F(),zA=Q(),PA=dt(),TA=Sd(),CA={message:({params:{len:t}})=>(0,uw.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,uw._)`{limit: ${t}}`},OA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:CA,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,zA.alwaysValidSchema)(n,e)&&(o?(0,TA.validateAdditionalItems)(t,o):t.ok((0,PA.validateArray)(t)))}};Ed.default=OA});var dw=$(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var pt=F(),ga=Q(),IA={message:({params:{min:t,max:e}})=>e===void 0?(0,pt.str)`must contain at least ${t} valid item(s)`:(0,pt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,pt._)`{minContains: ${t}}`:(0,pt._)`{minContains: ${t}, maxContains: ${e}}`},RA={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:IA,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,i,a,{minContains:c,maxContains:u}=n;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,pt._)`${o}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,ga.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,ga.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ga.alwaysValidSchema)(s,r)){let h=(0,pt._)`${l} >= ${i}`;a!==void 0&&(h=(0,pt._)`${h} && ${l} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?p(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,pt._)`${o}.length > 0`,m)):(e.let(d,!1),m()),t.result(d,()=>t.reset());function m(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>f(g)))}function p(h,g){e.forRange("i",0,l,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:ga.Type.Num,compositeRule:!0},h),g()})}function f(h){e.code((0,pt._)`${h}++`),a===void 0?e.if((0,pt._)`${h} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,pt._)`${h} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,pt._)`${h} >= ${i}`,()=>e.assign(d,!0)))}}};zd.default=RA});var mw=$(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateSchemaDeps=It.validatePropertyDeps=It.error=void 0;var Pd=F(),NA=Q(),gs=dt();It.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Pd.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Pd._)`{property: ${t},
29
29
  missingProperty: ${n},
30
30
  depsCount: ${e},
31
- deps: ${r}}`};var RA={keyword:"dependencies",type:"object",schemaType:"object",error:It.error,code(t){let[e,r]=NA(t);dw(t,e),fw(t,r)}};function NA({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}function dw(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,ps.propertyInData)(r,n,i,o.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,ps.checkReportMissingProp)(t,u)}):(r.if((0,zd._)`${c} && (${(0,ps.checkMissingProp)(t,a,s)})`),(0,ps.reportMissingProp)(t,s),r.else())}}It.validatePropertyDeps=dw;function fw(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,IA.alwaysValidSchema)(s,e[a])||(r.if((0,ps.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:o,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}It.validateSchemaDeps=fw;It.default=RA});var hw=$(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});var mw=F(),AA=Q(),DA={message:"property name must be valid",params:({params:t})=>(0,mw._)`{propertyName: ${t.propertyName}}`},jA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:DA,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,AA.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,mw.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Pd.default=jA});var Cd=$(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var ha=dt(),kt=F(),MA=Wt(),ga=Q(),ZA={message:"must NOT have additional properties",params:({params:t})=>(0,kt._)`{additionalProperty: ${t.additionalProperty}}`},LA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:ZA,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,ga.alwaysValidSchema)(i,r))return;let u=(0,ha.allSchemaProperties)(n.properties),l=(0,ha.allSchemaProperties)(n.patternProperties);d(),t.ok((0,kt._)`${s} === ${MA.default.errors}`);function d(){e.forIn("key",o,g=>{!u.length&&!l.length?f(g):e.if(m(g),()=>f(g))})}function m(g){let _;if(u.length>8){let x=(0,ga.schemaRefOrVal)(i,n.properties,"properties");_=(0,ha.isOwnProperty)(e,x,g)}else u.length?_=(0,kt.or)(...u.map(x=>(0,kt._)`${g} === ${x}`)):_=kt.nil;return l.length&&(_=(0,kt.or)(_,...l.map(x=>(0,kt._)`${(0,ha.usePattern)(t,x)}.test(${g})`))),(0,kt.not)(_)}function p(g){e.code((0,kt._)`delete ${o}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,ga.alwaysValidSchema)(i,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),e.if((0,kt.not)(_),()=>{t.reset(),p(g)})):(h(g,_),a||e.if((0,kt.not)(_),()=>e.break()))}}function h(g,_,x){let w={keyword:"additionalProperties",dataProp:g,dataPropType:ga.Type.Str};x===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,_)}}};Td.default=LA});var _w=$(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});var qA=Xo(),gw=dt(),Od=Q(),yw=Cd(),FA={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&yw.default.code(new qA.KeywordCxt(s,yw.default,"additionalProperties"));let i=(0,gw.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=Od.mergeEvaluated.props(e,(0,Od.toHash)(i),s.props));let a=i.filter(d=>!(0,Od.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,gw.propertyInData)(e,o,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Id.default=FA});var xw=$(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var vw=dt(),ya=F(),bw=Q(),ww=Q(),UA={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:i}=s,a=(0,vw.allSchemaProperties)(r),c=a.filter(h=>(0,bw.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&o.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof ya.Name)&&(s.props=(0,ww.evaluatedPropsToName)(e,s.props));let{props:d}=s;m();function m(){for(let h of a)u&&p(h),s.allErrors?f(h):(e.var(l,!0),f(h),e.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,bw.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,ya._)`${(0,vw.usePattern)(t,h)}.test(${g})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:ww.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,ya._)`${d}[${g}]`,!0):!_&&!s.allErrors&&e.if((0,ya.not)(l),()=>e.break())})})}}};Rd.default=UA});var Sw=$(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var VA=Q(),BA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,VA.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Nd.default=BA});var $w=$(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var HA=dt(),WA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:HA.validateUnion,error:{message:"must match a schema in anyOf"}};Ad.default=WA});var kw=$(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var _a=F(),GA=Q(),JA={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,_a._)`{passingSchemas: ${t.passing}}`},KA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:JA,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,d)=>{let m;(0,GA.alwaysValidSchema)(o,l)?e.var(c,!0):m=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,_a._)`${c} && ${i}`).assign(i,!1).assign(a,(0,_a._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),m&&t.mergeEvaluated(m,_a.Name)})})}}};Dd.default=KA});var Ew=$(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var YA=Q(),QA={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,i)=>{if((0,YA.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};jd.default=QA});var Tw=$(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var va=F(),Pw=Q(),XA={message:({params:t})=>(0,va.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,va._)`{failingKeyword: ${t.ifClause}}`},eD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:XA,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Pw.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=zw(n,"then"),s=zw(n,"else");if(!o&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),o&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else o?e.if(a,u("then")):e.if((0,va.not)(a),u("else"));t.pass(i,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let m=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(m,i),d?e.assign(d,(0,va._)`${l}`):t.setParams({ifClause:l})}}}};function zw(t,e){let r=t.schema[e];return r!==void 0&&!(0,Pw.alwaysValidSchema)(t,r)}Md.default=eD});var Cw=$(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var tD=Q(),rD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,tD.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Zd.default=rD});var Ow=$(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var nD=xd(),oD=aw(),sD=Sd(),iD=uw(),aD=lw(),cD=pw(),uD=hw(),lD=Cd(),dD=_w(),fD=xw(),pD=Sw(),mD=$w(),hD=kw(),gD=Ew(),yD=Tw(),_D=Cw();function vD(t=!1){let e=[pD.default,mD.default,hD.default,gD.default,yD.default,_D.default,uD.default,lD.default,cD.default,dD.default,fD.default];return t?e.push(oD.default,iD.default):e.push(nD.default,sD.default),e.push(aD.default),e}Ld.default=vD});var Iw=$(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var $e=F(),bD={message:({schemaCode:t})=>(0,$e.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,$e._)`{format: ${t}}`},wD={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bD,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;o?m():p();function m(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,$e._)`${f}[${i}]`),g=r.let("fType"),_=r.let("format");r.if((0,$e._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,$e._)`${h}.type || "string"`).assign(_,(0,$e._)`${h}.validate`),()=>r.assign(g,(0,$e._)`"string"`).assign(_,h)),t.fail$data((0,$e.or)(x(),w()));function x(){return c.strictSchema===!1?$e.nil:(0,$e._)`${i} && !${_}`}function w(){let S=l.$async?(0,$e._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,$e._)`${_}(${n})`,k=(0,$e._)`(typeof ${_} == "function" ? ${S} : ${_}.test(${n}))`;return(0,$e._)`${_} && ${_} !== true && ${g} === ${e} && !${k}`}}function p(){let f=d.formats[s];if(!f){x();return}if(f===!0)return;let[h,g,_]=w(f);h===e&&t.pass(S());function x(){if(c.strictSchema===!1){d.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function w(k){let W=k instanceof RegExp?(0,$e.regexpCode)(k):c.code.formats?(0,$e._)`${c.code.formats}${(0,$e.getProperty)(s)}`:void 0,Z=r.scopeValue("formats",{key:s,ref:k,code:W});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,$e._)`${Z}.validate`]:["string",k,Z]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,$e._)`await ${_}(${n})`}return typeof g=="function"?(0,$e._)`${_}(${n})`:(0,$e._)`${_}.test(${n})`}}}};qd.default=wD});var Rw=$(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var xD=Iw(),SD=[xD.default];Fd.default=SD});var Nw=$(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.contentVocabulary=Rn.metadataVocabulary=void 0;Rn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Rn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Dw=$(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var $D=Ub(),kD=nw(),ED=Ow(),zD=Rw(),Aw=Nw(),PD=[$D.default,kD.default,(0,ED.default)(),zD.default,Aw.metadataVocabulary,Aw.contentVocabulary];Ud.default=PD});var Mw=$(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.DiscrError=void 0;var jw;(function(t){t.Tag="tag",t.Mapping="mapping"})(jw||(ba.DiscrError=jw={}))});var Lw=$(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var Nn=F(),Vd=Mw(),Zw=na(),TD=es(),CD=Q(),OD={message:({params:{discrError:t,tagName:e}})=>t===Vd.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Nn._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},ID={keyword:"discriminator",type:"object",schemaType:"object",error:OD,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,Nn._)`${r}${(0,Nn.getProperty)(a)}`);e.if((0,Nn._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Vd.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let p=m();e.if(!1);for(let f in p)e.elseIf((0,Nn._)`${u} === ${f}`),e.assign(c,d(p[f]));e.else(),t.error(!1,{discrError:Vd.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(p){let f=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},f);return t.mergeEvaluated(h,Nn.Name),f}function m(){var p;let f={},h=_(o),g=!0;for(let S=0;S<i.length;S++){let k=i[S];if(k?.$ref&&!(0,CD.schemaHasRulesButRef)(k,s.self.RULES)){let Z=k.$ref;if(k=Zw.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Z),k instanceof Zw.SchemaEnv&&(k=k.schema),k===void 0)throw new TD.default(s.opts.uriResolver,s.baseId,Z)}let W=(p=k?.properties)===null||p===void 0?void 0:p[a];if(typeof W!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||_(k)),x(W,S)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return f;function _({required:S}){return Array.isArray(S)&&S.includes(a)}function x(S,k){if(S.const)w(S.const,k);else if(S.enum)for(let W of S.enum)w(W,k);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(S,k){if(typeof S!="string"||S in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[S]=k}}}};Bd.default=ID});var qw=$((uU,RD)=>{RD.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Wd=$((pe,Hd)=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.MissingRefError=pe.ValidationError=pe.CodeGen=pe.Name=pe.nil=pe.stringify=pe.str=pe._=pe.KeywordCxt=pe.Ajv=void 0;var ND=jb(),AD=Dw(),DD=Lw(),Fw=qw(),jD=["/properties"],wa="http://json-schema.org/draft-07/schema",An=class extends ND.default{_addVocabularies(){super._addVocabularies(),AD.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(DD.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Fw,jD):Fw;this.addMetaSchema(e,wa,!1),this.refs["http://json-schema.org/schema"]=wa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(wa)?wa:void 0)}};pe.Ajv=An;Hd.exports=pe=An;Hd.exports.Ajv=An;Object.defineProperty(pe,"__esModule",{value:!0});pe.default=An;var MD=Xo();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return MD.KeywordCxt}});var Dn=F();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return Dn._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return Dn.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return Dn.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return Dn.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return Dn.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return Dn.CodeGen}});var ZD=ta();Object.defineProperty(pe,"ValidationError",{enumerable:!0,get:function(){return ZD.default}});var LD=es();Object.defineProperty(pe,"MissingRefError",{enumerable:!0,get:function(){return LD.default}})});var Kw=$(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.formatNames=Nt.fastFormats=Nt.fullFormats=void 0;function Rt(t,e){return{validate:t,compare:e}}Nt.fullFormats={date:Rt(Hw,Yd),time:Rt(Jd(!0),Qd),"date-time":Rt(Uw(!0),Gw),"iso-time":Rt(Jd(),Ww),"iso-date-time":Rt(Uw(),Jw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:HD,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:XD,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:WD,int32:{type:"number",validate:KD},int64:{type:"number",validate:YD},float:{type:"number",validate:Bw},double:{type:"number",validate:Bw},password:!0,binary:!0};Nt.fastFormats={...Nt.fullFormats,date:Rt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Yd),time:Rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Qd),"date-time":Rt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Gw),"iso-time":Rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Ww),"iso-date-time":Rt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Jw),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Nt.formatNames=Object.keys(Nt.fullFormats);function qD(t){return t%4===0&&(t%100!==0||t%400===0)}var FD=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,UD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Hw(t){let e=FD.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&qD(r)?29:UD[n])}function Yd(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Gd=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Jd(t){return function(r){let n=Gd.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let d=s-l*c,m=o-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&i<61}}function Qd(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Ww(t,e){if(!(t&&e))return;let r=Gd.exec(t),n=Gd.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var Kd=/t|\s/i;function Uw(t){let e=Jd(t);return function(n){let o=n.split(Kd);return o.length===2&&Hw(o[0])&&e(o[1])}}function Gw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Jw(t,e){if(!(t&&e))return;let[r,n]=t.split(Kd),[o,s]=e.split(Kd),i=Yd(r,o);if(i!==void 0)return i||Qd(n,s)}var VD=/\/|:/,BD=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function HD(t){return VD.test(t)&&BD.test(t)}var Vw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function WD(t){return Vw.lastIndex=0,Vw.test(t)}var GD=-(2**31),JD=2**31-1;function KD(t){return Number.isInteger(t)&&t<=JD&&t>=GD}function YD(t){return Number.isInteger(t)}function Bw(){return!0}var QD=/[^\\]\\Z/;function XD(t){if(QD.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Yw=$(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.formatLimitDefinition=void 0;var ej=Wd(),Et=F(),hr=Et.operators,xa={formatMaximum:{okStr:"<=",ok:hr.LTE,fail:hr.GT},formatMinimum:{okStr:">=",ok:hr.GTE,fail:hr.LT},formatExclusiveMaximum:{okStr:"<",ok:hr.LT,fail:hr.GTE},formatExclusiveMinimum:{okStr:">",ok:hr.GT,fail:hr.LTE}},tj={message:({keyword:t,schemaCode:e})=>(0,Et.str)`should be ${xa[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Et._)`{comparison: ${xa[t].okStr}, limit: ${e}}`};jn.formatLimitDefinition={keyword:Object.keys(xa),type:"string",schemaType:"string",$data:!0,error:tj,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new ej.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let m=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),p=e.const("fmt",(0,Et._)`${m}[${c.schemaCode}]`);t.fail$data((0,Et.or)((0,Et._)`typeof ${p} != "object"`,(0,Et._)`${p} instanceof RegExp`,(0,Et._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let m=c.schema,p=a.formats[m];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let f=e.scopeValue("formats",{key:m,ref:p,code:i.code.formats?(0,Et._)`${i.code.formats}${(0,Et.getProperty)(m)}`:void 0});t.fail$data(d(f))}function d(m){return(0,Et._)`${m}.compare(${r}, ${n}) ${xa[o].fail} 0`}},dependencies:["format"]};var rj=t=>(t.addKeyword(jn.formatLimitDefinition),t);jn.default=rj});var tx=$((ms,ex)=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});var Mn=Kw(),nj=Yw(),Xd=F(),Qw=new Xd.Name("fullFormats"),oj=new Xd.Name("fastFormats"),ef=(t,e={keywords:!0})=>{if(Array.isArray(e))return Xw(t,e,Mn.fullFormats,Qw),t;let[r,n]=e.mode==="fast"?[Mn.fastFormats,oj]:[Mn.fullFormats,Qw],o=e.formats||Mn.formatNames;return Xw(t,o,r,n),e.keywords&&(0,nj.default)(t),t};ef.get=(t,e="full")=>{let n=(e==="fast"?Mn.fastFormats:Mn.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function Xw(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,Xd._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}ex.exports=ms=ef;Object.defineProperty(ms,"__esModule",{value:!0});ms.default=ef});var te;(function(t){t.assertEqual=o=>o;function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(te||(te={}));var Aa;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Aa||(Aa={}));var z=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jt=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}},E=te.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"]),yx=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qe=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Qe.create=t=>new Qe(t);var Qn=(t,e)=>{let r;switch(t.code){case E.invalid_type:t.received===z.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,te.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(t.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(t.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(t.options)}, received '${t.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case E.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case E.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=e.defaultError,te.assertNever(t)}return{message:r}},cf=Qn;function _x(t){cf=t}function vs(){return cf}var bs=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],i={...o,path:s},a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:o.message||a}},vx=[];function T(t,e){let r=bs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,vs(),Qn].filter(n=>!!n)});t.common.issues.push(r)}var Ae=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return D;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r)n.push({key:await o.key,value:await o.value});return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return D;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}},D=Object.freeze({status:"aborted"}),uf=t=>({status:"dirty",value:t}),Le=t=>({status:"valid",value:t}),Da=t=>t.status==="aborted",ja=t=>t.status==="dirty",Xn=t=>t.status==="valid",ws=t=>typeof Promise<"u"&&t instanceof Promise,I;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(I||(I={}));var ot=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},sf=(t,e)=>{if(Xn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Qe(t.common.issues);return this._error=r,this._error}}};function j(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>i.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:o}}var M=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Jt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ae,ctx:{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(ws(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let o={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},s=this._parseSync({data:e,path:o.path,parent:o});return sf(o,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(ws(o)?o:Promise.resolve(o));return sf(n,s)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:E.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new Xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ht.create(this,this._def)}nullable(){return jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dt.create(this,this._def)}promise(){return Qt.create(this,this._def)}or(e){return $r.create([this,e],this._def)}and(e){return kr.create(this,e,this._def)}transform(e){return new Xe({...j(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Cr({...j(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new ks({typeName:N.ZodBranded,type:this,...j(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new rn({...j(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return eo.create(this,e)}readonly(){return on.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},bx=/^c[^\s-]{8,}$/i,wx=/^[a-z][a-z0-9]*$/,xx=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sx=/^[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,$x=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Na,Ex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,zx=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Px=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Tx(t,e){return!!((e==="v4"||!e)&&Ex.test(t)||(e==="v6"||!e)&&zx.test(t))}var Kt=class t extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.string,received:s.parsedType}),D}let n=new Ae,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")$x.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"email",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Na||(Na=new RegExp(kx,"u")),Na.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"emoji",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Sx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"uuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")bx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")wx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid2",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")xx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ulid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),T(o,{validation:"url",code:E.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"regex",code:E.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Px(s).test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Tx(e.data,s.version)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ip",code:E.invalid_string,message:s.message}),n.dirty()):te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:E.invalid_string,...I.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...I.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...I.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...I.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...I.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...I.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...I.errToObj(r)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Kt.create=t=>{var e;return new Kt({checks:[],typeName:N.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};function Cx(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=parseInt(t.toFixed(o).replace(".","")),i=parseInt(e.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}var _r=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==z.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.number,received:s.parsedType}),D}let n,o=new Ae;for(let s of this._def.checks)s.kind==="int"?te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Cx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_finite,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};_r.create=t=>new _r({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...j(t)});var vr=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==z.bigint){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.bigint,received:s.parsedType}),D}let n,o=new Ae;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};vr.create=t=>{var e;return new vr({checks:[],typeName:N.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};var br=class extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.boolean,received:n.parsedType}),D}return Le(e.data)}};br.create=t=>new br({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...j(t)});var wr=class t extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.date,received:s.parsedType}),D}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),D}let n=new Ae,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:I.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};wr.create=t=>new wr({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...j(t)});var Qr=class extends M{_parse(e){if(this._getType(e)!==z.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.symbol,received:n.parsedType}),D}return Le(e.data)}};Qr.create=t=>new Qr({typeName:N.ZodSymbol,...j(t)});var xr=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.undefined,received:n.parsedType}),D}return Le(e.data)}};xr.create=t=>new xr({typeName:N.ZodUndefined,...j(t)});var Sr=class extends M{_parse(e){if(this._getType(e)!==z.null){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.null,received:n.parsedType}),D}return Le(e.data)}};Sr.create=t=>new Sr({typeName:N.ZodNull,...j(t)});var Yt=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return Le(e.data)}};Yt.create=t=>new Yt({typeName:N.ZodAny,...j(t)});var At=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Le(e.data)}};At.create=t=>new At({typeName:N.ZodUnknown,...j(t)});var gt=class extends M{_parse(e){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:z.never,received:r.parsedType}),D}};gt.create=t=>new gt({typeName:N.ZodNever,...j(t)});var Xr=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.void,received:n.parsedType}),D}return Le(e.data)}};Xr.create=t=>new Xr({typeName:N.ZodVoid,...j(t)});var Dt=class t extends M{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==z.array)return T(r,{code:E.invalid_type,expected:z.array,received:r.parsedType}),D;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(i||a)&&(T(r,{code:i?E.too_big:E.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(T(r,{code:E.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(T(r,{code:E.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>o.type._parseAsync(new ot(r,i,r.path,a)))).then(i=>Ae.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new ot(r,i,r.path,a)));return Ae.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:I.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:I.toString(r)}})}nonempty(e){return this.min(1,e)}};Dt.create=(t,e)=>new Dt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...j(e)});function Yr(t){if(t instanceof He){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ht.create(Yr(n))}return new He({...t._def,shape:()=>e})}else return t instanceof Dt?new Dt({...t._def,type:Yr(t.element)}):t instanceof ht?ht.create(Yr(t.unwrap())):t instanceof jt?jt.create(Yr(t.unwrap())):t instanceof zt?zt.create(t.items.map(e=>Yr(e))):t}var He=class t extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==z.object){let u=this._getOrReturnCtx(e);return T(u,{code:E.invalid_type,expected:z.object,received:u.parsedType}),D}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof gt&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ot(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof gt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(T(o,{code:E.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ot(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key;u.push({key:d,value:await l.value,alwaysSet:l.alwaysSet})}return u}).then(u=>Ae.mergeObjectSync(n,u)):Ae.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var o,s,i,a;let c=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=I.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Yr(this)}partial(e){let r={};return te.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ht;)s=s._def.innerType;r[n]=s}}),new t({...this._def,shape:()=>r})}keyof(){return lf(te.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...j(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:gt.create(),typeName:N.ZodObject,...j(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...j(e)});var $r=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Qe(a.ctx.common.issues));return T(r,{code:E.invalid_union,unionErrors:i}),D}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Qe(c));return T(r,{code:E.invalid_union,unionErrors:a}),D}}get options(){return this._def.options}};$r.create=(t,e)=>new $r({options:t,typeName:N.ZodUnion,...j(e)});var _s=t=>t instanceof Er?_s(t.schema):t instanceof Xe?_s(t.innerType()):t instanceof zr?[t.value]:t instanceof Pr?t.options:t instanceof Tr?Object.keys(t.enum):t instanceof Cr?_s(t._def.innerType):t instanceof xr?[void 0]:t instanceof Sr?[null]:null,xs=class t extends M{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.object)return T(r,{code:E.invalid_type,expected:z.object,received:r.parsedType}),D;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(T(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),D)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let i=_s(s.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...j(n)})}};function Ma(t,e){let r=Jt(t),n=Jt(e);if(t===e)return{valid:!0,data:t};if(r===z.object&&n===z.object){let o=te.objectKeys(e),s=te.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=Ma(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===z.array&&n===z.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=Ma(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===z.date&&n===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var kr=class extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,i)=>{if(Da(s)||Da(i))return D;let a=Ma(s.value,i.value);return a.valid?((ja(s)||ja(i))&&r.dirty(),{status:r.value,value:a.data}):(T(n,{code:E.invalid_intersection_types}),D)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};kr.create=(t,e,r)=>new kr({left:t,right:e,typeName:N.ZodIntersection,...j(r)});var zt=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.array)return T(n,{code:E.invalid_type,expected:z.array,received:n.parsedType}),D;if(n.data.length<this._def.items.length)return T(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),D;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ot(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>Ae.mergeArray(r,i)):Ae.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};zt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zt({items:t,typeName:N.ZodTuple,rest:null,...j(e)})};var Ss=class t extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.object)return T(n,{code:E.invalid_type,expected:z.object,received:n.parsedType}),D;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new ot(n,a,n.path,a)),value:i._parse(new ot(n,n.data[a],n.path,a))});return n.common.async?Ae.mergeObjectAsync(r,o):Ae.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new t({keyType:e,valueType:r,typeName:N.ZodRecord,...j(n)}):new t({keyType:Kt.create(),valueType:e,typeName:N.ZodRecord,...j(r)})}},en=class extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.map)return T(n,{code:E.invalid_type,expected:z.map,received:n.parsedType}),D;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new ot(n,a,n.path,[u,"key"])),value:s._parse(new ot(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return D;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return D;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};en.create=(t,e,r)=>new en({valueType:e,keyType:t,typeName:N.ZodMap,...j(r)});var tn=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.set)return T(n,{code:E.invalid_type,expected:z.set,received:n.parsedType}),D;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(T(n,{code:E.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(T(n,{code:E.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return D;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new ot(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:I.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};tn.create=(t,e)=>new tn({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...j(e)});var $s=class t extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.function)return T(r,{code:E.invalid_type,expected:z.function,received:r.parsedType}),D;function n(a,c){return bs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vs(),Qn].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return bs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,vs(),Qn].filter(u=>!!u),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Qt){let a=this;return Le(async function(...c){let u=new Qe([]),l=await a._def.args.parseAsync(c,s).catch(p=>{throw u.addIssue(n(c,p)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(p=>{throw u.addIssue(o(d,p)),u})})}else{let a=this;return Le(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Qe([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Qe([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:zt.create(e).rest(At.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||zt.create([]).rest(At.create()),returns:r||At.create(),typeName:N.ZodFunction,...j(n)})}},Er=class extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Er.create=(t,e)=>new Er({getter:t,typeName:N.ZodLazy,...j(e)});var zr=class extends M{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return T(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),D}return{status:"valid",value:e.data}}get value(){return this._def.value}};zr.create=(t,e)=>new zr({value:t,typeName:N.ZodLiteral,...j(e)});function lf(t,e){return new Pr({values:t,typeName:N.ZodEnum,...j(e)})}var Pr=class t extends M{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{expected:te.joinValues(n),received:r.parsedType,code:E.invalid_type}),D}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),D}return Le(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Pr.create=lf;var Tr=class extends M{_parse(e){let r=te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==z.string&&n.parsedType!==z.number){let o=te.objectValues(r);return T(n,{expected:te.joinValues(o),received:n.parsedType,code:E.invalid_type}),D}if(r.indexOf(e.data)===-1){let o=te.objectValues(r);return T(n,{received:n.data,code:E.invalid_enum_value,options:o}),D}return Le(e.data)}get enum(){return this._def.values}};Tr.create=(t,e)=>new Tr({values:t,typeName:N.ZodNativeEnum,...j(e)});var Qt=class extends M{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.promise&&r.common.async===!1)return T(r,{code:E.invalid_type,expected:z.promise,received:r.parsedType}),D;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Le(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Qt.create=(t,e)=>new Qt({type:t,typeName:N.ZodPromise,...j(e)});var Xe=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{T(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(i).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?D:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?D:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Xn(i))return i;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Xn(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):i);te.assertNever(o)}};Xe.create=(t,e,r)=>new Xe({schema:t,typeName:N.ZodEffects,effect:e,...j(r)});Xe.createWithPreprocess=(t,e,r)=>new Xe({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...j(r)});var ht=class extends M{_parse(e){return this._getType(e)===z.undefined?Le(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ht.create=(t,e)=>new ht({innerType:t,typeName:N.ZodOptional,...j(e)});var jt=class extends M{_parse(e){return this._getType(e)===z.null?Le(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jt.create=(t,e)=>new jt({innerType:t,typeName:N.ZodNullable,...j(e)});var Cr=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Cr.create=(t,e)=>new Cr({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});var rn=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ws(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};rn.create=(t,e)=>new rn({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});var nn=class extends M{_parse(e){if(this._getType(e)!==z.nan){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.nan,received:n.parsedType}),D}return{status:"valid",value:e.data}}};nn.create=t=>new nn({typeName:N.ZodNaN,...j(t)});var Ox=Symbol("zod_brand"),ks=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},eo=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?D:s.status==="dirty"?(r.dirty(),uf(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?D:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:N.ZodPipeline})}},on=class extends M{_parse(e){let r=this._def.innerType._parse(e);return Xn(r)&&(r.value=Object.freeze(r.value)),r}};on.create=(t,e)=>new on({innerType:t,typeName:N.ZodReadonly,...j(e)});var df=(t,e={},r)=>t?Yt.create().superRefine((n,o)=>{var s,i;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:c})}}):Yt.create(),Ix={object:He.lazycreate},N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));var Rx=(t,e={message:`Input not instance of ${t.name}`})=>df(r=>r instanceof t,e),ff=Kt.create,pf=_r.create,Nx=nn.create,Ax=vr.create,mf=br.create,Dx=wr.create,jx=Qr.create,Mx=xr.create,Zx=Sr.create,Lx=Yt.create,qx=At.create,Fx=gt.create,Ux=Xr.create,Vx=Dt.create,Bx=He.create,Hx=He.strictCreate,Wx=$r.create,Gx=xs.create,Jx=kr.create,Kx=zt.create,Yx=Ss.create,Qx=en.create,Xx=tn.create,e0=$s.create,t0=Er.create,r0=zr.create,n0=Pr.create,o0=Tr.create,s0=Qt.create,af=Xe.create,i0=ht.create,a0=jt.create,c0=Xe.createWithPreprocess,u0=eo.create,l0=()=>ff().optional(),d0=()=>pf().optional(),f0=()=>mf().optional(),p0={string:(t=>Kt.create({...t,coerce:!0})),number:(t=>_r.create({...t,coerce:!0})),boolean:(t=>br.create({...t,coerce:!0})),bigint:(t=>vr.create({...t,coerce:!0})),date:(t=>wr.create({...t,coerce:!0}))},m0=D,ke=Object.freeze({__proto__:null,defaultErrorMap:Qn,setErrorMap:_x,getErrorMap:vs,makeIssue:bs,EMPTY_PATH:vx,addIssueToContext:T,ParseStatus:Ae,INVALID:D,DIRTY:uf,OK:Le,isAborted:Da,isDirty:ja,isValid:Xn,isAsync:ws,get util(){return te},get objectUtil(){return Aa},ZodParsedType:z,getParsedType:Jt,ZodType:M,ZodString:Kt,ZodNumber:_r,ZodBigInt:vr,ZodBoolean:br,ZodDate:wr,ZodSymbol:Qr,ZodUndefined:xr,ZodNull:Sr,ZodAny:Yt,ZodUnknown:At,ZodNever:gt,ZodVoid:Xr,ZodArray:Dt,ZodObject:He,ZodUnion:$r,ZodDiscriminatedUnion:xs,ZodIntersection:kr,ZodTuple:zt,ZodRecord:Ss,ZodMap:en,ZodSet:tn,ZodFunction:$s,ZodLazy:Er,ZodLiteral:zr,ZodEnum:Pr,ZodNativeEnum:Tr,ZodPromise:Qt,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:ht,ZodNullable:jt,ZodDefault:Cr,ZodCatch:rn,ZodNaN:nn,BRAND:Ox,ZodBranded:ks,ZodPipeline:eo,ZodReadonly:on,custom:df,Schema:M,ZodSchema:M,late:Ix,get ZodFirstPartyTypeKind(){return N},coerce:p0,any:Lx,array:Vx,bigint:Ax,boolean:mf,date:Dx,discriminatedUnion:Gx,effect:af,enum:n0,function:e0,instanceof:Rx,intersection:Jx,lazy:t0,literal:r0,map:Qx,nan:Nx,nativeEnum:o0,never:Fx,null:Zx,nullable:a0,number:pf,object:Bx,oboolean:f0,onumber:d0,optional:i0,ostring:l0,pipeline:u0,preprocess:c0,promise:s0,record:Yx,set:Xx,strictObject:Hx,string:ff,symbol:jx,transformer:af,tuple:Kx,undefined:Mx,union:Wx,unknown:qx,void:Ux,NEVER:m0,ZodIssueCode:E,quotelessJson:yx,ZodError:Qe});var Xt=class{static detect(e){let r=e.trim();return this.isRemoteUrl(r)?{type:new URL(r).protocol==="https:"?"https_url":"http_url",originalPath:e,normalizedPath:r}:{type:"local",originalPath:e,normalizedPath:r}}static isValidUrl(e){try{return new URL(e.trim()).protocol.length>0}catch{return!1}}static isRemoteUrl(e){try{let r=e.trim();if(!r.startsWith("http://")&&!r.startsWith("https://"))return!1;let n=new URL(r);return!(n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname||n.hostname.length===0)}catch{return!1}}};var h0=ke.object({name:ke.string().default("eui-compodoc-mcp"),version:ke.string().default("1.0.0")}),g0=ke.object({path:ke.string().min(1,"Documentation path cannot be empty").refine(t=>t.trim().length>0,{message:"Documentation path cannot be only whitespace"}).refine(t=>{let e=t.trim();return e.startsWith("http://")||e.startsWith("https://")?Xt.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}),watchForChanges:ke.boolean().default(!0),reloadDebounce:ke.number().min(0).default(1e3),timeout:ke.number().min(1e3).default(1e4),maxRetries:ke.number().min(0).max(10).default(3),pollingInterval:ke.number().min(5e3).default(6e4)}),y0=ke.object({maxResults:ke.number().min(1).max(1e3).default(50),minQueryLength:ke.number().min(1).default(2)}),_0=ke.object({level:ke.enum(["debug","info","warn","error"]).default("info"),format:ke.enum(["json","text"]).default("text")}),v0=ke.object({path:ke.string().optional()}).default({}),hf=ke.object({server:h0.default({}),documentation:g0,search:y0.default({}),logging:_0.default({}),accessibility:v0.default({})}),Za={server:{name:"eui-compodoc-mcp",version:"1.0.0"},documentation:{path:"./documentation.json",watchForChanges:!0,reloadDebounce:1e3,timeout:1e4,maxRetries:3,pollingInterval:6e4},search:{maxResults:50,minQueryLength:2},logging:{level:"info",format:"text"}};function La(t){return hf.safeParse(t)}var zs=mt(require("fs")),gf=mt(require("path"));function yf(){let t={};return process.env.COMPODOC_MCP_DOC_PATH&&(t.documentation={path:process.env.COMPODOC_MCP_DOC_PATH}),process.env.COMPODOC_MCP_LOG_LEVEL&&(t.logging={level:process.env.COMPODOC_MCP_LOG_LEVEL}),process.env.COMPODOC_MCP_WATCH!==void 0&&(t.documentation||(t.documentation={path:""}),t.documentation.watchForChanges=process.env.COMPODOC_MCP_WATCH==="true"),process.env.COMPODOC_MCP_A11Y_PATH&&(t.accessibility={path:process.env.COMPODOC_MCP_A11Y_PATH}),t}function _f(t){let e={};for(let r=0;r<t.length;r++)switch(t[r]){case"--doc-path":case"--documentation-path":e.documentation||(e.documentation={path:""}),e.documentation.path=t[++r];break;case"--watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!0;break;case"--no-watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!1;break;case"--log-level":e.logging={level:t[++r]};break;case"--max-results":e.search={maxResults:parseInt(t[++r],10)};break;case"--a11y-path":e.accessibility||(e.accessibility={}),e.accessibility.path=t[++r];break;case"--help":case"-h":w0(),process.exit(0);break}return e}function vf(t){try{if(!zs.existsSync(t))return process.stderr.write(`Configuration file not found: ${t}
32
- `),{};let e=zs.readFileSync(t,"utf-8"),r=gf.extname(t).toLowerCase();return r===".json"?JSON.parse(e):(process.stderr.write(`Unsupported configuration file format: ${r}
31
+ deps: ${r}}`};var AA={keyword:"dependencies",type:"object",schemaType:"object",error:It.error,code(t){let[e,r]=DA(t);fw(t,e),pw(t,r)}};function DA({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}function fw(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,gs.propertyInData)(r,n,i,o.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,gs.checkReportMissingProp)(t,u)}):(r.if((0,Pd._)`${c} && (${(0,gs.checkMissingProp)(t,a,s)})`),(0,gs.reportMissingProp)(t,s),r.else())}}It.validatePropertyDeps=fw;function pw(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,NA.alwaysValidSchema)(s,e[a])||(r.if((0,gs.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:o,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}It.validateSchemaDeps=pw;It.default=AA});var gw=$(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var hw=F(),jA=Q(),MA={message:"property name must be valid",params:({params:t})=>(0,hw._)`{propertyName: ${t.propertyName}}`},ZA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:MA,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,jA.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,hw.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Td.default=ZA});var Od=$(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var ya=dt(),kt=F(),LA=Wt(),_a=Q(),qA={message:"must NOT have additional properties",params:({params:t})=>(0,kt._)`{additionalProperty: ${t.additionalProperty}}`},FA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qA,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,_a.alwaysValidSchema)(i,r))return;let u=(0,ya.allSchemaProperties)(n.properties),l=(0,ya.allSchemaProperties)(n.patternProperties);d(),t.ok((0,kt._)`${s} === ${LA.default.errors}`);function d(){e.forIn("key",o,g=>{!u.length&&!l.length?f(g):e.if(m(g),()=>f(g))})}function m(g){let _;if(u.length>8){let x=(0,_a.schemaRefOrVal)(i,n.properties,"properties");_=(0,ya.isOwnProperty)(e,x,g)}else u.length?_=(0,kt.or)(...u.map(x=>(0,kt._)`${g} === ${x}`)):_=kt.nil;return l.length&&(_=(0,kt.or)(_,...l.map(x=>(0,kt._)`${(0,ya.usePattern)(t,x)}.test(${g})`))),(0,kt.not)(_)}function p(g){e.code((0,kt._)`delete ${o}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,_a.alwaysValidSchema)(i,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),e.if((0,kt.not)(_),()=>{t.reset(),p(g)})):(h(g,_),a||e.if((0,kt.not)(_),()=>e.break()))}}function h(g,_,x){let w={keyword:"additionalProperties",dataProp:g,dataPropType:_a.Type.Str};x===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,_)}}};Cd.default=FA});var vw=$(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var UA=rs(),yw=dt(),Id=Q(),_w=Od(),VA={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&_w.default.code(new UA.KeywordCxt(s,_w.default,"additionalProperties"));let i=(0,yw.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=Id.mergeEvaluated.props(e,(0,Id.toHash)(i),s.props));let a=i.filter(d=>!(0,Id.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,yw.propertyInData)(e,o,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Rd.default=VA});var Sw=$(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var bw=dt(),va=F(),ww=Q(),xw=Q(),BA={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:i}=s,a=(0,bw.allSchemaProperties)(r),c=a.filter(h=>(0,ww.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&o.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof va.Name)&&(s.props=(0,xw.evaluatedPropsToName)(e,s.props));let{props:d}=s;m();function m(){for(let h of a)u&&p(h),s.allErrors?f(h):(e.var(l,!0),f(h),e.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,ww.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,va._)`${(0,bw.usePattern)(t,h)}.test(${g})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:xw.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,va._)`${d}[${g}]`,!0):!_&&!s.allErrors&&e.if((0,va.not)(l),()=>e.break())})})}}};Nd.default=BA});var $w=$(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var HA=Q(),WA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,HA.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Ad.default=WA});var kw=$(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var GA=dt(),JA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:GA.validateUnion,error:{message:"must match a schema in anyOf"}};Dd.default=JA});var Ew=$(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var ba=F(),KA=Q(),YA={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ba._)`{passingSchemas: ${t.passing}}`},QA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:YA,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,d)=>{let m;(0,KA.alwaysValidSchema)(o,l)?e.var(c,!0):m=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ba._)`${c} && ${i}`).assign(i,!1).assign(a,(0,ba._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),m&&t.mergeEvaluated(m,ba.Name)})})}}};jd.default=QA});var zw=$(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var XA=Q(),eD={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,i)=>{if((0,XA.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};Md.default=eD});var Cw=$(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var wa=F(),Tw=Q(),tD={message:({params:t})=>(0,wa.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,wa._)`{failingKeyword: ${t.ifClause}}`},rD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:tD,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Tw.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Pw(n,"then"),s=Pw(n,"else");if(!o&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),o&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else o?e.if(a,u("then")):e.if((0,wa.not)(a),u("else"));t.pass(i,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let m=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(m,i),d?e.assign(d,(0,wa._)`${l}`):t.setParams({ifClause:l})}}}};function Pw(t,e){let r=t.schema[e];return r!==void 0&&!(0,Tw.alwaysValidSchema)(t,r)}Zd.default=rD});var Ow=$(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var nD=Q(),oD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,nD.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Ld.default=oD});var Iw=$(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var sD=Sd(),iD=cw(),aD=$d(),cD=lw(),uD=dw(),lD=mw(),dD=gw(),fD=Od(),pD=vw(),mD=Sw(),hD=$w(),gD=kw(),yD=Ew(),_D=zw(),vD=Cw(),bD=Ow();function wD(t=!1){let e=[hD.default,gD.default,yD.default,_D.default,vD.default,bD.default,dD.default,fD.default,lD.default,pD.default,mD.default];return t?e.push(iD.default,cD.default):e.push(sD.default,aD.default),e.push(uD.default),e}qd.default=wD});var Rw=$(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var $e=F(),xD={message:({schemaCode:t})=>(0,$e.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,$e._)`{format: ${t}}`},SD={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:xD,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;o?m():p();function m(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,$e._)`${f}[${i}]`),g=r.let("fType"),_=r.let("format");r.if((0,$e._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,$e._)`${h}.type || "string"`).assign(_,(0,$e._)`${h}.validate`),()=>r.assign(g,(0,$e._)`"string"`).assign(_,h)),t.fail$data((0,$e.or)(x(),w()));function x(){return c.strictSchema===!1?$e.nil:(0,$e._)`${i} && !${_}`}function w(){let S=l.$async?(0,$e._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,$e._)`${_}(${n})`,k=(0,$e._)`(typeof ${_} == "function" ? ${S} : ${_}.test(${n}))`;return(0,$e._)`${_} && ${_} !== true && ${g} === ${e} && !${k}`}}function p(){let f=d.formats[s];if(!f){x();return}if(f===!0)return;let[h,g,_]=w(f);h===e&&t.pass(S());function x(){if(c.strictSchema===!1){d.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function w(k){let W=k instanceof RegExp?(0,$e.regexpCode)(k):c.code.formats?(0,$e._)`${c.code.formats}${(0,$e.getProperty)(s)}`:void 0,Z=r.scopeValue("formats",{key:s,ref:k,code:W});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,$e._)`${Z}.validate`]:["string",k,Z]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,$e._)`await ${_}(${n})`}return typeof g=="function"?(0,$e._)`${_}(${n})`:(0,$e._)`${_}.test(${n})`}}}};Fd.default=SD});var Nw=$(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var $D=Rw(),kD=[$D.default];Ud.default=kD});var Aw=$(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.contentVocabulary=Nn.metadataVocabulary=void 0;Nn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Nn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var jw=$(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var ED=Vb(),zD=ow(),PD=Iw(),TD=Nw(),Dw=Aw(),CD=[ED.default,zD.default,(0,PD.default)(),TD.default,Dw.metadataVocabulary,Dw.contentVocabulary];Vd.default=CD});var Zw=$(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.DiscrError=void 0;var Mw;(function(t){t.Tag="tag",t.Mapping="mapping"})(Mw||(xa.DiscrError=Mw={}))});var qw=$(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var An=F(),Bd=Zw(),Lw=sa(),OD=ns(),ID=Q(),RD={message:({params:{discrError:t,tagName:e}})=>t===Bd.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,An._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},ND={keyword:"discriminator",type:"object",schemaType:"object",error:RD,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,An._)`${r}${(0,An.getProperty)(a)}`);e.if((0,An._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Bd.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let p=m();e.if(!1);for(let f in p)e.elseIf((0,An._)`${u} === ${f}`),e.assign(c,d(p[f]));e.else(),t.error(!1,{discrError:Bd.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(p){let f=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},f);return t.mergeEvaluated(h,An.Name),f}function m(){var p;let f={},h=_(o),g=!0;for(let S=0;S<i.length;S++){let k=i[S];if(k?.$ref&&!(0,ID.schemaHasRulesButRef)(k,s.self.RULES)){let Z=k.$ref;if(k=Lw.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Z),k instanceof Lw.SchemaEnv&&(k=k.schema),k===void 0)throw new OD.default(s.opts.uriResolver,s.baseId,Z)}let W=(p=k?.properties)===null||p===void 0?void 0:p[a];if(typeof W!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||_(k)),x(W,S)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return f;function _({required:S}){return Array.isArray(S)&&S.includes(a)}function x(S,k){if(S.const)w(S.const,k);else if(S.enum)for(let W of S.enum)w(W,k);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(S,k){if(typeof S!="string"||S in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[S]=k}}}};Hd.default=ND});var Fw=$((dU,AD)=>{AD.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Gd=$((pe,Wd)=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.MissingRefError=pe.ValidationError=pe.CodeGen=pe.Name=pe.nil=pe.stringify=pe.str=pe._=pe.KeywordCxt=pe.Ajv=void 0;var DD=Mb(),jD=jw(),MD=qw(),Uw=Fw(),ZD=["/properties"],Sa="http://json-schema.org/draft-07/schema",Dn=class extends DD.default{_addVocabularies(){super._addVocabularies(),jD.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(MD.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Uw,ZD):Uw;this.addMetaSchema(e,Sa,!1),this.refs["http://json-schema.org/schema"]=Sa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sa)?Sa:void 0)}};pe.Ajv=Dn;Wd.exports=pe=Dn;Wd.exports.Ajv=Dn;Object.defineProperty(pe,"__esModule",{value:!0});pe.default=Dn;var LD=rs();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return LD.KeywordCxt}});var jn=F();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return jn._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return jn.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return jn.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return jn.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return jn.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return jn.CodeGen}});var qD=na();Object.defineProperty(pe,"ValidationError",{enumerable:!0,get:function(){return qD.default}});var FD=ns();Object.defineProperty(pe,"MissingRefError",{enumerable:!0,get:function(){return FD.default}})});var Yw=$(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.formatNames=Nt.fastFormats=Nt.fullFormats=void 0;function Rt(t,e){return{validate:t,compare:e}}Nt.fullFormats={date:Rt(Ww,Qd),time:Rt(Kd(!0),Xd),"date-time":Rt(Vw(!0),Jw),"iso-time":Rt(Kd(),Gw),"iso-date-time":Rt(Vw(),Kw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:GD,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:tj,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:JD,int32:{type:"number",validate:QD},int64:{type:"number",validate:XD},float:{type:"number",validate:Hw},double:{type:"number",validate:Hw},password:!0,binary:!0};Nt.fastFormats={...Nt.fullFormats,date:Rt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Qd),time:Rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xd),"date-time":Rt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Jw),"iso-time":Rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Gw),"iso-date-time":Rt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Kw),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Nt.formatNames=Object.keys(Nt.fullFormats);function UD(t){return t%4===0&&(t%100!==0||t%400===0)}var VD=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,BD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ww(t){let e=VD.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&UD(r)?29:BD[n])}function Qd(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Jd=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Kd(t){return function(r){let n=Jd.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let d=s-l*c,m=o-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&i<61}}function Xd(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Gw(t,e){if(!(t&&e))return;let r=Jd.exec(t),n=Jd.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var Yd=/t|\s/i;function Vw(t){let e=Kd(t);return function(n){let o=n.split(Yd);return o.length===2&&Ww(o[0])&&e(o[1])}}function Jw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Kw(t,e){if(!(t&&e))return;let[r,n]=t.split(Yd),[o,s]=e.split(Yd),i=Qd(r,o);if(i!==void 0)return i||Xd(n,s)}var HD=/\/|:/,WD=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function GD(t){return HD.test(t)&&WD.test(t)}var Bw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function JD(t){return Bw.lastIndex=0,Bw.test(t)}var KD=-(2**31),YD=2**31-1;function QD(t){return Number.isInteger(t)&&t<=YD&&t>=KD}function XD(t){return Number.isInteger(t)}function Hw(){return!0}var ej=/[^\\]\\Z/;function tj(t){if(ej.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Qw=$(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.formatLimitDefinition=void 0;var rj=Gd(),Et=F(),hr=Et.operators,$a={formatMaximum:{okStr:"<=",ok:hr.LTE,fail:hr.GT},formatMinimum:{okStr:">=",ok:hr.GTE,fail:hr.LT},formatExclusiveMaximum:{okStr:"<",ok:hr.LT,fail:hr.GTE},formatExclusiveMinimum:{okStr:">",ok:hr.GT,fail:hr.LTE}},nj={message:({keyword:t,schemaCode:e})=>(0,Et.str)`should be ${$a[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Et._)`{comparison: ${$a[t].okStr}, limit: ${e}}`};Mn.formatLimitDefinition={keyword:Object.keys($a),type:"string",schemaType:"string",$data:!0,error:nj,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new rj.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let m=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),p=e.const("fmt",(0,Et._)`${m}[${c.schemaCode}]`);t.fail$data((0,Et.or)((0,Et._)`typeof ${p} != "object"`,(0,Et._)`${p} instanceof RegExp`,(0,Et._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let m=c.schema,p=a.formats[m];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let f=e.scopeValue("formats",{key:m,ref:p,code:i.code.formats?(0,Et._)`${i.code.formats}${(0,Et.getProperty)(m)}`:void 0});t.fail$data(d(f))}function d(m){return(0,Et._)`${m}.compare(${r}, ${n}) ${$a[o].fail} 0`}},dependencies:["format"]};var oj=t=>(t.addKeyword(Mn.formatLimitDefinition),t);Mn.default=oj});var rx=$((ys,tx)=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});var Zn=Yw(),sj=Qw(),ef=F(),Xw=new ef.Name("fullFormats"),ij=new ef.Name("fastFormats"),tf=(t,e={keywords:!0})=>{if(Array.isArray(e))return ex(t,e,Zn.fullFormats,Xw),t;let[r,n]=e.mode==="fast"?[Zn.fastFormats,ij]:[Zn.fullFormats,Xw],o=e.formats||Zn.formatNames;return ex(t,o,r,n),e.keywords&&(0,sj.default)(t),t};tf.get=(t,e="full")=>{let n=(e==="fast"?Zn.fastFormats:Zn.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function ex(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,ef._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}tx.exports=ys=tf;Object.defineProperty(ys,"__esModule",{value:!0});ys.default=tf});var te;(function(t){t.assertEqual=o=>o;function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(te||(te={}));var ja;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ja||(ja={}));var z=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jt=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}},E=te.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"]),_x=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qe=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Qe.create=t=>new Qe(t);var Xn=(t,e)=>{let r;switch(t.code){case E.invalid_type:t.received===z.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,te.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(t.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(t.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(t.options)}, received '${t.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case E.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case E.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=e.defaultError,te.assertNever(t)}return{message:r}},uf=Xn;function vx(t){uf=t}function xs(){return uf}var Ss=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],i={...o,path:s},a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:o.message||a}},bx=[];function T(t,e){let r=Ss({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xs(),Xn].filter(n=>!!n)});t.common.issues.push(r)}var Ae=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return D;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r)n.push({key:await o.key,value:await o.value});return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return D;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}},D=Object.freeze({status:"aborted"}),lf=t=>({status:"dirty",value:t}),Le=t=>({status:"valid",value:t}),Ma=t=>t.status==="aborted",Za=t=>t.status==="dirty",eo=t=>t.status==="valid",$s=t=>typeof Promise<"u"&&t instanceof Promise,I;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(I||(I={}));var ot=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},af=(t,e)=>{if(eo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Qe(t.common.issues);return this._error=r,this._error}}};function j(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>i.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:o}}var M=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Jt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ae,ctx:{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if($s(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let o={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},s=this._parseSync({data:e,path:o.path,parent:o});return af(o,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await($s(o)?o:Promise.resolve(o));return af(n,s)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:E.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new Xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ht.create(this,this._def)}nullable(){return jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dt.create(this,this._def)}promise(){return Qt.create(this,this._def)}or(e){return $r.create([this,e],this._def)}and(e){return kr.create(this,e,this._def)}transform(e){return new Xe({...j(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Cr({...j(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new Ps({typeName:N.ZodBranded,type:this,...j(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new rn({...j(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return to.create(this,e)}readonly(){return on.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wx=/^c[^\s-]{8,}$/i,xx=/^[a-z][a-z0-9]*$/,Sx=/^[0-9A-HJKMNP-TV-Z]{26}$/,$x=/^[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,kx=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Da,zx=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Px=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Tx=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Cx(t,e){return!!((e==="v4"||!e)&&zx.test(t)||(e==="v6"||!e)&&Px.test(t))}var Kt=class t extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.string,received:s.parsedType}),D}let n=new Ae,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")kx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"email",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Da||(Da=new RegExp(Ex,"u")),Da.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"emoji",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")$x.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"uuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")wx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")xx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid2",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Sx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ulid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),T(o,{validation:"url",code:E.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"regex",code:E.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Tx(s).test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Cx(e.data,s.version)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ip",code:E.invalid_string,message:s.message}),n.dirty()):te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:E.invalid_string,...I.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...I.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...I.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...I.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...I.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...I.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...I.errToObj(r)})}nonempty(e){return this.min(1,I.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Kt.create=t=>{var e;return new Kt({checks:[],typeName:N.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};function Ox(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=parseInt(t.toFixed(o).replace(".","")),i=parseInt(e.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}var _r=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==z.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.number,received:s.parsedType}),D}let n,o=new Ae;for(let s of this._def.checks)s.kind==="int"?te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Ox(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_finite,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};_r.create=t=>new _r({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...j(t)});var vr=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==z.bigint){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.bigint,received:s.parsedType}),D}let n,o=new Ae;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};vr.create=t=>{var e;return new vr({checks:[],typeName:N.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};var br=class extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.boolean,received:n.parsedType}),D}return Le(e.data)}};br.create=t=>new br({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...j(t)});var wr=class t extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.date,received:s.parsedType}),D}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),D}let n=new Ae,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:I.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};wr.create=t=>new wr({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...j(t)});var Qr=class extends M{_parse(e){if(this._getType(e)!==z.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.symbol,received:n.parsedType}),D}return Le(e.data)}};Qr.create=t=>new Qr({typeName:N.ZodSymbol,...j(t)});var xr=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.undefined,received:n.parsedType}),D}return Le(e.data)}};xr.create=t=>new xr({typeName:N.ZodUndefined,...j(t)});var Sr=class extends M{_parse(e){if(this._getType(e)!==z.null){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.null,received:n.parsedType}),D}return Le(e.data)}};Sr.create=t=>new Sr({typeName:N.ZodNull,...j(t)});var Yt=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return Le(e.data)}};Yt.create=t=>new Yt({typeName:N.ZodAny,...j(t)});var At=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Le(e.data)}};At.create=t=>new At({typeName:N.ZodUnknown,...j(t)});var gt=class extends M{_parse(e){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:z.never,received:r.parsedType}),D}};gt.create=t=>new gt({typeName:N.ZodNever,...j(t)});var Xr=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.void,received:n.parsedType}),D}return Le(e.data)}};Xr.create=t=>new Xr({typeName:N.ZodVoid,...j(t)});var Dt=class t extends M{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==z.array)return T(r,{code:E.invalid_type,expected:z.array,received:r.parsedType}),D;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(i||a)&&(T(r,{code:i?E.too_big:E.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(T(r,{code:E.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(T(r,{code:E.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>o.type._parseAsync(new ot(r,i,r.path,a)))).then(i=>Ae.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new ot(r,i,r.path,a)));return Ae.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:I.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:I.toString(r)}})}nonempty(e){return this.min(1,e)}};Dt.create=(t,e)=>new Dt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...j(e)});function Yr(t){if(t instanceof He){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ht.create(Yr(n))}return new He({...t._def,shape:()=>e})}else return t instanceof Dt?new Dt({...t._def,type:Yr(t.element)}):t instanceof ht?ht.create(Yr(t.unwrap())):t instanceof jt?jt.create(Yr(t.unwrap())):t instanceof zt?zt.create(t.items.map(e=>Yr(e))):t}var He=class t extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==z.object){let u=this._getOrReturnCtx(e);return T(u,{code:E.invalid_type,expected:z.object,received:u.parsedType}),D}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof gt&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ot(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof gt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(T(o,{code:E.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ot(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key;u.push({key:d,value:await l.value,alwaysSet:l.alwaysSet})}return u}).then(u=>Ae.mergeObjectSync(n,u)):Ae.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var o,s,i,a;let c=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=I.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:N.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Yr(this)}partial(e){let r={};return te.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ht;)s=s._def.innerType;r[n]=s}}),new t({...this._def,shape:()=>r})}keyof(){return df(te.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...j(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:gt.create(),typeName:N.ZodObject,...j(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...j(e)});var $r=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Qe(a.ctx.common.issues));return T(r,{code:E.invalid_union,unionErrors:i}),D}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Qe(c));return T(r,{code:E.invalid_union,unionErrors:a}),D}}get options(){return this._def.options}};$r.create=(t,e)=>new $r({options:t,typeName:N.ZodUnion,...j(e)});var ws=t=>t instanceof Er?ws(t.schema):t instanceof Xe?ws(t.innerType()):t instanceof zr?[t.value]:t instanceof Pr?t.options:t instanceof Tr?Object.keys(t.enum):t instanceof Cr?ws(t._def.innerType):t instanceof xr?[void 0]:t instanceof Sr?[null]:null,ks=class t extends M{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.object)return T(r,{code:E.invalid_type,expected:z.object,received:r.parsedType}),D;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(T(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),D)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let i=ws(s.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...j(n)})}};function La(t,e){let r=Jt(t),n=Jt(e);if(t===e)return{valid:!0,data:t};if(r===z.object&&n===z.object){let o=te.objectKeys(e),s=te.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=La(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===z.array&&n===z.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=La(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===z.date&&n===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var kr=class extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,i)=>{if(Ma(s)||Ma(i))return D;let a=La(s.value,i.value);return a.valid?((Za(s)||Za(i))&&r.dirty(),{status:r.value,value:a.data}):(T(n,{code:E.invalid_intersection_types}),D)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};kr.create=(t,e,r)=>new kr({left:t,right:e,typeName:N.ZodIntersection,...j(r)});var zt=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.array)return T(n,{code:E.invalid_type,expected:z.array,received:n.parsedType}),D;if(n.data.length<this._def.items.length)return T(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),D;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ot(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>Ae.mergeArray(r,i)):Ae.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};zt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zt({items:t,typeName:N.ZodTuple,rest:null,...j(e)})};var Es=class t extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.object)return T(n,{code:E.invalid_type,expected:z.object,received:n.parsedType}),D;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new ot(n,a,n.path,a)),value:i._parse(new ot(n,n.data[a],n.path,a))});return n.common.async?Ae.mergeObjectAsync(r,o):Ae.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new t({keyType:e,valueType:r,typeName:N.ZodRecord,...j(n)}):new t({keyType:Kt.create(),valueType:e,typeName:N.ZodRecord,...j(r)})}},en=class extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.map)return T(n,{code:E.invalid_type,expected:z.map,received:n.parsedType}),D;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new ot(n,a,n.path,[u,"key"])),value:s._parse(new ot(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return D;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return D;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};en.create=(t,e,r)=>new en({valueType:e,keyType:t,typeName:N.ZodMap,...j(r)});var tn=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.set)return T(n,{code:E.invalid_type,expected:z.set,received:n.parsedType}),D;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(T(n,{code:E.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(T(n,{code:E.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return D;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new ot(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:I.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};tn.create=(t,e)=>new tn({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...j(e)});var zs=class t extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.function)return T(r,{code:E.invalid_type,expected:z.function,received:r.parsedType}),D;function n(a,c){return Ss({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xs(),Xn].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return Ss({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xs(),Xn].filter(u=>!!u),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Qt){let a=this;return Le(async function(...c){let u=new Qe([]),l=await a._def.args.parseAsync(c,s).catch(p=>{throw u.addIssue(n(c,p)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(p=>{throw u.addIssue(o(d,p)),u})})}else{let a=this;return Le(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Qe([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Qe([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:zt.create(e).rest(At.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||zt.create([]).rest(At.create()),returns:r||At.create(),typeName:N.ZodFunction,...j(n)})}},Er=class extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Er.create=(t,e)=>new Er({getter:t,typeName:N.ZodLazy,...j(e)});var zr=class extends M{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return T(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),D}return{status:"valid",value:e.data}}get value(){return this._def.value}};zr.create=(t,e)=>new zr({value:t,typeName:N.ZodLiteral,...j(e)});function df(t,e){return new Pr({values:t,typeName:N.ZodEnum,...j(e)})}var Pr=class t extends M{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{expected:te.joinValues(n),received:r.parsedType,code:E.invalid_type}),D}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),D}return Le(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Pr.create=df;var Tr=class extends M{_parse(e){let r=te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==z.string&&n.parsedType!==z.number){let o=te.objectValues(r);return T(n,{expected:te.joinValues(o),received:n.parsedType,code:E.invalid_type}),D}if(r.indexOf(e.data)===-1){let o=te.objectValues(r);return T(n,{received:n.data,code:E.invalid_enum_value,options:o}),D}return Le(e.data)}get enum(){return this._def.values}};Tr.create=(t,e)=>new Tr({values:t,typeName:N.ZodNativeEnum,...j(e)});var Qt=class extends M{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.promise&&r.common.async===!1)return T(r,{code:E.invalid_type,expected:z.promise,received:r.parsedType}),D;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Le(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Qt.create=(t,e)=>new Qt({type:t,typeName:N.ZodPromise,...j(e)});var Xe=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{T(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(i).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?D:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?D:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!eo(i))return i;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>eo(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):i);te.assertNever(o)}};Xe.create=(t,e,r)=>new Xe({schema:t,typeName:N.ZodEffects,effect:e,...j(r)});Xe.createWithPreprocess=(t,e,r)=>new Xe({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...j(r)});var ht=class extends M{_parse(e){return this._getType(e)===z.undefined?Le(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ht.create=(t,e)=>new ht({innerType:t,typeName:N.ZodOptional,...j(e)});var jt=class extends M{_parse(e){return this._getType(e)===z.null?Le(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jt.create=(t,e)=>new jt({innerType:t,typeName:N.ZodNullable,...j(e)});var Cr=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Cr.create=(t,e)=>new Cr({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});var rn=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return $s(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};rn.create=(t,e)=>new rn({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});var nn=class extends M{_parse(e){if(this._getType(e)!==z.nan){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.nan,received:n.parsedType}),D}return{status:"valid",value:e.data}}};nn.create=t=>new nn({typeName:N.ZodNaN,...j(t)});var Ix=Symbol("zod_brand"),Ps=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},to=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?D:s.status==="dirty"?(r.dirty(),lf(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?D:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:N.ZodPipeline})}},on=class extends M{_parse(e){let r=this._def.innerType._parse(e);return eo(r)&&(r.value=Object.freeze(r.value)),r}};on.create=(t,e)=>new on({innerType:t,typeName:N.ZodReadonly,...j(e)});var ff=(t,e={},r)=>t?Yt.create().superRefine((n,o)=>{var s,i;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:c})}}):Yt.create(),Rx={object:He.lazycreate},N;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(N||(N={}));var Nx=(t,e={message:`Input not instance of ${t.name}`})=>ff(r=>r instanceof t,e),pf=Kt.create,mf=_r.create,Ax=nn.create,Dx=vr.create,hf=br.create,jx=wr.create,Mx=Qr.create,Zx=xr.create,Lx=Sr.create,qx=Yt.create,Fx=At.create,Ux=gt.create,Vx=Xr.create,Bx=Dt.create,Hx=He.create,Wx=He.strictCreate,Gx=$r.create,Jx=ks.create,Kx=kr.create,Yx=zt.create,Qx=Es.create,Xx=en.create,e0=tn.create,t0=zs.create,r0=Er.create,n0=zr.create,o0=Pr.create,s0=Tr.create,i0=Qt.create,cf=Xe.create,a0=ht.create,c0=jt.create,u0=Xe.createWithPreprocess,l0=to.create,d0=()=>pf().optional(),f0=()=>mf().optional(),p0=()=>hf().optional(),m0={string:(t=>Kt.create({...t,coerce:!0})),number:(t=>_r.create({...t,coerce:!0})),boolean:(t=>br.create({...t,coerce:!0})),bigint:(t=>vr.create({...t,coerce:!0})),date:(t=>wr.create({...t,coerce:!0}))},h0=D,ke=Object.freeze({__proto__:null,defaultErrorMap:Xn,setErrorMap:vx,getErrorMap:xs,makeIssue:Ss,EMPTY_PATH:bx,addIssueToContext:T,ParseStatus:Ae,INVALID:D,DIRTY:lf,OK:Le,isAborted:Ma,isDirty:Za,isValid:eo,isAsync:$s,get util(){return te},get objectUtil(){return ja},ZodParsedType:z,getParsedType:Jt,ZodType:M,ZodString:Kt,ZodNumber:_r,ZodBigInt:vr,ZodBoolean:br,ZodDate:wr,ZodSymbol:Qr,ZodUndefined:xr,ZodNull:Sr,ZodAny:Yt,ZodUnknown:At,ZodNever:gt,ZodVoid:Xr,ZodArray:Dt,ZodObject:He,ZodUnion:$r,ZodDiscriminatedUnion:ks,ZodIntersection:kr,ZodTuple:zt,ZodRecord:Es,ZodMap:en,ZodSet:tn,ZodFunction:zs,ZodLazy:Er,ZodLiteral:zr,ZodEnum:Pr,ZodNativeEnum:Tr,ZodPromise:Qt,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:ht,ZodNullable:jt,ZodDefault:Cr,ZodCatch:rn,ZodNaN:nn,BRAND:Ix,ZodBranded:Ps,ZodPipeline:to,ZodReadonly:on,custom:ff,Schema:M,ZodSchema:M,late:Rx,get ZodFirstPartyTypeKind(){return N},coerce:m0,any:qx,array:Bx,bigint:Dx,boolean:hf,date:jx,discriminatedUnion:Jx,effect:cf,enum:o0,function:t0,instanceof:Nx,intersection:Kx,lazy:r0,literal:n0,map:Xx,nan:Ax,nativeEnum:s0,never:Ux,null:Lx,nullable:c0,number:mf,object:Hx,oboolean:p0,onumber:f0,optional:a0,ostring:d0,pipeline:l0,preprocess:u0,promise:i0,record:Qx,set:e0,strictObject:Wx,string:pf,symbol:Mx,transformer:cf,tuple:Yx,undefined:Zx,union:Gx,unknown:Fx,void:Vx,NEVER:h0,ZodIssueCode:E,quotelessJson:_x,ZodError:Qe});var Xt=class{static detect(e){let r=e.trim();return this.isRemoteUrl(r)?{type:new URL(r).protocol==="https:"?"https_url":"http_url",originalPath:e,normalizedPath:r}:{type:"local",originalPath:e,normalizedPath:r}}static isValidUrl(e){try{return new URL(e.trim()).protocol.length>0}catch{return!1}}static isRemoteUrl(e){try{let r=e.trim();if(!r.startsWith("http://")&&!r.startsWith("https://"))return!1;let n=new URL(r);return!(n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname||n.hostname.length===0)}catch{return!1}}};var g0=ke.object({name:ke.string().default("eui-compodoc-mcp"),version:ke.string().default("1.0.0")}),y0=ke.object({path:ke.string().refine(t=>!t||t==="__bundled__"?!0:t.trim().length>0,{message:"Documentation path cannot be only whitespace"}).refine(t=>{if(!t||t==="__bundled__")return!0;let e=t.trim();return e.startsWith("http://")||e.startsWith("https://")?Xt.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}).default("__bundled__"),watchForChanges:ke.boolean().default(!0),reloadDebounce:ke.number().min(0).default(1e3),timeout:ke.number().min(1e3).default(1e4),maxRetries:ke.number().min(0).max(10).default(3),pollingInterval:ke.number().min(5e3).default(6e4)}).default({}),_0=ke.object({maxResults:ke.number().min(1).max(1e3).default(50),minQueryLength:ke.number().min(1).default(2)}),v0=ke.object({level:ke.enum(["debug","info","warn","error"]).default("info"),format:ke.enum(["json","text"]).default("text")}),b0=ke.object({path:ke.string().optional()}).default({}),gf=ke.object({server:g0.default({}),documentation:y0,search:_0.default({}),logging:v0.default({}),accessibility:b0.default({})}),Ts={server:{name:"eui-compodoc-mcp",version:"1.0.0"},documentation:{path:"__bundled__",watchForChanges:!0,reloadDebounce:1e3,timeout:1e4,maxRetries:3,pollingInterval:6e4},search:{maxResults:50,minQueryLength:2},logging:{level:"info",format:"text"}};function qa(t){return gf.safeParse(t)}var sn=mt(require("fs")),ro=mt(require("path"));function w0(){let t=ro.join(__dirname,"documentation.json.gz");if(sn.existsSync(t))return t;let e=ro.join(__dirname,"documentation.json");return sn.existsSync(e)?e:Ts.documentation.path}function yf(){let t={};return process.env.COMPODOC_MCP_DOC_PATH&&(t.documentation={path:process.env.COMPODOC_MCP_DOC_PATH}),process.env.COMPODOC_MCP_LOG_LEVEL&&(t.logging={level:process.env.COMPODOC_MCP_LOG_LEVEL}),process.env.COMPODOC_MCP_WATCH!==void 0&&(t.documentation||(t.documentation={path:""}),t.documentation.watchForChanges=process.env.COMPODOC_MCP_WATCH==="true"),process.env.COMPODOC_MCP_A11Y_PATH&&(t.accessibility={path:process.env.COMPODOC_MCP_A11Y_PATH}),t}function _f(t){let e={};for(let r=0;r<t.length;r++)switch(t[r]){case"--doc-path":case"--documentation-path":e.documentation||(e.documentation={path:""}),e.documentation.path=t[++r];break;case"--watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!0;break;case"--no-watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!1;break;case"--log-level":e.logging={level:t[++r]};break;case"--max-results":e.search={maxResults:parseInt(t[++r],10)};break;case"--a11y-path":e.accessibility||(e.accessibility={}),e.accessibility.path=t[++r];break;case"--help":case"-h":S0(),process.exit(0);break}return e}function vf(t){try{if(!sn.existsSync(t))return process.stderr.write(`Configuration file not found: ${t}
32
+ `),{};let e=sn.readFileSync(t,"utf-8"),r=ro.extname(t).toLowerCase();return r===".json"?JSON.parse(e):(process.stderr.write(`Unsupported configuration file format: ${r}
33
33
  `),{})}catch(e){let r=e instanceof Error?e.message:"Unknown error occurred";return process.stderr.write(`Failed to load config file ${t}: ${r}
34
- `),{}}}function Es(t,e){let r={...t};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n],s=r[n];o&&typeof o=="object"&&!Array.isArray(o)&&s&&typeof s=="object"&&!Array.isArray(s)?r[n]=Es(s,o):o!==void 0&&(r[n]=o)}return r}function qa(t=process.argv.slice(2)){try{let e=t.indexOf("--config"),r=e>=0?t[e+1]:void 0,n=r?vf(r):{},o=yf(),s=_f(t),i={...Za};i=Es(i,n),i=Es(i,o),i=Es(i,s);let a=La(i);if(!a.success){let c=b0(a.error);return process.stderr.write(`Configuration validation failed:
34
+ `),{}}}function Cs(t,e){let r={...t};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n],s=r[n];o&&typeof o=="object"&&!Array.isArray(o)&&s&&typeof s=="object"&&!Array.isArray(s)?r[n]=Cs(s,o):o!==void 0&&(r[n]=o)}return r}function Fa(t=process.argv.slice(2)){try{let e=t.indexOf("--config"),r=e>=0?t[e+1]:void 0,n=r?vf(r):{},o=yf(),s=_f(t),i={...Ts};i=Cs(i,n),i=Cs(i,o),i=Cs(i,s);let a=qa(i);if(!a.success){let c=x0(a.error);return process.stderr.write(`Configuration validation failed:
35
35
  `),c.forEach(u=>process.stderr.write(` - ${u}
36
- `)),{success:!1,errors:c}}return{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function b0(t){return t.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function w0(){process.stderr.write(`
36
+ `)),{success:!1,errors:c}}return a.data.documentation.path==="__bundled__"&&(a.data.documentation.path=w0()),{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function x0(t){return t.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function S0(){process.stderr.write(`
37
37
  EUI Compodoc MCP Server - Model Context Protocol server for Angular component documentation
38
38
 
39
39
  Usage:
@@ -86,9 +86,9 @@ Examples:
86
86
  COMPODOC_MCP_DOC_PATH=./documentation.json eui-compodoc-mcp
87
87
 
88
88
  For more information, visit: https://github.com/your-org/eui-compodoc-mcp
89
- `)}var ni=mt(require("fs")),Ym=mt(require("path"));var Af=require("node:events"),Df=require("node:fs"),As=require("node:fs/promises"),H=mt(require("node:path"),1);var Mt=require("node:fs/promises"),Zt=require("node:path"),Sf=require("node:stream"),et={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Fa={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:et.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Fa);var $f="READDIRP_RECURSIVE_ERROR",x0=new Set(["ENOENT","EPERM","EACCES","ELOOP",$f]),bf=[et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE],S0=new Set([et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE]),$0=new Set([et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE]),k0=t=>x0.has(t.code),E0=process.platform==="win32",wf=t=>!0,xf=t=>{if(t===void 0)return wf;if(typeof t=="function")return t;if(typeof t=="string"){let e=t.trim();return r=>r.basename===e}if(Array.isArray(t)){let e=t.map(r=>r.trim());return r=>e.some(n=>r.basename===n)}return wf},Ua=class extends Sf.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let r={...Fa,...e},{root:n,type:o}=r;this._fileFilter=xf(r.fileFilter),this._directoryFilter=xf(r.directoryFilter);let s=r.lstat?Mt.lstat:Mt.stat;E0?this._stat=i=>s(i,{bigint:!0}):this._stat=s,this._maxDepth=r.depth!=null&&Number.isSafeInteger(r.depth)?r.depth:Fa.depth,this._wantsDir=o?S0.has(o):!1,this._wantsFile=o?$0.has(o):!1,this._wantsEverything=o===et.EVERYTHING_TYPE,this._root=(0,Zt.resolve)(n),this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let r=this.parent,n=r&&r.files;if(n&&n.length>0){let{path:o,depth:s}=r,i=n.splice(0,e).map(c=>this._formatEntry(c,o)),a=await Promise.all(i);for(let c of a){if(!c)continue;if(this.destroyed)return;let u=await this._getEntryType(c);u==="directory"&&this._directoryFilter(c)?(s<=this._maxDepth&&this.parents.push(this._exploreDir(c.fullPath,s+1)),this._wantsDir&&(this.push(c),e--)):(u==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await(0,Mt.readdir)(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:r,path:e}}async _formatEntry(e,r){let n,o=this._isDirent?e.name:e;try{let s=(0,Zt.resolve)((0,Zt.join)(r,o));n={path:(0,Zt.relative)(this._root,s),fullPath:s,basename:o},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(s){this._onError(s);return}return n}_onError(e){k0(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let r=e[this._statsProp];if(r.isFile())return"file";if(r.isDirectory())return"directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let o=await(0,Mt.realpath)(n),s=await(0,Mt.lstat)(o);if(s.isFile())return"file";if(s.isDirectory()){let i=o.length;if(n.startsWith(o)&&n.substr(i,1)===Zt.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${o}"`);return a.code=$f,this._onError(a)}return"directory"}}catch(o){return this._onError(o),""}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function kf(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=et.FILE_DIR_TYPE),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!bf.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${bf.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Ua(e)}var Ir=require("node:fs"),_t=require("node:fs/promises"),zf=require("node:os"),he=mt(require("node:path"),1),z0="data",Ha="end",Pf="close",Is=()=>{};var Rs=process.platform,Wa=Rs==="win32",P0=Rs==="darwin",T0=Rs==="linux",C0=Rs==="freebsd",Tf=(0,zf.type)()==="OS400",be={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},yt=be,O0="watch",I0={lstat:_t.lstat,stat:_t.stat},Or="listeners",Ps="errHandlers",sn="rawEmitters",R0=[Or,Ps,sn],N0=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),A0=t=>N0.has(he.extname(t).slice(1).toLowerCase()),Ba=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},to=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},D0=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},ro=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},Cf=t=>t instanceof Set?t.size===0:!t,Ts=new Map;function Ef(t,e,r,n,o){let s=(i,a)=>{r(t),o(i,a,{watchedPath:t}),a&&t!==a&&Cs(he.resolve(t,a),Or,he.join(t,a))};try{return(0,Ir.watch)(t,{persistent:e.persistent},s)}catch(i){n(i);return}}var Cs=(t,e,r,n,o)=>{let s=Ts.get(t);s&&Ba(s[e],i=>{i(r,n,o)})},j0=(t,e,r,n)=>{let{listener:o,errHandler:s,rawEmitter:i}=n,a=Ts.get(e),c;if(!r.persistent)return c=Ef(t,r,o,s,i),c?c.close.bind(c):void 0;if(a)to(a,Or,o),to(a,Ps,s),to(a,sn,i);else{if(c=Ef(t,r,Cs.bind(null,e,Or),s,Cs.bind(null,e,sn)),!c)return;c.on(yt.ERROR,async u=>{let l=Cs.bind(null,e,Ps);if(a&&(a.watcherUnusable=!0),Wa&&u.code==="EPERM")try{await(await(0,_t.open)(t,"r")).close(),l(u)}catch{}else l(u)}),a={listeners:o,errHandlers:s,rawEmitters:i,watcher:c},Ts.set(e,a)}return()=>{ro(a,Or,o),ro(a,Ps,s),ro(a,sn,i),Cf(a.listeners)&&(a.watcher.close(),Ts.delete(e),R0.forEach(D0(a)),a.watcher=void 0,Object.freeze(a))}},Va=new Map,M0=(t,e,r,n)=>{let{listener:o,rawEmitter:s}=n,i=Va.get(e),a=i&&i.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&((0,Ir.unwatchFile)(e),i=void 0),i?(to(i,Or,o),to(i,sn,s)):(i={listeners:o,rawEmitters:s,options:r,watcher:(0,Ir.watchFile)(e,r,(c,u)=>{Ba(i.rawEmitters,d=>{d(yt.CHANGE,e,{curr:c,prev:u})});let l=c.mtimeMs;(c.size!==u.size||l>u.mtimeMs||l===0)&&Ba(i.listeners,d=>d(t,c))})},Va.set(e,i)),()=>{ro(i,Or,o),ro(i,sn,s),Cf(i.listeners)&&(Va.delete(e),(0,Ir.unwatchFile)(e),i.options=i.watcher=void 0,Object.freeze(i))}},Os=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let n=this.fsw.options,o=he.dirname(e),s=he.basename(e);this.fsw._getWatchedDir(o).add(s);let a=he.resolve(e),c={persistent:n.persistent};r||(r=Is);let u;if(n.usePolling){let l=n.interval!==n.binaryInterval;c.interval=l&&A0(s)?n.binaryInterval:n.interval,u=M0(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})}else u=j0(e,a,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return u}_handleFile(e,r,n){if(this.fsw.closed)return;let o=he.dirname(e),s=he.basename(e),i=this.fsw._getWatchedDir(o),a=r;if(i.has(s))return;let c=async(l,d)=>{if(this.fsw._throttle(O0,e,5)){if(!d||d.mtimeMs===0)try{let m=await(0,_t.stat)(e);if(this.fsw.closed)return;let p=m.atimeMs,f=m.mtimeMs;if((!p||p<=f||f!==a.mtimeMs)&&this.fsw._emit(yt.CHANGE,e,m),(P0||T0||C0)&&a.ino!==m.ino){this.fsw._closeFile(l),a=m;let h=this._watchWithNodeFs(e,c);h&&this.fsw._addPathCloser(l,h)}else a=m}catch{this.fsw._remove(o,s)}else if(i.has(s)){let m=d.atimeMs,p=d.mtimeMs;(!m||m<=p||p!==a.mtimeMs)&&this.fsw._emit(yt.CHANGE,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(yt.ADD,e,0))return;this.fsw._emit(yt.ADD,e,r)}return u}async _handleSymlink(e,r,n,o){if(this.fsw.closed)return;let s=e.fullPath,i=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await(0,_t.realpath)(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(o)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(yt.CHANGE,n,e.stats)):(i.add(o),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(yt.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,r,n,o,s,i,a){e=he.join(e,"");let c=o?`${e}:${o}`:e;if(a=this.fsw._throttle("readdir",c,1e3),!a)return;let u=this.fsw._getWatchedDir(n.path),l=new Set,d=this.fsw._readdirp(e,{fileFilter:m=>n.filterPath(m),directoryFilter:m=>n.filterDir(m)});if(d)return d.on(z0,async m=>{if(this.fsw.closed){d=void 0;return}let p=m.path,f=he.join(e,p);if(l.add(p),!(m.stats.isSymbolicLink()&&await this._handleSymlink(m,e,f,p))){if(this.fsw.closed){d=void 0;return}(p===o||!o&&!u.has(p))&&(this.fsw._incrReadyCount(),f=he.join(s,he.relative(s,f)),this._addToNodeFs(f,r,n,i+1))}}).on(yt.ERROR,this._boundHandleError),new Promise((m,p)=>{if(!d)return p();d.once(Ha,()=>{if(this.fsw.closed){d=void 0;return}let f=a?a.clear():!1;m(void 0),u.getChildren().filter(h=>h!==e&&!l.has(h)).forEach(h=>{this.fsw._remove(e,h)}),d=void 0,f&&this._handleRead(e,!1,n,o,s,i,a)})})}async _handleDir(e,r,n,o,s,i,a){let c=this.fsw._getWatchedDir(he.dirname(e)),u=c.has(he.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&this.fsw._emit(yt.ADD_DIR,e,r),c.add(he.basename(e)),this.fsw._getWatchedDir(e);let l,d,m=this.fsw.options.depth;if((m==null||o<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,i,s,e,o,l),this.fsw.closed))return;d=this._watchWithNodeFs(e,(p,f)=>{f&&f.mtimeMs===0||this._handleRead(p,!1,i,s,e,o,l)})}return d}async _addToNodeFs(e,r,n,o,s){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e);n&&(a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await I0[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks,l;if(c.isDirectory()){let d=he.resolve(e),m=u?await(0,_t.realpath)(e):e;if(this.fsw.closed||(l=await this._handleDir(a.watchPath,c,r,o,s,a,m),this.fsw.closed))return;d!==m&&m!==void 0&&this.fsw._symlinkPaths.set(d,m)}else if(c.isSymbolicLink()){let d=u?await(0,_t.realpath)(e):e;if(this.fsw.closed)return;let m=he.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(yt.ADD,a.watchPath,c),l=await this._handleDir(m,c,r,o,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(he.resolve(e),d)}else l=this._handleFile(a.watchPath,c,r);return i(),l&&this.fsw._addPathCloser(e,l),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};var Ga="/",Z0="//",jf=".",L0="..",q0="string",F0=/\\/g,Mf=/\/\//g,U0=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,V0=/^\.[/\\]/;function Ns(t){return Array.isArray(t)?t:[t]}var Ja=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function B0(t){return typeof t=="function"?t:typeof t=="string"?e=>t===e:t instanceof RegExp?e=>t.test(e):typeof t=="object"&&t!==null?e=>{if(t.path===e)return!0;if(t.recursive){let r=H.relative(t.path,e);return r?!r.startsWith("..")&&!H.isAbsolute(r):!1}return!1}:()=>!1}function H0(t){if(typeof t!="string")throw new Error("string expected");t=H.normalize(t),t=t.replace(/\\/g,"/");let e=!1;return t.startsWith("//")&&(e=!0),t=t.replace(Mf,"/"),e&&(t="/"+t),t}function Of(t,e,r){let n=H0(e);for(let o=0;o<t.length;o++){let s=t[o];if(s(n,r))return!0}return!1}function W0(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=Ns(t).map(o=>B0(o));return e==null?(o,s)=>Of(n,o,s):Of(n,e)}var If=t=>{let e=Ns(t).flat();if(!e.every(r=>typeof r===q0))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Zf)},Rf=t=>{let e=t.replace(F0,Ga),r=!1;return e.startsWith(Z0)&&(r=!0),e=e.replace(Mf,Ga),r&&(e=Ga+e),e},Zf=t=>Rf(H.normalize(Rf(t))),Nf=(t="")=>e=>typeof e=="string"?Zf(H.isAbsolute(e)?e:H.join(t,e)):e,G0=(t,e)=>H.isAbsolute(t)?t:H.join(e,t),J0=Object.freeze(new Set),Ka=class{path;_removeWatcher;items;constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set}add(e){let{items:r}=this;r&&e!==jf&&e!==L0&&r.add(e)}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await(0,As.readdir)(n)}catch{this._removeWatcher&&this._removeWatcher(H.dirname(n),H.basename(n))}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=Is,this.items=J0,Object.freeze(this)}},K0="stat",Y0="lstat",Ya=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,r,n){this.fsw=n;let o=e;this.path=e=e.replace(V0,""),this.watchPath=o,this.fullWatchPath=H.resolve(o),this.dirParts=[],this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?K0:Y0}entryPath(e){return H.join(this.watchPath,H.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Qa=class extends Af.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let r=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},o={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?Ns(e.ignored):Ns([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};Tf&&(o.usePolling=!0),o.atomic===void 0&&(o.atomic=!o.usePolling);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?o.usePolling=!1:c==="true"||c==="1"?o.usePolling=!0:o.usePolling=!!c}let i=process.env.CHOKIDAR_INTERVAL;i&&(o.interval=Number.parseInt(i,10));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=Is,this._readyEmitted=!0,process.nextTick(()=>this.emit(be.READY)))},this._emitRaw=(...c)=>this.emit(be.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=o,this._nodeFsHandler=new Os(this),Object.freeze(o)}_addIgnoredPath(e){if(Ja(e)){for(let r of this._ignoredPaths)if(Ja(r)&&r.path===e.path&&r.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let r of this._ignoredPaths)Ja(r)&&r.path===e&&this._ignoredPaths.delete(r)}add(e,r,n){let{cwd:o}=this.options;this.closed=!1,this._closePromise=void 0;let s=If(e);return o&&(s=s.map(i=>G0(i,o))),s.forEach(i=>{this._removeIgnoredPath(i)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async i=>{let a=await this._nodeFsHandler._addToNodeFs(i,!n,void 0,0,r);return a&&this._emitReady(),a})).then(i=>{this.closed||i.forEach(a=>{a&&this.add(H.dirname(a),H.basename(r||a))})}),this}unwatch(e){if(this.closed)return this;let r=If(e),{cwd:n}=this.options;return r.forEach(o=>{!H.isAbsolute(o)&&!this._closers.has(o)&&(n&&(o=H.join(n,o)),o=H.resolve(o)),this._closePath(o),this._addIgnoredPath(o),this._watched.has(o)&&this._addIgnoredPath({path:o,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let o=n();o instanceof Promise&&e.push(o)})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=(this.options.cwd?H.relative(this.options.cwd,n):n)||jf;e[s]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(e,...r),e!==be.ERROR&&this.emit(be.ALL,e,...r)}async _emit(e,r,n){if(this.closed)return;let o=this.options;Wa&&(r=H.normalize(r)),o.cwd&&(r=H.relative(o.cwd,r));let s=[r];n!=null&&s.push(n);let i=o.awaitWriteFinish,a;if(i&&(a=this._pendingWrites.get(r)))return a.lastChange=new Date,this;if(o.atomic){if(e===be.UNLINK)return this._pendingUnlinks.set(r,[e,...s]),setTimeout(()=>{this._pendingUnlinks.forEach((c,u)=>{this.emit(...c),this.emit(be.ALL,...c),this._pendingUnlinks.delete(u)})},typeof o.atomic=="number"?o.atomic:100),this;e===be.ADD&&this._pendingUnlinks.has(r)&&(e=be.CHANGE,this._pendingUnlinks.delete(r))}if(i&&(e===be.ADD||e===be.CHANGE)&&this._readyEmitted){let c=(u,l)=>{u?(e=be.ERROR,s[0]=u,this.emitWithAll(e,s)):l&&(s.length>1?s[1]=l:s.push(l),this.emitWithAll(e,s))};return this._awaitWriteFinish(r,i.stabilityThreshold,e,c),this}if(e===be.CHANGE&&!this._throttle(be.CHANGE,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===be.ADD||e===be.ADD_DIR||e===be.CHANGE)){let c=o.cwd?H.join(o.cwd,r):r,u;try{u=await(0,As.stat)(c)}catch{}if(!u||this.closed)return;s.push(u)}return this.emitWithAll(e,s),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(be.ERROR,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let o=this._throttled.get(e);if(!o)throw new Error("invalid throttle");let s=o.get(r);if(s)return s.count++,!1;let i,a=()=>{let u=o.get(r),l=u?u.count:0;return o.delete(r),clearTimeout(i),u&&clearTimeout(u.timeoutObject),l};i=setTimeout(a,n);let c={timeoutObject:i,clear:a,count:0};return o.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,o){let s=this.options.awaitWriteFinish;if(typeof s!="object")return;let i=s.pollInterval,a,c=e;this.options.cwd&&!H.isAbsolute(e)&&(c=H.join(this.options.cwd,e));let u=new Date,l=this._pendingWrites;function d(m){(0,Df.stat)(c,(p,f)=>{if(p||!l.has(e)){p&&p.code!=="ENOENT"&&o(p);return}let h=Number(new Date);m&&f.size!==m.size&&(l.get(e).lastChange=h);let g=l.get(e);h-g.lastChange>=r?(l.delete(e),o(void 0,f)):a=setTimeout(d,i,f)})}l.has(e)||(l.set(e,{lastChange:u,cancelWait:()=>(l.delete(e),clearTimeout(a),n)}),a=setTimeout(d,i))}_isIgnored(e,r){if(this.options.atomic&&U0.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=(this.options.ignored||[]).map(Nf(n)),a=[...[...this._ignoredPaths].map(Nf(n)),...s];this._userIgnored=W0(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new Ya(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=H.resolve(e);return this._watched.has(r)||this._watched.set(r,new Ka(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,r,n){let o=H.join(e,r),s=H.resolve(o);if(n=n??(this._watched.has(o)||this._watched.has(s)),!this._throttle("remove",o,100))return;!n&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(o).getChildren().forEach(m=>this._remove(o,m));let c=this._getWatchedDir(e),u=c.has(r);c.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let l=o;if(this.options.cwd&&(l=H.relative(this.options.cwd,o)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===be.ADD)return;this._watched.delete(o),this._watched.delete(s);let d=n?be.UNLINK_DIR:be.UNLINK;u&&!this._isIgnored(o)&&this._emit(d,o),this._closePath(o)}_closePath(e){this._closeFile(e);let r=H.dirname(e);this._getWatchedDir(r).remove(H.basename(e))}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r)}_readdirp(e,r){if(this.closed)return;let n={type:be.ALL,alwaysStat:!0,lstat:!0,...r,depth:0},o=kf(e,n);return this._streams.add(o),o.once(Pf,()=>{o=void 0}),o.once(Ha,()=>{o&&(this._streams.delete(o),o=void 0)}),o}};function Lf(t,e={}){let r=new Qa(e);return r.add(t),r}var Hc=mt(Km()),co=class t{pino;context;constructor(e){this.context=e.context,this.pino=(0,Hc.default)({level:e.level},Hc.default.destination({dest:2,sync:!0}))}child(e){let r=new t({level:this.pino.level,format:"json",context:this.context?`${this.context}:${e}`:e});return r.pino=this.pino.child({context:e}),r}setLevel(e){this.pino.level=e}debug(e,r){this.pino.debug(r||{},e)}info(e,r){this.pino.info(r||{},e)}warn(e,r){this.pino.warn(r||{},e)}error(e,r,n){let o=n&&typeof n=="object"?n:{};this.pino.error({err:r,...o},e)}},ao=null;function Wc(t){return ao=new co(t),ao}function ne(){return ao||(ao=new co({level:"info",format:"text"})),ao}var Rz={failureThreshold:5,successThreshold:2,timeout:1e4,resetTimeout:6e4},ei=class{state="CLOSED";failureCount=0;successCount=0;nextAttempt=Date.now();options;name;constructor(e,r={}){this.name=e,this.options={...Rz,...r}}getState(){return this.state}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,nextAttempt:this.nextAttempt}}async execute(e){let r=ne();if(this.state==="OPEN"){if(Date.now()<this.nextAttempt){let n=new Error(`Circuit breaker '${this.name}' is OPEN. Next attempt at ${new Date(this.nextAttempt).toISOString()}`);throw r.warn("Circuit breaker is open",{name:this.name,nextAttempt:this.nextAttempt}),n}this.state="HALF_OPEN",this.successCount=0,r.info("Circuit breaker transitioning to HALF_OPEN",{name:this.name})}try{let n=await this.executeWithTimeout(e);return this.onSuccess(),n}catch(n){throw this.onFailure(),n}}async executeWithTimeout(e){return Promise.race([e(),new Promise((r,n)=>setTimeout(()=>n(new Error(`Operation timed out after ${this.options.timeout}ms`)),this.options.timeout))])}onSuccess(){let e=ne();this.failureCount=0,this.state==="HALF_OPEN"&&(this.successCount++,e.debug("Circuit breaker success in HALF_OPEN",{name:this.name,successCount:this.successCount,threshold:this.options.successThreshold}),this.successCount>=this.options.successThreshold&&(this.state="CLOSED",this.successCount=0,e.info("Circuit breaker closed",{name:this.name})))}onFailure(){let e=ne();this.failureCount++,e.debug("Circuit breaker failure",{name:this.name,failureCount:this.failureCount,threshold:this.options.failureThreshold,state:this.state}),(this.state==="HALF_OPEN"||this.failureCount>=this.options.failureThreshold)&&(this.state="OPEN",this.nextAttempt=Date.now()+this.options.resetTimeout,e.warn("Circuit breaker opened",{name:this.name,failureCount:this.failureCount,nextAttempt:this.nextAttempt}))}reset(){let e=ne();this.state="CLOSED",this.failureCount=0,this.successCount=0,this.nextAttempt=Date.now(),e.info("Circuit breaker manually reset",{name:this.name})}},ti=class{breakers=new Map;get(e,r){return this.breakers.has(e)||this.breakers.set(e,new ei(e,r)),this.breakers.get(e)}getAll(){return new Map(this.breakers)}resetAll(){this.breakers.forEach(e=>{e.reset()})}getAllStats(){let e={};return this.breakers.forEach((r,n)=>{e[n]=r.getStats()}),e}},Nz=new ti;var ri=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=Ym.resolve(e.path),this.watchForChanges=e.watchForChanges,this.reloadDebounce=e.reloadDebounce,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError}async load(){try{if(!ni.existsSync(this.filePath))return{success:!1,error:`Documentation file not found: ${this.filePath}`};let e=await ni.promises.readFile(this.filePath,"utf-8"),r;try{r=JSON.parse(e)}catch(o){return{success:!1,error:`Failed to parse JSON: ${o instanceof Error?o.message:String(o)}`}}let n=this.validateStructure(r);return n?{success:!1,error:n}:(this.currentData=r,this.watchForChanges&&!this.watcher&&this.startMonitoring(),{success:!0,data:r})}catch(e){return{success:!1,error:`Failed to load documentation: ${e instanceof Error?e.message:String(e)}`}}}startMonitoring(){!this.watchForChanges||this.watcher||this.startWatching()}async stopMonitoring(){this.reloadTimer&&(clearTimeout(this.reloadTimer),this.reloadTimer=void 0),this.watcher&&(await this.watcher.close(),this.watcher=void 0,ne().info("Stopped watching documentation file"))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}startWatching(){this.watcher||(this.watcher=Lf(this.filePath,{persistent:!0,ignoreInitial:!0}),this.watcher.on("change",()=>{this.scheduleReload()}),this.watcher.on("error",e=>{let r=e instanceof Error?e:new Error(String(e));ne().error("File watcher error",r),this.onErrorCallback&&this.onErrorCallback(r)}),ne().info(`Watching for changes: ${this.filePath}`))}scheduleReload(){this.reloadTimer&&clearTimeout(this.reloadTimer),this.reloadTimer=setTimeout(()=>{this.reload()},this.reloadDebounce)}async reload(){ne().info("Reloading documentation...");let e=await this.load();e.success&&e.data?(ne().info("Documentation reloaded successfully"),this.onReloadCallback&&this.onReloadCallback(e.data)):(ne().error("Failed to reload documentation",new Error(e.error)),this.onErrorCallback&&this.onErrorCallback(new Error(e.error)))}};var ln=class{options;constructor(e){this.options=e}async fetch(e,r){let n;for(let o=0;o<=this.options.maxRetries;o++)try{let s=await this.fetchOnce(e,r);if(!this.isRetryableError(void 0,s.status)||o>=this.options.maxRetries)return s;let i=this.calculateBackoff(o);await this.sleep(i)}catch(s){if(n=s instanceof Error?s:new Error(String(s)),o<this.options.maxRetries&&this.isRetryableError(n)){let i=this.calculateBackoff(o);await this.sleep(i);continue}throw n}throw n||new Error("Unknown error during fetch")}async fetchOnce(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeout);try{let s={Accept:"application/json","User-Agent":this.options.userAgent||"DocumentationLoader/1.0"};r&&r.forEach((u,l)=>{s[l]=u});let i=await fetch(e,{signal:n.signal,headers:s});clearTimeout(o);let a=new Map;i.headers.forEach((u,l)=>{a.set(l,u)});let c=await i.text();return{status:i.status,statusText:i.statusText,data:c,headers:a}}catch(s){throw clearTimeout(o),s instanceof Error&&s.name==="AbortError"?new Error(`Request timeout after ${this.options.timeout}ms`):s}}isRetryableError(e,r){if(r!==void 0){if(r>=200&&r<400)return!1;if(r>=500||r===408||r===429)return!0;if(r>=400&&r<500)return!1}if(e){let n=e.message.toLowerCase();if(n.includes("timeout")||n.includes("network")||n.includes("econnrefused")||n.includes("enotfound")||n.includes("econnreset"))return!0}return!0}calculateBackoff(e){return this.options.retryDelay*Math.pow(2,e)}sleep(e){return new Promise(r=>setTimeout(r,e))}};var oi=class{cache;constructor(){this.cache=new Map}set(e,r,n){let o={data:r,timestamp:Date.now()},s=this.getHeaderCaseInsensitive(n,"etag");s&&(o.etag=s);let i=this.getHeaderCaseInsensitive(n,"last-modified");i&&(o.lastModified=i),this.cache.set(e,o)}get(e){return this.cache.get(e)}getConditionalHeaders(e){let r=new Map,n=this.cache.get(e);return n&&(n.etag&&r.set("If-None-Match",n.etag),n.lastModified&&r.set("If-Modified-Since",n.lastModified)),r}clear(e){this.cache.delete(e)}clearAll(){this.cache.clear()}getHeaderCaseInsensitive(e,r){let n=r.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===n)return s}};var Gc=class t extends Error{constructor(r,n,o){super(r);this.url=n;this.cause=o;this.name="NetworkError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}url;cause};var uo=class t extends Gc{constructor(r,n,o,s){super(r,n);this.statusCode=o;this.statusText=s;this.name="HttpError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}statusCode;statusText},lo=class t extends Error{constructor(r,n){super(r);this.content=n;this.name="ParseError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}content};var si=class{url;httpClient;cacheManager;pollingTimer;currentData;pollingInterval;onReloadCallback;onErrorCallback;constructor(e){this.url=e.url,this.pollingInterval=e.pollingInterval,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError;let r={timeout:e.timeout,maxRetries:e.maxRetries,retryDelay:1e3,userAgent:"DocumentationLoader/1.0"};this.httpClient=new ln(r),this.cacheManager=new oi}async load(){return this.fetchDocumentation()}startMonitoring(){this.pollingTimer||(this.pollingTimer=setInterval(()=>{this.poll()},this.pollingInterval),ne().info(`Started polling ${this.url} every ${this.pollingInterval}ms`))}async stopMonitoring(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=void 0,ne().info(`Stopped polling ${this.url}`))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.cacheManager.clear(this.url),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}async poll(){try{ne().debug(`Polling ${this.url} for updates...`);let e=this.cacheManager.getConditionalHeaders(this.url),r=await this.httpClient.fetch(this.url,e);if(r.status===304){ne().debug("No changes detected (304 Not Modified)");return}if(r.status===200){let n=this.parseJson(r.data),o=this.validateStructure(n);if(o)throw new lo(o,r.data);this.cacheManager.set(this.url,n,r.headers),this.currentData=n,ne().info(`Documentation updated from ${this.url}`),this.onReloadCallback&&this.onReloadCallback(n);return}throw new uo(`HTTP ${r.status}: ${r.statusText}`,this.url,r.status,r.statusText)}catch(e){let r=e instanceof Error?e.message:String(e);ne().error(`Polling error for ${this.url}`,e instanceof Error?e:new Error(r)),this.onErrorCallback&&this.onErrorCallback(e instanceof Error?e:new Error(r))}}async fetchDocumentation(){try{let e=this.cacheManager.get(this.url),r=e?this.cacheManager.getConditionalHeaders(this.url):void 0,n=await this.httpClient.fetch(this.url,r);if(n.status===304&&e)return ne().debug("Using cached documentation (304 Not Modified)"),this.currentData=e.data,{success:!0,data:e.data};if(n.status!==200)return{success:!1,error:`${new uo(`HTTP ${n.status}: ${n.statusText}`,this.url,n.status,n.statusText).message} (URL: ${this.url})`};let o=this.parseJson(n.data),s=this.validateStructure(o);return s?{success:!1,error:s}:(this.cacheManager.set(this.url,o,n.headers),this.currentData=o,{success:!0,data:o})}catch(e){let r=e instanceof Error?e.message:String(e);return{success:!1,error:`Failed to fetch documentation from ${this.url}: ${r}`}}}parseJson(e){try{return JSON.parse(e)}catch(r){let n=r instanceof Error?r.message:String(r);throw new lo(`Failed to parse JSON: ${n}`,e)}}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}};var fo=class{source;constructor(e){this.source=this.createSource(e)}async load(){let e=await this.source.load();return e.success&&this.source.startMonitoring(),e}getCurrentData(){return this.source.getCurrentData()}async stopWatching(){await this.source.stopMonitoring()}async dispose(){await this.source.dispose()}createSource(e){let r=Xt.detect(e.path);return r.type==="local"?new ri({path:r.normalizedPath,watchForChanges:e.watchForChanges??!0,reloadDebounce:e.reloadDebounce??1e3,onReload:e.onReload,onError:e.onError}):new si({url:r.normalizedPath,timeout:e.timeout??1e4,maxRetries:e.maxRetries??3,pollingInterval:e.pollingInterval??6e4,onReload:e.onReload,onError:e.onError})}};var po=class{build(e){let r={byName:new Map,bySelector:new Map,searchIndex:new Map,components:[],directives:[],pipes:[],services:[],lastUpdated:new Date,totalCount:0},n=new Map;if(e.components)for(let o of e.components){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and component. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"component"),this.indexComponent(o,r)}if(e.directives)for(let o of e.directives){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and directive. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"directive"),this.indexDirective(o,r)}if(e.pipes)for(let o of e.pipes){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and pipe. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"pipe"),this.indexPipe(o,r)}if(e.injectables)for(let o of e.injectables){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and injectable. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"injectable"),this.indexInjectable(o,r)}return r.totalCount=r.components.length+r.directives.length+r.pipes.length+r.services.length,r}indexComponent(e,r){r.components.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexDirective(e,r){r.directives.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexPipe(e,r){r.pipes.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}indexInjectable(e,r){r.services.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}addToSearchIndex(e,r){let n=new Set;if(this.extractWords(e.name,n),"selector"in e&&e.selector&&this.extractWords(e.selector,n),e.description&&this.extractWords(e.description,n),"inputs"in e&&e.inputs)for(let o of e.inputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("outputs"in e&&e.outputs)for(let o of e.outputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("methods"in e&&e.methods)for(let o of e.methods)this.extractWords(o.name,n);for(let o of n)r.searchIndex.has(o)||r.searchIndex.set(o,new Set),r.searchIndex.get(o).add(e.name)}extractWords(e,r){let n=e.toLowerCase(),o=n.split(/[^a-z0-9]+/).filter(s=>s.length>0);for(let s of o)r.add(s);o.length===0&&e.trim().length>0&&r.add(n.trim())}getStatistics(e){return{totalCount:e.totalCount,componentCount:e.components.length,directiveCount:e.directives.length,pipeCount:e.pipes.length,serviceCount:e.services.length,lastUpdated:e.lastUpdated}}rebuild(e,r){return this.build(e)}};var Qm;function v(t,e,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let m=l[d];m in a||(a[m]=u[m].bind(a))}}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}var Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},dn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Qm=globalThis).__zod_globalConfig??(Qm.__zod_globalConfig={});var fn=globalThis.__zod_globalConfig;function tt(t){return t&&Object.assign(fn,t),fn}var Y={};of(Y,{BIGINT_FORMAT_RANGES:()=>rh,Class:()=>Kc,NUMBER_FORMAT_RANGES:()=>ru,aborted:()=>nr,allowsEval:()=>Xc,assert:()=>qz,assertEqual:()=>jz,assertIs:()=>Zz,assertNever:()=>Lz,assertNotEqual:()=>Mz,assignProp:()=>tr,base64ToUint8Array:()=>oh,base64urlToUint8Array:()=>oP,cached:()=>mn,captureStackTrace:()=>ci,cleanEnum:()=>nP,cleanRegex:()=>yo,clone:()=>wt,cloneDef:()=>Uz,createTransparentProxy:()=>Jz,defineLazy:()=>oe,esc:()=>ai,escapeRegex:()=>Ft,explicitlyAborted:()=>nu,extend:()=>Qz,finalizeIssue:()=>at,floatSafeRemainder:()=>Yc,getElementAtPath:()=>Vz,getEnumValues:()=>ho,getLengthableOrigin:()=>_o,getParsedType:()=>Gz,getSizableOrigin:()=>nh,hexToUint8Array:()=>iP,isObject:()=>Mr,isPlainObject:()=>rr,issue:()=>hn,joinValues:()=>ii,jsonStringifyReplacer:()=>pn,merge:()=>eP,mergeDefs:()=>qt,normalizeParams:()=>R,nullish:()=>go,numKeys:()=>Wz,objectClone:()=>Fz,omit:()=>Yz,optionalKeys:()=>tu,parsedType:()=>ou,partial:()=>tP,pick:()=>Kz,prefixIssues:()=>Ut,primitiveTypes:()=>th,promiseAllObject:()=>Bz,propertyKeyTypes:()=>eu,randomString:()=>Hz,required:()=>rP,safeExtend:()=>Xz,shallowClone:()=>eh,slugify:()=>Qc,stringifyPrimitive:()=>ui,uint8ArrayToBase64:()=>sh,uint8ArrayToBase64url:()=>sP,uint8ArrayToHex:()=>aP,unwrapMessage:()=>mo});function jz(t){return t}function Mz(t){return t}function Zz(t){}function Lz(t){throw new Error("Unexpected value in exhaustive check")}function qz(t){}function ho(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}function ii(t,e="|"){return t.map(r=>ui(r)).join(e)}function pn(t,e){return typeof e=="bigint"?e.toString():e}function mn(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function go(t){return t==null}function yo(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Yc(t,e){let r=t/e,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var Xm=Symbol("evaluating");function oe(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Xm)return n===void 0&&(n=Xm,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Fz(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function tr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qt(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Uz(t){return qt(t._zod.def)}function Vz(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Bz(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=n[s];return o})}function Hz(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function ai(t){return JSON.stringify(t)}function Qc(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ci="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Mr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Xc=mn(()=>{if(fn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function rr(t){if(Mr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Mr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function eh(t){return rr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Wz(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Gz=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},eu=new Set(["string","number","symbol"]),th=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ft(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wt(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function R(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Jz(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function ui(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function tu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var ru={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]},rh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Kz(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=qt(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return tr(this,"shape",i),i},checks:[]});return wt(t,s)}function Yz(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=qt(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return tr(this,"shape",i),i},checks:[]});return wt(t,s)}function Qz(t,e){if(!rr(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let i in e)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=qt(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return tr(this,"shape",s),s}});return wt(t,o)}function Xz(t,e){if(!rr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=qt(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return tr(this,"shape",n),n}});return wt(t,r)}function eP(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=qt(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return tr(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return wt(t,r)}function tP(t,e,r){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=qt(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return tr(this,"shape",c),c},checks:[]});return wt(e,i)}function rP(t,e,r){let n=qt(e._zod.def,{get shape(){let o=e._zod.def.shape,s={...o};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new t({type:"nonoptional",innerType:o[i]}))}else for(let i in o)s[i]=new t({type:"nonoptional",innerType:o[i]});return tr(this,"shape",s),s}});return wt(e,n)}function nr(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function nu(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Ut(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function mo(t){return typeof t=="string"?t:t?.message}function at(t,e,r){let n=t.message?t.message:mo(t.inst?._zod.def?.error?.(t))??mo(e?.error?.(t))??mo(r.customError?.(t))??mo(r.localeError?.(t))??"Invalid input",{inst:o,continue:s,input:i,...a}=t;return a.path??(a.path=[]),a.message=n,e?.reportInput&&(a.input=i),a}function nh(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function _o(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function ou(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function hn(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function nP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function oh(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function sh(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function oP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return oh(e+r)}function sP(t){return sh(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function iP(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function aP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Kc=class{constructor(...e){}};var ih=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,pn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},li=v("$ZodError",ih),su=v("$ZodError",ih,{Parent:Error});function ah(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function ch(t,e=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(e(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return n(t),r}var di=t=>(e,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Tt;if(i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>at(c,s,tt())));throw ci(a,o?.callee),a}return i.value};var fi=t=>async(e,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>at(c,s,tt())));throw ci(a,o?.callee),a}return i.value};var vo=t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Tt;return s.issues.length?{success:!1,error:new(t??li)(s.issues.map(i=>at(i,o,tt())))}:{success:!0,data:s.value}},bo=vo(su),wo=t=>async(e,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>at(i,o,tt())))}:{success:!0,data:s.value}},pi=wo(su),uh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return di(t)(e,r,o)};var lh=t=>(e,r,n)=>di(t)(e,r,n);var dh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return fi(t)(e,r,o)};var fh=t=>async(e,r,n)=>fi(t)(e,r,n);var ph=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return vo(t)(e,r,o)};var mh=t=>(e,r,n)=>vo(t)(e,r,n);var hh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return wo(t)(e,r,o)};var gh=t=>async(e,r,n)=>wo(t)(e,r,n);var yh=/^[cC][0-9a-z]{6,}$/,_h=/^[0-9a-z]+$/,vh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bh=/^[0-9a-vA-V]{20}$/,wh=/^[A-Za-z0-9]{27}$/,xh=/^[a-zA-Z0-9_-]{21}$/,Sh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var $h=/^([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})$/,iu=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/;var kh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var uP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Eh(){return new RegExp(uP,"u")}var zh=/^(?:(?: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])$/,Ph=/^(([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}|:))$/;var Th=/^((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])$/,Ch=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Oh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,au=/^[A-Za-z0-9_-]*$/;var Ih=/^https?$/,Rh=/^\+[1-9]\d{6,14}$/,Nh="(?:(?:\\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])))",Ah=new RegExp(`^${Nh}$`);function Dh(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function jh(t){return new RegExp(`^${Dh(t)}$`)}function Mh(t){let e=Dh({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Nh}T(?:${n})$`)}var Zh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Lh=/^-?\d+$/,cu=/^-?\d+(?:\.\d+)?$/,qh=/^(?:true|false)$/i,Fh=/^null$/i;var Uh=/^[^A-Z]*$/,Vh=/^[^a-z]*$/;var Pe=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Bh={number:"number",bigint:"bigint",object:"date"},uu=v("$ZodCheckLessThan",(t,e)=>{Pe.init(t,e);let r=Bh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),lu=v("$ZodCheckGreaterThan",(t,e)=>{Pe.init(t,e);let r=Bh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Hh=v("$ZodCheckMultipleOf",(t,e)=>{Pe.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Yc(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Wh=v("$ZodCheckNumberFormat",(t,e)=>{Pe.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=ru[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=o,a.maximum=s,r&&(a.pattern=Lh)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Gh=v("$ZodCheckMaxLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!go(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let i=_o(o);n.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Jh=v("$ZodCheckMinLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!go(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let i=_o(o);n.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Kh=v("$ZodCheckLengthEquals",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!go(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let i=_o(o),a=s>e.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),xo=v("$ZodCheckStringFormat",(t,e)=>{var r,n;Pe.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Yh=v("$ZodCheckRegex",(t,e)=>{xo.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Qh=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Uh),xo.init(t,e)}),Xh=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Vh),xo.init(t,e)}),eg=v("$ZodCheckIncludes",(t,e)=>{Pe.init(t,e);let r=Ft(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),tg=v("$ZodCheckStartsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`^${Ft(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),rg=v("$ZodCheckEndsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`.*${Ft(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});var ng=v("$ZodCheckOverwrite",(t,e)=>{Pe.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var hi=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
89
+ `)}var fo=mt(require("fs")),Ym=mt(require("path")),Qm=require("zlib");var Af=require("node:events"),Df=require("node:fs"),Ms=require("node:fs/promises"),H=mt(require("node:path"),1);var Mt=require("node:fs/promises"),Zt=require("node:path"),Sf=require("node:stream"),et={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Ua={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:et.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Ua);var $f="READDIRP_RECURSIVE_ERROR",$0=new Set(["ENOENT","EPERM","EACCES","ELOOP",$f]),bf=[et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE],k0=new Set([et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE]),E0=new Set([et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE]),z0=t=>$0.has(t.code),P0=process.platform==="win32",wf=t=>!0,xf=t=>{if(t===void 0)return wf;if(typeof t=="function")return t;if(typeof t=="string"){let e=t.trim();return r=>r.basename===e}if(Array.isArray(t)){let e=t.map(r=>r.trim());return r=>e.some(n=>r.basename===n)}return wf},Va=class extends Sf.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let r={...Ua,...e},{root:n,type:o}=r;this._fileFilter=xf(r.fileFilter),this._directoryFilter=xf(r.directoryFilter);let s=r.lstat?Mt.lstat:Mt.stat;P0?this._stat=i=>s(i,{bigint:!0}):this._stat=s,this._maxDepth=r.depth!=null&&Number.isSafeInteger(r.depth)?r.depth:Ua.depth,this._wantsDir=o?k0.has(o):!1,this._wantsFile=o?E0.has(o):!1,this._wantsEverything=o===et.EVERYTHING_TYPE,this._root=(0,Zt.resolve)(n),this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let r=this.parent,n=r&&r.files;if(n&&n.length>0){let{path:o,depth:s}=r,i=n.splice(0,e).map(c=>this._formatEntry(c,o)),a=await Promise.all(i);for(let c of a){if(!c)continue;if(this.destroyed)return;let u=await this._getEntryType(c);u==="directory"&&this._directoryFilter(c)?(s<=this._maxDepth&&this.parents.push(this._exploreDir(c.fullPath,s+1)),this._wantsDir&&(this.push(c),e--)):(u==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await(0,Mt.readdir)(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:r,path:e}}async _formatEntry(e,r){let n,o=this._isDirent?e.name:e;try{let s=(0,Zt.resolve)((0,Zt.join)(r,o));n={path:(0,Zt.relative)(this._root,s),fullPath:s,basename:o},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(s){this._onError(s);return}return n}_onError(e){z0(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let r=e[this._statsProp];if(r.isFile())return"file";if(r.isDirectory())return"directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let o=await(0,Mt.realpath)(n),s=await(0,Mt.lstat)(o);if(s.isFile())return"file";if(s.isDirectory()){let i=o.length;if(n.startsWith(o)&&n.substr(i,1)===Zt.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${o}"`);return a.code=$f,this._onError(a)}return"directory"}}catch(o){return this._onError(o),""}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function kf(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=et.FILE_DIR_TYPE),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!bf.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${bf.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Va(e)}var Ir=require("node:fs"),_t=require("node:fs/promises"),zf=require("node:os"),he=mt(require("node:path"),1),T0="data",Wa="end",Pf="close",As=()=>{};var Ds=process.platform,Ga=Ds==="win32",C0=Ds==="darwin",O0=Ds==="linux",I0=Ds==="freebsd",Tf=(0,zf.type)()==="OS400",be={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},yt=be,R0="watch",N0={lstat:_t.lstat,stat:_t.stat},Or="listeners",Os="errHandlers",an="rawEmitters",A0=[Or,Os,an],D0=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),j0=t=>D0.has(he.extname(t).slice(1).toLowerCase()),Ha=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},no=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},M0=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},oo=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},Cf=t=>t instanceof Set?t.size===0:!t,Is=new Map;function Ef(t,e,r,n,o){let s=(i,a)=>{r(t),o(i,a,{watchedPath:t}),a&&t!==a&&Rs(he.resolve(t,a),Or,he.join(t,a))};try{return(0,Ir.watch)(t,{persistent:e.persistent},s)}catch(i){n(i);return}}var Rs=(t,e,r,n,o)=>{let s=Is.get(t);s&&Ha(s[e],i=>{i(r,n,o)})},Z0=(t,e,r,n)=>{let{listener:o,errHandler:s,rawEmitter:i}=n,a=Is.get(e),c;if(!r.persistent)return c=Ef(t,r,o,s,i),c?c.close.bind(c):void 0;if(a)no(a,Or,o),no(a,Os,s),no(a,an,i);else{if(c=Ef(t,r,Rs.bind(null,e,Or),s,Rs.bind(null,e,an)),!c)return;c.on(yt.ERROR,async u=>{let l=Rs.bind(null,e,Os);if(a&&(a.watcherUnusable=!0),Ga&&u.code==="EPERM")try{await(await(0,_t.open)(t,"r")).close(),l(u)}catch{}else l(u)}),a={listeners:o,errHandlers:s,rawEmitters:i,watcher:c},Is.set(e,a)}return()=>{oo(a,Or,o),oo(a,Os,s),oo(a,an,i),Cf(a.listeners)&&(a.watcher.close(),Is.delete(e),A0.forEach(M0(a)),a.watcher=void 0,Object.freeze(a))}},Ba=new Map,L0=(t,e,r,n)=>{let{listener:o,rawEmitter:s}=n,i=Ba.get(e),a=i&&i.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&((0,Ir.unwatchFile)(e),i=void 0),i?(no(i,Or,o),no(i,an,s)):(i={listeners:o,rawEmitters:s,options:r,watcher:(0,Ir.watchFile)(e,r,(c,u)=>{Ha(i.rawEmitters,d=>{d(yt.CHANGE,e,{curr:c,prev:u})});let l=c.mtimeMs;(c.size!==u.size||l>u.mtimeMs||l===0)&&Ha(i.listeners,d=>d(t,c))})},Ba.set(e,i)),()=>{oo(i,Or,o),oo(i,an,s),Cf(i.listeners)&&(Ba.delete(e),(0,Ir.unwatchFile)(e),i.options=i.watcher=void 0,Object.freeze(i))}},Ns=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let n=this.fsw.options,o=he.dirname(e),s=he.basename(e);this.fsw._getWatchedDir(o).add(s);let a=he.resolve(e),c={persistent:n.persistent};r||(r=As);let u;if(n.usePolling){let l=n.interval!==n.binaryInterval;c.interval=l&&j0(s)?n.binaryInterval:n.interval,u=L0(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})}else u=Z0(e,a,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return u}_handleFile(e,r,n){if(this.fsw.closed)return;let o=he.dirname(e),s=he.basename(e),i=this.fsw._getWatchedDir(o),a=r;if(i.has(s))return;let c=async(l,d)=>{if(this.fsw._throttle(R0,e,5)){if(!d||d.mtimeMs===0)try{let m=await(0,_t.stat)(e);if(this.fsw.closed)return;let p=m.atimeMs,f=m.mtimeMs;if((!p||p<=f||f!==a.mtimeMs)&&this.fsw._emit(yt.CHANGE,e,m),(C0||O0||I0)&&a.ino!==m.ino){this.fsw._closeFile(l),a=m;let h=this._watchWithNodeFs(e,c);h&&this.fsw._addPathCloser(l,h)}else a=m}catch{this.fsw._remove(o,s)}else if(i.has(s)){let m=d.atimeMs,p=d.mtimeMs;(!m||m<=p||p!==a.mtimeMs)&&this.fsw._emit(yt.CHANGE,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(yt.ADD,e,0))return;this.fsw._emit(yt.ADD,e,r)}return u}async _handleSymlink(e,r,n,o){if(this.fsw.closed)return;let s=e.fullPath,i=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await(0,_t.realpath)(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(o)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(yt.CHANGE,n,e.stats)):(i.add(o),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(yt.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,r,n,o,s,i,a){e=he.join(e,"");let c=o?`${e}:${o}`:e;if(a=this.fsw._throttle("readdir",c,1e3),!a)return;let u=this.fsw._getWatchedDir(n.path),l=new Set,d=this.fsw._readdirp(e,{fileFilter:m=>n.filterPath(m),directoryFilter:m=>n.filterDir(m)});if(d)return d.on(T0,async m=>{if(this.fsw.closed){d=void 0;return}let p=m.path,f=he.join(e,p);if(l.add(p),!(m.stats.isSymbolicLink()&&await this._handleSymlink(m,e,f,p))){if(this.fsw.closed){d=void 0;return}(p===o||!o&&!u.has(p))&&(this.fsw._incrReadyCount(),f=he.join(s,he.relative(s,f)),this._addToNodeFs(f,r,n,i+1))}}).on(yt.ERROR,this._boundHandleError),new Promise((m,p)=>{if(!d)return p();d.once(Wa,()=>{if(this.fsw.closed){d=void 0;return}let f=a?a.clear():!1;m(void 0),u.getChildren().filter(h=>h!==e&&!l.has(h)).forEach(h=>{this.fsw._remove(e,h)}),d=void 0,f&&this._handleRead(e,!1,n,o,s,i,a)})})}async _handleDir(e,r,n,o,s,i,a){let c=this.fsw._getWatchedDir(he.dirname(e)),u=c.has(he.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&this.fsw._emit(yt.ADD_DIR,e,r),c.add(he.basename(e)),this.fsw._getWatchedDir(e);let l,d,m=this.fsw.options.depth;if((m==null||o<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,i,s,e,o,l),this.fsw.closed))return;d=this._watchWithNodeFs(e,(p,f)=>{f&&f.mtimeMs===0||this._handleRead(p,!1,i,s,e,o,l)})}return d}async _addToNodeFs(e,r,n,o,s){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e);n&&(a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await N0[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks,l;if(c.isDirectory()){let d=he.resolve(e),m=u?await(0,_t.realpath)(e):e;if(this.fsw.closed||(l=await this._handleDir(a.watchPath,c,r,o,s,a,m),this.fsw.closed))return;d!==m&&m!==void 0&&this.fsw._symlinkPaths.set(d,m)}else if(c.isSymbolicLink()){let d=u?await(0,_t.realpath)(e):e;if(this.fsw.closed)return;let m=he.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(yt.ADD,a.watchPath,c),l=await this._handleDir(m,c,r,o,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(he.resolve(e),d)}else l=this._handleFile(a.watchPath,c,r);return i(),l&&this.fsw._addPathCloser(e,l),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};var Ja="/",q0="//",jf=".",F0="..",U0="string",V0=/\\/g,Mf=/\/\//g,B0=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,H0=/^\.[/\\]/;function js(t){return Array.isArray(t)?t:[t]}var Ka=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function W0(t){return typeof t=="function"?t:typeof t=="string"?e=>t===e:t instanceof RegExp?e=>t.test(e):typeof t=="object"&&t!==null?e=>{if(t.path===e)return!0;if(t.recursive){let r=H.relative(t.path,e);return r?!r.startsWith("..")&&!H.isAbsolute(r):!1}return!1}:()=>!1}function G0(t){if(typeof t!="string")throw new Error("string expected");t=H.normalize(t),t=t.replace(/\\/g,"/");let e=!1;return t.startsWith("//")&&(e=!0),t=t.replace(Mf,"/"),e&&(t="/"+t),t}function Of(t,e,r){let n=G0(e);for(let o=0;o<t.length;o++){let s=t[o];if(s(n,r))return!0}return!1}function J0(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=js(t).map(o=>W0(o));return e==null?(o,s)=>Of(n,o,s):Of(n,e)}var If=t=>{let e=js(t).flat();if(!e.every(r=>typeof r===U0))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Zf)},Rf=t=>{let e=t.replace(V0,Ja),r=!1;return e.startsWith(q0)&&(r=!0),e=e.replace(Mf,Ja),r&&(e=Ja+e),e},Zf=t=>Rf(H.normalize(Rf(t))),Nf=(t="")=>e=>typeof e=="string"?Zf(H.isAbsolute(e)?e:H.join(t,e)):e,K0=(t,e)=>H.isAbsolute(t)?t:H.join(e,t),Y0=Object.freeze(new Set),Ya=class{path;_removeWatcher;items;constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set}add(e){let{items:r}=this;r&&e!==jf&&e!==F0&&r.add(e)}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await(0,Ms.readdir)(n)}catch{this._removeWatcher&&this._removeWatcher(H.dirname(n),H.basename(n))}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=As,this.items=Y0,Object.freeze(this)}},Q0="stat",X0="lstat",Qa=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,r,n){this.fsw=n;let o=e;this.path=e=e.replace(H0,""),this.watchPath=o,this.fullWatchPath=H.resolve(o),this.dirParts=[],this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?Q0:X0}entryPath(e){return H.join(this.watchPath,H.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Xa=class extends Af.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let r=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},o={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?js(e.ignored):js([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};Tf&&(o.usePolling=!0),o.atomic===void 0&&(o.atomic=!o.usePolling);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?o.usePolling=!1:c==="true"||c==="1"?o.usePolling=!0:o.usePolling=!!c}let i=process.env.CHOKIDAR_INTERVAL;i&&(o.interval=Number.parseInt(i,10));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=As,this._readyEmitted=!0,process.nextTick(()=>this.emit(be.READY)))},this._emitRaw=(...c)=>this.emit(be.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=o,this._nodeFsHandler=new Ns(this),Object.freeze(o)}_addIgnoredPath(e){if(Ka(e)){for(let r of this._ignoredPaths)if(Ka(r)&&r.path===e.path&&r.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let r of this._ignoredPaths)Ka(r)&&r.path===e&&this._ignoredPaths.delete(r)}add(e,r,n){let{cwd:o}=this.options;this.closed=!1,this._closePromise=void 0;let s=If(e);return o&&(s=s.map(i=>K0(i,o))),s.forEach(i=>{this._removeIgnoredPath(i)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async i=>{let a=await this._nodeFsHandler._addToNodeFs(i,!n,void 0,0,r);return a&&this._emitReady(),a})).then(i=>{this.closed||i.forEach(a=>{a&&this.add(H.dirname(a),H.basename(r||a))})}),this}unwatch(e){if(this.closed)return this;let r=If(e),{cwd:n}=this.options;return r.forEach(o=>{!H.isAbsolute(o)&&!this._closers.has(o)&&(n&&(o=H.join(n,o)),o=H.resolve(o)),this._closePath(o),this._addIgnoredPath(o),this._watched.has(o)&&this._addIgnoredPath({path:o,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let o=n();o instanceof Promise&&e.push(o)})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=(this.options.cwd?H.relative(this.options.cwd,n):n)||jf;e[s]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(e,...r),e!==be.ERROR&&this.emit(be.ALL,e,...r)}async _emit(e,r,n){if(this.closed)return;let o=this.options;Ga&&(r=H.normalize(r)),o.cwd&&(r=H.relative(o.cwd,r));let s=[r];n!=null&&s.push(n);let i=o.awaitWriteFinish,a;if(i&&(a=this._pendingWrites.get(r)))return a.lastChange=new Date,this;if(o.atomic){if(e===be.UNLINK)return this._pendingUnlinks.set(r,[e,...s]),setTimeout(()=>{this._pendingUnlinks.forEach((c,u)=>{this.emit(...c),this.emit(be.ALL,...c),this._pendingUnlinks.delete(u)})},typeof o.atomic=="number"?o.atomic:100),this;e===be.ADD&&this._pendingUnlinks.has(r)&&(e=be.CHANGE,this._pendingUnlinks.delete(r))}if(i&&(e===be.ADD||e===be.CHANGE)&&this._readyEmitted){let c=(u,l)=>{u?(e=be.ERROR,s[0]=u,this.emitWithAll(e,s)):l&&(s.length>1?s[1]=l:s.push(l),this.emitWithAll(e,s))};return this._awaitWriteFinish(r,i.stabilityThreshold,e,c),this}if(e===be.CHANGE&&!this._throttle(be.CHANGE,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===be.ADD||e===be.ADD_DIR||e===be.CHANGE)){let c=o.cwd?H.join(o.cwd,r):r,u;try{u=await(0,Ms.stat)(c)}catch{}if(!u||this.closed)return;s.push(u)}return this.emitWithAll(e,s),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(be.ERROR,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let o=this._throttled.get(e);if(!o)throw new Error("invalid throttle");let s=o.get(r);if(s)return s.count++,!1;let i,a=()=>{let u=o.get(r),l=u?u.count:0;return o.delete(r),clearTimeout(i),u&&clearTimeout(u.timeoutObject),l};i=setTimeout(a,n);let c={timeoutObject:i,clear:a,count:0};return o.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,o){let s=this.options.awaitWriteFinish;if(typeof s!="object")return;let i=s.pollInterval,a,c=e;this.options.cwd&&!H.isAbsolute(e)&&(c=H.join(this.options.cwd,e));let u=new Date,l=this._pendingWrites;function d(m){(0,Df.stat)(c,(p,f)=>{if(p||!l.has(e)){p&&p.code!=="ENOENT"&&o(p);return}let h=Number(new Date);m&&f.size!==m.size&&(l.get(e).lastChange=h);let g=l.get(e);h-g.lastChange>=r?(l.delete(e),o(void 0,f)):a=setTimeout(d,i,f)})}l.has(e)||(l.set(e,{lastChange:u,cancelWait:()=>(l.delete(e),clearTimeout(a),n)}),a=setTimeout(d,i))}_isIgnored(e,r){if(this.options.atomic&&B0.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=(this.options.ignored||[]).map(Nf(n)),a=[...[...this._ignoredPaths].map(Nf(n)),...s];this._userIgnored=J0(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new Qa(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=H.resolve(e);return this._watched.has(r)||this._watched.set(r,new Ya(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,r,n){let o=H.join(e,r),s=H.resolve(o);if(n=n??(this._watched.has(o)||this._watched.has(s)),!this._throttle("remove",o,100))return;!n&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(o).getChildren().forEach(m=>this._remove(o,m));let c=this._getWatchedDir(e),u=c.has(r);c.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let l=o;if(this.options.cwd&&(l=H.relative(this.options.cwd,o)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===be.ADD)return;this._watched.delete(o),this._watched.delete(s);let d=n?be.UNLINK_DIR:be.UNLINK;u&&!this._isIgnored(o)&&this._emit(d,o),this._closePath(o)}_closePath(e){this._closeFile(e);let r=H.dirname(e);this._getWatchedDir(r).remove(H.basename(e))}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r)}_readdirp(e,r){if(this.closed)return;let n={type:be.ALL,alwaysStat:!0,lstat:!0,...r,depth:0},o=kf(e,n);return this._streams.add(o),o.once(Pf,()=>{o=void 0}),o.once(Wa,()=>{o&&(this._streams.delete(o),o=void 0)}),o}};function Lf(t,e={}){let r=new Xa(e);return r.add(t),r}var Wc=mt(Km()),lo=class t{pino;context;constructor(e){this.context=e.context,this.pino=(0,Wc.default)({level:e.level},Wc.default.destination({dest:2,sync:!0}))}child(e){let r=new t({level:this.pino.level,format:"json",context:this.context?`${this.context}:${e}`:e});return r.pino=this.pino.child({context:e}),r}setLevel(e){this.pino.level=e}debug(e,r){this.pino.debug(r||{},e)}info(e,r){this.pino.info(r||{},e)}warn(e,r){this.pino.warn(r||{},e)}error(e,r,n){let o=n&&typeof n=="object"?n:{};this.pino.error({err:r,...o},e)}},uo=null;function Gc(t){return uo=new lo(t),uo}function ne(){return uo||(uo=new lo({level:"info",format:"text"})),uo}var Az={failureThreshold:5,successThreshold:2,timeout:1e4,resetTimeout:6e4},ni=class{state="CLOSED";failureCount=0;successCount=0;nextAttempt=Date.now();options;name;constructor(e,r={}){this.name=e,this.options={...Az,...r}}getState(){return this.state}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,nextAttempt:this.nextAttempt}}async execute(e){let r=ne();if(this.state==="OPEN"){if(Date.now()<this.nextAttempt){let n=new Error(`Circuit breaker '${this.name}' is OPEN. Next attempt at ${new Date(this.nextAttempt).toISOString()}`);throw r.warn("Circuit breaker is open",{name:this.name,nextAttempt:this.nextAttempt}),n}this.state="HALF_OPEN",this.successCount=0,r.info("Circuit breaker transitioning to HALF_OPEN",{name:this.name})}try{let n=await this.executeWithTimeout(e);return this.onSuccess(),n}catch(n){throw this.onFailure(),n}}async executeWithTimeout(e){return Promise.race([e(),new Promise((r,n)=>setTimeout(()=>n(new Error(`Operation timed out after ${this.options.timeout}ms`)),this.options.timeout))])}onSuccess(){let e=ne();this.failureCount=0,this.state==="HALF_OPEN"&&(this.successCount++,e.debug("Circuit breaker success in HALF_OPEN",{name:this.name,successCount:this.successCount,threshold:this.options.successThreshold}),this.successCount>=this.options.successThreshold&&(this.state="CLOSED",this.successCount=0,e.info("Circuit breaker closed",{name:this.name})))}onFailure(){let e=ne();this.failureCount++,e.debug("Circuit breaker failure",{name:this.name,failureCount:this.failureCount,threshold:this.options.failureThreshold,state:this.state}),(this.state==="HALF_OPEN"||this.failureCount>=this.options.failureThreshold)&&(this.state="OPEN",this.nextAttempt=Date.now()+this.options.resetTimeout,e.warn("Circuit breaker opened",{name:this.name,failureCount:this.failureCount,nextAttempt:this.nextAttempt}))}reset(){let e=ne();this.state="CLOSED",this.failureCount=0,this.successCount=0,this.nextAttempt=Date.now(),e.info("Circuit breaker manually reset",{name:this.name})}},oi=class{breakers=new Map;get(e,r){return this.breakers.has(e)||this.breakers.set(e,new ni(e,r)),this.breakers.get(e)}getAll(){return new Map(this.breakers)}resetAll(){this.breakers.forEach(e=>{e.reset()})}getAllStats(){let e={};return this.breakers.forEach((r,n)=>{e[n]=r.getStats()}),e}},Dz=new oi;var si=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=Ym.resolve(e.path),this.watchForChanges=e.watchForChanges,this.reloadDebounce=e.reloadDebounce,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError}async load(){try{if(!fo.existsSync(this.filePath))return{success:!1,error:`Documentation file not found: ${this.filePath}`};let e;if(this.filePath.endsWith(".gz")){let o=await fo.promises.readFile(this.filePath);e=(0,Qm.gunzipSync)(o).toString("utf-8")}else e=await fo.promises.readFile(this.filePath,"utf-8");let r;try{r=JSON.parse(e)}catch(o){return{success:!1,error:`Failed to parse JSON: ${o instanceof Error?o.message:String(o)}`}}let n=this.validateStructure(r);return n?{success:!1,error:n}:(this.currentData=r,this.watchForChanges&&!this.watcher&&this.startMonitoring(),{success:!0,data:r})}catch(e){return{success:!1,error:`Failed to load documentation: ${e instanceof Error?e.message:String(e)}`}}}startMonitoring(){!this.watchForChanges||this.watcher||this.startWatching()}async stopMonitoring(){this.reloadTimer&&(clearTimeout(this.reloadTimer),this.reloadTimer=void 0),this.watcher&&(await this.watcher.close(),this.watcher=void 0,ne().info("Stopped watching documentation file"))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}startWatching(){this.watcher||(this.watcher=Lf(this.filePath,{persistent:!0,ignoreInitial:!0}),this.watcher.on("change",()=>{this.scheduleReload()}),this.watcher.on("error",e=>{let r=e instanceof Error?e:new Error(String(e));ne().error("File watcher error",r),this.onErrorCallback&&this.onErrorCallback(r)}),ne().info(`Watching for changes: ${this.filePath}`))}scheduleReload(){this.reloadTimer&&clearTimeout(this.reloadTimer),this.reloadTimer=setTimeout(()=>{this.reload()},this.reloadDebounce)}async reload(){ne().info("Reloading documentation...");let e=await this.load();e.success&&e.data?(ne().info("Documentation reloaded successfully"),this.onReloadCallback&&this.onReloadCallback(e.data)):(ne().error("Failed to reload documentation",new Error(e.error)),this.onErrorCallback&&this.onErrorCallback(new Error(e.error)))}};var dn=class{options;constructor(e){this.options=e}async fetch(e,r){let n;for(let o=0;o<=this.options.maxRetries;o++)try{let s=await this.fetchOnce(e,r);if(!this.isRetryableError(void 0,s.status)||o>=this.options.maxRetries)return s;let i=this.calculateBackoff(o);await this.sleep(i)}catch(s){if(n=s instanceof Error?s:new Error(String(s)),o<this.options.maxRetries&&this.isRetryableError(n)){let i=this.calculateBackoff(o);await this.sleep(i);continue}throw n}throw n||new Error("Unknown error during fetch")}async fetchOnce(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeout);try{let s={Accept:"application/json","User-Agent":this.options.userAgent||"DocumentationLoader/1.0"};r&&r.forEach((u,l)=>{s[l]=u});let i=await fetch(e,{signal:n.signal,headers:s});clearTimeout(o);let a=new Map;i.headers.forEach((u,l)=>{a.set(l,u)});let c=await i.text();return{status:i.status,statusText:i.statusText,data:c,headers:a}}catch(s){throw clearTimeout(o),s instanceof Error&&s.name==="AbortError"?new Error(`Request timeout after ${this.options.timeout}ms`):s}}isRetryableError(e,r){if(r!==void 0){if(r>=200&&r<400)return!1;if(r>=500||r===408||r===429)return!0;if(r>=400&&r<500)return!1}if(e){let n=e.message.toLowerCase();if(n.includes("timeout")||n.includes("network")||n.includes("econnrefused")||n.includes("enotfound")||n.includes("econnreset"))return!0}return!0}calculateBackoff(e){return this.options.retryDelay*Math.pow(2,e)}sleep(e){return new Promise(r=>setTimeout(r,e))}};var ii=class{cache;constructor(){this.cache=new Map}set(e,r,n){let o={data:r,timestamp:Date.now()},s=this.getHeaderCaseInsensitive(n,"etag");s&&(o.etag=s);let i=this.getHeaderCaseInsensitive(n,"last-modified");i&&(o.lastModified=i),this.cache.set(e,o)}get(e){return this.cache.get(e)}getConditionalHeaders(e){let r=new Map,n=this.cache.get(e);return n&&(n.etag&&r.set("If-None-Match",n.etag),n.lastModified&&r.set("If-Modified-Since",n.lastModified)),r}clear(e){this.cache.delete(e)}clearAll(){this.cache.clear()}getHeaderCaseInsensitive(e,r){let n=r.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===n)return s}};var Jc=class t extends Error{constructor(r,n,o){super(r);this.url=n;this.cause=o;this.name="NetworkError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}url;cause};var po=class t extends Jc{constructor(r,n,o,s){super(r,n);this.statusCode=o;this.statusText=s;this.name="HttpError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}statusCode;statusText},mo=class t extends Error{constructor(r,n){super(r);this.content=n;this.name="ParseError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}content};var ai=class{url;httpClient;cacheManager;pollingTimer;currentData;pollingInterval;onReloadCallback;onErrorCallback;constructor(e){this.url=e.url,this.pollingInterval=e.pollingInterval,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError;let r={timeout:e.timeout,maxRetries:e.maxRetries,retryDelay:1e3,userAgent:"DocumentationLoader/1.0"};this.httpClient=new dn(r),this.cacheManager=new ii}async load(){return this.fetchDocumentation()}startMonitoring(){this.pollingTimer||(this.pollingTimer=setInterval(()=>{this.poll()},this.pollingInterval),ne().info(`Started polling ${this.url} every ${this.pollingInterval}ms`))}async stopMonitoring(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=void 0,ne().info(`Stopped polling ${this.url}`))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.cacheManager.clear(this.url),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}async poll(){try{ne().debug(`Polling ${this.url} for updates...`);let e=this.cacheManager.getConditionalHeaders(this.url),r=await this.httpClient.fetch(this.url,e);if(r.status===304){ne().debug("No changes detected (304 Not Modified)");return}if(r.status===200){let n=this.parseJson(r.data),o=this.validateStructure(n);if(o)throw new mo(o,r.data);this.cacheManager.set(this.url,n,r.headers),this.currentData=n,ne().info(`Documentation updated from ${this.url}`),this.onReloadCallback&&this.onReloadCallback(n);return}throw new po(`HTTP ${r.status}: ${r.statusText}`,this.url,r.status,r.statusText)}catch(e){let r=e instanceof Error?e.message:String(e);ne().error(`Polling error for ${this.url}`,e instanceof Error?e:new Error(r)),this.onErrorCallback&&this.onErrorCallback(e instanceof Error?e:new Error(r))}}async fetchDocumentation(){try{let e=this.cacheManager.get(this.url),r=e?this.cacheManager.getConditionalHeaders(this.url):void 0,n=await this.httpClient.fetch(this.url,r);if(n.status===304&&e)return ne().debug("Using cached documentation (304 Not Modified)"),this.currentData=e.data,{success:!0,data:e.data};if(n.status!==200)return{success:!1,error:`${new po(`HTTP ${n.status}: ${n.statusText}`,this.url,n.status,n.statusText).message} (URL: ${this.url})`};let o=this.parseJson(n.data),s=this.validateStructure(o);return s?{success:!1,error:s}:(this.cacheManager.set(this.url,o,n.headers),this.currentData=o,{success:!0,data:o})}catch(e){let r=e instanceof Error?e.message:String(e);return{success:!1,error:`Failed to fetch documentation from ${this.url}: ${r}`}}}parseJson(e){try{return JSON.parse(e)}catch(r){let n=r instanceof Error?r.message:String(r);throw new mo(`Failed to parse JSON: ${n}`,e)}}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}};var ho=class{source;constructor(e){this.source=this.createSource(e)}async load(){let e=await this.source.load();return e.success&&this.source.startMonitoring(),e}getCurrentData(){return this.source.getCurrentData()}async stopWatching(){await this.source.stopMonitoring()}async dispose(){await this.source.dispose()}createSource(e){let r=Xt.detect(e.path);return r.type==="local"?new si({path:r.normalizedPath,watchForChanges:e.watchForChanges??!0,reloadDebounce:e.reloadDebounce??1e3,onReload:e.onReload,onError:e.onError}):new ai({url:r.normalizedPath,timeout:e.timeout??1e4,maxRetries:e.maxRetries??3,pollingInterval:e.pollingInterval??6e4,onReload:e.onReload,onError:e.onError})}};var go=class{build(e){let r={byName:new Map,bySelector:new Map,searchIndex:new Map,components:[],directives:[],pipes:[],services:[],lastUpdated:new Date,totalCount:0},n=new Map;if(e.components)for(let o of e.components){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and component. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"component"),this.indexComponent(o,r)}if(e.directives)for(let o of e.directives){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and directive. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"directive"),this.indexDirective(o,r)}if(e.pipes)for(let o of e.pipes){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and pipe. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"pipe"),this.indexPipe(o,r)}if(e.injectables)for(let o of e.injectables){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and injectable. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"injectable"),this.indexInjectable(o,r)}return r.totalCount=r.components.length+r.directives.length+r.pipes.length+r.services.length,r}indexComponent(e,r){r.components.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexDirective(e,r){r.directives.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexPipe(e,r){r.pipes.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}indexInjectable(e,r){r.services.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}addToSearchIndex(e,r){let n=new Set;if(this.extractWords(e.name,n),"selector"in e&&e.selector&&this.extractWords(e.selector,n),e.description&&this.extractWords(e.description,n),"inputs"in e&&e.inputs)for(let o of e.inputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("outputs"in e&&e.outputs)for(let o of e.outputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("methods"in e&&e.methods)for(let o of e.methods)this.extractWords(o.name,n);for(let o of n)r.searchIndex.has(o)||r.searchIndex.set(o,new Set),r.searchIndex.get(o).add(e.name)}extractWords(e,r){let n=e.toLowerCase(),o=n.split(/[^a-z0-9]+/).filter(s=>s.length>0);for(let s of o)r.add(s);o.length===0&&e.trim().length>0&&r.add(n.trim())}getStatistics(e){return{totalCount:e.totalCount,componentCount:e.components.length,directiveCount:e.directives.length,pipeCount:e.pipes.length,serviceCount:e.services.length,lastUpdated:e.lastUpdated}}rebuild(e,r){return this.build(e)}};var Xm;function v(t,e,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let m=l[d];m in a||(a[m]=u[m].bind(a))}}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}var Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},fn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Xm=globalThis).__zod_globalConfig??(Xm.__zod_globalConfig={});var pn=globalThis.__zod_globalConfig;function tt(t){return t&&Object.assign(pn,t),pn}var Y={};sf(Y,{BIGINT_FORMAT_RANGES:()=>nh,Class:()=>Yc,NUMBER_FORMAT_RANGES:()=>nu,aborted:()=>nr,allowsEval:()=>eu,assert:()=>Uz,assertEqual:()=>Zz,assertIs:()=>qz,assertNever:()=>Fz,assertNotEqual:()=>Lz,assignProp:()=>tr,base64ToUint8Array:()=>sh,base64urlToUint8Array:()=>iP,cached:()=>hn,captureStackTrace:()=>li,cleanEnum:()=>sP,cleanRegex:()=>bo,clone:()=>wt,cloneDef:()=>Bz,createTransparentProxy:()=>Yz,defineLazy:()=>oe,esc:()=>ui,escapeRegex:()=>Ft,explicitlyAborted:()=>ou,extend:()=>eP,finalizeIssue:()=>at,floatSafeRemainder:()=>Qc,getElementAtPath:()=>Hz,getEnumValues:()=>_o,getLengthableOrigin:()=>wo,getParsedType:()=>Kz,getSizableOrigin:()=>oh,hexToUint8Array:()=>cP,isObject:()=>Mr,isPlainObject:()=>rr,issue:()=>gn,joinValues:()=>ci,jsonStringifyReplacer:()=>mn,merge:()=>rP,mergeDefs:()=>qt,normalizeParams:()=>R,nullish:()=>vo,numKeys:()=>Jz,objectClone:()=>Vz,omit:()=>Xz,optionalKeys:()=>ru,parsedType:()=>su,partial:()=>nP,pick:()=>Qz,prefixIssues:()=>Ut,primitiveTypes:()=>rh,promiseAllObject:()=>Wz,propertyKeyTypes:()=>tu,randomString:()=>Gz,required:()=>oP,safeExtend:()=>tP,shallowClone:()=>th,slugify:()=>Xc,stringifyPrimitive:()=>di,uint8ArrayToBase64:()=>ih,uint8ArrayToBase64url:()=>aP,uint8ArrayToHex:()=>uP,unwrapMessage:()=>yo});function Zz(t){return t}function Lz(t){return t}function qz(t){}function Fz(t){throw new Error("Unexpected value in exhaustive check")}function Uz(t){}function _o(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}function ci(t,e="|"){return t.map(r=>di(r)).join(e)}function mn(t,e){return typeof e=="bigint"?e.toString():e}function hn(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function vo(t){return t==null}function bo(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Qc(t,e){let r=t/e,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var eh=Symbol("evaluating");function oe(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==eh)return n===void 0&&(n=eh,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Vz(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function tr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qt(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Bz(t){return qt(t._zod.def)}function Hz(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Wz(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=n[s];return o})}function Gz(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function ui(t){return JSON.stringify(t)}function Xc(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var li="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Mr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var eu=hn(()=>{if(pn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function rr(t){if(Mr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Mr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function th(t){return rr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Jz(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Kz=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},tu=new Set(["string","number","symbol"]),rh=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ft(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wt(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function R(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Yz(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function di(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function ru(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var nu={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]},nh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Qz(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=qt(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return tr(this,"shape",i),i},checks:[]});return wt(t,s)}function Xz(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=qt(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return tr(this,"shape",i),i},checks:[]});return wt(t,s)}function eP(t,e){if(!rr(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let i in e)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=qt(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return tr(this,"shape",s),s}});return wt(t,o)}function tP(t,e){if(!rr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=qt(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return tr(this,"shape",n),n}});return wt(t,r)}function rP(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=qt(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return tr(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return wt(t,r)}function nP(t,e,r){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=qt(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return tr(this,"shape",c),c},checks:[]});return wt(e,i)}function oP(t,e,r){let n=qt(e._zod.def,{get shape(){let o=e._zod.def.shape,s={...o};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new t({type:"nonoptional",innerType:o[i]}))}else for(let i in o)s[i]=new t({type:"nonoptional",innerType:o[i]});return tr(this,"shape",s),s}});return wt(e,n)}function nr(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function ou(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Ut(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function yo(t){return typeof t=="string"?t:t?.message}function at(t,e,r){let n=t.message?t.message:yo(t.inst?._zod.def?.error?.(t))??yo(e?.error?.(t))??yo(r.customError?.(t))??yo(r.localeError?.(t))??"Invalid input",{inst:o,continue:s,input:i,...a}=t;return a.path??(a.path=[]),a.message=n,e?.reportInput&&(a.input=i),a}function oh(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function wo(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function su(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function gn(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function sP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function sh(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function ih(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function iP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return sh(e+r)}function aP(t){return ih(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function cP(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function uP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Yc=class{constructor(...e){}};var ah=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,mn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},fi=v("$ZodError",ah),iu=v("$ZodError",ah,{Parent:Error});function ch(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function uh(t,e=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(e(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return n(t),r}var pi=t=>(e,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Tt;if(i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>at(c,s,tt())));throw li(a,o?.callee),a}return i.value};var mi=t=>async(e,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>at(c,s,tt())));throw li(a,o?.callee),a}return i.value};var xo=t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Tt;return s.issues.length?{success:!1,error:new(t??fi)(s.issues.map(i=>at(i,o,tt())))}:{success:!0,data:s.value}},So=xo(iu),$o=t=>async(e,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>at(i,o,tt())))}:{success:!0,data:s.value}},hi=$o(iu),lh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return pi(t)(e,r,o)};var dh=t=>(e,r,n)=>pi(t)(e,r,n);var fh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return mi(t)(e,r,o)};var ph=t=>async(e,r,n)=>mi(t)(e,r,n);var mh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return xo(t)(e,r,o)};var hh=t=>(e,r,n)=>xo(t)(e,r,n);var gh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return $o(t)(e,r,o)};var yh=t=>async(e,r,n)=>$o(t)(e,r,n);var _h=/^[cC][0-9a-z]{6,}$/,vh=/^[0-9a-z]+$/,bh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wh=/^[0-9a-vA-V]{20}$/,xh=/^[A-Za-z0-9]{27}$/,Sh=/^[a-zA-Z0-9_-]{21}$/,$h=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var kh=/^([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})$/,au=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[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)$/;var Eh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var dP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function zh(){return new RegExp(dP,"u")}var Ph=/^(?:(?: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])$/,Th=/^(([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}|:))$/;var Ch=/^((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])$/,Oh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ih=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cu=/^[A-Za-z0-9_-]*$/;var Rh=/^https?$/,Nh=/^\+[1-9]\d{6,14}$/,Ah="(?:(?:\\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])))",Dh=new RegExp(`^${Ah}$`);function jh(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Mh(t){return new RegExp(`^${jh(t)}$`)}function Zh(t){let e=jh({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Ah}T(?:${n})$`)}var Lh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var qh=/^-?\d+$/,uu=/^-?\d+(?:\.\d+)?$/,Fh=/^(?:true|false)$/i,Uh=/^null$/i;var Vh=/^[^A-Z]*$/,Bh=/^[^a-z]*$/;var Pe=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Hh={number:"number",bigint:"bigint",object:"date"},lu=v("$ZodCheckLessThan",(t,e)=>{Pe.init(t,e);let r=Hh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),du=v("$ZodCheckGreaterThan",(t,e)=>{Pe.init(t,e);let r=Hh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Wh=v("$ZodCheckMultipleOf",(t,e)=>{Pe.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Qc(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Gh=v("$ZodCheckNumberFormat",(t,e)=>{Pe.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=nu[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=o,a.maximum=s,r&&(a.pattern=qh)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Jh=v("$ZodCheckMaxLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!vo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let i=wo(o);n.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Kh=v("$ZodCheckMinLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!vo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let i=wo(o);n.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Yh=v("$ZodCheckLengthEquals",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!vo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let i=wo(o),a=s>e.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),ko=v("$ZodCheckStringFormat",(t,e)=>{var r,n;Pe.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Qh=v("$ZodCheckRegex",(t,e)=>{ko.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Xh=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Vh),ko.init(t,e)}),eg=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Bh),ko.init(t,e)}),tg=v("$ZodCheckIncludes",(t,e)=>{Pe.init(t,e);let r=Ft(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),rg=v("$ZodCheckStartsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`^${Ft(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),ng=v("$ZodCheckEndsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`.*${Ft(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});var og=v("$ZodCheckOverwrite",(t,e)=>{Pe.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var yi=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
90
90
  `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(`
91
- `))}};var sg={major:4,minor:4,patch:3};var le=v("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=sg;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(i,a,c)=>{let u=nr(i),l;for(let d of a){if(d._zod.def.when){if(nu(i)||!d._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,p=d._zod.check(i);if(p instanceof Promise&&c?.async===!1)throw new Tt;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,i.issues.length!==m&&(u||(u=nr(i,m)))});else{if(i.issues.length===m)continue;u||(u=nr(i,m))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(nr(i))return i.aborted=!0,i;let u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(i,a)=>{if(a.skipChecks)return t._zod.parse(i,a);if(a.direction==="backward"){let u=t._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=t._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Tt;return c.then(u=>o(u,n,a))}return o(c,n,a)}}oe(t,"~standard",()=>({validate:o=>{try{let s=bo(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return pi(t,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),_i=v("$ZodString",(t,e)=>{le.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Zh(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),de=v("$ZodStringFormat",(t,e)=>{xo.init(t,e),_i.init(t,e)}),mg=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=$h),de.init(t,e)}),hg=v("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=iu(n))}else e.pattern??(e.pattern=iu());de.init(t,e)}),gg=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=kh),de.init(t,e)}),yg=v("$ZodURL",(t,e)=>{de.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===Ih.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),_g=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Eh()),de.init(t,e)}),vg=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=xh),de.init(t,e)}),bg=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=yh),de.init(t,e)}),wg=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=_h),de.init(t,e)}),xg=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=vh),de.init(t,e)}),Sg=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=bh),de.init(t,e)}),$g=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=wh),de.init(t,e)}),kg=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Mh(e)),de.init(t,e)}),Eg=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Ah),de.init(t,e)}),zg=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=jh(e)),de.init(t,e)}),Pg=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Sh),de.init(t,e)}),Tg=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=zh),de.init(t,e),t._zod.bag.format="ipv4"}),Cg=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Ph),de.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}});var Og=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Th),de.init(t,e)}),Ig=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Ch),de.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,s]=n;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Rg(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Ng=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Oh),de.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Rg(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function fP(t){if(!au.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Rg(r)}var Ag=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=au),de.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{fP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Dg=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Rh),de.init(t,e)});function pP(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}var jg=v("$ZodJWT",(t,e)=>{de.init(t,e),t._zod.check=r=>{pP(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var fu=v("$ZodNumber",(t,e)=>{le.init(t,e),t._zod.pattern=t._zod.bag.pattern??cu,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Mg=v("$ZodNumberFormat",(t,e)=>{Wh.init(t,e),fu.init(t,e)}),Zg=v("$ZodBoolean",(t,e)=>{le.init(t,e),t._zod.pattern=qh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}});var Lg=v("$ZodNull",(t,e)=>{le.init(t,e),t._zod.pattern=Fh,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}});var qg=v("$ZodUnknown",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Fg=v("$ZodNever",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function ig(t,e,r){t.issues.length&&e.issues.push(...Ut(r,t.issues)),e.value[r]=t.value}var Ug=v("$ZodArray",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=e.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(u=>ig(u,r,i))):ig(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function yi(t,e,r,n,o,s){let i=r in n;if(t.issues.length){if(o&&s&&!i)return;e.issues.push(...Ut(r,t.issues))}if(!i&&!o){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?i&&(e.value[r]=void 0):e.value[r]=t.value}function Vg(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=tu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Bg(t,e,r,n,o,s){let i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let m in e){if(m==="__proto__"||a.has(m))continue;if(u==="never"){i.push(m);continue}let p=c.run({value:e[m],issues:[]},n);p instanceof Promise?t.push(p.then(f=>yi(f,r,m,e,l,d))):yi(p,r,m,e,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var mP=v("$ZodObject",(t,e)=>{if(le.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let n=mn(()=>Vg(e));oe(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let o=Mr,s=e.catchall,i;t._zod.parse=(a,c)=>{i??(i=n.value);let u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=i.shape;for(let m of i.keys){let p=d[m],f=p._zod.optin==="optional",h=p._zod.optout==="optional",g=p._zod.run({value:u[m],issues:[]},c);g instanceof Promise?l.push(g.then(_=>yi(_,a,m,u,f,h))):yi(g,a,m,u,f,h)}return s?Bg(l,u,a,c,n.value,t):l.length?Promise.all(l).then(()=>a):a}}),Hg=v("$ZodObjectJIT",(t,e)=>{mP.init(t,e);let r=t._zod.parse,n=mn(()=>Vg(e)),o=m=>{let p=new hi(["shape","payload","ctx"]),f=n.value,h=w=>{let S=ai(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");let g=Object.create(null),_=0;for(let w of f.keys)g[w]=`key_${_++}`;p.write("const newResult = {};");for(let w of f.keys){let S=g[w],k=ai(w),W=m[w],Z=W?._zod?.optin==="optional",re=W?._zod?.optout==="optional";p.write(`const ${S} = ${h(w)};`),Z&&re?p.write(`
91
+ `))}};var ig={major:4,minor:4,patch:3};var le=v("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=ig;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(i,a,c)=>{let u=nr(i),l;for(let d of a){if(d._zod.def.when){if(ou(i)||!d._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,p=d._zod.check(i);if(p instanceof Promise&&c?.async===!1)throw new Tt;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,i.issues.length!==m&&(u||(u=nr(i,m)))});else{if(i.issues.length===m)continue;u||(u=nr(i,m))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(nr(i))return i.aborted=!0,i;let u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(i,a)=>{if(a.skipChecks)return t._zod.parse(i,a);if(a.direction==="backward"){let u=t._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=t._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Tt;return c.then(u=>o(u,n,a))}return o(c,n,a)}}oe(t,"~standard",()=>({validate:o=>{try{let s=So(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return hi(t,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),bi=v("$ZodString",(t,e)=>{le.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Lh(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),de=v("$ZodStringFormat",(t,e)=>{ko.init(t,e),bi.init(t,e)}),hg=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=kh),de.init(t,e)}),gg=v("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=au(n))}else e.pattern??(e.pattern=au());de.init(t,e)}),yg=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Eh),de.init(t,e)}),_g=v("$ZodURL",(t,e)=>{de.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===Rh.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),vg=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=zh()),de.init(t,e)}),bg=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Sh),de.init(t,e)}),wg=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=_h),de.init(t,e)}),xg=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=vh),de.init(t,e)}),Sg=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=bh),de.init(t,e)}),$g=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=wh),de.init(t,e)}),kg=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=xh),de.init(t,e)}),Eg=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Zh(e)),de.init(t,e)}),zg=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Dh),de.init(t,e)}),Pg=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Mh(e)),de.init(t,e)}),Tg=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=$h),de.init(t,e)}),Cg=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Ph),de.init(t,e),t._zod.bag.format="ipv4"}),Og=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Th),de.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}});var Ig=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ch),de.init(t,e)}),Rg=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Oh),de.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,s]=n;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Ng(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Ag=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Ih),de.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Ng(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function mP(t){if(!cu.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ng(r)}var Dg=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=cu),de.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{mP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),jg=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Nh),de.init(t,e)});function hP(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}var Mg=v("$ZodJWT",(t,e)=>{de.init(t,e),t._zod.check=r=>{hP(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var pu=v("$ZodNumber",(t,e)=>{le.init(t,e),t._zod.pattern=t._zod.bag.pattern??uu,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Zg=v("$ZodNumberFormat",(t,e)=>{Gh.init(t,e),pu.init(t,e)}),Lg=v("$ZodBoolean",(t,e)=>{le.init(t,e),t._zod.pattern=Fh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}});var qg=v("$ZodNull",(t,e)=>{le.init(t,e),t._zod.pattern=Uh,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}});var Fg=v("$ZodUnknown",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Ug=v("$ZodNever",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function ag(t,e,r){t.issues.length&&e.issues.push(...Ut(r,t.issues)),e.value[r]=t.value}var Vg=v("$ZodArray",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=e.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(u=>ag(u,r,i))):ag(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function vi(t,e,r,n,o,s){let i=r in n;if(t.issues.length){if(o&&s&&!i)return;e.issues.push(...Ut(r,t.issues))}if(!i&&!o){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?i&&(e.value[r]=void 0):e.value[r]=t.value}function Bg(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=ru(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Hg(t,e,r,n,o,s){let i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let m in e){if(m==="__proto__"||a.has(m))continue;if(u==="never"){i.push(m);continue}let p=c.run({value:e[m],issues:[]},n);p instanceof Promise?t.push(p.then(f=>vi(f,r,m,e,l,d))):vi(p,r,m,e,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var gP=v("$ZodObject",(t,e)=>{if(le.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let n=hn(()=>Bg(e));oe(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let o=Mr,s=e.catchall,i;t._zod.parse=(a,c)=>{i??(i=n.value);let u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=i.shape;for(let m of i.keys){let p=d[m],f=p._zod.optin==="optional",h=p._zod.optout==="optional",g=p._zod.run({value:u[m],issues:[]},c);g instanceof Promise?l.push(g.then(_=>vi(_,a,m,u,f,h))):vi(g,a,m,u,f,h)}return s?Hg(l,u,a,c,n.value,t):l.length?Promise.all(l).then(()=>a):a}}),Wg=v("$ZodObjectJIT",(t,e)=>{gP.init(t,e);let r=t._zod.parse,n=hn(()=>Bg(e)),o=m=>{let p=new yi(["shape","payload","ctx"]),f=n.value,h=w=>{let S=ui(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");let g=Object.create(null),_=0;for(let w of f.keys)g[w]=`key_${_++}`;p.write("const newResult = {};");for(let w of f.keys){let S=g[w],k=ui(w),W=m[w],Z=W?._zod?.optin==="optional",re=W?._zod?.optout==="optional";p.write(`const ${S} = ${h(w)};`),Z&&re?p.write(`
92
92
  if (${S}.issues.length) {
93
93
  if (${k} in input) {
94
94
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
@@ -147,11 +147,11 @@ For more information, visit: https://github.com/your-org/eui-compodoc-mcp
147
147
  }
148
148
  }
149
149
 
150
- `)}p.write("payload.value = newResult;"),p.write("return payload;");let x=p.compile();return(w,S)=>x(m,w,S)},s,i=Mr,a=!fn.jitless,u=a&&Xc.value,l=e.catchall,d;t._zod.parse=(m,p)=>{d??(d=n.value);let f=m.value;return i(f)?a&&u&&p?.async===!1&&p.jitless!==!0?(s||(s=o(e.shape)),m=s(m,p),l?Bg([],f,m,p,d,t):m):r(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),m)}});function ag(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!nr(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>at(i,n,tt())))}),e)}var pu=v("$ZodUnion",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),oe(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),oe(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),oe(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>yo(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>ag(a,n,t,o)):ag(i,n,t,o)}});var Wg=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,pu.init(t,e);let r=t._zod.parse;oe(t._zod,"propValues",()=>{let o={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=mn(()=>{let o=e.options,s=new Map;for(let i of o){let a=i._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});t._zod.parse=(o,s)=>{let i=o.value;if(!Mr(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),o;let a=n.value.get(i?.[e.discriminator]);return a?a._zod.run(o,s):e.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:i,path:[e.discriminator],inst:t}),o)}}),Gg=v("$ZodIntersection",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),i=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>cg(r,c,u)):cg(r,s,i)}});function du(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(rr(t)&&rr(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let i=du(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let o=t[n],s=e[n],i=du(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function cg(t,e,r){let n=new Map,o;for(let a of e.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(a);let s=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&t.issues.push({...o,keys:s}),nr(t))return t;let i=du(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var Jg=v("$ZodRecord",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!rr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],i=e.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>at(p,n,tt())),input:u,path:[u],inst:t});continue}let d=l.value,m=e.valueType._zod.run({value:o[u],issues:[]},n);m instanceof Promise?s.push(m.then(p=>{p.issues.length&&r.issues.push(...Ut(u,p.issues)),r.value[d]=p.value})):(m.issues.length&&r.issues.push(...Ut(u,m.issues)),r.value[d]=m.value)}let c;for(let u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&cu.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=o[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>at(d,n,tt())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:o[a],issues:[]},n);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...Ut(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Ut(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Kg=v("$ZodEnum",(t,e)=>{le.init(t,e);let r=ho(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>eu.has(typeof o)).map(o=>typeof o=="string"?Ft(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:t}),o}}),Yg=v("$ZodLiteral",(t,e)=>{if(le.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Ft(n):n?Ft(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var Qg=v("$ZodTransform",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new dn(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new Tt;return r.value=o,r.fallback=!0,r}});function ug(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var mu=v("$ZodOptional",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.optout="optional",oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${yo(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>ug(i,o)):ug(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),Xg=v("$ZodExactOptional",(t,e)=>{mu.init(t,e),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),ey=v("$ZodNullable",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.innerType._zod.optin),oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${yo(r.source)}|null)$`):void 0}),oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),ty=v("$ZodDefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>lg(s,e)):lg(o,e)}});function lg(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ry=v("$ZodPrefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),ny=v("$ZodNonOptional",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>dg(s,t)):dg(o,t)}});function dg(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var oy=v("$ZodCatch",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>at(i,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>at(s,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var hu=v("$ZodPipe",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>e.in._zod.values),oe(t._zod,"optin",()=>e.in._zod.optin),oe(t._zod,"optout",()=>e.out._zod.optout),oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(i=>gi(i,e.in,n)):gi(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>gi(s,e.out,n)):gi(o,e.out,n)}});function gi(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var sy=v("$ZodPreprocess",(t,e)=>{hu.init(t,e)}),iy=v("$ZodReadonly",(t,e)=>{le.init(t,e),oe(t._zod,"propValues",()=>e.innerType._zod.propValues),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"optin",()=>e.innerType?._zod?.optin),oe(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(fg):fg(o)}});function fg(t){return t.value=Object.freeze(t.value),t}var ay=v("$ZodCustom",(t,e)=>{Pe.init(t,e),le.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>pg(s,r,n,t));pg(o,r,n,t)}});function pg(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(hn(o))}}var hP=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,i=ou(o.input),a=n[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${ui(o.values[0])}`:`Invalid option: expected one of ${ii(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",i=e(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",i=e(o.origin);return i?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${ii(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function cy(){return{localeError:hP()}}var uy;var gu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function gP(){return new gu}(uy=globalThis).__zod_globalRegistry??(uy.__zod_globalRegistry=gP());var Zr=globalThis.__zod_globalRegistry;function ly(t,e){return new t({type:"string",...R(e)})}function dy(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...R(e)})}function yu(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...R(e)})}function fy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}function py(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}function my(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}function hy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}function gy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...R(e)})}function yy(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...R(e)})}function _y(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}function vy(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}function by(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}function wy(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}function xy(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}function Sy(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}function $y(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}function ky(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}function Ey(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}function zy(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}function Py(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...R(e)})}function Ty(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...R(e)})}function Cy(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}function Oy(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}function Iy(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(e)})}function Ry(t,e){return new t({type:"string",format:"date",check:"string_format",...R(e)})}function Ny(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}function Ay(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}function Dy(t,e){return new t({type:"number",checks:[],...R(e)})}function jy(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}function My(t,e){return new t({type:"boolean",...R(e)})}function Zy(t,e){return new t({type:"null",...R(e)})}function Ly(t){return new t({type:"unknown"})}function qy(t,e){return new t({type:"never",...R(e)})}function vi(t,e){return new uu({check:"less_than",...R(e),value:t,inclusive:!1})}function So(t,e){return new uu({check:"less_than",...R(e),value:t,inclusive:!0})}function bi(t,e){return new lu({check:"greater_than",...R(e),value:t,inclusive:!1})}function $o(t,e){return new lu({check:"greater_than",...R(e),value:t,inclusive:!0})}function wi(t,e){return new Hh({check:"multiple_of",...R(e),value:t})}function xi(t,e){return new Gh({check:"max_length",...R(e),maximum:t})}function gn(t,e){return new Jh({check:"min_length",...R(e),minimum:t})}function Si(t,e){return new Kh({check:"length_equals",...R(e),length:t})}function _u(t,e){return new Yh({check:"string_format",format:"regex",...R(e),pattern:t})}function vu(t){return new Qh({check:"string_format",format:"lowercase",...R(t)})}function bu(t){return new Xh({check:"string_format",format:"uppercase",...R(t)})}function wu(t,e){return new eg({check:"string_format",format:"includes",...R(e),includes:t})}function xu(t,e){return new tg({check:"string_format",format:"starts_with",...R(e),prefix:t})}function Su(t,e){return new rg({check:"string_format",format:"ends_with",...R(e),suffix:t})}function or(t){return new ng({check:"overwrite",tx:t})}function $u(t){return or(e=>e.normalize(t))}function ku(){return or(t=>t.trim())}function Eu(){return or(t=>t.toLowerCase())}function zu(){return or(t=>t.toUpperCase())}function Pu(){return or(t=>Qc(t))}function Fy(t,e,r){return new t({type:"array",element:e,...R(r)})}function Uy(t,e,r){let n=R(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Vy(t,e,r){return new t({type:"custom",check:"custom",fn:e,...R(r)})}function By(t,e){let r=yP(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(hn(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(hn(s))}},t(n.value,n)),e);return r}function yP(t,e){let r=new Pe({check:"custom",...R(e)});return r._zod.check=t,r}function Tu(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Zr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Se(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);let a=t._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,l);else{let m=i.schema,p=e.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(t,e,m,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),Se(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(i.schema,c),e.io==="input"&&qe(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function Cu(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let i of t.seen.entries()){let a=t.metadataRegistry.get(i[0])?.id;if(a){let c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}let o=i=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(i[0])?.id,m=t.external.uri??(f=>f);if(d)return{ref:m(d)};let p=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=p,{defId:p,ref:`${m("__shared")}#/${a}/${p}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let i of t.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
150
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");let x=p.compile();return(w,S)=>x(m,w,S)},s,i=Mr,a=!pn.jitless,u=a&&eu.value,l=e.catchall,d;t._zod.parse=(m,p)=>{d??(d=n.value);let f=m.value;return i(f)?a&&u&&p?.async===!1&&p.jitless!==!0?(s||(s=o(e.shape)),m=s(m,p),l?Hg([],f,m,p,d,t):m):r(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),m)}});function cg(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!nr(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>at(i,n,tt())))}),e)}var mu=v("$ZodUnion",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),oe(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),oe(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),oe(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>bo(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>cg(a,n,t,o)):cg(i,n,t,o)}});var Gg=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,mu.init(t,e);let r=t._zod.parse;oe(t._zod,"propValues",()=>{let o={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=hn(()=>{let o=e.options,s=new Map;for(let i of o){let a=i._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});t._zod.parse=(o,s)=>{let i=o.value;if(!Mr(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),o;let a=n.value.get(i?.[e.discriminator]);return a?a._zod.run(o,s):e.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:i,path:[e.discriminator],inst:t}),o)}}),Jg=v("$ZodIntersection",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),i=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>ug(r,c,u)):ug(r,s,i)}});function fu(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(rr(t)&&rr(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let i=fu(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let o=t[n],s=e[n],i=fu(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ug(t,e,r){let n=new Map,o;for(let a of e.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(a);let s=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&t.issues.push({...o,keys:s}),nr(t))return t;let i=fu(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var Kg=v("$ZodRecord",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!rr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],i=e.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>at(p,n,tt())),input:u,path:[u],inst:t});continue}let d=l.value,m=e.valueType._zod.run({value:o[u],issues:[]},n);m instanceof Promise?s.push(m.then(p=>{p.issues.length&&r.issues.push(...Ut(u,p.issues)),r.value[d]=p.value})):(m.issues.length&&r.issues.push(...Ut(u,m.issues)),r.value[d]=m.value)}let c;for(let u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&uu.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=o[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>at(d,n,tt())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:o[a],issues:[]},n);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...Ut(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Ut(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Yg=v("$ZodEnum",(t,e)=>{le.init(t,e);let r=_o(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>tu.has(typeof o)).map(o=>typeof o=="string"?Ft(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:t}),o}}),Qg=v("$ZodLiteral",(t,e)=>{if(le.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Ft(n):n?Ft(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var Xg=v("$ZodTransform",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new Tt;return r.value=o,r.fallback=!0,r}});function lg(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var hu=v("$ZodOptional",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.optout="optional",oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bo(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>lg(i,o)):lg(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),ey=v("$ZodExactOptional",(t,e)=>{hu.init(t,e),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),ty=v("$ZodNullable",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.innerType._zod.optin),oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bo(r.source)}|null)$`):void 0}),oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),ry=v("$ZodDefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>dg(s,e)):dg(o,e)}});function dg(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ny=v("$ZodPrefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),oy=v("$ZodNonOptional",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>fg(s,t)):fg(o,t)}});function fg(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var sy=v("$ZodCatch",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>at(i,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>at(s,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var gu=v("$ZodPipe",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>e.in._zod.values),oe(t._zod,"optin",()=>e.in._zod.optin),oe(t._zod,"optout",()=>e.out._zod.optout),oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(i=>_i(i,e.in,n)):_i(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>_i(s,e.out,n)):_i(o,e.out,n)}});function _i(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var iy=v("$ZodPreprocess",(t,e)=>{gu.init(t,e)}),ay=v("$ZodReadonly",(t,e)=>{le.init(t,e),oe(t._zod,"propValues",()=>e.innerType._zod.propValues),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"optin",()=>e.innerType?._zod?.optin),oe(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(pg):pg(o)}});function pg(t){return t.value=Object.freeze(t.value),t}var cy=v("$ZodCustom",(t,e)=>{Pe.init(t,e),le.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>mg(s,r,n,t));mg(o,r,n,t)}});function mg(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(gn(o))}}var yP=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,i=su(o.input),a=n[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${di(o.values[0])}`:`Invalid option: expected one of ${ci(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",i=e(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",i=e(o.origin);return i?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${ci(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function uy(){return{localeError:yP()}}var ly;var yu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function _P(){return new yu}(ly=globalThis).__zod_globalRegistry??(ly.__zod_globalRegistry=_P());var Zr=globalThis.__zod_globalRegistry;function dy(t,e){return new t({type:"string",...R(e)})}function fy(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...R(e)})}function _u(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...R(e)})}function py(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}function my(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}function hy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}function gy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}function yy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...R(e)})}function _y(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...R(e)})}function vy(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}function by(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}function wy(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}function xy(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}function Sy(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}function $y(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}function ky(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}function Ey(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}function zy(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}function Py(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}function Ty(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...R(e)})}function Cy(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...R(e)})}function Oy(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}function Iy(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}function Ry(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(e)})}function Ny(t,e){return new t({type:"string",format:"date",check:"string_format",...R(e)})}function Ay(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}function Dy(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}function jy(t,e){return new t({type:"number",checks:[],...R(e)})}function My(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}function Zy(t,e){return new t({type:"boolean",...R(e)})}function Ly(t,e){return new t({type:"null",...R(e)})}function qy(t){return new t({type:"unknown"})}function Fy(t,e){return new t({type:"never",...R(e)})}function wi(t,e){return new lu({check:"less_than",...R(e),value:t,inclusive:!1})}function Eo(t,e){return new lu({check:"less_than",...R(e),value:t,inclusive:!0})}function xi(t,e){return new du({check:"greater_than",...R(e),value:t,inclusive:!1})}function zo(t,e){return new du({check:"greater_than",...R(e),value:t,inclusive:!0})}function Si(t,e){return new Wh({check:"multiple_of",...R(e),value:t})}function $i(t,e){return new Jh({check:"max_length",...R(e),maximum:t})}function yn(t,e){return new Kh({check:"min_length",...R(e),minimum:t})}function ki(t,e){return new Yh({check:"length_equals",...R(e),length:t})}function vu(t,e){return new Qh({check:"string_format",format:"regex",...R(e),pattern:t})}function bu(t){return new Xh({check:"string_format",format:"lowercase",...R(t)})}function wu(t){return new eg({check:"string_format",format:"uppercase",...R(t)})}function xu(t,e){return new tg({check:"string_format",format:"includes",...R(e),includes:t})}function Su(t,e){return new rg({check:"string_format",format:"starts_with",...R(e),prefix:t})}function $u(t,e){return new ng({check:"string_format",format:"ends_with",...R(e),suffix:t})}function or(t){return new og({check:"overwrite",tx:t})}function ku(t){return or(e=>e.normalize(t))}function Eu(){return or(t=>t.trim())}function zu(){return or(t=>t.toLowerCase())}function Pu(){return or(t=>t.toUpperCase())}function Tu(){return or(t=>Xc(t))}function Uy(t,e,r){return new t({type:"array",element:e,...R(r)})}function Vy(t,e,r){let n=R(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function By(t,e,r){return new t({type:"custom",check:"custom",fn:e,...R(r)})}function Hy(t,e){let r=vP(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(gn(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(gn(s))}},t(n.value,n)),e);return r}function vP(t,e){let r=new Pe({check:"custom",...R(e)});return r._zod.check=t,r}function Cu(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Zr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Se(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);let a=t._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,l);else{let m=i.schema,p=e.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(t,e,m,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),Se(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(i.schema,c),e.io==="input"&&qe(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function Ou(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let i of t.seen.entries()){let a=t.metadataRegistry.get(i[0])?.id;if(a){let c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}let o=i=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(i[0])?.id,m=t.external.uri??(f=>f);if(d)return{ref:m(d)};let p=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=p,{defId:p,ref:`${m("__shared")}#/${a}/${p}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let i of t.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
151
151
 
152
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of t.seen.entries()){let a=i[1];if(e===i[0]){s(i);continue}if(t.external){let u=t.external.registry.get(i[0])?.id;if(e!==i[0]&&u){s(i);continue}}if(t.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&t.reused==="ref"){s(i);continue}}}function Ou(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),f=p.schema;if(f.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(f)):Object.assign(u,f),Object.assign(u,l),a._zod.parent===d)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(f.$ref&&p.def)for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}let m=a._zod.parent;if(m&&m!==d){n(m);let p=t.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let f in u)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(u[f])===JSON.stringify(p.def[f])&&delete u[f]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(a)}Object.assign(o,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&o.id===s&&delete o.id;let i=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:ko(e,"input",t.processors),output:ko(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function qe(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return qe(n.element,r);if(n.type==="set")return qe(n.valueType,r);if(n.type==="lazy")return qe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return qe(n.innerType,r);if(n.type==="intersection")return qe(n.left,r)||qe(n.right,r);if(n.type==="record"||n.type==="map")return qe(n.keyType,r)||qe(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:qe(n.in,r)||qe(n.out,r);if(n.type==="object"){for(let o in n.shape)if(qe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(qe(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(qe(o,r))return!0;return!!(n.rest&&qe(n.rest,r))}return!1}var Hy=(t,e={})=>r=>{let n=Tu({...r,processors:e});return Se(t,n),Cu(n,t),Ou(n,t)},ko=(t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Tu({...o??{},target:s,io:e,processors:r});return Se(t,i),Cu(i,t),Ou(i,t)};var _P={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Wy=(t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=_P[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Gy=(t,e,r,n)=>{let o=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof s=="number"&&(o.minimum=s),m?p?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},Jy=(t,e,r,n)=>{r.type="boolean"};var Ky=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var Yy=(t,e,r,n)=>{r.not={}};var Qy=(t,e,r,n)=>{};var Xy=(t,e,r,n)=>{let o=t._zod.def,s=ho(o.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},e_=(t,e,r,n)=>{let o=t._zod.def,s=[];for(let i of o.values)if(i===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var t_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var r_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var n_=(t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:i,maximum:a}=t._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Se(s.element,e,{...n,path:[...n.path,"items"]})},o_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object",o.properties={};let i=s.shape;for(let u in i)o.properties[u]=Se(i[u],e,{...n,path:[...n.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Se(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},s_=(t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Se(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},i_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=Se(o.right,e,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c};var a_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Se(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let d of c)o.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Se(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Se(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l)}},c_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.innerType,e,n),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},u_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},l_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},d_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},f_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},p_=(t,e,r,n)=>{let o=t._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?o.out:o.in:o.out;Se(i,e,n);let a=e.seen.get(t);a.ref=i},m_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0};var Iu=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType};function yn(t){return!!t._zod}function sr(t,e){return yn(t)?bo(t,e):t.safeParse(e)}function $i(t){if(!t)return;let e;if(yn(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function h_(t){if(yn(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var zo={};of(zo,{ZodISODate:()=>y_,ZodISODateTime:()=>g_,ZodISODuration:()=>v_,ZodISOTime:()=>__,date:()=>Nu,datetime:()=>Ru,duration:()=>Du,time:()=>Au});var g_=v("ZodISODateTime",(t,e)=>{kg.init(t,e),ge.init(t,e)});function Ru(t){return Iy(g_,t)}var y_=v("ZodISODate",(t,e)=>{Eg.init(t,e),ge.init(t,e)});function Nu(t){return Ry(y_,t)}var __=v("ZodISOTime",(t,e)=>{zg.init(t,e),ge.init(t,e)});function Au(t){return Ny(__,t)}var v_=v("ZodISODuration",(t,e)=>{Pg.init(t,e),ge.init(t,e)});function Du(t){return Ay(v_,t)}var zP=(t,e)=>{li.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>ch(t,r)},flatten:{value:r=>ah(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,pn,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,pn,2)}},isEmpty:{get(){return t.issues.length===0}}})};var rt=v("ZodError",zP,{Parent:Error});var b_=di(rt),w_=fi(rt),x_=vo(rt),S_=wo(rt),$_=uh(rt),k_=lh(rt),E_=dh(rt),z_=fh(rt),P_=ph(rt),T_=mh(rt),C_=hh(rt),O_=gh(rt);var I_=new WeakMap;function Po(t,e,r){let n=Object.getPrototypeOf(t),o=I_.get(n);if(o||(o=new Set,I_.set(n,o)),!o.has(e)){o.add(e);for(let s in r){let i=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var _e=v("ZodType",(t,e)=>(le.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ko(t,"input"),output:ko(t,"output")}}),t.toJSONSchema=Hy(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>b_(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>x_(t,r,n),t.parseAsync=async(r,n)=>w_(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>S_(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>$_(t,r,n),t.decode=(r,n)=>k_(t,r,n),t.encodeAsync=async(r,n)=>E_(t,r,n),t.decodeAsync=async(r,n)=>z_(t,r,n),t.safeEncode=(r,n)=>P_(t,r,n),t.safeDecode=(r,n)=>T_(t,r,n),t.safeEncodeAsync=async(r,n)=>C_(t,r,n),t.safeDecodeAsync=async(r,n)=>O_(t,r,n),Po(t,"ZodType",{check(...r){let n=this.def;return this.clone(Y.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return wt(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(yT(r,n))},superRefine(r,n){return this.check(_T(r,n))},overwrite(r){return this.check(or(r))},optional(){return we(this)},exactOptional(){return sT(this)},nullable(){return D_(this)},nullish(){return we(D_(this))},nonoptional(r){return dT(this,r)},array(){return J(this)},or(r){return ce([this,r])},and(r){return Ei(this,r)},transform(r){return j_(this,F_(r))},default(r){return cT(this,r)},prefault(r){return lT(this,r)},catch(r){return pT(this,r)},pipe(r){return j_(this,r)},readonly(){return gT(this)},describe(r){let n=this.clone();return Zr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Zr.get(this);let n=this.clone();return Zr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Zr.get(t)?.description},configurable:!0}),t)),M_=v("_ZodString",(t,e)=>{_i.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Wy(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Po(t,"_ZodString",{regex(...n){return this.check(_u(...n))},includes(...n){return this.check(wu(...n))},startsWith(...n){return this.check(xu(...n))},endsWith(...n){return this.check(Su(...n))},min(...n){return this.check(gn(...n))},max(...n){return this.check(xi(...n))},length(...n){return this.check(Si(...n))},nonempty(...n){return this.check(gn(1,...n))},lowercase(n){return this.check(vu(n))},uppercase(n){return this.check(bu(n))},trim(){return this.check(ku())},normalize(...n){return this.check($u(...n))},toLowerCase(){return this.check(Eu())},toUpperCase(){return this.check(zu())},slugify(){return this.check(Pu())}})}),TP=v("ZodString",(t,e)=>{_i.init(t,e),M_.init(t,e),t.email=r=>t.check(dy(CP,r)),t.url=r=>t.check(gy(OP,r)),t.jwt=r=>t.check(Oy(HP,r)),t.emoji=r=>t.check(yy(IP,r)),t.guid=r=>t.check(yu(R_,r)),t.uuid=r=>t.check(fy(ki,r)),t.uuidv4=r=>t.check(py(ki,r)),t.uuidv6=r=>t.check(my(ki,r)),t.uuidv7=r=>t.check(hy(ki,r)),t.nanoid=r=>t.check(_y(RP,r)),t.guid=r=>t.check(yu(R_,r)),t.cuid=r=>t.check(vy(NP,r)),t.cuid2=r=>t.check(by(AP,r)),t.ulid=r=>t.check(wy(DP,r)),t.base64=r=>t.check(Py(UP,r)),t.base64url=r=>t.check(Ty(VP,r)),t.xid=r=>t.check(xy(jP,r)),t.ksuid=r=>t.check(Sy(MP,r)),t.ipv4=r=>t.check($y(ZP,r)),t.ipv6=r=>t.check(ky(LP,r)),t.cidrv4=r=>t.check(Ey(qP,r)),t.cidrv6=r=>t.check(zy(FP,r)),t.e164=r=>t.check(Cy(BP,r)),t.datetime=r=>t.check(Ru(r)),t.date=r=>t.check(Nu(r)),t.time=r=>t.check(Au(r)),t.duration=r=>t.check(Du(r))});function y(t){return ly(TP,t)}var ge=v("ZodStringFormat",(t,e)=>{de.init(t,e),M_.init(t,e)}),CP=v("ZodEmail",(t,e)=>{gg.init(t,e),ge.init(t,e)});var R_=v("ZodGUID",(t,e)=>{mg.init(t,e),ge.init(t,e)});var ki=v("ZodUUID",(t,e)=>{hg.init(t,e),ge.init(t,e)});var OP=v("ZodURL",(t,e)=>{yg.init(t,e),ge.init(t,e)});var IP=v("ZodEmoji",(t,e)=>{_g.init(t,e),ge.init(t,e)});var RP=v("ZodNanoID",(t,e)=>{vg.init(t,e),ge.init(t,e)});var NP=v("ZodCUID",(t,e)=>{bg.init(t,e),ge.init(t,e)});var AP=v("ZodCUID2",(t,e)=>{wg.init(t,e),ge.init(t,e)});var DP=v("ZodULID",(t,e)=>{xg.init(t,e),ge.init(t,e)});var jP=v("ZodXID",(t,e)=>{Sg.init(t,e),ge.init(t,e)});var MP=v("ZodKSUID",(t,e)=>{$g.init(t,e),ge.init(t,e)});var ZP=v("ZodIPv4",(t,e)=>{Tg.init(t,e),ge.init(t,e)});var LP=v("ZodIPv6",(t,e)=>{Cg.init(t,e),ge.init(t,e)});var qP=v("ZodCIDRv4",(t,e)=>{Og.init(t,e),ge.init(t,e)});var FP=v("ZodCIDRv6",(t,e)=>{Ig.init(t,e),ge.init(t,e)});var UP=v("ZodBase64",(t,e)=>{Ng.init(t,e),ge.init(t,e)});var VP=v("ZodBase64URL",(t,e)=>{Ag.init(t,e),ge.init(t,e)});var BP=v("ZodE164",(t,e)=>{Dg.init(t,e),ge.init(t,e)});var HP=v("ZodJWT",(t,e)=>{jg.init(t,e),ge.init(t,e)});var Z_=v("ZodNumber",(t,e)=>{fu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Gy(t,n,o,s),Po(t,"ZodNumber",{gt(n,o){return this.check(bi(n,o))},gte(n,o){return this.check($o(n,o))},min(n,o){return this.check($o(n,o))},lt(n,o){return this.check(vi(n,o))},lte(n,o){return this.check(So(n,o))},max(n,o){return this.check(So(n,o))},int(n){return this.check(N_(n))},safe(n){return this.check(N_(n))},positive(n){return this.check(bi(0,n))},nonnegative(n){return this.check($o(0,n))},negative(n){return this.check(vi(0,n))},nonpositive(n){return this.check(So(0,n))},multipleOf(n,o){return this.check(wi(n,o))},step(n,o){return this.check(wi(n,o))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function se(t){return Dy(Z_,t)}var WP=v("ZodNumberFormat",(t,e)=>{Mg.init(t,e),Z_.init(t,e)});function N_(t){return jy(WP,t)}var GP=v("ZodBoolean",(t,e)=>{Zg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Jy(t,r,n,o)});function ze(t){return My(GP,t)}var JP=v("ZodNull",(t,e)=>{Lg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ky(t,r,n,o)});function Mu(t){return Zy(JP,t)}var KP=v("ZodUnknown",(t,e)=>{qg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qy(t,r,n,o)});function ye(){return Ly(KP)}var YP=v("ZodNever",(t,e)=>{Fg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Yy(t,r,n,o)});function QP(t){return qy(YP,t)}var XP=v("ZodArray",(t,e)=>{Ug.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>n_(t,r,n,o),t.element=e.element,Po(t,"ZodArray",{min(r,n){return this.check(gn(r,n))},nonempty(r){return this.check(gn(1,r))},max(r,n){return this.check(xi(r,n))},length(r,n){return this.check(Si(r,n))},unwrap(){return this.element}})});function J(t,e){return Fy(XP,t,e)}var L_=v("ZodObject",(t,e)=>{Hg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>o_(t,r,n,o),Y.defineLazy(t,"shape",()=>e.shape),Po(t,"ZodObject",{keyof(){return We(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ye()})},loose(){return this.clone({...this._zod.def,catchall:ye()})},strict(){return this.clone({...this._zod.def,catchall:QP()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Y.extend(this,r)},safeExtend(r){return Y.safeExtend(this,r)},merge(r){return Y.merge(this,r)},pick(r){return Y.pick(this,r)},omit(r){return Y.omit(this,r)},partial(...r){return Y.partial(U_,this,r[0])},required(...r){return Y.required(V_,this,r[0])}})});function P(t,e){let r={type:"object",shape:t??{},...Y.normalizeParams(e)};return new L_(r)}function Fe(t,e){return new L_({type:"object",shape:t,catchall:ye(),...Y.normalizeParams(e)})}var q_=v("ZodUnion",(t,e)=>{pu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>s_(t,r,n,o),t.options=e.options});function ce(t,e){return new q_({type:"union",options:t,...Y.normalizeParams(e)})}var eT=v("ZodDiscriminatedUnion",(t,e)=>{q_.init(t,e),Wg.init(t,e)});function Zu(t,e,r){return new eT({type:"union",options:e,discriminator:t,...Y.normalizeParams(r)})}var tT=v("ZodIntersection",(t,e)=>{Gg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>i_(t,r,n,o)});function Ei(t,e){return new tT({type:"intersection",left:t,right:e})}var A_=v("ZodRecord",(t,e)=>{Jg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>a_(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ve(t,e,r){return!e||!e._zod?new A_({type:"record",keyType:y(),valueType:t,...Y.normalizeParams(e)}):new A_({type:"record",keyType:t,valueType:e,...Y.normalizeParams(r)})}var ju=v("ZodEnum",(t,e)=>{Kg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Xy(t,n,o,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new ju({...e,checks:[],...Y.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new ju({...e,checks:[],...Y.normalizeParams(o),entries:s})}});function We(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new ju({type:"enum",entries:r,...Y.normalizeParams(e)})}var rT=v("ZodLiteral",(t,e)=>{Yg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>e_(t,r,n,o),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function C(t,e){return new rT({type:"literal",values:Array.isArray(t)?t:[t],...Y.normalizeParams(e)})}var nT=v("ZodTransform",(t,e)=>{Qg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>r_(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new dn(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Y.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(Y.issue(i))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function F_(t){return new nT({type:"transform",transform:t})}var U_=v("ZodOptional",(t,e)=>{mu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Iu(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function we(t){return new U_({type:"optional",innerType:t})}var oT=v("ZodExactOptional",(t,e)=>{Xg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Iu(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function sT(t){return new oT({type:"optional",innerType:t})}var iT=v("ZodNullable",(t,e)=>{ey.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>c_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function D_(t){return new iT({type:"nullable",innerType:t})}var aT=v("ZodDefault",(t,e)=>{ty.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>l_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function cT(t,e){return new aT({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var uT=v("ZodPrefault",(t,e)=>{ry.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>d_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function lT(t,e){return new uT({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var V_=v("ZodNonOptional",(t,e)=>{ny.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>u_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function dT(t,e){return new V_({type:"nonoptional",innerType:t,...Y.normalizeParams(e)})}var fT=v("ZodCatch",(t,e)=>{oy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>f_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function pT(t,e){return new fT({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var B_=v("ZodPipe",(t,e)=>{hu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>p_(t,r,n,o),t.in=e.in,t.out=e.out});function j_(t,e){return new B_({type:"pipe",in:t,out:e})}var mT=v("ZodPreprocess",(t,e)=>{B_.init(t,e),sy.init(t,e)}),hT=v("ZodReadonly",(t,e)=>{iy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>m_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function gT(t){return new hT({type:"readonly",innerType:t})}var H_=v("ZodCustom",(t,e)=>{ay.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>t_(t,r,n,o)});function W_(t,e){return Uy(H_,t??(()=>!0),e)}function yT(t,e={}){return Vy(H_,t,e)}function _T(t,e){return By(t,e)}function Lu(t,e){return new mT({type:"pipe",in:F_(t),out:e})}tt(cy());var Fu="2025-11-25";var G_=[Fu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ir="io.modelcontextprotocol/related-task",Pi="2.0",Te=W_(t=>t!==null&&(typeof t=="object"||typeof t=="function")),J_=ce([y(),se().int()]),K_=y(),uq=Fe({ttl:ce([se(),Mu()]).optional(),pollInterval:se().optional()}),vT=P({ttl:se().optional()}),bT=P({taskId:y()}),Uu=Fe({progressToken:J_.optional(),[ir]:bT.optional()}),nt=P({_meta:Uu.optional()}),To=nt.extend({task:vT.optional()}),Y_=t=>To.safeParse(t).success,Ce=P({method:y(),params:nt.loose().optional()}),ct=P({_meta:Uu.optional()}),ut=P({method:y(),params:ct.loose().optional()}),Oe=Fe({_meta:Uu.optional()}),Ti=ce([y(),se().int()]),Q_=P({jsonrpc:C(Pi),id:Ti,...Ce.shape}).strict(),Vu=t=>Q_.safeParse(t).success,X_=P({jsonrpc:C(Pi),...ut.shape}).strict(),ev=t=>X_.safeParse(t).success,Bu=P({jsonrpc:C(Pi),id:Ti,result:Oe}).strict(),Co=t=>Bu.safeParse(t).success;var G;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(G||(G={}));var Hu=P({jsonrpc:C(Pi),id:Ti.optional(),error:P({code:se().int(),message:y(),data:ye().optional()})}).strict();var tv=t=>Hu.safeParse(t).success;var rv=ce([Q_,X_,Bu,Hu]),lq=ce([Bu,Hu]),Ci=Oe.strict(),wT=ct.extend({requestId:Ti.optional(),reason:y().optional()}),Oi=ut.extend({method:C("notifications/cancelled"),params:wT}),xT=P({src:y(),mimeType:y().optional(),sizes:J(y()).optional(),theme:We(["light","dark"]).optional()}),Oo=P({icons:J(xT).optional()}),_n=P({name:y(),title:y().optional()}),nv=_n.extend({..._n.shape,...Oo.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),ST=Ei(P({applyDefaults:ze().optional()}),ve(y(),ye())),$T=Lu(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Ei(P({form:ST.optional(),url:Te.optional()}),ve(y(),ye()).optional())),kT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({sampling:Fe({createMessage:Te.optional()}).optional(),elicitation:Fe({create:Te.optional()}).optional()}).optional()}),ET=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({tools:Fe({call:Te.optional()}).optional()}).optional()}),zT=P({experimental:ve(y(),Te).optional(),sampling:P({context:Te.optional(),tools:Te.optional()}).optional(),elicitation:$T.optional(),roots:P({listChanged:ze().optional()}).optional(),tasks:kT.optional()}),PT=nt.extend({protocolVersion:y(),capabilities:zT,clientInfo:nv}),Wu=Ce.extend({method:C("initialize"),params:PT});var TT=P({experimental:ve(y(),Te).optional(),logging:Te.optional(),completions:Te.optional(),prompts:P({listChanged:ze().optional()}).optional(),resources:P({subscribe:ze().optional(),listChanged:ze().optional()}).optional(),tools:P({listChanged:ze().optional()}).optional(),tasks:ET.optional()}),CT=Oe.extend({protocolVersion:y(),capabilities:TT,serverInfo:nv,instructions:y().optional()}),Gu=ut.extend({method:C("notifications/initialized"),params:ct.optional()});var Ii=Ce.extend({method:C("ping"),params:nt.optional()}),OT=P({progress:se(),total:we(se()),message:we(y())}),IT=P({...ct.shape,...OT.shape,progressToken:J_}),Ri=ut.extend({method:C("notifications/progress"),params:IT}),RT=nt.extend({cursor:K_.optional()}),Io=Ce.extend({params:RT.optional()}),Ro=Oe.extend({nextCursor:K_.optional()}),NT=We(["working","input_required","completed","failed","cancelled"]),No=P({taskId:y(),status:NT,ttl:ce([se(),Mu()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:we(se()),statusMessage:we(y())}),vn=Oe.extend({task:No}),AT=ct.merge(No),Ao=ut.extend({method:C("notifications/tasks/status"),params:AT}),Ni=Ce.extend({method:C("tasks/get"),params:nt.extend({taskId:y()})}),Ai=Oe.merge(No),Di=Ce.extend({method:C("tasks/result"),params:nt.extend({taskId:y()})}),dq=Oe.loose(),ji=Io.extend({method:C("tasks/list")}),Mi=Ro.extend({tasks:J(No)}),Zi=Ce.extend({method:C("tasks/cancel"),params:nt.extend({taskId:y()})}),ov=Oe.merge(No),sv=P({uri:y(),mimeType:we(y()),_meta:ve(y(),ye()).optional()}),iv=sv.extend({text:y()}),Ju=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),av=sv.extend({blob:Ju}),Do=We(["user","assistant"]),bn=P({audience:J(Do).optional(),priority:se().min(0).max(1).optional(),lastModified:zo.datetime({offset:!0}).optional()}),cv=P({..._n.shape,...Oo.shape,uri:y(),description:we(y()),mimeType:we(y()),annotations:bn.optional(),_meta:we(Fe({}))}),DT=P({..._n.shape,...Oo.shape,uriTemplate:y(),description:we(y()),mimeType:we(y()),annotations:bn.optional(),_meta:we(Fe({}))}),jT=Io.extend({method:C("resources/list")}),MT=Ro.extend({resources:J(cv)}),ZT=Io.extend({method:C("resources/templates/list")}),LT=Ro.extend({resourceTemplates:J(DT)}),Ku=nt.extend({uri:y()}),qT=Ku,FT=Ce.extend({method:C("resources/read"),params:qT}),UT=Oe.extend({contents:J(ce([iv,av]))}),VT=ut.extend({method:C("notifications/resources/list_changed"),params:ct.optional()}),BT=Ku,HT=Ce.extend({method:C("resources/subscribe"),params:BT}),WT=Ku,GT=Ce.extend({method:C("resources/unsubscribe"),params:WT}),JT=ct.extend({uri:y()}),KT=ut.extend({method:C("notifications/resources/updated"),params:JT}),YT=P({name:y(),description:we(y()),required:we(ze())}),QT=P({..._n.shape,...Oo.shape,description:we(y()),arguments:we(J(YT)),_meta:we(Fe({}))}),XT=Io.extend({method:C("prompts/list")}),eC=Ro.extend({prompts:J(QT)}),tC=nt.extend({name:y(),arguments:ve(y(),y()).optional()}),rC=Ce.extend({method:C("prompts/get"),params:tC}),Yu=P({type:C("text"),text:y(),annotations:bn.optional(),_meta:ve(y(),ye()).optional()}),Qu=P({type:C("image"),data:Ju,mimeType:y(),annotations:bn.optional(),_meta:ve(y(),ye()).optional()}),Xu=P({type:C("audio"),data:Ju,mimeType:y(),annotations:bn.optional(),_meta:ve(y(),ye()).optional()}),nC=P({type:C("tool_use"),name:y(),id:y(),input:ve(y(),ye()),_meta:ve(y(),ye()).optional()}),oC=P({type:C("resource"),resource:ce([iv,av]),annotations:bn.optional(),_meta:ve(y(),ye()).optional()}),sC=cv.extend({type:C("resource_link")}),el=ce([Yu,Qu,Xu,sC,oC]),iC=P({role:Do,content:el}),aC=Oe.extend({description:y().optional(),messages:J(iC)}),cC=ut.extend({method:C("notifications/prompts/list_changed"),params:ct.optional()}),uC=P({title:y().optional(),readOnlyHint:ze().optional(),destructiveHint:ze().optional(),idempotentHint:ze().optional(),openWorldHint:ze().optional()}),lC=P({taskSupport:We(["required","optional","forbidden"]).optional()}),uv=P({..._n.shape,...Oo.shape,description:y().optional(),inputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()),outputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()).optional(),annotations:uC.optional(),execution:lC.optional(),_meta:ve(y(),ye()).optional()}),tl=Io.extend({method:C("tools/list")}),dC=Ro.extend({tools:J(uv)}),Li=Oe.extend({content:J(el).default([]),structuredContent:ve(y(),ye()).optional(),isError:ze().optional()}),fq=Li.or(Oe.extend({toolResult:ye()})),fC=To.extend({name:y(),arguments:ve(y(),ye()).optional()}),jo=Ce.extend({method:C("tools/call"),params:fC}),pC=ut.extend({method:C("notifications/tools/list_changed"),params:ct.optional()}),pq=P({autoRefresh:ze().default(!0),debounceMs:se().int().nonnegative().default(300)}),Mo=We(["debug","info","notice","warning","error","critical","alert","emergency"]),mC=nt.extend({level:Mo}),rl=Ce.extend({method:C("logging/setLevel"),params:mC}),hC=ct.extend({level:Mo,logger:y().optional(),data:ye()}),gC=ut.extend({method:C("notifications/message"),params:hC}),yC=P({name:y().optional()}),_C=P({hints:J(yC).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),vC=P({mode:We(["auto","required","none"]).optional()}),bC=P({type:C("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:J(el).default([]),structuredContent:P({}).loose().optional(),isError:ze().optional(),_meta:ve(y(),ye()).optional()}),wC=Zu("type",[Yu,Qu,Xu]),zi=Zu("type",[Yu,Qu,Xu,nC,bC]),xC=P({role:Do,content:ce([zi,J(zi)]),_meta:ve(y(),ye()).optional()}),SC=To.extend({messages:J(xC),modelPreferences:_C.optional(),systemPrompt:y().optional(),includeContext:We(["none","thisServer","allServers"]).optional(),temperature:se().optional(),maxTokens:se().int(),stopSequences:J(y()).optional(),metadata:Te.optional(),tools:J(uv).optional(),toolChoice:vC.optional()}),$C=Ce.extend({method:C("sampling/createMessage"),params:SC}),nl=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens"]).or(y())),role:Do,content:wC}),ol=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:Do,content:ce([zi,J(zi)])}),kC=P({type:C("boolean"),title:y().optional(),description:y().optional(),default:ze().optional()}),EC=P({type:C("string"),title:y().optional(),description:y().optional(),minLength:se().optional(),maxLength:se().optional(),format:We(["email","uri","date","date-time"]).optional(),default:y().optional()}),zC=P({type:We(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),PC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),default:y().optional()}),TC=P({type:C("string"),title:y().optional(),description:y().optional(),oneOf:J(P({const:y(),title:y()})),default:y().optional()}),CC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),enumNames:J(y()).optional(),default:y().optional()}),OC=ce([PC,TC]),IC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({type:C("string"),enum:J(y())}),default:J(y()).optional()}),RC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({anyOf:J(P({const:y(),title:y()}))}),default:J(y()).optional()}),NC=ce([IC,RC]),AC=ce([CC,OC,NC]),DC=ce([AC,kC,EC,zC]),jC=To.extend({mode:C("form").optional(),message:y(),requestedSchema:P({type:C("object"),properties:ve(y(),DC),required:J(y()).optional()})}),MC=To.extend({mode:C("url"),message:y(),elicitationId:y(),url:y().url()}),ZC=ce([jC,MC]),LC=Ce.extend({method:C("elicitation/create"),params:ZC}),qC=ct.extend({elicitationId:y()}),FC=ut.extend({method:C("notifications/elicitation/complete"),params:qC}),qi=Oe.extend({action:We(["accept","decline","cancel"]),content:Lu(t=>t===null?void 0:t,ve(y(),ce([y(),se(),ze(),J(y())])).optional())}),UC=P({type:C("ref/resource"),uri:y()});var VC=P({type:C("ref/prompt"),name:y()}),BC=nt.extend({ref:ce([VC,UC]),argument:P({name:y(),value:y()}),context:P({arguments:ve(y(),y()).optional()}).optional()}),HC=Ce.extend({method:C("completion/complete"),params:BC});var WC=Oe.extend({completion:Fe({values:J(y()).max(100),total:we(se().int()),hasMore:we(ze())})}),GC=P({uri:y().startsWith("file://"),name:y().optional(),_meta:ve(y(),ye()).optional()}),JC=Ce.extend({method:C("roots/list"),params:nt.optional()}),sl=Oe.extend({roots:J(GC)}),KC=ut.extend({method:C("notifications/roots/list_changed"),params:ct.optional()}),mq=ce([Ii,Wu,HC,rl,rC,XT,jT,ZT,FT,HT,GT,jo,tl,Ni,Di,ji,Zi]),hq=ce([Oi,Ri,Gu,KC,Ao]),gq=ce([Ci,nl,ol,qi,sl,Ai,Mi,vn]),yq=ce([Ii,$C,LC,JC,Ni,Di,ji,Zi]),_q=ce([Oi,Ri,gC,KT,VT,pC,cC,Ao,FC]),vq=ce([Ci,CT,WC,aC,eC,MT,LT,UT,Li,dC,Ai,Mi,vn]),L=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===G.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new qu(o.elicitations,r)}return new t(e,r,n)}},qu=class extends L{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(G.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function ar(t){return t==="completed"||t==="failed"||t==="cancelled"}var Qq=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function il(t){let r=$i(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=h_(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function al(t,e){let r=sr(t,e);if(!r.success)throw r.error;return r.data}var rO=6e4,Fi=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Oi,r=>{this._oncancel(r)}),this.setNotificationHandler(Ri,r=>{this._onprogress(r)}),this.setRequestHandler(Ii,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ni,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Di,async(r,n)=>{let o=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,m=new L(d.error.code,d.error.message,d.error.data);l(m)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let i=await this._taskStore.getTask(s,n.sessionId);if(!i)throw new L(G.InvalidParams,`Task not found: ${s}`);if(!ar(i.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(ar(i.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ir]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(ji,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new L(G.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Zi,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,`Task not found: ${r.params.taskId}`);if(ar(o.status))throw new L(G.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new L(G.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof L?o:new L(G.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),L.fromError(G.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{o?.(s,i),Co(s)||tv(s)?this._onresponse(s):Vu(s)?this._onrequest(s,i):ev(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=L.fromError(G.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[ir]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:G.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):o?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let a=Y_(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,u={signal:i.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(i.signal.aborted)return;let d={relatedRequestId:e.id};s&&(d.relatedTask={taskId:s}),await this.notification(l,d)},sendRequest:async(l,d,m)=>{if(i.signal.aborted)throw new L(G.ConnectionClosed,"Request was cancelled");let p={...m,relatedRequestId:e.id};s&&!p.relatedTask&&(p.relatedTask={taskId:s});let f=p.relatedTask?.taskId??s;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(l,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,u)).then(async l=>{if(i.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)},async l=>{if(i.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:G.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(c);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Co(e))n(e);else{let i=new L(e.error.code,e.error.message,e.error.data);n(i)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(Co(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),Co(e))o(e);else{let i=L.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}return}let s;try{let i=await this.request(e,vn,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new L(G.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},ar(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new L(G.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new L(G.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=x=>{l(x)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(x){d(x);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[ir]:c}});let f=x=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(x)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let w=x instanceof L?x:new L(G.RequestTimeout,String(x));l(w)};this._responseHandlers.set(m,x=>{if(!n?.signal?.aborted){if(x instanceof Error)return l(x);try{let w=sr(r,x.result);w.success?u(w.data):l(w.error)}catch(w){l(w)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let h=n?.timeout??rO,g=()=>f(L.fromError(G.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(m,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let x=w=>{let S=this._responseHandlers.get(m);S?S(w):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,x),this._enqueueTaskMessage(_,{type:"request",message:p,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(m),l(w)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(x=>{this._cleanupTimeout(m),l(x)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Ai,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Mi,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},ov,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ir]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ir]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ir]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=il(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=al(e,o);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=il(e);this._notificationHandlers.set(n,o=>{let s=al(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&Vu(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new L(G.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new L(G.InvalidRequest,"Request cancelled"));return}let i=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(i),s(new L(G.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},getTask:async o=>{let s=await n.getTask(o,r);if(!s)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,i)=>{await n.storeTaskResult(o,s,i,r);let a=await n.getTask(o,r);if(a){let c=Ao.parse({method:"notifications/tasks/status",params:a});await this.notification(c),ar(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,s,i)=>{let a=await n.getTask(o,r);if(!a)throw new L(G.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(ar(a.status))throw new L(G.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,i,r);let c=await n.getTask(o,r);if(c){let u=Ao.parse({method:"notifications/tasks/status",params:c});await this.notification(u),ar(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function lv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function dv(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let i=r[o];lv(i)&&lv(s)?r[o]={...i,...s}:r[o]=s}return r}var rx=mt(Wd(),1),nx=mt(tx(),1);function sj(){let t=new rx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,nx.default)(t),t}var Sa=class{constructor(e){this._ajv=e??sj()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var $a=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function ox(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function sx(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var ka=class extends Fi{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Mo.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Sa,this.setRequestHandler(Wu,n=>this._oninitialize(n)),this.setNotificationHandler(Gu,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(rl,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,a=Mo.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new $a(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=dv(this._capabilities,e)}setRequestHandler(e,r){let o=$i(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(yn(o)){let a=o;s=a._zod?.def?.value??a.value}else{let a=o;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let a=async(c,u)=>{let l=sr(jo,c);if(!l.success){let f=l.error instanceof Error?l.error.message:String(l.error);throw new L(G.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=l.data,m=await Promise.resolve(r(c,u));if(d.task){let f=sr(vn,m);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new L(G.InvalidParams,`Invalid task creation result: ${h}`)}return f.data}let p=sr(Li,m);if(!p.success){let f=p.error instanceof Error?p.error.message:String(p.error);throw new L(G.InvalidParams,`Invalid tools/call result: ${f}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){sx(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&ox(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:G_.includes(r)?r:Fu,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Ci)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},ol,r):this.request({method:"sampling/createMessage",params:e},nl,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=e;return this.request({method:"elicitation/create",params:o},qi,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:o},qi,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!a.valid)throw new L(G.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof L?i:new L(G.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},sl,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var tf=mt(require("node:process"),1);var Ea=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
153
- `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),ij(r)}clear(){this._buffer=void 0}};function ij(t){return rv.parse(JSON.parse(t))}function ix(t){return JSON.stringify(t)+`
154
- `}var za=class{constructor(e=tf.default.stdin,r=tf.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Ea,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=ix(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var hs=class{index;constructor(e){this.index=e}getByName(e){return this.index.byName.get(e)}getBySelector(e){return this.index.bySelector.get(e)}getByType(e){switch(e){case"component":return this.index.components;case"directive":return this.index.directives;case"pipe":return this.index.pipes;case"service":return this.index.services;case"all":return[...this.index.components,...this.index.directives,...this.index.pipes,...this.index.services];default:return[]}}getAll(e=!1){let r=this.getByType("all");return e?r:r.filter(n=>!n.deprecated)}updateIndex(e){this.index=e}};var gs=class{index;constructor(e){this.index=e}search(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50,offset:i=0}=e,a=r.toLowerCase().trim();if(a.length===0)return{items:[],total:0,hasMore:!1};let c=this.getCandidates(a,n),u=[];for(let p of c){if(!o&&p.deprecated)continue;let f=this.calculateRelevanceScore(p,a);f>0&&u.push({doc:p,relevanceScore:f})}u.sort((p,f)=>f.relevanceScore-p.relevanceScore);let l=u.length,d=u.slice(i,i+s),m=i+s<l;return{items:d,total:l,hasMore:m}}getCandidates(e,r){let n=e.split(/[^a-z0-9]+/).filter(i=>i.length>0),o=new Set;for(let i of n){if(this.index.searchIndex.has(i)){let a=this.index.searchIndex.get(i);for(let c of a)o.add(c)}for(let[a,c]of this.index.searchIndex.entries())if(a.startsWith(i))for(let u of c)o.add(u)}let s=[];for(let i of o){let a=this.index.byName.get(i);a&&(r&&r.length>0?r.includes(a.type)&&s.push(a):s.push(a))}return s}calculateRelevanceScore(e,r){let n=0,o=e.name.toLowerCase();if(o===r&&(n+=100),"selector"in e&&e.selector){let s=e.selector.toLowerCase();(s===r||s.includes(r))&&(n+=80)}if(o.startsWith(r)&&(n+=60),!o.startsWith(r)&&o.includes(r)&&(n+=30),e.description&&e.description.toLowerCase().includes(r)&&(n+=40),"inputs"in e&&e.inputs){for(let s of e.inputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("outputs"in e&&e.outputs){for(let s of e.outputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("methods"in e&&e.methods){for(let s of e.methods)if(s.name.toLowerCase().includes(r)){n+=20;break}}return e.deprecated&&(n=Math.floor(n*.5)),n}updateIndex(e){this.index=e}};var Pa=class{getPreferredDescription(e){return e.rawdescription??e.description??""}formatList(e,r=!1){return e.filter(n=>r||!n.deprecated).map(n=>this.formatSummary(n))}formatSummary(e){let r=e.type==="injectable"?"service":e.type,n="selector"in e?e.selector:void 0;return{name:e.name,type:r,selector:n,description:this.getPreferredDescription(e),deprecated:e.deprecated}}formatDetails(e){let r=this.formatInputs(e),n=this.formatOutputs(e),o=this.formatMethods(e),s=this.formatExamples(e),i=e.type==="injectable"?"service":e.type,a="selector"in e?e.selector:void 0,c="standalone"in e?e.standalone:void 0,u="imports"in e?e.imports:void 0;return{name:e.name,type:i,selector:a,description:this.getPreferredDescription(e),inputs:r,outputs:n,methods:o,examples:s,deprecated:e.deprecated,deprecationMessage:e.deprecationMessage,standalone:c,imports:u}}formatInputs(e){let r=[];return"inputs"in e&&e.inputs&&r.push(...e.inputs.map(n=>this.formatProperty(n))),"inputsClass"in e&&e.inputsClass&&r.push(...e.inputsClass.map(n=>this.formatProperty(n))),r}formatOutputs(e){let r=[];return"outputs"in e&&e.outputs&&r.push(...e.outputs.map(n=>this.formatProperty(n))),"outputsClass"in e&&e.outputsClass&&r.push(...e.outputsClass.map(n=>this.formatProperty(n))),r}formatProperty(e){return{name:e.name,type:e.type||"any",required:!e.optional,description:this.getPreferredDescription(e),defaultValue:e.defaultValue}}formatMethods(e){return!("methods"in e)||!e.methods?[]:e.methods.map(r=>this.formatMethod(r))}formatMethod(e){let r=(e.args||[]).map(s=>({name:s.name,type:s.type||"any",optional:s.optional||!1,defaultValue:s.defaultValue})),n=r.map(s=>{let i=s.optional?"?":"",a=s.defaultValue?` = ${s.defaultValue}`:"";return`${s.name}${i}: ${s.type}${a}`}).join(", "),o=`${e.name}(${n}): ${e.returnType||"void"}`;return{name:e.name,signature:o,description:this.getPreferredDescription(e),parameters:r,returnType:e.returnType||"void"}}formatExamples(e){return!("examples"in e)||!e.examples?[]:e.examples}formatSearchResults(e){return e.map(r=>{let n=r.doc.type==="injectable"?"service":r.doc.type,o="selector"in r.doc?r.doc.selector:void 0;return{name:r.doc.name,type:n,selector:o,description:this.getPreferredDescription(r.doc),deprecated:r.doc.deprecated,relevanceScore:r.relevanceScore}})}toJSON(e){return JSON.stringify(e,null,2)}formatDeprecatedList(e,r){if(e.length===0)return"No deprecated items found.";let n=e.reduce((s,i)=>(s[i.type]||(s[i.type]=[]),s[i.type].push(i),s),{}),o=`Found ${e.length} deprecated item(s):
152
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of t.seen.entries()){let a=i[1];if(e===i[0]){s(i);continue}if(t.external){let u=t.external.registry.get(i[0])?.id;if(e!==i[0]&&u){s(i);continue}}if(t.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&t.reused==="ref"){s(i);continue}}}function Iu(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),f=p.schema;if(f.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(f)):Object.assign(u,f),Object.assign(u,l),a._zod.parent===d)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(f.$ref&&p.def)for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}let m=a._zod.parent;if(m&&m!==d){n(m);let p=t.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let f in u)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(u[f])===JSON.stringify(p.def[f])&&delete u[f]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(a)}Object.assign(o,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&o.id===s&&delete o.id;let i=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:Po(e,"input",t.processors),output:Po(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function qe(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return qe(n.element,r);if(n.type==="set")return qe(n.valueType,r);if(n.type==="lazy")return qe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return qe(n.innerType,r);if(n.type==="intersection")return qe(n.left,r)||qe(n.right,r);if(n.type==="record"||n.type==="map")return qe(n.keyType,r)||qe(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:qe(n.in,r)||qe(n.out,r);if(n.type==="object"){for(let o in n.shape)if(qe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(qe(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(qe(o,r))return!0;return!!(n.rest&&qe(n.rest,r))}return!1}var Wy=(t,e={})=>r=>{let n=Cu({...r,processors:e});return Se(t,n),Ou(n,t),Iu(n,t)},Po=(t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Cu({...o??{},target:s,io:e,processors:r});return Se(t,i),Ou(i,t),Iu(i,t)};var bP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gy=(t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=bP[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Jy=(t,e,r,n)=>{let o=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof s=="number"&&(o.minimum=s),m?p?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},Ky=(t,e,r,n)=>{r.type="boolean"};var Yy=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var Qy=(t,e,r,n)=>{r.not={}};var Xy=(t,e,r,n)=>{};var e_=(t,e,r,n)=>{let o=t._zod.def,s=_o(o.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},t_=(t,e,r,n)=>{let o=t._zod.def,s=[];for(let i of o.values)if(i===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var r_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var n_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var o_=(t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:i,maximum:a}=t._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Se(s.element,e,{...n,path:[...n.path,"items"]})},s_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object",o.properties={};let i=s.shape;for(let u in i)o.properties[u]=Se(i[u],e,{...n,path:[...n.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Se(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},i_=(t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Se(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},a_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=Se(o.right,e,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c};var c_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Se(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let d of c)o.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Se(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Se(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l)}},u_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.innerType,e,n),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},l_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},d_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},f_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},p_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},m_=(t,e,r,n)=>{let o=t._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?o.out:o.in:o.out;Se(i,e,n);let a=e.seen.get(t);a.ref=i},h_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0};var Ru=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType};function _n(t){return!!t._zod}function sr(t,e){return _n(t)?So(t,e):t.safeParse(e)}function Ei(t){if(!t)return;let e;if(_n(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function g_(t){if(_n(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var Co={};sf(Co,{ZodISODate:()=>__,ZodISODateTime:()=>y_,ZodISODuration:()=>b_,ZodISOTime:()=>v_,date:()=>Au,datetime:()=>Nu,duration:()=>ju,time:()=>Du});var y_=v("ZodISODateTime",(t,e)=>{Eg.init(t,e),ge.init(t,e)});function Nu(t){return Ry(y_,t)}var __=v("ZodISODate",(t,e)=>{zg.init(t,e),ge.init(t,e)});function Au(t){return Ny(__,t)}var v_=v("ZodISOTime",(t,e)=>{Pg.init(t,e),ge.init(t,e)});function Du(t){return Ay(v_,t)}var b_=v("ZodISODuration",(t,e)=>{Tg.init(t,e),ge.init(t,e)});function ju(t){return Dy(b_,t)}var TP=(t,e)=>{fi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>uh(t,r)},flatten:{value:r=>ch(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,mn,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,mn,2)}},isEmpty:{get(){return t.issues.length===0}}})};var rt=v("ZodError",TP,{Parent:Error});var w_=pi(rt),x_=mi(rt),S_=xo(rt),$_=$o(rt),k_=lh(rt),E_=dh(rt),z_=fh(rt),P_=ph(rt),T_=mh(rt),C_=hh(rt),O_=gh(rt),I_=yh(rt);var R_=new WeakMap;function Oo(t,e,r){let n=Object.getPrototypeOf(t),o=R_.get(n);if(o||(o=new Set,R_.set(n,o)),!o.has(e)){o.add(e);for(let s in r){let i=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var _e=v("ZodType",(t,e)=>(le.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Po(t,"input"),output:Po(t,"output")}}),t.toJSONSchema=Wy(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>w_(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>S_(t,r,n),t.parseAsync=async(r,n)=>x_(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>$_(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>k_(t,r,n),t.decode=(r,n)=>E_(t,r,n),t.encodeAsync=async(r,n)=>z_(t,r,n),t.decodeAsync=async(r,n)=>P_(t,r,n),t.safeEncode=(r,n)=>T_(t,r,n),t.safeDecode=(r,n)=>C_(t,r,n),t.safeEncodeAsync=async(r,n)=>O_(t,r,n),t.safeDecodeAsync=async(r,n)=>I_(t,r,n),Oo(t,"ZodType",{check(...r){let n=this.def;return this.clone(Y.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return wt(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(vT(r,n))},superRefine(r,n){return this.check(bT(r,n))},overwrite(r){return this.check(or(r))},optional(){return we(this)},exactOptional(){return aT(this)},nullable(){return j_(this)},nullish(){return we(j_(this))},nonoptional(r){return pT(this,r)},array(){return J(this)},or(r){return ce([this,r])},and(r){return Pi(this,r)},transform(r){return M_(this,U_(r))},default(r){return lT(this,r)},prefault(r){return fT(this,r)},catch(r){return hT(this,r)},pipe(r){return M_(this,r)},readonly(){return _T(this)},describe(r){let n=this.clone();return Zr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Zr.get(this);let n=this.clone();return Zr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Zr.get(t)?.description},configurable:!0}),t)),Z_=v("_ZodString",(t,e)=>{bi.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Gy(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Oo(t,"_ZodString",{regex(...n){return this.check(vu(...n))},includes(...n){return this.check(xu(...n))},startsWith(...n){return this.check(Su(...n))},endsWith(...n){return this.check($u(...n))},min(...n){return this.check(yn(...n))},max(...n){return this.check($i(...n))},length(...n){return this.check(ki(...n))},nonempty(...n){return this.check(yn(1,...n))},lowercase(n){return this.check(bu(n))},uppercase(n){return this.check(wu(n))},trim(){return this.check(Eu())},normalize(...n){return this.check(ku(...n))},toLowerCase(){return this.check(zu())},toUpperCase(){return this.check(Pu())},slugify(){return this.check(Tu())}})}),OP=v("ZodString",(t,e)=>{bi.init(t,e),Z_.init(t,e),t.email=r=>t.check(fy(IP,r)),t.url=r=>t.check(yy(RP,r)),t.jwt=r=>t.check(Iy(GP,r)),t.emoji=r=>t.check(_y(NP,r)),t.guid=r=>t.check(_u(N_,r)),t.uuid=r=>t.check(py(zi,r)),t.uuidv4=r=>t.check(my(zi,r)),t.uuidv6=r=>t.check(hy(zi,r)),t.uuidv7=r=>t.check(gy(zi,r)),t.nanoid=r=>t.check(vy(AP,r)),t.guid=r=>t.check(_u(N_,r)),t.cuid=r=>t.check(by(DP,r)),t.cuid2=r=>t.check(wy(jP,r)),t.ulid=r=>t.check(xy(MP,r)),t.base64=r=>t.check(Ty(BP,r)),t.base64url=r=>t.check(Cy(HP,r)),t.xid=r=>t.check(Sy(ZP,r)),t.ksuid=r=>t.check($y(LP,r)),t.ipv4=r=>t.check(ky(qP,r)),t.ipv6=r=>t.check(Ey(FP,r)),t.cidrv4=r=>t.check(zy(UP,r)),t.cidrv6=r=>t.check(Py(VP,r)),t.e164=r=>t.check(Oy(WP,r)),t.datetime=r=>t.check(Nu(r)),t.date=r=>t.check(Au(r)),t.time=r=>t.check(Du(r)),t.duration=r=>t.check(ju(r))});function y(t){return dy(OP,t)}var ge=v("ZodStringFormat",(t,e)=>{de.init(t,e),Z_.init(t,e)}),IP=v("ZodEmail",(t,e)=>{yg.init(t,e),ge.init(t,e)});var N_=v("ZodGUID",(t,e)=>{hg.init(t,e),ge.init(t,e)});var zi=v("ZodUUID",(t,e)=>{gg.init(t,e),ge.init(t,e)});var RP=v("ZodURL",(t,e)=>{_g.init(t,e),ge.init(t,e)});var NP=v("ZodEmoji",(t,e)=>{vg.init(t,e),ge.init(t,e)});var AP=v("ZodNanoID",(t,e)=>{bg.init(t,e),ge.init(t,e)});var DP=v("ZodCUID",(t,e)=>{wg.init(t,e),ge.init(t,e)});var jP=v("ZodCUID2",(t,e)=>{xg.init(t,e),ge.init(t,e)});var MP=v("ZodULID",(t,e)=>{Sg.init(t,e),ge.init(t,e)});var ZP=v("ZodXID",(t,e)=>{$g.init(t,e),ge.init(t,e)});var LP=v("ZodKSUID",(t,e)=>{kg.init(t,e),ge.init(t,e)});var qP=v("ZodIPv4",(t,e)=>{Cg.init(t,e),ge.init(t,e)});var FP=v("ZodIPv6",(t,e)=>{Og.init(t,e),ge.init(t,e)});var UP=v("ZodCIDRv4",(t,e)=>{Ig.init(t,e),ge.init(t,e)});var VP=v("ZodCIDRv6",(t,e)=>{Rg.init(t,e),ge.init(t,e)});var BP=v("ZodBase64",(t,e)=>{Ag.init(t,e),ge.init(t,e)});var HP=v("ZodBase64URL",(t,e)=>{Dg.init(t,e),ge.init(t,e)});var WP=v("ZodE164",(t,e)=>{jg.init(t,e),ge.init(t,e)});var GP=v("ZodJWT",(t,e)=>{Mg.init(t,e),ge.init(t,e)});var L_=v("ZodNumber",(t,e)=>{pu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Jy(t,n,o,s),Oo(t,"ZodNumber",{gt(n,o){return this.check(xi(n,o))},gte(n,o){return this.check(zo(n,o))},min(n,o){return this.check(zo(n,o))},lt(n,o){return this.check(wi(n,o))},lte(n,o){return this.check(Eo(n,o))},max(n,o){return this.check(Eo(n,o))},int(n){return this.check(A_(n))},safe(n){return this.check(A_(n))},positive(n){return this.check(xi(0,n))},nonnegative(n){return this.check(zo(0,n))},negative(n){return this.check(wi(0,n))},nonpositive(n){return this.check(Eo(0,n))},multipleOf(n,o){return this.check(Si(n,o))},step(n,o){return this.check(Si(n,o))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function se(t){return jy(L_,t)}var JP=v("ZodNumberFormat",(t,e)=>{Zg.init(t,e),L_.init(t,e)});function A_(t){return My(JP,t)}var KP=v("ZodBoolean",(t,e)=>{Lg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ky(t,r,n,o)});function ze(t){return Zy(KP,t)}var YP=v("ZodNull",(t,e)=>{qg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Yy(t,r,n,o)});function Zu(t){return Ly(YP,t)}var QP=v("ZodUnknown",(t,e)=>{Fg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Xy(t,r,n,o)});function ye(){return qy(QP)}var XP=v("ZodNever",(t,e)=>{Ug.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qy(t,r,n,o)});function eT(t){return Fy(XP,t)}var tT=v("ZodArray",(t,e)=>{Vg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>o_(t,r,n,o),t.element=e.element,Oo(t,"ZodArray",{min(r,n){return this.check(yn(r,n))},nonempty(r){return this.check(yn(1,r))},max(r,n){return this.check($i(r,n))},length(r,n){return this.check(ki(r,n))},unwrap(){return this.element}})});function J(t,e){return Uy(tT,t,e)}var q_=v("ZodObject",(t,e)=>{Wg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>s_(t,r,n,o),Y.defineLazy(t,"shape",()=>e.shape),Oo(t,"ZodObject",{keyof(){return We(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ye()})},loose(){return this.clone({...this._zod.def,catchall:ye()})},strict(){return this.clone({...this._zod.def,catchall:eT()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Y.extend(this,r)},safeExtend(r){return Y.safeExtend(this,r)},merge(r){return Y.merge(this,r)},pick(r){return Y.pick(this,r)},omit(r){return Y.omit(this,r)},partial(...r){return Y.partial(V_,this,r[0])},required(...r){return Y.required(B_,this,r[0])}})});function P(t,e){let r={type:"object",shape:t??{},...Y.normalizeParams(e)};return new q_(r)}function Fe(t,e){return new q_({type:"object",shape:t,catchall:ye(),...Y.normalizeParams(e)})}var F_=v("ZodUnion",(t,e)=>{mu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>i_(t,r,n,o),t.options=e.options});function ce(t,e){return new F_({type:"union",options:t,...Y.normalizeParams(e)})}var rT=v("ZodDiscriminatedUnion",(t,e)=>{F_.init(t,e),Gg.init(t,e)});function Lu(t,e,r){return new rT({type:"union",options:e,discriminator:t,...Y.normalizeParams(r)})}var nT=v("ZodIntersection",(t,e)=>{Jg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>a_(t,r,n,o)});function Pi(t,e){return new nT({type:"intersection",left:t,right:e})}var D_=v("ZodRecord",(t,e)=>{Kg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>c_(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ve(t,e,r){return!e||!e._zod?new D_({type:"record",keyType:y(),valueType:t,...Y.normalizeParams(e)}):new D_({type:"record",keyType:t,valueType:e,...Y.normalizeParams(r)})}var Mu=v("ZodEnum",(t,e)=>{Yg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>e_(t,n,o,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...e,checks:[],...Y.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...e,checks:[],...Y.normalizeParams(o),entries:s})}});function We(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Mu({type:"enum",entries:r,...Y.normalizeParams(e)})}var oT=v("ZodLiteral",(t,e)=>{Qg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>t_(t,r,n,o),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function C(t,e){return new oT({type:"literal",values:Array.isArray(t)?t:[t],...Y.normalizeParams(e)})}var sT=v("ZodTransform",(t,e)=>{Xg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>n_(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Y.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(Y.issue(i))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function U_(t){return new sT({type:"transform",transform:t})}var V_=v("ZodOptional",(t,e)=>{hu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ru(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function we(t){return new V_({type:"optional",innerType:t})}var iT=v("ZodExactOptional",(t,e)=>{ey.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ru(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function aT(t){return new iT({type:"optional",innerType:t})}var cT=v("ZodNullable",(t,e)=>{ty.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>u_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function j_(t){return new cT({type:"nullable",innerType:t})}var uT=v("ZodDefault",(t,e)=>{ry.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>d_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function lT(t,e){return new uT({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var dT=v("ZodPrefault",(t,e)=>{ny.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>f_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function fT(t,e){return new dT({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var B_=v("ZodNonOptional",(t,e)=>{oy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>l_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function pT(t,e){return new B_({type:"nonoptional",innerType:t,...Y.normalizeParams(e)})}var mT=v("ZodCatch",(t,e)=>{sy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>p_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function hT(t,e){return new mT({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var H_=v("ZodPipe",(t,e)=>{gu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>m_(t,r,n,o),t.in=e.in,t.out=e.out});function M_(t,e){return new H_({type:"pipe",in:t,out:e})}var gT=v("ZodPreprocess",(t,e)=>{H_.init(t,e),iy.init(t,e)}),yT=v("ZodReadonly",(t,e)=>{ay.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>h_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function _T(t){return new yT({type:"readonly",innerType:t})}var W_=v("ZodCustom",(t,e)=>{cy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>r_(t,r,n,o)});function G_(t,e){return Vy(W_,t??(()=>!0),e)}function vT(t,e={}){return By(W_,t,e)}function bT(t,e){return Hy(t,e)}function qu(t,e){return new gT({type:"pipe",in:U_(t),out:e})}tt(uy());var Uu="2025-11-25";var J_=[Uu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ir="io.modelcontextprotocol/related-task",Ci="2.0",Te=G_(t=>t!==null&&(typeof t=="object"||typeof t=="function")),K_=ce([y(),se().int()]),Y_=y(),dq=Fe({ttl:ce([se(),Zu()]).optional(),pollInterval:se().optional()}),wT=P({ttl:se().optional()}),xT=P({taskId:y()}),Vu=Fe({progressToken:K_.optional(),[ir]:xT.optional()}),nt=P({_meta:Vu.optional()}),Io=nt.extend({task:wT.optional()}),Q_=t=>Io.safeParse(t).success,Ce=P({method:y(),params:nt.loose().optional()}),ct=P({_meta:Vu.optional()}),ut=P({method:y(),params:ct.loose().optional()}),Oe=Fe({_meta:Vu.optional()}),Oi=ce([y(),se().int()]),X_=P({jsonrpc:C(Ci),id:Oi,...Ce.shape}).strict(),Bu=t=>X_.safeParse(t).success,ev=P({jsonrpc:C(Ci),...ut.shape}).strict(),tv=t=>ev.safeParse(t).success,Hu=P({jsonrpc:C(Ci),id:Oi,result:Oe}).strict(),Ro=t=>Hu.safeParse(t).success;var G;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(G||(G={}));var Wu=P({jsonrpc:C(Ci),id:Oi.optional(),error:P({code:se().int(),message:y(),data:ye().optional()})}).strict();var rv=t=>Wu.safeParse(t).success;var nv=ce([X_,ev,Hu,Wu]),fq=ce([Hu,Wu]),Ii=Oe.strict(),ST=ct.extend({requestId:Oi.optional(),reason:y().optional()}),Ri=ut.extend({method:C("notifications/cancelled"),params:ST}),$T=P({src:y(),mimeType:y().optional(),sizes:J(y()).optional(),theme:We(["light","dark"]).optional()}),No=P({icons:J($T).optional()}),vn=P({name:y(),title:y().optional()}),ov=vn.extend({...vn.shape,...No.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),kT=Pi(P({applyDefaults:ze().optional()}),ve(y(),ye())),ET=qu(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Pi(P({form:kT.optional(),url:Te.optional()}),ve(y(),ye()).optional())),zT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({sampling:Fe({createMessage:Te.optional()}).optional(),elicitation:Fe({create:Te.optional()}).optional()}).optional()}),PT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({tools:Fe({call:Te.optional()}).optional()}).optional()}),TT=P({experimental:ve(y(),Te).optional(),sampling:P({context:Te.optional(),tools:Te.optional()}).optional(),elicitation:ET.optional(),roots:P({listChanged:ze().optional()}).optional(),tasks:zT.optional()}),CT=nt.extend({protocolVersion:y(),capabilities:TT,clientInfo:ov}),Gu=Ce.extend({method:C("initialize"),params:CT});var OT=P({experimental:ve(y(),Te).optional(),logging:Te.optional(),completions:Te.optional(),prompts:P({listChanged:ze().optional()}).optional(),resources:P({subscribe:ze().optional(),listChanged:ze().optional()}).optional(),tools:P({listChanged:ze().optional()}).optional(),tasks:PT.optional()}),IT=Oe.extend({protocolVersion:y(),capabilities:OT,serverInfo:ov,instructions:y().optional()}),Ju=ut.extend({method:C("notifications/initialized"),params:ct.optional()});var Ni=Ce.extend({method:C("ping"),params:nt.optional()}),RT=P({progress:se(),total:we(se()),message:we(y())}),NT=P({...ct.shape,...RT.shape,progressToken:K_}),Ai=ut.extend({method:C("notifications/progress"),params:NT}),AT=nt.extend({cursor:Y_.optional()}),Ao=Ce.extend({params:AT.optional()}),Do=Oe.extend({nextCursor:Y_.optional()}),DT=We(["working","input_required","completed","failed","cancelled"]),jo=P({taskId:y(),status:DT,ttl:ce([se(),Zu()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:we(se()),statusMessage:we(y())}),bn=Oe.extend({task:jo}),jT=ct.merge(jo),Mo=ut.extend({method:C("notifications/tasks/status"),params:jT}),Di=Ce.extend({method:C("tasks/get"),params:nt.extend({taskId:y()})}),ji=Oe.merge(jo),Mi=Ce.extend({method:C("tasks/result"),params:nt.extend({taskId:y()})}),pq=Oe.loose(),Zi=Ao.extend({method:C("tasks/list")}),Li=Do.extend({tasks:J(jo)}),qi=Ce.extend({method:C("tasks/cancel"),params:nt.extend({taskId:y()})}),sv=Oe.merge(jo),iv=P({uri:y(),mimeType:we(y()),_meta:ve(y(),ye()).optional()}),av=iv.extend({text:y()}),Ku=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),cv=iv.extend({blob:Ku}),Zo=We(["user","assistant"]),wn=P({audience:J(Zo).optional(),priority:se().min(0).max(1).optional(),lastModified:Co.datetime({offset:!0}).optional()}),uv=P({...vn.shape,...No.shape,uri:y(),description:we(y()),mimeType:we(y()),annotations:wn.optional(),_meta:we(Fe({}))}),MT=P({...vn.shape,...No.shape,uriTemplate:y(),description:we(y()),mimeType:we(y()),annotations:wn.optional(),_meta:we(Fe({}))}),ZT=Ao.extend({method:C("resources/list")}),LT=Do.extend({resources:J(uv)}),qT=Ao.extend({method:C("resources/templates/list")}),FT=Do.extend({resourceTemplates:J(MT)}),Yu=nt.extend({uri:y()}),UT=Yu,VT=Ce.extend({method:C("resources/read"),params:UT}),BT=Oe.extend({contents:J(ce([av,cv]))}),HT=ut.extend({method:C("notifications/resources/list_changed"),params:ct.optional()}),WT=Yu,GT=Ce.extend({method:C("resources/subscribe"),params:WT}),JT=Yu,KT=Ce.extend({method:C("resources/unsubscribe"),params:JT}),YT=ct.extend({uri:y()}),QT=ut.extend({method:C("notifications/resources/updated"),params:YT}),XT=P({name:y(),description:we(y()),required:we(ze())}),eC=P({...vn.shape,...No.shape,description:we(y()),arguments:we(J(XT)),_meta:we(Fe({}))}),tC=Ao.extend({method:C("prompts/list")}),rC=Do.extend({prompts:J(eC)}),nC=nt.extend({name:y(),arguments:ve(y(),y()).optional()}),oC=Ce.extend({method:C("prompts/get"),params:nC}),Qu=P({type:C("text"),text:y(),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),Xu=P({type:C("image"),data:Ku,mimeType:y(),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),el=P({type:C("audio"),data:Ku,mimeType:y(),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),sC=P({type:C("tool_use"),name:y(),id:y(),input:ve(y(),ye()),_meta:ve(y(),ye()).optional()}),iC=P({type:C("resource"),resource:ce([av,cv]),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),aC=uv.extend({type:C("resource_link")}),tl=ce([Qu,Xu,el,aC,iC]),cC=P({role:Zo,content:tl}),uC=Oe.extend({description:y().optional(),messages:J(cC)}),lC=ut.extend({method:C("notifications/prompts/list_changed"),params:ct.optional()}),dC=P({title:y().optional(),readOnlyHint:ze().optional(),destructiveHint:ze().optional(),idempotentHint:ze().optional(),openWorldHint:ze().optional()}),fC=P({taskSupport:We(["required","optional","forbidden"]).optional()}),lv=P({...vn.shape,...No.shape,description:y().optional(),inputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()),outputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()).optional(),annotations:dC.optional(),execution:fC.optional(),_meta:ve(y(),ye()).optional()}),rl=Ao.extend({method:C("tools/list")}),pC=Do.extend({tools:J(lv)}),Fi=Oe.extend({content:J(tl).default([]),structuredContent:ve(y(),ye()).optional(),isError:ze().optional()}),mq=Fi.or(Oe.extend({toolResult:ye()})),mC=Io.extend({name:y(),arguments:ve(y(),ye()).optional()}),Lo=Ce.extend({method:C("tools/call"),params:mC}),hC=ut.extend({method:C("notifications/tools/list_changed"),params:ct.optional()}),hq=P({autoRefresh:ze().default(!0),debounceMs:se().int().nonnegative().default(300)}),qo=We(["debug","info","notice","warning","error","critical","alert","emergency"]),gC=nt.extend({level:qo}),nl=Ce.extend({method:C("logging/setLevel"),params:gC}),yC=ct.extend({level:qo,logger:y().optional(),data:ye()}),_C=ut.extend({method:C("notifications/message"),params:yC}),vC=P({name:y().optional()}),bC=P({hints:J(vC).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),wC=P({mode:We(["auto","required","none"]).optional()}),xC=P({type:C("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:J(tl).default([]),structuredContent:P({}).loose().optional(),isError:ze().optional(),_meta:ve(y(),ye()).optional()}),SC=Lu("type",[Qu,Xu,el]),Ti=Lu("type",[Qu,Xu,el,sC,xC]),$C=P({role:Zo,content:ce([Ti,J(Ti)]),_meta:ve(y(),ye()).optional()}),kC=Io.extend({messages:J($C),modelPreferences:bC.optional(),systemPrompt:y().optional(),includeContext:We(["none","thisServer","allServers"]).optional(),temperature:se().optional(),maxTokens:se().int(),stopSequences:J(y()).optional(),metadata:Te.optional(),tools:J(lv).optional(),toolChoice:wC.optional()}),EC=Ce.extend({method:C("sampling/createMessage"),params:kC}),ol=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens"]).or(y())),role:Zo,content:SC}),sl=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:Zo,content:ce([Ti,J(Ti)])}),zC=P({type:C("boolean"),title:y().optional(),description:y().optional(),default:ze().optional()}),PC=P({type:C("string"),title:y().optional(),description:y().optional(),minLength:se().optional(),maxLength:se().optional(),format:We(["email","uri","date","date-time"]).optional(),default:y().optional()}),TC=P({type:We(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),CC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),default:y().optional()}),OC=P({type:C("string"),title:y().optional(),description:y().optional(),oneOf:J(P({const:y(),title:y()})),default:y().optional()}),IC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),enumNames:J(y()).optional(),default:y().optional()}),RC=ce([CC,OC]),NC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({type:C("string"),enum:J(y())}),default:J(y()).optional()}),AC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({anyOf:J(P({const:y(),title:y()}))}),default:J(y()).optional()}),DC=ce([NC,AC]),jC=ce([IC,RC,DC]),MC=ce([jC,zC,PC,TC]),ZC=Io.extend({mode:C("form").optional(),message:y(),requestedSchema:P({type:C("object"),properties:ve(y(),MC),required:J(y()).optional()})}),LC=Io.extend({mode:C("url"),message:y(),elicitationId:y(),url:y().url()}),qC=ce([ZC,LC]),FC=Ce.extend({method:C("elicitation/create"),params:qC}),UC=ct.extend({elicitationId:y()}),VC=ut.extend({method:C("notifications/elicitation/complete"),params:UC}),Ui=Oe.extend({action:We(["accept","decline","cancel"]),content:qu(t=>t===null?void 0:t,ve(y(),ce([y(),se(),ze(),J(y())])).optional())}),BC=P({type:C("ref/resource"),uri:y()});var HC=P({type:C("ref/prompt"),name:y()}),WC=nt.extend({ref:ce([HC,BC]),argument:P({name:y(),value:y()}),context:P({arguments:ve(y(),y()).optional()}).optional()}),GC=Ce.extend({method:C("completion/complete"),params:WC});var JC=Oe.extend({completion:Fe({values:J(y()).max(100),total:we(se().int()),hasMore:we(ze())})}),KC=P({uri:y().startsWith("file://"),name:y().optional(),_meta:ve(y(),ye()).optional()}),YC=Ce.extend({method:C("roots/list"),params:nt.optional()}),il=Oe.extend({roots:J(KC)}),QC=ut.extend({method:C("notifications/roots/list_changed"),params:ct.optional()}),gq=ce([Ni,Gu,GC,nl,oC,tC,ZT,qT,VT,GT,KT,Lo,rl,Di,Mi,Zi,qi]),yq=ce([Ri,Ai,Ju,QC,Mo]),_q=ce([Ii,ol,sl,Ui,il,ji,Li,bn]),vq=ce([Ni,EC,FC,YC,Di,Mi,Zi,qi]),bq=ce([Ri,Ai,_C,QT,HT,hC,lC,Mo,VC]),wq=ce([Ii,IT,JC,uC,rC,LT,FT,BT,Fi,pC,ji,Li,bn]),L=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===G.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Fu(o.elicitations,r)}return new t(e,r,n)}},Fu=class extends L{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(G.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function ar(t){return t==="completed"||t==="failed"||t==="cancelled"}var e2=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function al(t){let r=Ei(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=g_(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function cl(t,e){let r=sr(t,e);if(!r.success)throw r.error;return r.data}var oO=6e4,Vi=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Ri,r=>{this._oncancel(r)}),this.setNotificationHandler(Ai,r=>{this._onprogress(r)}),this.setRequestHandler(Ni,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Di,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Mi,async(r,n)=>{let o=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,m=new L(d.error.code,d.error.message,d.error.data);l(m)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let i=await this._taskStore.getTask(s,n.sessionId);if(!i)throw new L(G.InvalidParams,`Task not found: ${s}`);if(!ar(i.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(ar(i.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ir]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(Zi,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new L(G.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(qi,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,`Task not found: ${r.params.taskId}`);if(ar(o.status))throw new L(G.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new L(G.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof L?o:new L(G.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),L.fromError(G.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{o?.(s,i),Ro(s)||rv(s)?this._onresponse(s):Bu(s)?this._onrequest(s,i):tv(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=L.fromError(G.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[ir]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:G.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):o?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let a=Q_(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,u={signal:i.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(i.signal.aborted)return;let d={relatedRequestId:e.id};s&&(d.relatedTask={taskId:s}),await this.notification(l,d)},sendRequest:async(l,d,m)=>{if(i.signal.aborted)throw new L(G.ConnectionClosed,"Request was cancelled");let p={...m,relatedRequestId:e.id};s&&!p.relatedTask&&(p.relatedTask={taskId:s});let f=p.relatedTask?.taskId??s;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(l,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,u)).then(async l=>{if(i.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)},async l=>{if(i.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:G.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(c);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Ro(e))n(e);else{let i=new L(e.error.code,e.error.message,e.error.data);n(i)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(Ro(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),Ro(e))o(e);else{let i=L.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}return}let s;try{let i=await this.request(e,bn,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new L(G.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},ar(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new L(G.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new L(G.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=x=>{l(x)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(x){d(x);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[ir]:c}});let f=x=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(x)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let w=x instanceof L?x:new L(G.RequestTimeout,String(x));l(w)};this._responseHandlers.set(m,x=>{if(!n?.signal?.aborted){if(x instanceof Error)return l(x);try{let w=sr(r,x.result);w.success?u(w.data):l(w.error)}catch(w){l(w)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let h=n?.timeout??oO,g=()=>f(L.fromError(G.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(m,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let x=w=>{let S=this._responseHandlers.get(m);S?S(w):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,x),this._enqueueTaskMessage(_,{type:"request",message:p,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(m),l(w)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(x=>{this._cleanupTimeout(m),l(x)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},ji,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Li,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},sv,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ir]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ir]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ir]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=al(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=cl(e,o);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=al(e);this._notificationHandlers.set(n,o=>{let s=cl(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&Bu(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new L(G.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new L(G.InvalidRequest,"Request cancelled"));return}let i=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(i),s(new L(G.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},getTask:async o=>{let s=await n.getTask(o,r);if(!s)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,i)=>{await n.storeTaskResult(o,s,i,r);let a=await n.getTask(o,r);if(a){let c=Mo.parse({method:"notifications/tasks/status",params:a});await this.notification(c),ar(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,s,i)=>{let a=await n.getTask(o,r);if(!a)throw new L(G.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(ar(a.status))throw new L(G.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,i,r);let c=await n.getTask(o,r);if(c){let u=Mo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),ar(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function dv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function fv(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let i=r[o];dv(i)&&dv(s)?r[o]={...i,...s}:r[o]=s}return r}var nx=mt(Gd(),1),ox=mt(rx(),1);function aj(){let t=new nx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,ox.default)(t),t}var ka=class{constructor(e){this._ajv=e??aj()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Ea=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function sx(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function ix(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var za=class extends Vi{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(qo.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new ka,this.setRequestHandler(Gu,n=>this._oninitialize(n)),this.setNotificationHandler(Ju,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(nl,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,a=qo.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ea(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=fv(this._capabilities,e)}setRequestHandler(e,r){let o=Ei(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(_n(o)){let a=o;s=a._zod?.def?.value??a.value}else{let a=o;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let a=async(c,u)=>{let l=sr(Lo,c);if(!l.success){let f=l.error instanceof Error?l.error.message:String(l.error);throw new L(G.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=l.data,m=await Promise.resolve(r(c,u));if(d.task){let f=sr(bn,m);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new L(G.InvalidParams,`Invalid task creation result: ${h}`)}return f.data}let p=sr(Fi,m);if(!p.success){let f=p.error instanceof Error?p.error.message:String(p.error);throw new L(G.InvalidParams,`Invalid tools/call result: ${f}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){ix(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&sx(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:J_.includes(r)?r:Uu,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Ii)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},sl,r):this.request({method:"sampling/createMessage",params:e},ol,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=e;return this.request({method:"elicitation/create",params:o},Ui,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:o},Ui,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!a.valid)throw new L(G.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof L?i:new L(G.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},il,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var rf=mt(require("node:process"),1);var Pa=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
153
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),cj(r)}clear(){this._buffer=void 0}};function cj(t){return nv.parse(JSON.parse(t))}function ax(t){return JSON.stringify(t)+`
154
+ `}var Ta=class{constructor(e=rf.default.stdin,r=rf.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Pa,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=ax(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var _s=class{index;constructor(e){this.index=e}getByName(e){return this.index.byName.get(e)}getBySelector(e){return this.index.bySelector.get(e)}getByType(e){switch(e){case"component":return this.index.components;case"directive":return this.index.directives;case"pipe":return this.index.pipes;case"service":return this.index.services;case"all":return[...this.index.components,...this.index.directives,...this.index.pipes,...this.index.services];default:return[]}}getAll(e=!1){let r=this.getByType("all");return e?r:r.filter(n=>!n.deprecated)}updateIndex(e){this.index=e}};var vs=class{index;constructor(e){this.index=e}search(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50,offset:i=0}=e,a=r.toLowerCase().trim();if(a.length===0)return{items:[],total:0,hasMore:!1};let c=this.getCandidates(a,n),u=[];for(let p of c){if(!o&&p.deprecated)continue;let f=this.calculateRelevanceScore(p,a);f>0&&u.push({doc:p,relevanceScore:f})}u.sort((p,f)=>f.relevanceScore-p.relevanceScore);let l=u.length,d=u.slice(i,i+s),m=i+s<l;return{items:d,total:l,hasMore:m}}getCandidates(e,r){let n=e.split(/[^a-z0-9]+/).filter(i=>i.length>0),o=new Set;for(let i of n){if(this.index.searchIndex.has(i)){let a=this.index.searchIndex.get(i);for(let c of a)o.add(c)}for(let[a,c]of this.index.searchIndex.entries())if(a.startsWith(i))for(let u of c)o.add(u)}let s=[];for(let i of o){let a=this.index.byName.get(i);a&&(r&&r.length>0?r.includes(a.type)&&s.push(a):s.push(a))}return s}calculateRelevanceScore(e,r){let n=0,o=e.name.toLowerCase();if(o===r&&(n+=100),"selector"in e&&e.selector){let s=e.selector.toLowerCase();(s===r||s.includes(r))&&(n+=80)}if(o.startsWith(r)&&(n+=60),!o.startsWith(r)&&o.includes(r)&&(n+=30),e.description&&e.description.toLowerCase().includes(r)&&(n+=40),"inputs"in e&&e.inputs){for(let s of e.inputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("outputs"in e&&e.outputs){for(let s of e.outputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("methods"in e&&e.methods){for(let s of e.methods)if(s.name.toLowerCase().includes(r)){n+=20;break}}return e.deprecated&&(n=Math.floor(n*.5)),n}updateIndex(e){this.index=e}};var Ca=class{getPreferredDescription(e){return e.rawdescription??e.description??""}formatList(e,r=!1){return e.filter(n=>r||!n.deprecated).map(n=>this.formatSummary(n))}formatSummary(e){let r=e.type==="injectable"?"service":e.type,n="selector"in e?e.selector:void 0;return{name:e.name,type:r,selector:n,description:this.getPreferredDescription(e),deprecated:e.deprecated}}formatDetails(e){let r=this.formatInputs(e),n=this.formatOutputs(e),o=this.formatMethods(e),s=this.formatExamples(e),i=e.type==="injectable"?"service":e.type,a="selector"in e?e.selector:void 0,c="standalone"in e?e.standalone:void 0,u="imports"in e?e.imports:void 0;return{name:e.name,type:i,selector:a,description:this.getPreferredDescription(e),inputs:r,outputs:n,methods:o,examples:s,deprecated:e.deprecated,deprecationMessage:e.deprecationMessage,standalone:c,imports:u}}formatInputs(e){let r=[];return"inputs"in e&&e.inputs&&r.push(...e.inputs.map(n=>this.formatProperty(n))),"inputsClass"in e&&e.inputsClass&&r.push(...e.inputsClass.map(n=>this.formatProperty(n))),r}formatOutputs(e){let r=[];return"outputs"in e&&e.outputs&&r.push(...e.outputs.map(n=>this.formatProperty(n))),"outputsClass"in e&&e.outputsClass&&r.push(...e.outputsClass.map(n=>this.formatProperty(n))),r}formatProperty(e){return{name:e.name,type:e.type||"any",required:!e.optional,description:this.getPreferredDescription(e),defaultValue:e.defaultValue}}formatMethods(e){return!("methods"in e)||!e.methods?[]:e.methods.map(r=>this.formatMethod(r))}formatMethod(e){let r=(e.args||[]).map(s=>({name:s.name,type:s.type||"any",optional:s.optional||!1,defaultValue:s.defaultValue})),n=r.map(s=>{let i=s.optional?"?":"",a=s.defaultValue?` = ${s.defaultValue}`:"";return`${s.name}${i}: ${s.type}${a}`}).join(", "),o=`${e.name}(${n}): ${e.returnType||"void"}`;return{name:e.name,signature:o,description:this.getPreferredDescription(e),parameters:r,returnType:e.returnType||"void"}}formatExamples(e){return!("examples"in e)||!e.examples?[]:e.examples}formatSearchResults(e){return e.map(r=>{let n=r.doc.type==="injectable"?"service":r.doc.type,o="selector"in r.doc?r.doc.selector:void 0;return{name:r.doc.name,type:n,selector:o,description:this.getPreferredDescription(r.doc),deprecated:r.doc.deprecated,relevanceScore:r.relevanceScore}})}toJSON(e){return JSON.stringify(e,null,2)}formatDeprecatedList(e,r){if(e.length===0)return"No deprecated items found.";let n=e.reduce((s,i)=>(s[i.type]||(s[i.type]=[]),s[i.type].push(i),s),{}),o=`Found ${e.length} deprecated item(s):
155
155
 
156
156
  `;for(let[s,i]of Object.entries(n)){o+=`## ${s.charAt(0).toUpperCase()+s.slice(1)}s
157
157
 
@@ -170,7 +170,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
170
170
 
171
171
  `),e.replacementSuggestion&&(r+=`**Recommended replacement**: ${e.replacementSuggestion}
172
172
 
173
- `),r}};var Zn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e={}){let{includeDeprecated:r=!1,type:n="all",limit:o=50,offset:s=0}=e;if(o<1||o>1e3)throw new Error("Limit must be between 1 and 1000");if(s<0)throw new Error("Offset must be non-negative");let i=this.query.getByType(n),a=r?i:i.filter(m=>!m.deprecated),c=a.length,u=a.slice(s,s+o),l=s+o<c;return{items:this.formatter.formatList(u,!0),total:c,hasMore:l,offset:s,limit:o}}static getToolDefinition(){return{name:"list-components",description:"Lists all available components, directives, pipes, and services from the EUI component library. Supports filtering by type and deprecated status, with pagination for large result sets.",inputSchema:{type:"object",properties:{includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in the results (default: false)",default:!1},type:{type:"string",enum:["component","directive","pipe","service","all"],description:"Filter by type (default: all)",default:"all"},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3},offset:{type:"number",description:"Number of results to skip for pagination (default: 0)",default:0,minimum:0}}}}}};var Ln=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{component:this.formatter.formatDetails(n)}}static getToolDefinition(){return{name:"get-component-docs",description:"Retrieves detailed documentation for a specific component, directive, pipe, or service by name. Returns complete metadata including inputs, outputs, methods, examples, selector information, standalone flag, and module import requirements.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service to retrieve"}},required:["name"]}}}};var qn=class{searchEngine;formatter;constructor(e,r){this.searchEngine=e,this.formatter=r}execute(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50}=e;if(r==null||typeof r!="string")throw new Error("Query is required and must be a string");let i=r.trim();if(i.length===0)throw new Error("Query cannot be empty");if(s<1||s>1e3)throw new Error("Limit must be between 1 and 1000");if(n&&n.length>0){let l=["component","directive","pipe","service"];for(let d of n)if(!l.includes(d))throw new Error(`Invalid type "${d}". Must be one of: ${l.join(", ")}`)}let a={query:i,types:n,includeDeprecated:o,limit:s,offset:0},c=this.searchEngine.search(a);return{items:this.formatter.formatSearchResults(c.items),total:c.total,hasMore:c.hasMore,query:i}}static getToolDefinition(){return{name:"search-components",description:"Searches for components, directives, pipes, and services by keyword or functionality. Returns results ranked by relevance, matching against component names, selectors, descriptions, inputs, outputs, and methods. Supports filtering by type and deprecated status.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query to match against component metadata"},types:{type:"array",items:{type:"string",enum:["component","directive","pipe","service"]},description:"Filter results by type (optional). If not specified, searches all types."},includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in results (default: false)",default:!1},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3}},required:["query"]}}}};var Fn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatInputs(n);return{componentName:n.name,inputs:o}}static getToolDefinition(){return{name:"get-component-inputs",description:"Retrieves all input properties for a specific component, directive, pipe, or service by name. Returns detailed information about each input including name, type, description, default value, and required flag.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Un=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatOutputs(n);return{componentName:n.name,outputs:o}}static getToolDefinition(){return{name:"get-component-outputs",description:"Retrieves all output events for a specific component, directive, pipe, or service by name. Returns detailed information about each output including name, type, and description.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Vn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatExamples(n);return{componentName:n.name,examples:o}}static getToolDefinition(){return{name:"get-component-examples",description:"Retrieves all usage examples for a specific component, directive, pipe, or service by name. Returns code examples with HTML templates and TypeScript code, preserving formatting. Returns an empty array if no examples are available.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Bn=class{async execute(e={}){try{let r=await fetch("https://registry.npmjs.org/@eui/components");if(!r.ok)throw r.status===404?new Error('Package "@eui/components" not found in npm registry'):new Error(`npm registry returned status ${r.status}`);let n=await r.json();if(!n["dist-tags"]||!n["dist-tags"].latest)throw new Error("Invalid response: missing dist-tags.latest");if(!n.time)throw new Error("Invalid response: missing time field");let o=n["dist-tags"].latest,s=n.time[o];if(!s)throw new Error(`Invalid response: no publish date for version ${o}`);return{packageName:"@eui/components",version:o,publishDate:s}}catch(r){throw r instanceof Error?r:new Error(`Unexpected error querying npm registry: ${String(r)}`)}}static getToolDefinition(){return{name:"get-library-version",description:"Queries the npm registry to retrieve the latest version information for the @eui/components package, including the version number and publish date.",inputSchema:{type:"object",properties:{}}}}};var Ta=class{isDeprecated(e){return!!(e.deprecated===!0||e.decorators&&e.decorators.some(r=>r.name==="deprecated")||e.jsdoctags&&e.jsdoctags.some(r=>r.tagName?.text==="deprecated"))}extractDeprecationMessage(e){let r=e.jsdoctags?.find(n=>n.tagName?.text==="deprecated");return r?.comment?r.comment:e.deprecationMessage?e.deprecationMessage:"This item is deprecated."}extractVersion(e){let r=[/since\s+v?(\d+\.\d+\.\d+)/i,/deprecated\s+in\s+v?(\d+\.\d+\.\d+)/i,/v(\d+\.\d+\.\d+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}extractReplacement(e){let r=[/use\s+([A-Za-z0-9_-]+)\s+instead/i,/replaced\s+by\s+([A-Za-z0-9_-]+)/i,/migrate\s+to\s+([A-Za-z0-9_-]+)/i,/see\s+([A-Za-z0-9_-]+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}parseDeprecationInfo(e){let r=this.extractDeprecationMessage(e);return{deprecationMessage:r,versionDeprecated:this.extractVersion(r),replacementSuggestion:this.extractReplacement(r),filePath:e.file}}};var Hn=class{constructor(e){this.index=e;this.parser=new Ta}index;parser;listDeprecated(e={}){let r=[],n=[{items:this.index.components,type:"component"},{items:this.index.directives,type:"directive"},{items:this.index.pipes,type:"pipe"},{items:this.index.services,type:"injectable"}];for(let{items:o,type:s}of n)if(!(e.type&&e.type!==s)){for(let i of o)if(this.parser.isDeprecated(i)){let a=this.parser.parseDeprecationInfo(i),c=e.includeReplacements?a.replacementSuggestion:void 0;r.push({name:i.name,type:s,deprecationMessage:a.deprecationMessage,versionDeprecated:a.versionDeprecated,replacementSuggestion:c,filePath:a.filePath})}}return r}getDeprecationInfo(e){let r=this.index.byName.get(e);if(!r)return null;if(!this.parser.isDeprecated(r))return{name:e,type:r.type,isDeprecated:!1};let o=this.parser.parseDeprecationInfo(r);return{name:e,type:r.type,isDeprecated:!0,deprecationMessage:o.deprecationMessage,versionDeprecated:o.versionDeprecated,replacementSuggestion:o.replacementSuggestion}}};var Wn=class{query;formatter;constructor(e,r){this.query=new Hn(e),this.formatter=r}execute(e={}){let{type:r,includeReplacements:n=!1}=e,o=this.query.listDeprecated({type:r,includeReplacements:n});return{content:[{type:"text",text:this.formatter.formatDeprecatedList(o,n)}]}}static getToolDefinition(){return{name:"list-deprecated",description:"Lists all deprecated items in the library (components, directives, pipes, services). Supports filtering by type and optionally includes replacement suggestions.",inputSchema:{type:"object",properties:{type:{type:"string",description:"Filter by type (component, directive, pipe, injectable)"},includeReplacements:{type:"boolean",description:"Include replacement suggestions in results (default: false)",default:!1}}}}}};var Gn=class{query;formatter;constructor(e,r){this.query=new Hn(e),this.formatter=r}execute(e){let{componentName:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getDeprecationInfo(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{content:[{type:"text",text:this.formatter.formatDeprecationInfo(n)}]}}static getToolDefinition(){return{name:"get-deprecation-info",description:"Retrieves detailed deprecation information for a specific component, directive, pipe, or service. Returns deprecation status, message, version deprecated, and replacement suggestions.",inputSchema:{type:"object",properties:{componentName:{type:"string",description:"The name of the component or library element to check"}},required:["componentName"]}}}};var Jn=class{execute(e={}){return Promise.resolve({content:aj,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-guide",description:"Returns a comprehensive markdown guide for getting started with EUI CLI, including installation, project creation, and basic usage instructions.",inputSchema:{type:"object",properties:{}}}}},aj=`# Getting Started with EUI CLI
173
+ `),r}};var Ln=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e={}){let{includeDeprecated:r=!1,type:n="all",limit:o=50,offset:s=0}=e;if(o<1||o>1e3)throw new Error("Limit must be between 1 and 1000");if(s<0)throw new Error("Offset must be non-negative");let i=this.query.getByType(n),a=r?i:i.filter(m=>!m.deprecated),c=a.length,u=a.slice(s,s+o),l=s+o<c;return{items:this.formatter.formatList(u,!0),total:c,hasMore:l,offset:s,limit:o}}static getToolDefinition(){return{name:"list-components",description:"Lists all available components, directives, pipes, and services from the EUI component library. Supports filtering by type and deprecated status, with pagination for large result sets.",inputSchema:{type:"object",properties:{includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in the results (default: false)",default:!1},type:{type:"string",enum:["component","directive","pipe","service","all"],description:"Filter by type (default: all)",default:"all"},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3},offset:{type:"number",description:"Number of results to skip for pagination (default: 0)",default:0,minimum:0}}}}}};var qn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{component:this.formatter.formatDetails(n)}}static getToolDefinition(){return{name:"get-component-docs",description:"Retrieves detailed documentation for a specific component, directive, pipe, or service by name. Returns complete metadata including inputs, outputs, methods, examples, selector information, standalone flag, and module import requirements.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service to retrieve"}},required:["name"]}}}};var Fn=class{searchEngine;formatter;constructor(e,r){this.searchEngine=e,this.formatter=r}execute(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50}=e;if(r==null||typeof r!="string")throw new Error("Query is required and must be a string");let i=r.trim();if(i.length===0)throw new Error("Query cannot be empty");if(s<1||s>1e3)throw new Error("Limit must be between 1 and 1000");if(n&&n.length>0){let l=["component","directive","pipe","service"];for(let d of n)if(!l.includes(d))throw new Error(`Invalid type "${d}". Must be one of: ${l.join(", ")}`)}let a={query:i,types:n,includeDeprecated:o,limit:s,offset:0},c=this.searchEngine.search(a);return{items:this.formatter.formatSearchResults(c.items),total:c.total,hasMore:c.hasMore,query:i}}static getToolDefinition(){return{name:"search-components",description:"Searches for components, directives, pipes, and services by keyword or functionality. Returns results ranked by relevance, matching against component names, selectors, descriptions, inputs, outputs, and methods. Supports filtering by type and deprecated status.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query to match against component metadata"},types:{type:"array",items:{type:"string",enum:["component","directive","pipe","service"]},description:"Filter results by type (optional). If not specified, searches all types."},includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in results (default: false)",default:!1},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3}},required:["query"]}}}};var Un=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatInputs(n);return{componentName:n.name,inputs:o}}static getToolDefinition(){return{name:"get-component-inputs",description:"Retrieves all input properties for a specific component, directive, pipe, or service by name. Returns detailed information about each input including name, type, description, default value, and required flag.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Vn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatOutputs(n);return{componentName:n.name,outputs:o}}static getToolDefinition(){return{name:"get-component-outputs",description:"Retrieves all output events for a specific component, directive, pipe, or service by name. Returns detailed information about each output including name, type, and description.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Bn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatExamples(n);return{componentName:n.name,examples:o}}static getToolDefinition(){return{name:"get-component-examples",description:"Retrieves all usage examples for a specific component, directive, pipe, or service by name. Returns code examples with HTML templates and TypeScript code, preserving formatting. Returns an empty array if no examples are available.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Hn=class{async execute(e={}){try{let r=await fetch("https://registry.npmjs.org/@eui/components");if(!r.ok)throw r.status===404?new Error('Package "@eui/components" not found in npm registry'):new Error(`npm registry returned status ${r.status}`);let n=await r.json();if(!n["dist-tags"]||!n["dist-tags"].latest)throw new Error("Invalid response: missing dist-tags.latest");if(!n.time)throw new Error("Invalid response: missing time field");let o=n["dist-tags"].latest,s=n.time[o];if(!s)throw new Error(`Invalid response: no publish date for version ${o}`);return{packageName:"@eui/components",version:o,publishDate:s}}catch(r){throw r instanceof Error?r:new Error(`Unexpected error querying npm registry: ${String(r)}`)}}static getToolDefinition(){return{name:"get-library-version",description:"Queries the npm registry to retrieve the latest version information for the @eui/components package, including the version number and publish date.",inputSchema:{type:"object",properties:{}}}}};var Oa=class{isDeprecated(e){return!!(e.deprecated===!0||e.decorators&&e.decorators.some(r=>r.name==="deprecated")||e.jsdoctags&&e.jsdoctags.some(r=>r.tagName?.text==="deprecated"))}extractDeprecationMessage(e){let r=e.jsdoctags?.find(n=>n.tagName?.text==="deprecated");return r?.comment?r.comment:e.deprecationMessage?e.deprecationMessage:"This item is deprecated."}extractVersion(e){let r=[/since\s+v?(\d+\.\d+\.\d+)/i,/deprecated\s+in\s+v?(\d+\.\d+\.\d+)/i,/v(\d+\.\d+\.\d+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}extractReplacement(e){let r=[/use\s+([A-Za-z0-9_-]+)\s+instead/i,/replaced\s+by\s+([A-Za-z0-9_-]+)/i,/migrate\s+to\s+([A-Za-z0-9_-]+)/i,/see\s+([A-Za-z0-9_-]+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}parseDeprecationInfo(e){let r=this.extractDeprecationMessage(e);return{deprecationMessage:r,versionDeprecated:this.extractVersion(r),replacementSuggestion:this.extractReplacement(r),filePath:e.file}}};var Wn=class{constructor(e){this.index=e;this.parser=new Oa}index;parser;listDeprecated(e={}){let r=[],n=[{items:this.index.components,type:"component"},{items:this.index.directives,type:"directive"},{items:this.index.pipes,type:"pipe"},{items:this.index.services,type:"injectable"}];for(let{items:o,type:s}of n)if(!(e.type&&e.type!==s)){for(let i of o)if(this.parser.isDeprecated(i)){let a=this.parser.parseDeprecationInfo(i),c=e.includeReplacements?a.replacementSuggestion:void 0;r.push({name:i.name,type:s,deprecationMessage:a.deprecationMessage,versionDeprecated:a.versionDeprecated,replacementSuggestion:c,filePath:a.filePath})}}return r}getDeprecationInfo(e){let r=this.index.byName.get(e);if(!r)return null;if(!this.parser.isDeprecated(r))return{name:e,type:r.type,isDeprecated:!1};let o=this.parser.parseDeprecationInfo(r);return{name:e,type:r.type,isDeprecated:!0,deprecationMessage:o.deprecationMessage,versionDeprecated:o.versionDeprecated,replacementSuggestion:o.replacementSuggestion}}};var Gn=class{query;formatter;constructor(e,r){this.query=new Wn(e),this.formatter=r}execute(e={}){let{type:r,includeReplacements:n=!1}=e,o=this.query.listDeprecated({type:r,includeReplacements:n});return{content:[{type:"text",text:this.formatter.formatDeprecatedList(o,n)}]}}static getToolDefinition(){return{name:"list-deprecated",description:"Lists all deprecated items in the library (components, directives, pipes, services). Supports filtering by type and optionally includes replacement suggestions.",inputSchema:{type:"object",properties:{type:{type:"string",description:"Filter by type (component, directive, pipe, injectable)"},includeReplacements:{type:"boolean",description:"Include replacement suggestions in results (default: false)",default:!1}}}}}};var Jn=class{query;formatter;constructor(e,r){this.query=new Wn(e),this.formatter=r}execute(e){let{componentName:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getDeprecationInfo(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{content:[{type:"text",text:this.formatter.formatDeprecationInfo(n)}]}}static getToolDefinition(){return{name:"get-deprecation-info",description:"Retrieves detailed deprecation information for a specific component, directive, pipe, or service. Returns deprecation status, message, version deprecated, and replacement suggestions.",inputSchema:{type:"object",properties:{componentName:{type:"string",description:"The name of the component or library element to check"}},required:["componentName"]}}}};var Kn=class{execute(e={}){return Promise.resolve({content:uj,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-guide",description:"Returns a comprehensive markdown guide for getting started with EUI CLI, including installation, project creation, and basic usage instructions.",inputSchema:{type:"object",properties:{}}}}},uj=`# Getting Started with EUI CLI
174
174
 
175
175
  The EUI CLI is a command-line tool for scaffolding and managing EUI applications.
176
176
 
@@ -295,7 +295,7 @@ my-app/
295
295
  \`\`\`
296
296
 
297
297
  The application will be available at \`http://localhost:4200\`
298
- `;var Kn=class{execute(e={}){return Promise.resolve({content:cj,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-instructions",description:"Returns complete EUI CLI instructions including all commands, options, headless mode configuration, CI/CD usage, and best practices for automated scaffolding and building.",inputSchema:{type:"object",properties:{}}}}},cj=`# eUI CLI - Complete Options Report
298
+ `;var Yn=class{execute(e={}){return Promise.resolve({content:lj,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-instructions",description:"Returns complete EUI CLI instructions including all commands, options, headless mode configuration, CI/CD usage, and best practices for automated scaffolding and building.",inputSchema:{type:"object",properties:{}}}}},lj=`# eUI CLI - Complete Options Report
299
299
 
300
300
  ## Overview
301
301
 
@@ -635,9 +635,9 @@ eui-cli serve-app --maxSpaceSize
635
635
 
636
636
  - **Node.js**: >=24.0.0
637
637
  - **Yarn**: >=1.22.4 <2
638
- `;function uj(t){let e=t.replace(/Component$/,"").replace(/Directive$/,"").replace(/Pipe$/,"").replace(/Service$/,"");return e=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase(),e}var Yn=class{data;constructor(e){this.data=e}updateData(e){this.data=e}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");if(!this.data||this.data.length===0)throw new Error("Accessibility data is not available. Ensure --a11y-path is configured pointing to a valid accessibility.json URL or file path.");let n=uj(r.trim()),o=this.data.find(s=>s.component===n);if(o||(o=this.data.find(s=>s.component===`eui-${n}`)),!o){let s=r.trim().toLowerCase();o=this.data.find(i=>i.component===s)}if(!o){let s=this.data.map(a=>a.component).sort().slice(0,20),i=this.data.length-20;throw new Error(`Accessibility documentation not found for "${r}". Available components: ${s.join(", ")}`+(i>0?` and ${i} more.`:"."))}return{componentName:o.component,accessibility:o.content}}static getToolDefinition(){return{name:"get-component-accessibility",description:"Retrieves accessibility (a11y) documentation for a specific EUI component. Returns plain-text accessibility guidelines, ARIA requirements, and keyboard interaction details.",inputSchema:{type:"object",properties:{name:{type:"string",description:'The name of the component (e.g. "ButtonComponent", "DatePickerComponent", or just "button")'}},required:["name"]}}}};var ys=class{server;index;query;searchEngine;formatter;accessibilityData;tools;isRunning=!1;constructor(e,r,n){this.index=r,this.accessibilityData=n??null,this.query=new hs(r),this.searchEngine=new gs(r),this.formatter=new Pa,this.tools=new Map,this.server=new ka({name:e.name,version:e.version},{capabilities:{tools:{}}}),this.registerTools(),this.setupHandlers()}registerTools(){let e=new Zn(this.query,this.formatter),r=new Ln(this.query,this.formatter),n=new qn(this.searchEngine,this.formatter),o=new Fn(this.query,this.formatter),s=new Un(this.query,this.formatter),i=new Vn(this.query,this.formatter),a=new Bn,c=new Wn(this.index,this.formatter),u=new Gn(this.index,this.formatter),l=new Jn,d=new Kn,m=new Yn(this.accessibilityData);this.tools.set("list-components",e),this.tools.set("get-component-docs",r),this.tools.set("search-components",n),this.tools.set("get-component-inputs",o),this.tools.set("get-component-outputs",s),this.tools.set("get-component-examples",i),this.tools.set("get-library-version",a),this.tools.set("list-deprecated",c),this.tools.set("get-deprecation-info",u),this.tools.set("get-eui-cli-guide",l),this.tools.set("get-eui-cli-instructions",d),this.tools.set("get-component-accessibility",m)}setupHandlers(){this.server.setRequestHandler(tl,()=>({tools:[Zn.getToolDefinition(),Ln.getToolDefinition(),qn.getToolDefinition(),Fn.getToolDefinition(),Un.getToolDefinition(),Vn.getToolDefinition(),Bn.getToolDefinition(),Wn.getToolDefinition(),Gn.getToolDefinition(),Jn.getToolDefinition(),Kn.getToolDefinition(),Yn.getToolDefinition()]})),this.server.setRequestHandler(jo,async e=>{let{name:r,arguments:n}=e.params;try{let o=this.tools.get(r);if(!o)return{content:[{type:"text",text:JSON.stringify({error:{code:"TOOL_NOT_FOUND",message:`Tool '${r}' does not exist. Available tools: ${Array.from(this.tools.keys()).join(", ")}`}})}],isError:!0};if(n==null)return{content:[{type:"text",text:JSON.stringify({error:{code:"INVALID_PARAMETERS",message:"Tool parameters are required"}})}],isError:!0};let s=await o.execute(n??{});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}catch(o){let s=o instanceof Error?o.message:"Unknown error occurred",i=this.categorizeError(o);return{content:[{type:"text",text:JSON.stringify({error:{code:i,message:s}})}],isError:!0}}})}categorizeError(e){if(e instanceof Error){let r=e.message.toLowerCase();if(r.includes("not found")||r.includes("does not exist"))return"NOT_FOUND";if(r.includes("invalid")||r.includes("must be")||r.includes("required")||r.includes("limit")||r.includes("offset"))return"INVALID_PARAMETERS"}return"INTERNAL_ERROR"}async start(){if(this.isRunning)throw new Error("Server is already running");let e=new za;await this.server.connect(e),this.isRunning=!0}async stop(){this.isRunning&&(await this.server.close(),this.isRunning=!1)}isHealthy(){return this.isRunning}getStats(){return{isRunning:this.isRunning,toolCount:this.tools.size,indexStats:{totalComponents:this.index.totalCount,lastUpdated:this.index.lastUpdated}}}updateIndex(e){this.index=e,this.query=new hs(e),this.searchEngine=new gs(e),this.registerTools()}updateAccessibilityData(e){this.accessibilityData=e;let r=this.tools.get("get-component-accessibility");r&&r.updateData(e)}};var cx=mt(require("fs")),gr=null,Oa=null,ax=!1;async function lj(t,e){let r=Xt.detect(t);if(r.type==="local"){let s=cx.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new ln({timeout:e,maxRetries:2,retryDelay:1e3,userAgent:"EUI-MCP-Server/1.0"}).fetch(r.normalizedPath);if(o.status!==200)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return JSON.parse(o.data)}async function dj(){try{let t=qa();(!t.success||!t.config)&&(process.stderr.write(`Failed to load configuration
638
+ `;function dj(t){let e=t.replace(/Component$/,"").replace(/Directive$/,"").replace(/Pipe$/,"").replace(/Service$/,"");return e=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase(),e}var Qn=class{data;constructor(e){this.data=e}updateData(e){this.data=e}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");if(!this.data||this.data.length===0)throw new Error("Accessibility data is not available. Ensure --a11y-path is configured pointing to a valid accessibility.json URL or file path.");let n=dj(r.trim()),o=this.data.find(s=>s.component===n);if(o||(o=this.data.find(s=>s.component===`eui-${n}`)),!o){let s=r.trim().toLowerCase();o=this.data.find(i=>i.component===s)}if(!o){let s=this.data.map(a=>a.component).sort().slice(0,20),i=this.data.length-20;throw new Error(`Accessibility documentation not found for "${r}". Available components: ${s.join(", ")}`+(i>0?` and ${i} more.`:"."))}return{componentName:o.component,accessibility:o.content}}static getToolDefinition(){return{name:"get-component-accessibility",description:"Retrieves accessibility (a11y) documentation for a specific EUI component. Returns plain-text accessibility guidelines, ARIA requirements, and keyboard interaction details.",inputSchema:{type:"object",properties:{name:{type:"string",description:'The name of the component (e.g. "ButtonComponent", "DatePickerComponent", or just "button")'}},required:["name"]}}}};var bs=class{server;index;query;searchEngine;formatter;accessibilityData;tools;isRunning=!1;constructor(e,r,n){this.index=r,this.accessibilityData=n??null,this.query=new _s(r),this.searchEngine=new vs(r),this.formatter=new Ca,this.tools=new Map,this.server=new za({name:e.name,version:e.version},{capabilities:{tools:{}}}),this.registerTools(),this.setupHandlers()}registerTools(){let e=new Ln(this.query,this.formatter),r=new qn(this.query,this.formatter),n=new Fn(this.searchEngine,this.formatter),o=new Un(this.query,this.formatter),s=new Vn(this.query,this.formatter),i=new Bn(this.query,this.formatter),a=new Hn,c=new Gn(this.index,this.formatter),u=new Jn(this.index,this.formatter),l=new Kn,d=new Yn,m=new Qn(this.accessibilityData);this.tools.set("list-components",e),this.tools.set("get-component-docs",r),this.tools.set("search-components",n),this.tools.set("get-component-inputs",o),this.tools.set("get-component-outputs",s),this.tools.set("get-component-examples",i),this.tools.set("get-library-version",a),this.tools.set("list-deprecated",c),this.tools.set("get-deprecation-info",u),this.tools.set("get-eui-cli-guide",l),this.tools.set("get-eui-cli-instructions",d),this.tools.set("get-component-accessibility",m)}setupHandlers(){this.server.setRequestHandler(rl,()=>({tools:[Ln.getToolDefinition(),qn.getToolDefinition(),Fn.getToolDefinition(),Un.getToolDefinition(),Vn.getToolDefinition(),Bn.getToolDefinition(),Hn.getToolDefinition(),Gn.getToolDefinition(),Jn.getToolDefinition(),Kn.getToolDefinition(),Yn.getToolDefinition(),Qn.getToolDefinition()]})),this.server.setRequestHandler(Lo,async e=>{let{name:r,arguments:n}=e.params;try{let o=this.tools.get(r);if(!o)return{content:[{type:"text",text:JSON.stringify({error:{code:"TOOL_NOT_FOUND",message:`Tool '${r}' does not exist. Available tools: ${Array.from(this.tools.keys()).join(", ")}`}})}],isError:!0};if(n==null)return{content:[{type:"text",text:JSON.stringify({error:{code:"INVALID_PARAMETERS",message:"Tool parameters are required"}})}],isError:!0};let s=await o.execute(n??{});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}catch(o){let s=o instanceof Error?o.message:"Unknown error occurred",i=this.categorizeError(o);return{content:[{type:"text",text:JSON.stringify({error:{code:i,message:s}})}],isError:!0}}})}categorizeError(e){if(e instanceof Error){let r=e.message.toLowerCase();if(r.includes("not found")||r.includes("does not exist"))return"NOT_FOUND";if(r.includes("invalid")||r.includes("must be")||r.includes("required")||r.includes("limit")||r.includes("offset"))return"INVALID_PARAMETERS"}return"INTERNAL_ERROR"}async start(){if(this.isRunning)throw new Error("Server is already running");let e=new Ta;await this.server.connect(e),this.isRunning=!0}async stop(){this.isRunning&&(await this.server.close(),this.isRunning=!1)}isHealthy(){return this.isRunning}getStats(){return{isRunning:this.isRunning,toolCount:this.tools.size,indexStats:{totalComponents:this.index.totalCount,lastUpdated:this.index.lastUpdated}}}updateIndex(e){this.index=e,this.query=new _s(e),this.searchEngine=new vs(e),this.registerTools()}updateAccessibilityData(e){this.accessibilityData=e;let r=this.tools.get("get-component-accessibility");r&&r.updateData(e)}};var ux=mt(require("fs")),gr=null,Ra=null,cx=!1;async function fj(t,e){let r=Xt.detect(t);if(r.type==="local"){let s=ux.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new dn({timeout:e,maxRetries:2,retryDelay:1e3,userAgent:"EUI-MCP-Server/1.0"}).fetch(r.normalizedPath);if(o.status!==200)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return JSON.parse(o.data)}async function pj(){try{let t=Fa();(!t.success||!t.config)&&(process.stderr.write(`Failed to load configuration
639
639
  `),t.errors&&t.errors.forEach(c=>process.stderr.write(` - ${c}
640
- `)),process.exit(1));let e=t.config,r=Wc({level:e.logging.level,format:e.logging.format});r.info("Starting EUI Compodoc MCP Server",{version:e.server.version,documentationPath:e.documentation.path}),r.info("Loading documentation...",{path:e.documentation.path}),Oa=new fo({path:e.documentation.path,watchForChanges:e.documentation.watchForChanges,reloadDebounce:e.documentation.reloadDebounce,onReload:fj,onError:pj});let n=await Oa.load();(!n.success||!n.data)&&(r.error("Failed to load documentation",void 0,{error:n.error}),process.exit(1)),r.info("Documentation loaded successfully",{path:e.documentation.path}),r.info("Building component index...");let o=new po,s;try{s=o.build(n.data);let c=o.getStatistics(s);r.info("Index built successfully",{totalCount:c.totalCount,components:c.componentCount,directives:c.directiveCount,pipes:c.pipeCount,services:c.serviceCount})}catch(c){r.error("Failed to build index",c instanceof Error?c:new Error(String(c))),process.exit(1)}r.info("Initializing MCP server...");let i=null;if(e.accessibility?.path){r.info("Loading accessibility data...",{path:e.accessibility.path});try{i=await lj(e.accessibility.path,e.documentation.timeout),r.info("Accessibility data loaded successfully",{entries:i.length})}catch(c){r.warn("Failed to load accessibility data - tool will be unavailable",{error:c instanceof Error?c.message:String(c)})}}else r.info("No accessibility path configured - get-component-accessibility tool will report not configured");gr=new ys({name:e.server.name,version:e.server.version},s,i),r.info("Starting MCP server..."),await gr.start(),r.info("MCP server started successfully",{name:e.server.name,version:e.server.version,watchForChanges:e.documentation.watchForChanges}),gr.isHealthy()?r.info("Health check passed"):r.warn("Health check failed - server may not be fully operational");let a=gr.getStats();r.debug("Server statistics",a),r.info("Server is ready to accept requests")}catch(t){ne().error("Fatal error during startup",t instanceof Error?t:new Error(String(t))),process.exit(1)}}function fj(t){let e=ne();e.info("Documentation file changed, reloading...");try{let r=new po,n=r.build(t);if(gr){gr.updateIndex(n);let o=r.getStatistics(n);e.info("Index updated successfully",{totalCount:o.totalCount,components:o.componentCount,directives:o.directiveCount,pipes:o.pipeCount,services:o.serviceCount})}}catch(r){e.error("Failed to reload documentation",r instanceof Error?r:new Error(String(r)))}}function pj(t){ne().error("Documentation loader error",t)}async function Ca(t){if(ax)return;ax=!0;let e=ne();e.info(`Received ${t}, shutting down gracefully...`);try{gr&&(e.info("Stopping MCP server..."),await gr.stop(),e.info("MCP server stopped")),Oa&&(e.info("Stopping documentation loader..."),await Oa.dispose(),e.info("Documentation loader stopped")),e.info("Shutdown complete"),process.exit(0)}catch(r){e.error("Error during shutdown",r instanceof Error?r:new Error(String(r))),process.exit(1)}}function mj(){process.on("SIGINT",()=>{Ca("SIGINT")}),process.on("SIGTERM",()=>{Ca("SIGTERM")}),process.on("uncaughtException",t=>{ne().error("Uncaught exception",t),Ca("uncaughtException")}),process.on("unhandledRejection",t=>{ne().error("Unhandled promise rejection",t instanceof Error?t:new Error(String(t))),Ca("unhandledRejection")})}mj();dj().catch(t=>{process.stderr.write(`Fatal error: ${t}
640
+ `)),process.exit(1));let e=t.config,r=Gc({level:e.logging.level,format:e.logging.format});r.info("Starting EUI Compodoc MCP Server",{version:e.server.version,documentationPath:e.documentation.path}),r.info("Loading documentation...",{path:e.documentation.path}),Ra=new ho({path:e.documentation.path,watchForChanges:e.documentation.watchForChanges,reloadDebounce:e.documentation.reloadDebounce,onReload:mj,onError:hj});let n=await Ra.load();(!n.success||!n.data)&&(r.error("Failed to load documentation",void 0,{error:n.error}),process.exit(1)),r.info("Documentation loaded successfully",{path:e.documentation.path}),r.info("Building component index...");let o=new go,s;try{s=o.build(n.data);let c=o.getStatistics(s);r.info("Index built successfully",{totalCount:c.totalCount,components:c.componentCount,directives:c.directiveCount,pipes:c.pipeCount,services:c.serviceCount})}catch(c){r.error("Failed to build index",c instanceof Error?c:new Error(String(c))),process.exit(1)}r.info("Initializing MCP server...");let i=null;if(e.accessibility?.path){r.info("Loading accessibility data...",{path:e.accessibility.path});try{i=await fj(e.accessibility.path,e.documentation.timeout),r.info("Accessibility data loaded successfully",{entries:i.length})}catch(c){r.warn("Failed to load accessibility data - tool will be unavailable",{error:c instanceof Error?c.message:String(c)})}}else r.info("No accessibility path configured - get-component-accessibility tool will report not configured");gr=new bs({name:e.server.name,version:e.server.version},s,i),r.info("Starting MCP server..."),await gr.start(),r.info("MCP server started successfully",{name:e.server.name,version:e.server.version,watchForChanges:e.documentation.watchForChanges}),gr.isHealthy()?r.info("Health check passed"):r.warn("Health check failed - server may not be fully operational");let a=gr.getStats();r.debug("Server statistics",a),r.info("Server is ready to accept requests")}catch(t){ne().error("Fatal error during startup",t instanceof Error?t:new Error(String(t))),process.exit(1)}}function mj(t){let e=ne();e.info("Documentation file changed, reloading...");try{let r=new go,n=r.build(t);if(gr){gr.updateIndex(n);let o=r.getStatistics(n);e.info("Index updated successfully",{totalCount:o.totalCount,components:o.componentCount,directives:o.directiveCount,pipes:o.pipeCount,services:o.serviceCount})}}catch(r){e.error("Failed to reload documentation",r instanceof Error?r:new Error(String(r)))}}function hj(t){ne().error("Documentation loader error",t)}async function Ia(t){if(cx)return;cx=!0;let e=ne();e.info(`Received ${t}, shutting down gracefully...`);try{gr&&(e.info("Stopping MCP server..."),await gr.stop(),e.info("MCP server stopped")),Ra&&(e.info("Stopping documentation loader..."),await Ra.dispose(),e.info("Documentation loader stopped")),e.info("Shutdown complete"),process.exit(0)}catch(r){e.error("Error during shutdown",r instanceof Error?r:new Error(String(r))),process.exit(1)}}function gj(){process.on("SIGINT",()=>{Ia("SIGINT")}),process.on("SIGTERM",()=>{Ia("SIGTERM")}),process.on("uncaughtException",t=>{ne().error("Uncaught exception",t),Ia("uncaughtException")}),process.on("unhandledRejection",t=>{ne().error("Unhandled promise rejection",t instanceof Error?t:new Error(String(t))),Ia("unhandledRejection")})}gj();pj().catch(t=>{process.stderr.write(`Fatal error: ${t}
641
641
  `),process.exit(1)});
642
642
  /*! Bundled license information:
643
643