@eui/mcp 22.0.0-alpha.56 → 22.0.0-alpha.58

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,39 +1,39 @@
1
1
  #!/usr/bin/env node
2
- var gx=Object.create;var Za=Object.defineProperty;var yx=Object.getOwnPropertyDescriptor;var _x=Object.getOwnPropertyNames;var vx=Object.getPrototypeOf,bx=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},ff=(t,e)=>{for(var r in e)Za(t,r,{get:e[r],enumerable:!0})},wx=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _x(e))!bx.call(t,o)&&o!==r&&Za(t,o,{get:()=>e[o],enumerable:!(n=yx(e,o))||n.enumerable});return t};var gt=(t,e,r)=>(r=t!=null?gx(vx(t)):{},wx(e||!t||!t.__esModule?Za(r,"default",{value:t,enumerable:!0}):r,t));var sc=$((Q1,Jf)=>{"use strict";var ao=t=>t&&typeof t.message=="string",oc=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return ao(r)?r:void 0}else return ao(e)?e:void 0},Wf=(t,e)=>{if(!ao(t))return"";let r=t.stack||"";if(e.has(t))return r+`
3
- causes have become circular...`;let n=oc(t);return n?(e.add(t),r+`
4
- caused by: `+Wf(n,e)):r},sS=t=>Wf(t,new Set),Gf=(t,e,r)=>{if(!ao(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let o=oc(t);if(o){e.add(t);let s=typeof t.cause=="function";return n+(s?"":": ")+Gf(o,e,s)}else return n},iS=t=>Gf(t,new Set);Jf.exports={isErrorLike:ao,getErrorCause:oc,stackWithCauses:sS,messageWithCauses:iS}});var ic=$((X1,Yf)=>{"use strict";var aS=Symbol("circular-ref-tag"),qs=Symbol("pino-raw-err-ref"),Kf=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[qs]},set:function(t){this[qs]=t}}});Object.defineProperty(Kf,qs,{writable:!0,value:{}});Yf.exports={pinoErrProto:Kf,pinoErrorSymbols:{seen:aS,rawSymbol:qs}}});var ep=$((ej,Xf)=>{"use strict";Xf.exports=cc;var{messageWithCauses:cS,stackWithCauses:uS,isErrorLike:Qf}=sc(),{pinoErrProto:lS,pinoErrorSymbols:dS}=ic(),{seen:ac}=dS,{toString:fS}=Object.prototype;function cc(t){if(!Qf(t))return t;t[ac]=void 0;let e=Object.create(lS);e.type=fS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=cS(t),e.stack=uS(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>cc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Qf(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,ac)&&(e[r]=cc(n)):e[r]=n}return delete t[ac],e.raw=t,e}});var rp=$((tj,tp)=>{"use strict";tp.exports=Us;var{isErrorLike:uc}=sc(),{pinoErrProto:pS,pinoErrorSymbols:mS}=ic(),{seen:Fs}=mS,{toString:hS}=Object.prototype;function Us(t){if(!uc(t))return t;t[Fs]=void 0;let e=Object.create(pS);e.type=hS.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=>Us(r))),uc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Fs)&&(e.cause=Us(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];uc(n)?Object.prototype.hasOwnProperty.call(n,Fs)||(e[r]=Us(n)):e[r]=n}return delete t[Fs],e.raw=t,e}});var ip=$((rj,sp)=>{"use strict";sp.exports={mapHttpRequest:gS,reqSerializer:op};var lc=Symbol("pino-raw-req-ref"),np=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[lc]},set:function(t){this[lc]=t}}});Object.defineProperty(np,lc,{writable:!0,value:{}});function op(t){let e=t.info||t.socket,r=Object.create(np);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 gS(t){return{req:op(t)}}});var lp=$((nj,up)=>{"use strict";up.exports={mapHttpResponse:yS,resSerializer:cp};var dc=Symbol("pino-raw-res-ref"),ap=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[dc]},set:function(t){this[dc]=t}}});Object.defineProperty(ap,dc,{writable:!0,value:{}});function cp(t){let e=Object.create(ap);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function yS(t){return{res:cp(t)}}});var pc=$((oj,dp)=>{"use strict";var fc=ep(),_S=rp(),Vs=ip(),Bs=lp();dp.exports={err:fc,errWithCause:_S,mapHttpRequest:Vs.mapHttpRequest,mapHttpResponse:Bs.mapHttpResponse,req:Vs.reqSerializer,res:Bs.resSerializer,wrapErrorSerializer:function(e){return e===fc?e:function(n){return e(fc(n))}},wrapRequestSerializer:function(e){return e===Vs.reqSerializer?e:function(n){return e(Vs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Bs.resSerializer?e:function(n){return e(Bs.resSerializer(n))}}}});var mc=$((sj,fp)=>{"use strict";function vS(t,e){return e}fp.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=vS;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 _p=$((ij,yp)=>{"use strict";function hc(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]=hc(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]=hc(t[r]));return e}return t}function pp(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 mp(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 hp(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 Hs=Symbol("PATH_NOT_FOUND");function bS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return Hs;r=r[n]}return r}function wS(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 xS(t,e,r,n=!1){for(let o of e){let s=pp(o);if(s.includes("*"))gp(t,s,r,o,n);else if(n)hp(t,s);else{let i=bS(t,s);if(i===Hs)continue;let a=typeof r=="function"?r(i,s):r;mp(t,s,a)}}}function gp(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 SS(t,e,r,s,n,o)}function SS(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 p=0;p<l.length;p++)c[d]=p.toString(),u(l[p],d+1);else if(typeof l=="object"&&l!==null)for(let p in l)c[d]=p,u(l[p],d+1)}else if(d<i.length){let p=i[d];l&&typeof l=="object"&&l!==null&&p in l&&(c[d]=p,u(l[p],d+1))}else if(a.includes("*"))gp(l,a,typeof r=="function"?(m,f)=>{let h=[...c.slice(0,d),...f];return r(m,h)}:r,o,s);else if(s)hp(l,a);else{let p=typeof r=="function"?r(wS(l,a),[...c.slice(0,d),...a]):r;mp(l,a,p)}}if(i.length===0)u(t,0);else{let l=t;for(let d=0;d<i.length;d++){let p=i[d];if(l==null||typeof l!="object"||l===null)return;l=l[p],c[d]=p}l!=null&&u(l,i.length)}}function $S(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=pp(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 kS(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 ES(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 zS(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)ES(e)}function PS(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:o=!0,remove:s=!1}=t;zS(e);let i=$S(e);return function(c){if(o&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let u=kS(c,i),l=c,d=r;return typeof r=="function"&&(d=r),xS(u,e,d,s),n===!1?(u.restore=function(){return hc(l)},u):typeof n=="function"?n(u):JSON.stringify(u)}}yp.exports=PS});var fn=$((aj,vp)=>{"use strict";var TS=Symbol("pino.setLevel"),CS=Symbol("pino.getLevel"),OS=Symbol("pino.levelVal"),IS=Symbol("pino.levelComp"),RS=Symbol("pino.useLevelLabels"),DS=Symbol("pino.useOnlyCustomLevels"),AS=Symbol("pino.mixin"),NS=Symbol("pino.lsCache"),jS=Symbol("pino.chindings"),MS=Symbol("pino.asJson"),LS=Symbol("pino.write"),ZS=Symbol("pino.redactFmt"),qS=Symbol("pino.time"),FS=Symbol("pino.timeSliceIndex"),US=Symbol("pino.stream"),VS=Symbol("pino.stringify"),BS=Symbol("pino.stringifySafe"),HS=Symbol("pino.stringifiers"),WS=Symbol("pino.end"),GS=Symbol("pino.formatOpts"),JS=Symbol("pino.messageKey"),KS=Symbol("pino.errorKey"),YS=Symbol("pino.nestedKey"),QS=Symbol("pino.nestedKeyStr"),XS=Symbol("pino.mixinMergeStrategy"),e$=Symbol("pino.msgPrefix"),t$=Symbol("pino.wildcardFirst"),r$=Symbol.for("pino.serializers"),n$=Symbol.for("pino.formatters"),o$=Symbol.for("pino.hooks"),s$=Symbol.for("pino.metadata");vp.exports={setLevelSym:TS,getLevelSym:CS,levelValSym:OS,levelCompSym:IS,useLevelLabelsSym:RS,mixinSym:AS,lsCacheSym:NS,chindingsSym:jS,asJsonSym:MS,writeSym:LS,serializersSym:r$,redactFmtSym:ZS,timeSym:qS,timeSliceIndexSym:FS,streamSym:US,stringifySym:VS,stringifySafeSym:BS,stringifiersSym:HS,endSym:WS,formatOptsSym:GS,messageKeySym:JS,errorKeySym:KS,nestedKeySym:YS,wildcardFirstSym:t$,needsMetadataGsym:s$,useOnlyCustomLevelsSym:DS,formattersSym:n$,hooksSym:o$,nestedKeyStrSym:QS,mixinMergeStrategySym:XS,msgPrefixSym:e$}});var yc=$((cj,Sp)=>{"use strict";var bp=_p(),{redactFmtSym:i$,wildcardFirstSym:Ws}=fn(),gc=/[^.[\]]+|\[([^[\]]*?)\]/g,wp="[Redacted]",xp=!1;function a$(t,e){let{paths:r,censor:n,remove:o}=c$(t),s=r.reduce((c,u)=>{gc.lastIndex=0;let l=gc.exec(u),d=gc.exec(u),p=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(p==="*"&&(p=Ws),d===null)return c[p]=null,c;if(c[p]===null)return c;let{index:m}=d,f=`${u.substr(m,u.length-1)}`;return c[p]=c[p]||[],p!==Ws&&c[p].length===0&&c[p].push(...c[Ws]||[]),p===Ws&&Object.keys(c).forEach(function(h){c[h]&&c[h].push(f)}),c[p].push(f),c},{}),i={[i$]:bp({paths:r,censor:n,serialize:e,strict:xp,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,p)=>n(d,[u,...p]):n;c[u]=bp({paths:s[u],censor:l,serialize:e,strict:xp,remove:o})}return c},i)}function c$(t){if(Array.isArray(t))return t={paths:t,censor:wp},t;let{paths:e,censor:r=wp,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}}Sp.exports=a$});var Ep=$((uj,kp)=>{"use strict";var u$=()=>"",l$=()=>`,"time":${Date.now()}`,d$=()=>`,"time":${Math.round(Date.now()/1e3)}`,f$=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,p$=1000000n,$p=1000000000n,m$=BigInt(Date.now())*p$,h$=process.hrtime.bigint(),g$=()=>{let t=process.hrtime.bigint()-h$,e=m$+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"`};kp.exports={nullTime:u$,epochTime:l$,unixTime:d$,isoTime:f$,isoTimeNano:g$}});var Pp=$((lj,zp)=>{"use strict";function y$(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}zp.exports=_$;function _$(t,e,r){var n=r&&r.stringify||y$,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,p=t&&t.length||0,m=0;m<p;){if(t.charCodeAt(m)===37&&m+1<p){switch(d=d>-1?d:0,t.charCodeAt(m+1)){case 100:case 102:if(l>=c||e[l]==null)break;d<m&&(u+=t.slice(d,m)),u+=Number(e[l]),d=m+2,m++;break;case 105:if(l>=c||e[l]==null)break;d<m&&(u+=t.slice(d,m)),u+=Math.floor(Number(e[l])),d=m+2,m++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;d<m&&(u+=t.slice(d,m));var f=typeof e[l];if(f==="string"){u+="'"+e[l]+"'",d=m+2,m++;break}if(f==="function"){u+=e[l].name||"<anonymous>",d=m+2,m++;break}u+=n(e[l]),d=m+2,m++;break;case 115:if(l>=c)break;d<m&&(u+=t.slice(d,m)),u+=String(e[l]),d=m+2,m++;break;case 37:d<m&&(u+=t.slice(d,m)),u+="%",d=m+2,m++,l--;break}++l}++m}return d===-1?t:(d<p&&(u+=t.slice(d)),u)}});var vc=$((dj,_c)=>{"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));_c.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(););};_c.exports=t}});var Np=$((fj,Ap)=>{"use strict";var ue=require("fs"),v$=require("events"),b$=require("util").inherits,Tp=require("path"),wc=vc(),w$=require("assert"),Gs=100,Js=Buffer.allocUnsafe(0),x$=16*1024,Cp="buffer",Op="utf8",[S$,$$]=(process.versions.node||"0.0").split(".").map(Number),k$=S$>=22&&$$>=7;function Ip(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(Tp.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(Tp.dirname(t),{recursive:!0},s=>{if(s)return r(s);ue.open(t,n,o,r)}):ue.open(t,n,o,r)}function wt(t){if(!(this instanceof wt))return new wt(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:p,mode:m}=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||x$,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=m,this.retryEAGAIN=l||(()=>!0),this.mkdir=u||!1;let f,h;if(p===Cp)this._writingBuf=Js,this.write=P$,this.flush=C$,this.flushSync=I$,this._actualWrite=D$,f=()=>ue.writeSync(this.fd,this._writingBuf),h=()=>ue.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===Op)this._writingBuf="",this.write=z$,this.flush=T$,this.flushSync=O$,this._actualWrite=R$,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 "${Op}" and "${Cp}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Ip(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{wc(Gs),this.release(void 0,0)}catch(S){this.release(S)}else setTimeout(h,Gs);else this._writing=!1,this.emit("error",g);return}this.emit("write",_);let x=bc(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=bc(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,Ks(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(E$,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 bc(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 E$(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}b$(wt,v$);function Rp(t,e){return t.length===0?Js:t.length===1?t[0]:Buffer.concat(t,e)}function z$(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 P$(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 Dp(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$(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&&Dp.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function C$(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&&Dp.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}wt.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)})}),Ip(this.file,this)};wt.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():Ks(this)))};function O$(){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=bc(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;wc(Gs)}}try{ue.fsyncSync(this.fd)}catch{}}function I$(){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=Js);let t=Js;for(;this._bufs.length||t.length;){t.length<=0&&(t=Rp(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;wc(Gs)}}}wt.prototype.destroy=function(){this.destroyed||Ks(this)};function R$(){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 D$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Rp(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 k$&&(this._writingBuf=Buffer.from(this._writingBuf)),ue.write(this.fd,this._writingBuf,t)}function Ks(t){if(t.fd===-1){t.once("ready",Ks.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],w$(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")}}wt.SonicBoom=wt;wt.default=wt;Ap.exports=wt});var xc=$((pj,qp)=>{"use strict";var xt={exit:[],beforeExit:[]},jp={exit:j$,beforeExit:M$},pn;function A$(){pn===void 0&&(pn=new FinalizationRegistry(L$))}function N$(t){xt[t].length>0||process.on(t,jp[t])}function Mp(t){xt[t].length>0||(process.removeListener(t,jp[t]),xt.exit.length===0&&xt.beforeExit.length===0&&(pn=void 0))}function j$(){Lp("exit")}function M$(){Lp("beforeExit")}function Lp(t){for(let e of xt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}xt[t]=[]}function L$(t){for(let e of["exit","beforeExit"]){let r=xt[e].indexOf(t);xt[e].splice(r,r+1),Mp(e)}}function Zp(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");N$(t);let n=new WeakRef(e);n.fn=r,A$(),pn.register(e,n),xt[t].push(n)}function Z$(t,e){Zp("exit",t,e)}function q$(t,e){Zp("beforeExit",t,e)}function F$(t){if(pn!==void 0){pn.unregister(t);for(let e of["exit","beforeExit"])xt[e]=xt[e].filter(r=>{let n=r.deref();return n&&n!==t}),Mp(e)}}qp.exports={register:Z$,registerBeforeExit:q$,unregister:F$}});var Fp=$((mj,U$)=>{U$.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 Vp=$((hj,Up)=>{"use strict";function V$(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 B$(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()}Up.exports={wait:V$,waitDiff:B$}});var Hp=$((gj,Bp)=>{"use strict";Bp.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var om=$((yj,nm)=>{"use strict";var{version:H$}=Fp(),{EventEmitter:W$}=require("events"),{Worker:G$}=require("worker_threads"),{join:J$}=require("path"),{pathToFileURL:K$}=require("url"),{wait:Y$}=Vp(),{WRITE_INDEX:Ft,READ_INDEX:Ar,SEQ_INDEX:Sc}=Hp(),Q$=require("buffer"),X$=require("assert"),b=Symbol("kImpl"),ek=Q$.constants.MAX_STRING_LENGTH;function Wp(){}function zc(t,e){Atomics.add(t[b].state,Sc,1),e(),Atomics.add(t[b].state,Sc,1),Atomics.notify(t[b].state,Sc)}function Gp(t){zc(t,()=>{Atomics.store(t[b].state,Ar,0),Atomics.store(t[b].state,Ft,0)})}var co=class{constructor(e){this._value=e}deref(){return this._value}},Ys=class{register(){}unregister(){}},tk=process.env.NODE_V8_COVERAGE?Ys:global.FinalizationRegistry||Ys,rk=process.env.NODE_V8_COVERAGE?co:global.WeakRef||co,Jp=new tk(t=>{t.exited||t.terminate()});function nk(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||J$(__dirname,"lib","worker.js"),i=new G$(s,{...e.workerOpts,name:e.workerOpts?.name||"thread-stream",trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:K$(r).href,dataBuf:t[b].dataBuf,stateBuf:t[b].stateBuf,workerData:{$context:{threadStreamVersion:H$},...n}}});return i.stream=new co(t),i.on("message",ok),i.on("exit",Qp),Jp.register(t,i),i}function Kp(t){X$(!t[b].sync),t[b].needDrain&&(t[b].needDrain=!1,t.emit("drain"))}function Yp(t){for(;;){let e=Atomics.load(t[b].state,Ft),r=t[b].data.length-e;if(r>0){if(t[b].bufLen===0){t[b].flushing=!1,t[b].ending?Pc(t):t[b].needDrain&&process.nextTick(Kp,t);return}tm(t,r,Wp);continue}if(r===0){if(e===0&&t[b].bufLen===0)return;Qs(t,()=>{t.destroyed||(Gp(t),Yp(t))});return}it(t,new Error("overwritten"));return}}function ok(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 rk(e),Qs(e,()=>{e[b].ready=!0,e.emit("ready")});break;case"ERROR":it(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"){it(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:it(e,new Error("this should not happen: "+t.code))}}function Qp(t){let e=this.stream.deref();e!==void 0&&(Jp.unregister(e),e.worker.exited=!0,e.worker.off("exit",Qp),it(e,t!==0?new Error("the worker thread exited"):null))}var kc=class extends W${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=nk(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 Ec(this,new Error("the worker has exited")),!1;if(this[b].ending)return Ec(this,new Error("the worker is ending")),!1;if(this[b].flushing&&this[b].bufLen+r.length>=ek)try{$c(this),this[b].flushing=!0}catch(n){return it(this,n),!1}if(this[b].buf.push(r),this[b].bufLen+=r.length,this[b].sync)try{return $c(this),!0}catch(n){return it(this,n),!1}return this[b].flushing||(this[b].flushing=!0,setImmediate(Yp,this)),this[b].needDrain=this[b].data.length-this[b].bufLen-Atomics.load(this[b].state,Ft)<=0,!this[b].needDrain}end(){this[b].destroyed||(this[b].ending=!0,Pc(this))}flush(e){e=typeof e=="function"?e:Wp,Xp(this,r=>{if(r){process.nextTick(e,r);return}em(this,e)})}flushSync(){this[b].destroyed||($c(this),rm(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 Xp(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(Xp,t,e);return}Qs(t,e)}function Qs(t,e){let r=Atomics.load(t[b].state,Ft);Y$(t[b].state,Ar,r,1/0,(n,o)=>{if(n){it(t,n),e(n);return}if(o!=="ok"){Qs(t,e);return}e()})}function em(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].ready){let n=()=>{s(),em(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),it(t,n),process.nextTick(e,n)}}function sk(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 Ec(t,e){setImmediate(()=>{t.emit("error",e)})}function it(t,e){t[b].destroyed||(t[b].destroyed=!0,sk(t,e),e&&(t[b].errored=e,Ec(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 tm(t,e,r){let o=Atomics.load(t[b].state,Ft),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 zc(t,()=>{Atomics.store(t[b].state,Ft,o)}),r(),!0}function Pc(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,Ar);zc(t,()=>{Atomics.store(t[b].state,Ft,-1)});let r=0;for(;e!==-1;){if(Atomics.wait(t[b].state,Ar,e,1e3),e=Atomics.load(t[b].state,Ar),e===-2){it(t,new Error("end() failed"));return}if(++r===10){it(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[b].finished=!0,t.emit("finish")})}catch(e){it(t,e)}}}function $c(t){let e=()=>{t[b].ending?Pc(t):t[b].needDrain&&process.nextTick(Kp,t)};for(t[b].flushing=!1;t[b].bufLen!==0;){let r=Atomics.load(t[b].state,Ft),n=t[b].data.length-r;if(n===0){rm(t),Gp(t);continue}else if(n<0)throw new Error("overwritten");tm(t,n,e)}}function rm(t){if(t[b].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[b].state,Ft),r=0;for(;;){let n=Atomics.load(t[b].state,Ar);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[b].state,Ar,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}nm.exports=kc});var Oc=$((_j,am)=>{"use strict";var{createRequire:ik}=require("module"),{existsSync:ak}=require("node:fs"),ck=mc(),{join:Tc,isAbsolute:im,sep:uk}=require("node:path"),{fileURLToPath:lk}=require("node:url"),dk=vc(),Cc=xc(),fk=om();function pk(t){Cc.register(t,_k),Cc.registerBeforeExit(t,vk),t.on("close",function(){Cc.unregister(t)})}function mk(){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 hk(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&&sm(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(sm(i)){n=!0;continue}}r.push(s)}return n?r.join(" "):t}function sm(t){let e=gk(t);if(!e)return!1;let r=e;if(r.startsWith("file://"))try{r=lk(r)}catch{return!1}return im(r)&&!ak(r)}function gk(t){let e=t[0],r=t[t.length-1];return e==='"'&&r==='"'||e==="'"&&r==="'"?t.slice(1,-1):t}function yk(t,e,r,n,o){if(!r.execArgv&&mk()&&require.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=hk(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:o};let s=new fk({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&&pk(s)}function a(){s.closed||(s.flushSync(),dk(100),s.end())}return s}function _k(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function vk(t){t.flushSync()}function bk(t){let{pipeline:e,targets:r,levels:n,dedupe:o,worker:s={},caller:i=ck(),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"]||Tc(__dirname,"worker.js"),c.targets=r.filter(f=>f.target).map(f=>({...f,target:m(f.target)})),c.pipelines=r.filter(f=>f.pipeline).map(f=>f.pipeline.map(h=>({...h,level:f.level,target:m(h.target)})))):e&&(d=l["pino-worker"]||Tc(__dirname,"worker.js"),c.pipelines=[e.map(f=>({...f,target:m(f.target)}))]),n&&(c.levels=n),o&&(c.dedupe=o),c.pinoWillSendConfig=!0;let p=r||e?"pino.transport":d;return yk(m(d),c,s,a,p);function m(f){if(f=l[f]||f,im(f)||f.indexOf("file://")===0)return f;if(f==="pino/file")return Tc(__dirname,"..","file.js");let h;for(let g of u)try{let _=g==="node:repl"?process.cwd()+uk:g;h=ik(_).resolve(f);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${f}"`);return h}}am.exports=bk});var ti=$((vj,bm)=>{"use strict";var wk=require("node:diagnostics_channel"),cm=Pp(),{mapHttpRequest:xk,mapHttpResponse:Sk}=pc(),Rc=Np(),um=xc(),{lsCacheSym:$k,chindingsSym:mm,writeSym:lm,serializersSym:hm,formatOptsSym:dm,endSym:kk,stringifiersSym:gm,stringifySym:ym,stringifySafeSym:Dc,wildcardFirstSym:_m,nestedKeySym:Ek,formattersSym:vm,messageKeySym:zk,errorKeySym:Pk,nestedKeyStrSym:Tk,msgPrefixSym:Xs}=fn(),{isMainThread:Ck}=require("worker_threads"),Ok=Oc(),[Ik]=process.versions.node.split(".").map(t=>Number(t)),fm=wk.tracingChannel("pino_asJson"),Ic=Ik>=25?t=>JSON.stringify(t):Dk;function mn(){}function Rk(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=xk(n):typeof n.setHeader=="function"&&(n=Sk(n)));let i;s===null&&o.length===0?i=[null]:(s=o.shift(),i=o),typeof this[Xs]=="string"&&s!==void 0&&s!==null&&(s=this[Xs]+s),this[lm](n,cm(s,i,this[dm]),t)}else{let s=n===void 0?o.shift():n;typeof this[Xs]=="string"&&s!==void 0&&s!==null&&(s=this[Xs]+s),this[lm](null,cm(s,o,this[dm]),t)}}}function Dk(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 Ak(t,e,r,n){if(fm.hasSubscribers===!1)return pm.call(this,t,e,r,n);let o={instance:this,arguments};return fm.traceSync(pm,o,this,t,e,r,n)}function pm(t,e,r,n){let o=this[ym],s=this[Dc],i=this[gm],a=this[kk],c=this[mm],u=this[hm],l=this[vm],d=this[zk],p=this[Pk],m=this[$k][r]+n;m=m+c;let f;l.log&&(t=l.log(t));let h=i[_m],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===p&&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||Ic)(f);break;default:f=(w||o)(f,s)}if(f===void 0)continue;let S=Ic(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||Ic)(f),_=',"'+d+'":'+f;break;default:f=(x||o)(f,s),_=',"'+d+'":'+f}}return this[Ek]&&g?m+this[Tk]+g.slice(1)+"}"+_+a:m+g+_+a}function Nk(t,e){let r,n=t[mm],o=t[ym],s=t[Dc],i=t[gm],a=i[_m],c=t[hm],u=t[vm].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 jk(t){return t.write!==t.constructor.prototype.write}function ei(t){let e=new Rc(t);return e.on("error",r),!t.sync&&Ck&&(um.register(e,Mk),e.on("close",function(){um.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=mn,e.end=mn,e.flushSync=mn,e.destroy=mn;return}e.removeListener("error",r),e.emit("error",n)}}function Mk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Lk(t){return function(r,n,o={},s){if(typeof o=="string")s=ei({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=ei({dest:s})}else if(o instanceof Rc||o.writable||o._writableState)s=o,o={};else if(o.transport){if(o.transport instanceof Rc||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=Ok({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=mn),s||(jk(process.stdout)?s=process.stdout:s=ei({fd:process.stdout.fd||1})),{opts:o,stream:s}}}function Zk(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Dc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function qk(t,e,r){return{level:t,bindings:e,log:r}}function Fk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}bm.exports={noop:mn,buildSafeSonicBoom:ei,asChindings:Nk,asJson:Ak,genLog:Rk,createArgsNormalizer:Lk,stringify:Zk,buildFormatters:qk,normalizeDestFileDescriptor:Fk}});var ri=$((bj,wm)=>{var Uk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Vk={ASC:"ASC",DESC:"DESC"};wm.exports={DEFAULT_LEVELS:Uk,SORTING_ORDER:Vk}});var jc=$((wj,km)=>{"use strict";var{lsCacheSym:Bk,levelValSym:Ac,useOnlyCustomLevelsSym:Hk,streamSym:Wk,formattersSym:Gk,hooksSym:Jk,levelCompSym:xm}=fn(),{noop:Kk,genLog:Nr}=ti(),{DEFAULT_LEVELS:Ct,SORTING_ORDER:Sm}=ri(),$m={fatal:t=>{let e=Nr(Ct.fatal,t);return function(...r){let n=this[Wk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>Nr(Ct.error,t),warn:t=>Nr(Ct.warn,t),info:t=>Nr(Ct.info,t),debug:t=>Nr(Ct.debug,t),trace:t=>Nr(Ct.trace,t)},Nc=Object.keys(Ct).reduce((t,e)=>(t[Ct[e]]=e,t),{}),Yk=Object.keys(Nc).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Qk(t){let e=t[Gk].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[Bk]=n,t}function Xk(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 eE(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[Ac],o=this[Ac]=r[t],s=this[Hk],i=this[xm],a=this[Jk].logMethod;for(let c in r){if(i(r[c],o)===!1){this[c]=Kk;continue}this[c]=Xk(c,s)?$m[c](a):Nr(r[c],a)}this.emit("level-change",t,o,e[n],n,this)}function tE(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function rE(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[xm](r,this[Ac])}function nE(t,e,r){return t===Sm.DESC?e<=r:e>=r}function oE(t){return typeof t=="string"?nE.bind(null,t):t}function sE(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:Nc,r),o=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Ct,t);return{labels:n,values:o}}function iE(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Nc).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:Ct,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function aE(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 cE(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(Sm).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}km.exports={initialLsCache:Yk,genLsCache:Qk,levelMethods:$m,getLevel:tE,setLevel:eE,isLevelEnabled:rE,mappings:sE,assertNoLevelCollisions:aE,assertDefaultLevelFound:iE,genLevelComparison:oE,assertLevelComparison:cE}});var Mc=$((xj,Em)=>{"use strict";Em.exports={version:"10.3.1"}});var Dm=$(($j,Rm)=>{"use strict";var{EventEmitter:uE}=require("node:events"),{lsCacheSym:lE,levelValSym:dE,setLevelSym:Zc,getLevelSym:zm,chindingsSym:oi,mixinSym:fE,asJsonSym:Tm,writeSym:pE,mixinMergeStrategySym:mE,timeSym:hE,timeSliceIndexSym:gE,streamSym:Cm,serializersSym:jr,formattersSym:uo,errorKeySym:yE,messageKeySym:_E,useOnlyCustomLevelsSym:vE,needsMetadataGsym:bE,redactFmtSym:wE,stringifySym:xE,formatOptsSym:SE,stringifiersSym:$E,msgPrefixSym:qc,hooksSym:kE}=fn(),{getLevel:EE,setLevel:zE,isLevelEnabled:PE,mappings:TE,initialLsCache:CE,genLsCache:OE,assertNoLevelCollisions:IE}=jc(),{asChindings:Fc,asJson:RE,buildFormatters:Lc,stringify:Pm,noop:Om}=ti(),{version:DE}=Mc(),AE=yc(),NE=class{},Im={constructor:NE,child:jE,bindings:ME,setBindings:LE,flush:FE,isLevelEnabled:PE,version:DE,get level(){return this[zm]()},set level(t){this[Zc](t)},get levelVal(){return this[dE]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[qc]},get[Symbol.toStringTag](){return"Pino"},[lE]:CE,[pE]:qE,[Tm]:RE,[zm]:EE,[Zc]:zE};Object.setPrototypeOf(Im,uE.prototype);Rm.exports=function(){return Object.create(Im)};var ni=t=>t;function jE(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[jr],n=this[uo],o=Object.create(this);if(e==null)return o[uo].bindings!==ni&&(o[uo]=Lc(n.level,ni,n.log)),o[oi]=Fc(o,t),this.onChild!==Om&&this.onChild(o),o;if(e.hasOwnProperty("serializers")===!0){o[jr]=Object.create(null);for(let u in r)o[jr][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++){let u=a[s];o[jr][u]=r[u]}for(let u in e.serializers)o[jr][u]=e.serializers[u];let c=Object.getOwnPropertySymbols(e.serializers);for(var i=0;i<c.length;i++){let u=c[i];o[jr][u]=e.serializers[u]}}else o[jr]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:c,log:u}=e.formatters;o[uo]=Lc(a||n.level,c||ni,u||n.log)}else o[uo]=Lc(n.level,ni,n.log);if(e.hasOwnProperty("customLevels")===!0&&(IE(this.levels,e.customLevels),o.levels=TE(e.customLevels,o[vE]),OE(o)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){o.redact=e.redact;let a=AE(o.redact,Pm),c={stringify:a[wE]};o[xE]=Pm,o[$E]=a,o[SE]=c}if(typeof e.msgPrefix=="string"&&(o[qc]=(this[qc]||"")+e.msgPrefix),o[oi]=Fc(o,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;o[Zc](a)}return this.onChild(o),o}function ME(){let e=`{${this[oi].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function LE(t){let e=Fc(this,t);this[oi]=e}function ZE(t,e){return Object.assign(e,t)}function qE(t,e,r){let n=this[hE](),o=this[fE],s=this[yE],i=this[_E],a=this[mE]||ZE,c,u=this[kE].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[Tm](c,e,r,n),d=this[Cm];d[bE]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=e,d.lastTime=n.slice(this[gE]),d.lastLogger=this),d.write(u?u(l):l)}function FE(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[Cm];typeof e.flush=="function"?e.flush(t||Om):t&&t()}});var Mm=$((Hc,jm)=>{"use strict";var{hasOwnProperty:lo}=Object.prototype,Lr=Bc();Lr.configure=Bc;Lr.stringify=Lr;Lr.default=Lr;Hc.stringify=Lr;Hc.configure=Bc;jm.exports=Lr;var UE=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function tr(t){return t.length<5e3&&!UE.test(t)?`"${t}"`:JSON.stringify(t)}function Uc(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 VE=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Vc(t){return VE.call(t)!==void 0&&t.length!==0}function Am(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 BE(t){if(lo.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 HE(t){let e;if(lo.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 WE(t,e){let r;if(lo.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 Nm(t,e){let r;if(lo.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 Mr(t){return t===1?"1 item":`${t} items`}function GE(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function JE(t){if(lo.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 Bc(t){t={...t};let e=JE(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=BE(t),n=WE(t,"bigint"),o=HE(t),s=typeof o=="function"?o:void 0,i=Nm(t,"maximumDepth"),a=Nm(t,"maximumBreadth");function c(m,f,h,g,_,x){let w=f[m];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(m)),w=g.call(f,m,w),typeof w){case"string":return tr(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
- ${x}`,k=`,
6
- ${x}`);let Se=Math.min(w.length,a),Le=0;for(;Le<Se-1;Le++){let _r=c(String(Le),w,h,g,_,x);S+=_r!==void 0?_r:"null",S+=k}let Be=c(String(Le),w,h,g,_,x);if(S+=Be!==void 0?Be:"null",w.length-1>a){let _r=w.length-a-1;S+=`${k}"... ${Mr(_r)} not stringified"`}return _!==""&&(S+=`
7
- ${W}`),h.pop(),`[${S}]`}let L=Object.keys(w),re=L.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&&!Vc(w)&&(L=Uc(L,s)),h.push(w);for(let Se=0;Se<Ee;Se++){let Le=L[Se],Be=c(Le,w,h,g,_,x);Be!==void 0&&(S+=`${me}${tr(Le)}:${U}${Be}`,me=k)}if(re>a){let Se=re-a;S+=`${me}"...":${U}"${Mr(Se)} not stringified"`,me=k}return _!==""&&me.length>1&&(S=`
9
- ${x}${S}
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(m,f,h,g,_,x){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(m)),typeof f){case"string":return tr(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
- ${x}`,k=`,
12
- ${x}`);let re=Math.min(f.length,a),U=0;for(;U<re-1;U++){let Ee=u(String(U),f[U],h,g,_,x);S+=Ee!==void 0?Ee:"null",S+=k}let me=u(String(U),f[U],h,g,_,x);if(S+=me!==void 0?me:"null",f.length-1>a){let Ee=f.length-a-1;S+=`${k}"... ${Mr(Ee)} not stringified"`}return _!==""&&(S+=`
13
- ${w}`),h.pop(),`[${S}]`}h.push(f);let W="";_!==""&&(x+=_,k=`,
14
- ${x}`,W=" ");let L="";for(let re of g){let U=u(re,f[re],h,g,_,x);U!==void 0&&(S+=`${L}${tr(re)}:${W}${U}`,L=k)}return _!==""&&L.length>1&&(S=`
15
- ${x}${S}
16
- ${w}`),h.pop(),`{${S}}`}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 l(m,f,h,g,_){switch(typeof f){case"string":return tr(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return l(m,f,h,g,_);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let x=_;if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),_+=g;let U=`
17
- ${_}`,me=`,
18
- ${_}`,Ee=Math.min(f.length,a),Se=0;for(;Se<Ee-1;Se++){let Be=l(String(Se),f[Se],h,g,_);U+=Be!==void 0?Be:"null",U+=me}let Le=l(String(Se),f[Se],h,g,_);if(U+=Le!==void 0?Le:"null",f.length-1>a){let Be=f.length-a-1;U+=`${me}"... ${Mr(Be)} not stringified"`}return U+=`
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="",L="",re=Math.min(S,a);Vc(f)&&(W+=Am(f,k,a),w=w.slice(f.length),re-=f.length,L=k),o&&(w=Uc(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+=`${L}${tr(me)}: ${Ee}`,L=k)}if(S>a){let U=S-a;W+=`${L}"...": "${Mr(U)} not stringified"`,L=k}return L!==""&&(W=`
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(m,f,h){switch(typeof f){case"string":return tr(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return d(m,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),L=0;for(;L<W-1;L++){let U=d(String(L),f[L],h);g+=U!==void 0?U:"null",g+=","}let re=d(String(L),f[L],h);if(g+=re!==void 0?re:"null",f.length-1>a){let U=f.length-a-1;g+=`,"... ${Mr(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);_&&Vc(f)&&(g+=Am(f,",",a),x=x.slice(f.length),k-=f.length,S=","),o&&(x=Uc(x,s)),h.push(f);for(let W=0;W<k;W++){let L=x[W],re=d(L,f[L],h);re!==void 0&&(g+=`${S}${tr(L)}:${re}`,S=",")}if(w>a){let W=w-a;g+=`${S}"...":"${Mr(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 p(m,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("",{"":m},[],f,g,"");if(Array.isArray(f))return u("",m,[],GE(f),g,"")}if(g.length!==0)return l("",m,[],g,"")}return d("",m,[])}return p}});var Fm=$((kj,qm)=>{"use strict";var Wc=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Zm}=ri(),KE=Zm.info;function YE(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(Zm);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,[Wc]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function o(d){let p,m=this.lastLevel,{streams:f}=this,h=0,g;for(let _=QE(f.length,e.dedupe);ez(_,f.length,e.dedupe);_=XE(_,e.dedupe))if(p=f[_],p.level<=m){if(h!==0&&h!==p.level)break;if(g=p.stream,g[Wc]){let{lastTime:x,lastMsg:w,lastObj:S,lastLogger:k}=this;g.lastLevel=m,g.lastTime=x,g.lastMsg=w,g.lastObj=S,g.lastLogger=k}g.write(d),e.dedupe&&(h=p.level)}else if(!e.dedupe)break}function s(...d){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.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 p=typeof d.write=="function"||d.stream,m=d.write?d:d.stream;if(!p)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=KE;let _={stream:m,level:g,levelVal:void 0,id:++n.lastId};return f.unshift(_),f.sort(Lm),this.minLevel=f[0].level,n}function c(d){let{streams:p}=this,m=p.findIndex(f=>f.id===d);return m>=0&&(p.splice(m,1),p.sort(Lm),this.minLevel=p.length>0?p[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 p=new Array(this.streams.length);for(let m=0;m<p.length;m++)p[m]={level:d,stream:this.streams[m].stream};return{write:o,add:a,remove:c,minLevel:d,streams:p,clone:l,emit:s,flushSync:i,[Wc]:!0}}}function Lm(t,e){return t.level-e.level}function QE(t,e){return e?t-1:0}function XE(t,e){return e?t-1:t+1}function ez(t,e,r){return r?t>=0:t<e}qm.exports=YE});var rh=$((Ej,at)=>{"use strict";var tz=require("node:os"),Km=pc(),rz=mc(),nz=yc(),Ym=Ep(),oz=Dm(),Qm=fn(),{configure:sz}=Mm(),{assertDefaultLevelFound:iz,mappings:Xm,genLsCache:az,genLevelComparison:cz,assertLevelComparison:uz}=jc(),{DEFAULT_LEVELS:eh,SORTING_ORDER:lz}=ri(),{createArgsNormalizer:dz,asChindings:fz,buildSafeSonicBoom:Um,buildFormatters:pz,stringify:Gc,normalizeDestFileDescriptor:Vm,noop:mz}=ti(),{version:hz}=Mc(),{chindingsSym:Bm,redactFmtSym:gz,serializersSym:Hm,timeSym:yz,timeSliceIndexSym:_z,streamSym:vz,stringifySym:Wm,stringifySafeSym:Jc,stringifiersSym:Gm,setLevelSym:bz,endSym:wz,formatOptsSym:xz,messageKeySym:Sz,errorKeySym:$z,nestedKeySym:kz,mixinSym:Ez,levelCompSym:zz,useOnlyCustomLevelsSym:Pz,formattersSym:Jm,hooksSym:Tz,nestedKeyStrSym:Cz,mixinMergeStrategySym:Oz,msgPrefixSym:Iz}=Qm,{epochTime:th,nullTime:Rz}=Ym,{pid:Dz}=process,Az=tz.hostname(),Nz=Km.err,jz={level:"info",levelComparison:lz.ASC,levels:eh,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Dz,hostname:Az},serializers:Object.assign(Object.create(null),{err:Nz}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:th,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Mz=dz(jz),Lz=Object.assign(Object.create(null),Km);function Kc(...t){let e={},{opts:r,stream:n}=Mz(e,rz(),...t);r.level&&typeof r.level=="string"&&eh[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:p,level:m,customLevels:f,levelComparison:h,mixin:g,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:w,hooks:S,depthLimit:k,edgeLimit:W,onChild:L,msgPrefix:re}=r,U=sz({maximumDepth:k,maximumBreadth:W}),me=pz(w.level,w.bindings,w.log),Ee=Gc.bind({[Jc]:U}),Se=o?nz(o,Ee):{},Le=o?{stringify:Se[gz]}:{stringify:Ee},Be="}"+(s?`\r
2
+ var pS=Object.create;var Ic=Object.defineProperty;var mS=Object.getOwnPropertyDescriptor;var hS=Object.getOwnPropertyNames;var gS=Object.getPrototypeOf,yS=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},_p=(t,e)=>{for(var r in e)Ic(t,r,{get:e[r],enumerable:!0})},_S=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of hS(e))!yS.call(t,o)&&o!==r&&Ic(t,o,{get:()=>e[o],enumerable:!(n=mS(e,o))||n.enumerable});return t};var _t=(t,e,r)=>(r=t!=null?pS(gS(t)):{},_S(e||!t||!t.__esModule?Ic(r,"default",{value:t,enumerable:!0}):r,t));var Yc=$((cZ,tm)=>{"use strict";var wo=t=>t&&typeof t.message=="string",Kc=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return wo(r)?r:void 0}else return wo(e)?e:void 0},Qp=(t,e)=>{if(!wo(t))return"";let r=t.stack||"";if(e.has(t))return r+`
3
+ causes have become circular...`;let n=Kc(t);return n?(e.add(t),r+`
4
+ caused by: `+Qp(n,e)):r},rE=t=>Qp(t,new Set),em=(t,e,r)=>{if(!wo(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let o=Kc(t);if(o){e.add(t);let s=typeof t.cause=="function";return n+(s?"":": ")+em(o,e,s)}else return n},nE=t=>em(t,new Set);tm.exports={isErrorLike:wo,getErrorCause:Kc,stackWithCauses:rE,messageWithCauses:nE}});var Xc=$((uZ,nm)=>{"use strict";var oE=Symbol("circular-ref-tag"),ci=Symbol("pino-raw-err-ref"),rm=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[ci]},set:function(t){this[ci]=t}}});Object.defineProperty(rm,ci,{writable:!0,value:{}});nm.exports={pinoErrProto:rm,pinoErrorSymbols:{seen:oE,rawSymbol:ci}}});var im=$((lZ,sm)=>{"use strict";sm.exports=eu;var{messageWithCauses:sE,stackWithCauses:iE,isErrorLike:om}=Yc(),{pinoErrProto:aE,pinoErrorSymbols:cE}=Xc(),{seen:Qc}=cE,{toString:uE}=Object.prototype;function eu(t){if(!om(t))return t;t[Qc]=void 0;let e=Object.create(aE);e.type=uE.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=sE(t),e.stack=iE(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>eu(r)));for(let r in t)if(e[r]===void 0){let n=t[r];om(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Qc)&&(e[r]=eu(n)):e[r]=n}return delete t[Qc],e.raw=t,e}});var cm=$((dZ,am)=>{"use strict";am.exports=li;var{isErrorLike:tu}=Yc(),{pinoErrProto:lE,pinoErrorSymbols:dE}=Xc(),{seen:ui}=dE,{toString:fE}=Object.prototype;function li(t){if(!tu(t))return t;t[ui]=void 0;let e=Object.create(lE);e.type=fE.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=>li(r))),tu(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,ui)&&(e.cause=li(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];tu(n)?Object.prototype.hasOwnProperty.call(n,ui)||(e[r]=li(n)):e[r]=n}return delete t[ui],e.raw=t,e}});var fm=$((fZ,dm)=>{"use strict";dm.exports={mapHttpRequest:pE,reqSerializer:lm};var ru=Symbol("pino-raw-req-ref"),um=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[ru]},set:function(t){this[ru]=t}}});Object.defineProperty(um,ru,{writable:!0,value:{}});function lm(t){let e=t.info||t.socket,r=Object.create(um);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 pE(t){return{req:lm(t)}}});var gm=$((pZ,hm)=>{"use strict";hm.exports={mapHttpResponse:mE,resSerializer:mm};var nu=Symbol("pino-raw-res-ref"),pm=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[nu]},set:function(t){this[nu]=t}}});Object.defineProperty(pm,nu,{writable:!0,value:{}});function mm(t){let e=Object.create(pm);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function mE(t){return{res:mm(t)}}});var su=$((mZ,ym)=>{"use strict";var ou=im(),hE=cm(),di=fm(),fi=gm();ym.exports={err:ou,errWithCause:hE,mapHttpRequest:di.mapHttpRequest,mapHttpResponse:fi.mapHttpResponse,req:di.reqSerializer,res:fi.resSerializer,wrapErrorSerializer:function(e){return e===ou?e:function(n){return e(ou(n))}},wrapRequestSerializer:function(e){return e===di.reqSerializer?e:function(n){return e(di.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===fi.resSerializer?e:function(n){return e(fi.resSerializer(n))}}}});var iu=$((hZ,_m)=>{"use strict";function gE(t,e){return e}_m.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=gE;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 $m=$((gZ,Sm)=>{"use strict";function au(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]=au(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]=au(t[r]));return e}return t}function vm(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 bm(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 wm(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 pi=Symbol("PATH_NOT_FOUND");function yE(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return pi;r=r[n]}return r}function _E(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 vE(t,e,r,n=!1){for(let o of e){let s=vm(o);if(s.includes("*"))xm(t,s,r,o,n);else if(n)wm(t,s);else{let i=yE(t,s);if(i===pi)continue;let a=typeof r=="function"?r(i,s):r;bm(t,s,a)}}}function xm(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 bE(t,e,r,s,n,o)}function bE(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 p=0;p<l.length;p++)c[d]=p.toString(),u(l[p],d+1);else if(typeof l=="object"&&l!==null)for(let p in l)c[d]=p,u(l[p],d+1)}else if(d<i.length){let p=i[d];l&&typeof l=="object"&&l!==null&&p in l&&(c[d]=p,u(l[p],d+1))}else if(a.includes("*"))xm(l,a,typeof r=="function"?(m,f)=>{let h=[...c.slice(0,d),...f];return r(m,h)}:r,o,s);else if(s)wm(l,a);else{let p=typeof r=="function"?r(_E(l,a),[...c.slice(0,d),...a]):r;bm(l,a,p)}}if(i.length===0)u(t,0);else{let l=t;for(let d=0;d<i.length;d++){let p=i[d];if(l==null||typeof l!="object"||l===null)return;l=l[p],c[d]=p}l!=null&&u(l,i.length)}}function wE(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=vm(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 xE(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 SE(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 $E(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)SE(e)}function EE(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:o=!0,remove:s=!1}=t;$E(e);let i=wE(e);return function(c){if(o&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let u=xE(c,i),l=c,d=r;return typeof r=="function"&&(d=r),vE(u,e,d,s),n===!1?(u.restore=function(){return au(l)},u):typeof n=="function"?n(u):JSON.stringify(u)}}Sm.exports=EE});var wn=$((yZ,Em)=>{"use strict";var kE=Symbol("pino.setLevel"),PE=Symbol("pino.getLevel"),zE=Symbol("pino.levelVal"),TE=Symbol("pino.levelComp"),CE=Symbol("pino.useLevelLabels"),OE=Symbol("pino.useOnlyCustomLevels"),IE=Symbol("pino.mixin"),RE=Symbol("pino.lsCache"),DE=Symbol("pino.chindings"),AE=Symbol("pino.asJson"),NE=Symbol("pino.write"),jE=Symbol("pino.redactFmt"),ME=Symbol("pino.time"),LE=Symbol("pino.timeSliceIndex"),ZE=Symbol("pino.stream"),FE=Symbol("pino.stringify"),qE=Symbol("pino.stringifySafe"),UE=Symbol("pino.stringifiers"),VE=Symbol("pino.end"),BE=Symbol("pino.formatOpts"),HE=Symbol("pino.messageKey"),WE=Symbol("pino.errorKey"),GE=Symbol("pino.nestedKey"),JE=Symbol("pino.nestedKeyStr"),KE=Symbol("pino.mixinMergeStrategy"),YE=Symbol("pino.msgPrefix"),XE=Symbol("pino.wildcardFirst"),QE=Symbol.for("pino.serializers"),ek=Symbol.for("pino.formatters"),tk=Symbol.for("pino.hooks"),rk=Symbol.for("pino.metadata");Em.exports={setLevelSym:kE,getLevelSym:PE,levelValSym:zE,levelCompSym:TE,useLevelLabelsSym:CE,mixinSym:IE,lsCacheSym:RE,chindingsSym:DE,asJsonSym:AE,writeSym:NE,serializersSym:QE,redactFmtSym:jE,timeSym:ME,timeSliceIndexSym:LE,streamSym:ZE,stringifySym:FE,stringifySafeSym:qE,stringifiersSym:UE,endSym:VE,formatOptsSym:BE,messageKeySym:HE,errorKeySym:WE,nestedKeySym:GE,wildcardFirstSym:XE,needsMetadataGsym:rk,useOnlyCustomLevelsSym:OE,formattersSym:ek,hooksSym:tk,nestedKeyStrSym:JE,mixinMergeStrategySym:KE,msgPrefixSym:YE}});var uu=$((_Z,Tm)=>{"use strict";var km=$m(),{redactFmtSym:nk,wildcardFirstSym:mi}=wn(),cu=/[^.[\]]+|\[([^[\]]*?)\]/g,Pm="[Redacted]",zm=!1;function ok(t,e){let{paths:r,censor:n,remove:o}=sk(t),s=r.reduce((c,u)=>{cu.lastIndex=0;let l=cu.exec(u),d=cu.exec(u),p=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(p==="*"&&(p=mi),d===null)return c[p]=null,c;if(c[p]===null)return c;let{index:m}=d,f=`${u.substr(m,u.length-1)}`;return c[p]=c[p]||[],p!==mi&&c[p].length===0&&c[p].push(...c[mi]||[]),p===mi&&Object.keys(c).forEach(function(h){c[h]&&c[h].push(f)}),c[p].push(f),c},{}),i={[nk]:km({paths:r,censor:n,serialize:e,strict:zm,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,p)=>n(d,[u,...p]):n;c[u]=km({paths:s[u],censor:l,serialize:e,strict:zm,remove:o})}return c},i)}function sk(t){if(Array.isArray(t))return t={paths:t,censor:Pm},t;let{paths:e,censor:r=Pm,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}}Tm.exports=ok});var Im=$((vZ,Om)=>{"use strict";var ik=()=>"",ak=()=>`,"time":${Date.now()}`,ck=()=>`,"time":${Math.round(Date.now()/1e3)}`,uk=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,lk=1000000n,Cm=1000000000n,dk=BigInt(Date.now())*lk,fk=process.hrtime.bigint(),pk=()=>{let t=process.hrtime.bigint()-fk,e=dk+t,r=e/Cm,n=e%Cm,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"`};Om.exports={nullTime:ik,epochTime:ak,unixTime:ck,isoTime:uk,isoTimeNano:pk}});var Dm=$((bZ,Rm)=>{"use strict";function mk(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Rm.exports=hk;function hk(t,e,r){var n=r&&r.stringify||mk,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,p=t&&t.length||0,m=0;m<p;){if(t.charCodeAt(m)===37&&m+1<p){switch(d=d>-1?d:0,t.charCodeAt(m+1)){case 100:case 102:if(l>=c||e[l]==null)break;d<m&&(u+=t.slice(d,m)),u+=Number(e[l]),d=m+2,m++;break;case 105:if(l>=c||e[l]==null)break;d<m&&(u+=t.slice(d,m)),u+=Math.floor(Number(e[l])),d=m+2,m++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;d<m&&(u+=t.slice(d,m));var f=typeof e[l];if(f==="string"){u+="'"+e[l]+"'",d=m+2,m++;break}if(f==="function"){u+=e[l].name||"<anonymous>",d=m+2,m++;break}u+=n(e[l]),d=m+2,m++;break;case 115:if(l>=c)break;d<m&&(u+=t.slice(d,m)),u+=String(e[l]),d=m+2,m++;break;case 37:d<m&&(u+=t.slice(d,m)),u+="%",d=m+2,m++,l--;break}++l}++m}return d===-1?t:(d<p&&(u+=t.slice(d)),u)}});var du=$((wZ,lu)=>{"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));lu.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(););};lu.exports=t}});var qm=$((xZ,Fm)=>{"use strict";var le=require("fs"),gk=require("events"),yk=require("util").inherits,Am=require("path"),pu=du(),_k=require("assert"),hi=100,gi=Buffer.allocUnsafe(0),vk=16*1024,Nm="buffer",jm="utf8",[bk,wk]=(process.versions.node||"0.0").split(".").map(Number),xk=bk>=22&&wk>=7;function Mm(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&&le.mkdirSync(Am.dirname(t),{recursive:!0});let s=le.openSync(t,n,o);r(null,s)}catch(s){throw r(s),s}else e.mkdir?le.mkdir(Am.dirname(t),{recursive:!0},s=>{if(s)return r(s);le.open(t,n,o,r)}):le.open(t,n,o,r)}function St(t){if(!(this instanceof St))return new St(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:p,mode:m}=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||vk,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=m,this.retryEAGAIN=l||(()=>!0),this.mkdir=u||!1;let f,h;if(p===Nm)this._writingBuf=gi,this.write=Ek,this.flush=Pk,this.flushSync=Tk,this._actualWrite=Ok,f=()=>le.writeSync(this.fd,this._writingBuf),h=()=>le.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===jm)this._writingBuf="",this.write=$k,this.flush=kk,this.flushSync=zk,this._actualWrite=Ck,f=()=>Buffer.isBuffer(this._writingBuf)?le.writeSync(this.fd,this._writingBuf):le.writeSync(this.fd,this._writingBuf,"utf8"),h=()=>Buffer.isBuffer(this._writingBuf)?le.write(this.fd,this._writingBuf,this.release):le.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${jm}" and "${Nm}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Mm(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,y)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{pu(hi),this.release(void 0,0)}catch(S){this.release(S)}else setTimeout(h,hi);else this._writing=!1,this.emit("error",g);return}this.emit("write",y);let v=fu(this._writingBuf,this._len,y);if(this._len=v.len,this._writingBuf=v.writingBuf,this._writingBuf.length){if(!this.sync){h();return}try{do{let S=f(),E=fu(this._writingBuf,this._len,S);this._len=E.len,this._writingBuf=E.writingBuf}while(this._writingBuf.length)}catch(S){this.release(S);return}}this._fsync&&le.fsyncSync(this.fd);let x=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):x>this.minLength?this._actualWrite():this._ending?x>0?this._actualWrite():(this._writing=!1,yi(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(Sk,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 fu(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 Sk(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}yk(St,gk);function Lm(t,e){return t.length===0?gi:t.length===1?t[0]:Buffer.concat(t,e)}function $k(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 Ek(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 Zm(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{le.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 kk(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&&Zm.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function Pk(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&&Zm.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}St.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&&le.close(e,r=>{if(r)return this.emit("error",r)})}),Mm(this.file,this)};St.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():yi(this)))};function zk(){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)?le.writeSync(this.fd,t):le.writeSync(this.fd,t,"utf8"),r=fu(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;pu(hi)}}try{le.fsyncSync(this.fd)}catch{}}function Tk(){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=gi);let t=gi;for(;this._bufs.length||t.length;){t.length<=0&&(t=Lm(this._bufs[0],this._lens[0]));try{let e=le.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;pu(hi)}}}St.prototype.destroy=function(){this.destroyed||yi(this)};function Ck(){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)?le.writeSync(this.fd,this._writingBuf):le.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else le.write(this.fd,this._writingBuf,t)}function Ok(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Lm(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=le.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else xk&&(this._writingBuf=Buffer.from(this._writingBuf)),le.write(this.fd,this._writingBuf,t)}function yi(t){if(t.fd===-1){t.once("ready",yi.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],_k(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{le.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?le.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")}}St.SonicBoom=St;St.default=St;Fm.exports=St});var mu=$((SZ,Wm)=>{"use strict";var $t={exit:[],beforeExit:[]},Um={exit:Dk,beforeExit:Ak},xn;function Ik(){xn===void 0&&(xn=new FinalizationRegistry(Nk))}function Rk(t){$t[t].length>0||process.on(t,Um[t])}function Vm(t){$t[t].length>0||(process.removeListener(t,Um[t]),$t.exit.length===0&&$t.beforeExit.length===0&&(xn=void 0))}function Dk(){Bm("exit")}function Ak(){Bm("beforeExit")}function Bm(t){for(let e of $t[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}$t[t]=[]}function Nk(t){for(let e of["exit","beforeExit"]){let r=$t[e].indexOf(t);$t[e].splice(r,r+1),Vm(e)}}function Hm(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");Rk(t);let n=new WeakRef(e);n.fn=r,Ik(),xn.register(e,n),$t[t].push(n)}function jk(t,e){Hm("exit",t,e)}function Mk(t,e){Hm("beforeExit",t,e)}function Lk(t){if(xn!==void 0){xn.unregister(t);for(let e of["exit","beforeExit"])$t[e]=$t[e].filter(r=>{let n=r.deref();return n&&n!==t}),Vm(e)}}Wm.exports={register:jk,registerBeforeExit:Mk,unregister:Lk}});var Gm=$(($Z,Zk)=>{Zk.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 Km=$((EZ,Jm)=>{"use strict";function Fk(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 qk(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()}Jm.exports={wait:Fk,waitDiff:qk}});var Xm=$((kZ,Ym)=>{"use strict";Ym.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var lh=$((PZ,uh)=>{"use strict";var{version:Uk}=Gm(),{EventEmitter:Vk}=require("events"),{Worker:Bk}=require("worker_threads"),{join:Hk}=require("path"),{pathToFileURL:Wk}=require("url"),{wait:Gk}=Km(),{WRITE_INDEX:Ht,READ_INDEX:qr,SEQ_INDEX:hu}=Xm(),Jk=require("buffer"),Kk=require("assert"),w=Symbol("kImpl"),Yk=Jk.constants.MAX_STRING_LENGTH;function Qm(){}function vu(t,e){Atomics.add(t[w].state,hu,1),e(),Atomics.add(t[w].state,hu,1),Atomics.notify(t[w].state,hu)}function eh(t){vu(t,()=>{Atomics.store(t[w].state,qr,0),Atomics.store(t[w].state,Ht,0)})}var xo=class{constructor(e){this._value=e}deref(){return this._value}},_i=class{register(){}unregister(){}},Xk=process.env.NODE_V8_COVERAGE?_i:global.FinalizationRegistry||_i,Qk=process.env.NODE_V8_COVERAGE?xo:global.WeakRef||xo,th=new Xk(t=>{t.exited||t.terminate()});function eP(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||Hk(__dirname,"lib","worker.js"),i=new Bk(s,{...e.workerOpts,name:e.workerOpts?.name||"thread-stream",trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:Wk(r).href,dataBuf:t[w].dataBuf,stateBuf:t[w].stateBuf,workerData:{$context:{threadStreamVersion:Uk},...n}}});return i.stream=new xo(t),i.on("message",tP),i.on("exit",oh),th.register(t,i),i}function rh(t){Kk(!t[w].sync),t[w].needDrain&&(t[w].needDrain=!1,t.emit("drain"))}function nh(t){for(;;){let e=Atomics.load(t[w].state,Ht),r=t[w].data.length-e;if(r>0){if(t[w].bufLen===0){t[w].flushing=!1,t[w].ending?bu(t):t[w].needDrain&&process.nextTick(rh,t);return}ah(t,r,Qm);continue}if(r===0){if(e===0&&t[w].bufLen===0)return;vi(t,()=>{t.destroyed||(eh(t),nh(t))});return}ut(t,new Error("overwritten"));return}}function tP(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 Qk(e),vi(e,()=>{e[w].ready=!0,e.emit("ready")});break;case"ERROR":ut(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"){ut(e,new Error("this should not happen: "+t.code));break}let r=e[w].flushCallbacks.get(t.id);r&&(e[w].flushCallbacks.delete(t.id),process.nextTick(r));break}case"WARNING":process.emitWarning(t.err);break;default:ut(e,new Error("this should not happen: "+t.code))}}function oh(t){let e=this.stream.deref();e!==void 0&&(th.unregister(e),e.worker.exited=!0,e.worker.off("exit",oh),ut(e,t!==0?new Error("the worker thread exited"):null))}var yu=class extends Vk{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[w]={},this[w].stateBuf=new SharedArrayBuffer(128),this[w].state=new Int32Array(this[w].stateBuf),this[w].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[w].data=Buffer.from(this[w].dataBuf),this[w].sync=e.sync||!1,this[w].ending=!1,this[w].ended=!1,this[w].needDrain=!1,this[w].destroyed=!1,this[w].flushing=!1,this[w].ready=!1,this[w].finished=!1,this[w].errored=null,this[w].closed=!1,this[w].buf=[],this[w].bufHead=0,this[w].bufLen=0,this[w].flushCallbacks=new Map,this[w].nextFlushId=0,this.worker=eP(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[w].destroyed)return _u(this,new Error("the worker has exited")),!1;if(this[w].ending)return _u(this,new Error("the worker is ending")),!1;if(this[w].flushing&&this[w].bufLen+r.length>=Yk)try{gu(this),this[w].flushing=!0}catch(n){return ut(this,n),!1}if(this[w].buf.push(r),this[w].bufLen+=r.length,this[w].sync)try{return gu(this),!0}catch(n){return ut(this,n),!1}return this[w].flushing||(this[w].flushing=!0,setImmediate(nh,this)),this[w].needDrain=this[w].data.length-this[w].bufLen-Atomics.load(this[w].state,Ht)<=0,!this[w].needDrain}end(){this[w].destroyed||(this[w].ending=!0,bu(this))}flush(e){e=typeof e=="function"?e:Qm,sh(this,r=>{if(r){process.nextTick(e,r);return}ih(this,e)})}flushSync(){this[w].destroyed||(gu(this),ch(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[w].ready}get destroyed(){return this[w].destroyed}get closed(){return this[w].closed}get writable(){return!this[w].destroyed&&!this[w].ending}get writableEnded(){return this[w].ending}get writableFinished(){return this[w].finished}get writableNeedDrain(){return this[w].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[w].errored}};function sh(t,e){if(t[w].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[w].sync&&(t[w].flushing||t[w].bufLen>0)){setImmediate(sh,t,e);return}vi(t,e)}function vi(t,e){let r=Atomics.load(t[w].state,Ht);Gk(t[w].state,qr,r,1/0,(n,o)=>{if(n){ut(t,n),e(n);return}if(o!=="ok"){vi(t,e);return}e()})}function ih(t,e){if(t[w].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[w].ready){let n=()=>{s(),ih(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[w].nextFlushId;t[w].flushCallbacks.set(r,e);try{t.worker.postMessage({code:"FLUSH",context:"thread-stream",id:r})}catch(n){t[w].flushCallbacks.delete(r),ut(t,n),process.nextTick(e,n)}}function rP(t,e){let r=t[w].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 _u(t,e){setImmediate(()=>{t.emit("error",e)})}function ut(t,e){t[w].destroyed||(t[w].destroyed=!0,rP(t,e),e&&(t[w].errored=e,_u(t,e)),t.worker.exited?setImmediate(()=>{t[w].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[w].closed=!0,t.emit("close")}))}function ah(t,e,r){let o=Atomics.load(t[w].state,Ht),s=e;for(;s>0&&t[w].bufLen!==0;){let i=t[w].bufHead,a=t[w].buf[i];if(a.length<=s){a.copy(t[w].data,o),o+=a.length,s-=a.length,t[w].bufLen-=a.length,t[w].bufHead=i+1,t[w].bufHead===t[w].buf.length?(t[w].buf.length=0,t[w].bufHead=0):t[w].bufHead>=1024&&t[w].bufHead*2>=t[w].buf.length&&(t[w].buf.splice(0,t[w].bufHead),t[w].bufHead=0);continue}a.copy(t[w].data,o,0,s),t[w].buf[i]=a.subarray(s),t[w].bufLen-=s,o+=s,s=0}return vu(t,()=>{Atomics.store(t[w].state,Ht,o)}),r(),!0}function bu(t){if(!(t[w].ended||!t[w].ending||t[w].flushing)){t[w].ended=!0;try{t.flushSync();let e=Atomics.load(t[w].state,qr);vu(t,()=>{Atomics.store(t[w].state,Ht,-1)});let r=0;for(;e!==-1;){if(Atomics.wait(t[w].state,qr,e,1e3),e=Atomics.load(t[w].state,qr),e===-2){ut(t,new Error("end() failed"));return}if(++r===10){ut(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[w].finished=!0,t.emit("finish")})}catch(e){ut(t,e)}}}function gu(t){let e=()=>{t[w].ending?bu(t):t[w].needDrain&&process.nextTick(rh,t)};for(t[w].flushing=!1;t[w].bufLen!==0;){let r=Atomics.load(t[w].state,Ht),n=t[w].data.length-r;if(n===0){ch(t),eh(t);continue}else if(n<0)throw new Error("overwritten");ah(t,n,e)}}function ch(t){if(t[w].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[w].state,Ht),r=0;for(;;){let n=Atomics.load(t[w].state,qr);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[w].state,qr,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}uh.exports=yu});var Su=$((zZ,ph)=>{"use strict";var{createRequire:nP}=require("module"),{existsSync:oP}=require("node:fs"),sP=iu(),{join:wu,isAbsolute:fh,sep:iP}=require("node:path"),{fileURLToPath:aP}=require("node:url"),cP=du(),xu=mu(),uP=lh();function lP(t){xu.register(t,hP),xu.registerBeforeExit(t,gP),t.on("close",function(){xu.unregister(t)})}function dP(){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 fP(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&&dh(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(dh(i)){n=!0;continue}}r.push(s)}return n?r.join(" "):t}function dh(t){let e=pP(t);if(!e)return!1;let r=e;if(r.startsWith("file://"))try{r=aP(r)}catch{return!1}return fh(r)&&!oP(r)}function pP(t){let e=t[0],r=t[t.length-1];return e==='"'&&r==='"'||e==="'"&&r==="'"?t.slice(1,-1):t}function mP(t,e,r,n,o){if(!r.execArgv&&dP()&&require.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=fP(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:o};let s=new uP({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&&lP(s)}function a(){s.closed||(s.flushSync(),cP(100),s.end())}return s}function hP(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function gP(t){t.flushSync()}function yP(t){let{pipeline:e,targets:r,levels:n,dedupe:o,worker:s={},caller:i=sP(),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"]||wu(__dirname,"worker.js"),c.targets=r.filter(f=>f.target).map(f=>({...f,target:m(f.target)})),c.pipelines=r.filter(f=>f.pipeline).map(f=>f.pipeline.map(h=>({...h,level:f.level,target:m(h.target)})))):e&&(d=l["pino-worker"]||wu(__dirname,"worker.js"),c.pipelines=[e.map(f=>({...f,target:m(f.target)}))]),n&&(c.levels=n),o&&(c.dedupe=o),c.pinoWillSendConfig=!0;let p=r||e?"pino.transport":d;return mP(m(d),c,s,a,p);function m(f){if(f=l[f]||f,fh(f)||f.indexOf("file://")===0)return f;if(f==="pino/file")return wu(__dirname,"..","file.js");let h;for(let g of u)try{let y=g==="node:repl"?process.cwd()+iP:g;h=nP(y).resolve(f);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${f}"`);return h}}ph.exports=yP});var xi=$((TZ,kh)=>{"use strict";var _P=require("node:diagnostics_channel"),mh=Dm(),{mapHttpRequest:vP,mapHttpResponse:bP}=su(),Eu=qm(),hh=mu(),{lsCacheSym:wP,chindingsSym:bh,writeSym:gh,serializersSym:wh,formatOptsSym:yh,endSym:xP,stringifiersSym:xh,stringifySym:Sh,stringifySafeSym:ku,wildcardFirstSym:$h,nestedKeySym:SP,formattersSym:Eh,messageKeySym:$P,errorKeySym:EP,nestedKeyStrSym:kP,msgPrefixSym:bi}=wn(),{isMainThread:PP}=require("worker_threads"),zP=Su(),[TP]=process.versions.node.split(".").map(t=>Number(t)),_h=_P.tracingChannel("pino_asJson"),$u=TP>=25?t=>JSON.stringify(t):OP;function Sn(){}function CP(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=vP(n):typeof n.setHeader=="function"&&(n=bP(n)));let i;s===null&&o.length===0?i=[null]:(s=o.shift(),i=o),typeof this[bi]=="string"&&s!==void 0&&s!==null&&(s=this[bi]+s),this[gh](n,mh(s,i,this[yh]),t)}else{let s=n===void 0?o.shift():n;typeof this[bi]=="string"&&s!==void 0&&s!==null&&(s=this[bi]+s),this[gh](null,mh(s,o,this[yh]),t)}}}function OP(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 IP(t,e,r,n){if(_h.hasSubscribers===!1)return vh.call(this,t,e,r,n);let o={instance:this,arguments};return _h.traceSync(vh,o,this,t,e,r,n)}function vh(t,e,r,n){let o=this[Sh],s=this[ku],i=this[xh],a=this[xP],c=this[bh],u=this[wh],l=this[Eh],d=this[$P],p=this[EP],m=this[wP][r]+n;m=m+c;let f;l.log&&(t=l.log(t));let h=i[$h],g="";for(let v in t)if(f=t[v],Object.prototype.hasOwnProperty.call(t,v)&&f!==void 0){u[v]?f=u[v](f):v===p&&u.err&&(f=u.err(f));let x=i[v]||h;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":x&&(f=x(f));break;case"string":f=(x||$u)(f);break;default:f=(x||o)(f,s)}if(f===void 0)continue;let S=$u(v);g+=","+S+":"+f}let y="";if(e!==void 0){f=u[d]?u[d](e):e;let v=i[d]||h;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":v&&(f=v(f)),y=',"'+d+'":'+f;break;case"string":f=(v||$u)(f),y=',"'+d+'":'+f;break;default:f=(v||o)(f,s),y=',"'+d+'":'+f}}return this[SP]&&g?m+this[kP]+g.slice(1)+"}"+y+a:m+g+y+a}function RP(t,e){let r,n=t[bh],o=t[Sh],s=t[ku],i=t[xh],a=i[$h],c=t[wh],u=t[Eh].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 DP(t){return t.write!==t.constructor.prototype.write}function wi(t){let e=new Eu(t);return e.on("error",r),!t.sync&&PP&&(hh.register(e,AP),e.on("close",function(){hh.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=Sn,e.end=Sn,e.flushSync=Sn,e.destroy=Sn;return}e.removeListener("error",r),e.emit("error",n)}}function AP(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function NP(t){return function(r,n,o={},s){if(typeof o=="string")s=wi({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=wi({dest:s})}else if(o instanceof Eu||o.writable||o._writableState)s=o,o={};else if(o.transport){if(o.transport instanceof Eu||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=zP({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=Sn),s||(DP(process.stdout)?s=process.stdout:s=wi({fd:process.stdout.fd||1})),{opts:o,stream:s}}}function jP(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[ku])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function MP(t,e,r){return{level:t,bindings:e,log:r}}function LP(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}kh.exports={noop:Sn,buildSafeSonicBoom:wi,asChindings:RP,asJson:IP,genLog:CP,createArgsNormalizer:NP,stringify:jP,buildFormatters:MP,normalizeDestFileDescriptor:LP}});var Si=$((CZ,Ph)=>{var ZP={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},FP={ASC:"ASC",DESC:"DESC"};Ph.exports={DEFAULT_LEVELS:ZP,SORTING_ORDER:FP}});var Tu=$((OZ,Oh)=>{"use strict";var{lsCacheSym:qP,levelValSym:Pu,useOnlyCustomLevelsSym:UP,streamSym:VP,formattersSym:BP,hooksSym:HP,levelCompSym:zh}=wn(),{noop:WP,genLog:Ur}=xi(),{DEFAULT_LEVELS:At,SORTING_ORDER:Th}=Si(),Ch={fatal:t=>{let e=Ur(At.fatal,t);return function(...r){let n=this[VP];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>Ur(At.error,t),warn:t=>Ur(At.warn,t),info:t=>Ur(At.info,t),debug:t=>Ur(At.debug,t),trace:t=>Ur(At.trace,t)},zu=Object.keys(At).reduce((t,e)=>(t[At[e]]=e,t),{}),GP=Object.keys(zu).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function JP(t){let e=t[BP].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[qP]=n,t}function KP(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 YP(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[Pu],o=this[Pu]=r[t],s=this[UP],i=this[zh],a=this[HP].logMethod;for(let c in r){if(i(r[c],o)===!1){this[c]=WP;continue}this[c]=KP(c,s)?Ch[c](a):Ur(r[c],a)}this.emit("level-change",t,o,e[n],n,this)}function XP(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function QP(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[zh](r,this[Pu])}function ez(t,e,r){return t===Th.DESC?e<=r:e>=r}function tz(t){return typeof t=="string"?ez.bind(null,t):t}function rz(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:zu,r),o=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:At,t);return{labels:n,values:o}}function nz(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(zu).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:At,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function oz(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 sz(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(Th).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}Oh.exports={initialLsCache:GP,genLsCache:JP,levelMethods:Ch,getLevel:XP,setLevel:YP,isLevelEnabled:QP,mappings:rz,assertNoLevelCollisions:oz,assertDefaultLevelFound:nz,genLevelComparison:tz,assertLevelComparison:sz}});var Cu=$((IZ,Ih)=>{"use strict";Ih.exports={version:"10.3.1"}});var Zh=$((DZ,Lh)=>{"use strict";var{EventEmitter:iz}=require("node:events"),{lsCacheSym:az,levelValSym:cz,setLevelSym:Iu,getLevelSym:Rh,chindingsSym:Ei,mixinSym:uz,asJsonSym:Ah,writeSym:lz,mixinMergeStrategySym:dz,timeSym:fz,timeSliceIndexSym:pz,streamSym:Nh,serializersSym:Vr,formattersSym:So,errorKeySym:mz,messageKeySym:hz,useOnlyCustomLevelsSym:gz,needsMetadataGsym:yz,redactFmtSym:_z,stringifySym:vz,formatOptsSym:bz,stringifiersSym:wz,msgPrefixSym:Ru,hooksSym:xz}=wn(),{getLevel:Sz,setLevel:$z,isLevelEnabled:Ez,mappings:kz,initialLsCache:Pz,genLsCache:zz,assertNoLevelCollisions:Tz}=Tu(),{asChindings:Du,asJson:Cz,buildFormatters:Ou,stringify:Dh,noop:jh}=xi(),{version:Oz}=Cu(),Iz=uu(),Rz=class{},Mh={constructor:Rz,child:Dz,bindings:Az,setBindings:Nz,flush:Lz,isLevelEnabled:Ez,version:Oz,get level(){return this[Rh]()},set level(t){this[Iu](t)},get levelVal(){return this[cz]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[Ru]},get[Symbol.toStringTag](){return"Pino"},[az]:Pz,[lz]:Mz,[Ah]:Cz,[Rh]:Sz,[Iu]:$z};Object.setPrototypeOf(Mh,iz.prototype);Lh.exports=function(){return Object.create(Mh)};var $i=t=>t;function Dz(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[Vr],n=this[So],o=Object.create(this);if(e==null)return o[So].bindings!==$i&&(o[So]=Ou(n.level,$i,n.log)),o[Ei]=Du(o,t),this.onChild!==jh&&this.onChild(o),o;if(e.hasOwnProperty("serializers")===!0){o[Vr]=Object.create(null);for(let u in r)o[Vr][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++){let u=a[s];o[Vr][u]=r[u]}for(let u in e.serializers)o[Vr][u]=e.serializers[u];let c=Object.getOwnPropertySymbols(e.serializers);for(var i=0;i<c.length;i++){let u=c[i];o[Vr][u]=e.serializers[u]}}else o[Vr]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:c,log:u}=e.formatters;o[So]=Ou(a||n.level,c||$i,u||n.log)}else o[So]=Ou(n.level,$i,n.log);if(e.hasOwnProperty("customLevels")===!0&&(Tz(this.levels,e.customLevels),o.levels=kz(e.customLevels,o[gz]),zz(o)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){o.redact=e.redact;let a=Iz(o.redact,Dh),c={stringify:a[_z]};o[vz]=Dh,o[wz]=a,o[bz]=c}if(typeof e.msgPrefix=="string"&&(o[Ru]=(this[Ru]||"")+e.msgPrefix),o[Ei]=Du(o,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;o[Iu](a)}return this.onChild(o),o}function Az(){let e=`{${this[Ei].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function Nz(t){let e=Du(this,t);this[Ei]=e}function jz(t,e){return Object.assign(e,t)}function Mz(t,e,r){let n=this[fz](),o=this[uz],s=this[mz],i=this[hz],a=this[dz]||jz,c,u=this[xz].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[Ah](c,e,r,n),d=this[Nh];d[yz]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=e,d.lastTime=n.slice(this[pz]),d.lastLogger=this),d.write(u?u(l):l)}function Lz(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[Nh];typeof e.flush=="function"?e.flush(t||jh):t&&t()}});var Vh=$((Mu,Uh)=>{"use strict";var{hasOwnProperty:$o}=Object.prototype,Hr=ju();Hr.configure=ju;Hr.stringify=Hr;Hr.default=Hr;Mu.stringify=Hr;Mu.configure=ju;Uh.exports=Hr;var Zz=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ar(t){return t.length<5e3&&!Zz.test(t)?`"${t}"`:JSON.stringify(t)}function Au(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 Fz=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Nu(t){return Fz.call(t)!==void 0&&t.length!==0}function Fh(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 qz(t){if($o.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 Uz(t){let e;if($o.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 Vz(t,e){let r;if($o.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 qh(t,e){let r;if($o.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 Br(t){return t===1?"1 item":`${t} items`}function Bz(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function Hz(t){if($o.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 ju(t){t={...t};let e=Hz(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=qz(t),n=Vz(t,"bigint"),o=Uz(t),s=typeof o=="function"?o:void 0,i=qh(t,"maximumDepth"),a=qh(t,"maximumBreadth");function c(m,f,h,g,y,v){let x=f[m];switch(typeof x=="object"&&x!==null&&typeof x.toJSON=="function"&&(x=x.toJSON(m)),x=g.call(f,m,x),typeof x){case"string":return ar(x);case"object":{if(x===null)return"null";if(h.indexOf(x)!==-1)return r;let S="",E=",",C=v;if(Array.isArray(x)){if(x.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(x),y!==""&&(v+=y,S+=`
5
+ ${v}`,E=`,
6
+ ${v}`);let be=Math.min(x.length,a),Ce=0;for(;Ce<be-1;Ce++){let Er=c(String(Ce),x,h,g,y,v);S+=Er!==void 0?Er:"null",S+=E}let We=c(String(Ce),x,h,g,y,v);if(S+=We!==void 0?We:"null",x.length-1>a){let Er=x.length-a-1;S+=`${E}"... ${Br(Er)} not stringified"`}return y!==""&&(S+=`
7
+ ${C}`),h.pop(),`[${S}]`}let A=Object.keys(x),re=A.length;if(re===0)return"{}";if(i<h.length+1)return'"[Object]"';let F="",ie="";y!==""&&(v+=y,E=`,
8
+ ${v}`,F=" ");let $e=Math.min(re,a);o&&!Nu(x)&&(A=Au(A,s)),h.push(x);for(let be=0;be<$e;be++){let Ce=A[be],We=c(Ce,x,h,g,y,v);We!==void 0&&(S+=`${ie}${ar(Ce)}:${F}${We}`,ie=E)}if(re>a){let be=re-a;S+=`${ie}"...":${F}"${Br(be)} not stringified"`,ie=E}return y!==""&&ie.length>1&&(S=`
9
+ ${v}${S}
10
+ ${C}`),h.pop(),`{${S}}`}case"number":return isFinite(x)?String(x):e?e(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(x);default:return e?e(x):void 0}}function u(m,f,h,g,y,v){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(m)),typeof f){case"string":return ar(f);case"object":{if(f===null)return"null";if(h.indexOf(f)!==-1)return r;let x=v,S="",E=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),y!==""&&(v+=y,S+=`
11
+ ${v}`,E=`,
12
+ ${v}`);let re=Math.min(f.length,a),F=0;for(;F<re-1;F++){let $e=u(String(F),f[F],h,g,y,v);S+=$e!==void 0?$e:"null",S+=E}let ie=u(String(F),f[F],h,g,y,v);if(S+=ie!==void 0?ie:"null",f.length-1>a){let $e=f.length-a-1;S+=`${E}"... ${Br($e)} not stringified"`}return y!==""&&(S+=`
13
+ ${x}`),h.pop(),`[${S}]`}h.push(f);let C="";y!==""&&(v+=y,E=`,
14
+ ${v}`,C=" ");let A="";for(let re of g){let F=u(re,f[re],h,g,y,v);F!==void 0&&(S+=`${A}${ar(re)}:${C}${F}`,A=E)}return y!==""&&A.length>1&&(S=`
15
+ ${v}${S}
16
+ ${x}`),h.pop(),`{${S}}`}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 l(m,f,h,g,y){switch(typeof f){case"string":return ar(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return l(m,f,h,g,y);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let v=y;if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),y+=g;let F=`
17
+ ${y}`,ie=`,
18
+ ${y}`,$e=Math.min(f.length,a),be=0;for(;be<$e-1;be++){let We=l(String(be),f[be],h,g,y);F+=We!==void 0?We:"null",F+=ie}let Ce=l(String(be),f[be],h,g,y);if(F+=Ce!==void 0?Ce:"null",f.length-1>a){let We=f.length-a-1;F+=`${ie}"... ${Br(We)} not stringified"`}return F+=`
19
+ ${v}`,h.pop(),`[${F}]`}let x=Object.keys(f),S=x.length;if(S===0)return"{}";if(i<h.length+1)return'"[Object]"';y+=g;let E=`,
20
+ ${y}`,C="",A="",re=Math.min(S,a);Nu(f)&&(C+=Fh(f,E,a),x=x.slice(f.length),re-=f.length,A=E),o&&(x=Au(x,s)),h.push(f);for(let F=0;F<re;F++){let ie=x[F],$e=l(ie,f[ie],h,g,y);$e!==void 0&&(C+=`${A}${ar(ie)}: ${$e}`,A=E)}if(S>a){let F=S-a;C+=`${A}"...": "${Br(F)} not stringified"`,A=E}return A!==""&&(C=`
21
+ ${y}${C}
22
+ ${v}`),h.pop(),`{${C}}`}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(m,f,h){switch(typeof f){case"string":return ar(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return d(m,f,h);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let g="",y=f.length!==void 0;if(y&&Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f);let C=Math.min(f.length,a),A=0;for(;A<C-1;A++){let F=d(String(A),f[A],h);g+=F!==void 0?F:"null",g+=","}let re=d(String(A),f[A],h);if(g+=re!==void 0?re:"null",f.length-1>a){let F=f.length-a-1;g+=`,"... ${Br(F)} not stringified"`}return h.pop(),`[${g}]`}let v=Object.keys(f),x=v.length;if(x===0)return"{}";if(i<h.length+1)return'"[Object]"';let S="",E=Math.min(x,a);y&&Nu(f)&&(g+=Fh(f,",",a),v=v.slice(f.length),E-=f.length,S=","),o&&(v=Au(v,s)),h.push(f);for(let C=0;C<E;C++){let A=v[C],re=d(A,f[A],h);re!==void 0&&(g+=`${S}${ar(A)}:${re}`,S=",")}if(x>a){let C=x-a;g+=`${S}"...":"${Br(C)} 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 p(m,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("",{"":m},[],f,g,"");if(Array.isArray(f))return u("",m,[],Bz(f),g,"")}if(g.length!==0)return l("",m,[],g,"")}return d("",m,[])}return p}});var Gh=$((AZ,Wh)=>{"use strict";var Lu=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Hh}=Si(),Wz=Hh.info;function Gz(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(Hh);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,[Lu]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function o(d){let p,m=this.lastLevel,{streams:f}=this,h=0,g;for(let y=Jz(f.length,e.dedupe);Yz(y,f.length,e.dedupe);y=Kz(y,e.dedupe))if(p=f[y],p.level<=m){if(h!==0&&h!==p.level)break;if(g=p.stream,g[Lu]){let{lastTime:v,lastMsg:x,lastObj:S,lastLogger:E}=this;g.lastLevel=m,g.lastTime=v,g.lastMsg=x,g.lastObj=S,g.lastLogger=E}g.write(d),e.dedupe&&(h=p.level)}else if(!e.dedupe)break}function s(...d){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.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 p=typeof d.write=="function"||d.stream,m=d.write?d:d.stream;if(!p)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=Wz;let y={stream:m,level:g,levelVal:void 0,id:++n.lastId};return f.unshift(y),f.sort(Bh),this.minLevel=f[0].level,n}function c(d){let{streams:p}=this,m=p.findIndex(f=>f.id===d);return m>=0&&(p.splice(m,1),p.sort(Bh),this.minLevel=p.length>0?p[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 p=new Array(this.streams.length);for(let m=0;m<p.length;m++)p[m]={level:d,stream:this.streams[m].stream};return{write:o,add:a,remove:c,minLevel:d,streams:p,clone:l,emit:s,flushSync:i,[Lu]:!0}}}function Bh(t,e){return t.level-e.level}function Jz(t,e){return e?t-1:0}function Kz(t,e){return e?t-1:t+1}function Yz(t,e,r){return r?t>=0:t<e}Wh.exports=Gz});var cg=$((NZ,lt)=>{"use strict";var Xz=require("node:os"),rg=su(),Qz=iu(),eT=uu(),ng=Im(),tT=Zh(),og=wn(),{configure:rT}=Vh(),{assertDefaultLevelFound:nT,mappings:sg,genLsCache:oT,genLevelComparison:sT,assertLevelComparison:iT}=Tu(),{DEFAULT_LEVELS:ig,SORTING_ORDER:aT}=Si(),{createArgsNormalizer:cT,asChindings:uT,buildSafeSonicBoom:Jh,buildFormatters:lT,stringify:Zu,normalizeDestFileDescriptor:Kh,noop:dT}=xi(),{version:fT}=Cu(),{chindingsSym:Yh,redactFmtSym:pT,serializersSym:Xh,timeSym:mT,timeSliceIndexSym:hT,streamSym:gT,stringifySym:Qh,stringifySafeSym:Fu,stringifiersSym:eg,setLevelSym:yT,endSym:_T,formatOptsSym:vT,messageKeySym:bT,errorKeySym:wT,nestedKeySym:xT,mixinSym:ST,levelCompSym:$T,useOnlyCustomLevelsSym:ET,formattersSym:tg,hooksSym:kT,nestedKeyStrSym:PT,mixinMergeStrategySym:zT,msgPrefixSym:TT}=og,{epochTime:ag,nullTime:CT}=ng,{pid:OT}=process,IT=Xz.hostname(),RT=rg.err,DT={level:"info",levelComparison:aT.ASC,levels:ig,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:OT,hostname:IT},serializers:Object.assign(Object.create(null),{err:RT}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:ag,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},AT=cT(DT),NT=Object.assign(Object.create(null),rg);function qu(...t){let e={},{opts:r,stream:n}=AT(e,Qz(),...t);r.level&&typeof r.level=="string"&&ig[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:p,level:m,customLevels:f,levelComparison:h,mixin:g,mixinMergeStrategy:y,useOnlyCustomLevels:v,formatters:x,hooks:S,depthLimit:E,edgeLimit:C,onChild:A,msgPrefix:re}=r,F=rT({maximumDepth:E,maximumBreadth:C}),ie=lT(x.level,x.bindings,x.log),$e=Zu.bind({[Fu]:F}),be=o?eT(o,$e):{},Ce=o?{stringify:be[pT]}:{stringify:$e},We="}"+(s?`\r
23
23
  `:`
24
- `),_r=fz.bind(null,{[Bm]:"",[Hm]:i,[Gm]:Se,[Wm]:Gc,[Jc]:U,[Jm]:me}),La="";d!==null&&(p===void 0?La=_r(d):La=_r(Object.assign({},d,{name:p})));let lf=a instanceof Function?a:a?th:Rz,mx=lf().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"`);iz(m,f,x);let df=Xm(f,x);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:df,messageKey:c,errorKey:u}}),uz(h);let hx=cz(h);return Object.assign(e,{levels:df,[zz]:hx,[Pz]:x,[vz]:n,[yz]:lf,[_z]:mx,[Wm]:Gc,[Jc]:U,[Gm]:Se,[wz]:Be,[xz]:Le,[Sz]:c,[$z]:u,[kz]:l,[Cz]:l?`,${JSON.stringify(l)}:{`:"",[Hm]:i,[Ez]:g,[Oz]:_,[Bm]:La,[Jm]:me,[Tz]:S,silent:mz,onChild:L,[Iz]:re}),Object.setPrototypeOf(e,oz()),az(e),e[bz](m),e}at.exports=Kc;at.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Vm(t.dest||process.stdout.fd),Um(t)):Um({dest:Vm(t),minLength:0});at.exports.transport=Oc();at.exports.multistream=Fm();at.exports.levels=Xm();at.exports.stdSerializers=Lz;at.exports.stdTimeFunctions=Object.assign({},Ym);at.exports.symbols=Qm;at.exports.version=hz;at.exports.default=Kc;at.exports.pino=Kc});var Wo=$(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 Bo=class{};ee._CodeOrName=Bo;ee.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ur=class extends Bo{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=Ur;var dt=class extends Bo{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 Ur&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ee._Code=dt;ee.nil=new dt("");function vv(t,...e){let r=[t[0]],n=0;for(;n<e.length;)ml(r,e[n]),r.push(t[++n]);return new dt(r)}ee._=vv;var pl=new dt("+");function bv(t,...e){let r=[Ho(t[0])],n=0;for(;n<e.length;)r.push(pl),ml(r,e[n]),r.push(pl,Ho(t[++n]));return lO(r),new dt(r)}ee.str=bv;function ml(t,e){e instanceof dt?t.push(...e._items):e instanceof Ur?t.push(e):t.push(pO(e))}ee.addCodeArg=ml;function lO(t){let e=1;for(;e<t.length-1;){if(t[e]===pl){let r=dO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function dO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ur||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 Ur))return`"${t}${e.slice(1)}`}function fO(t,e){return e.emptyStr()?t:t.emptyStr()?e:bv`${t}${e}`}ee.strConcat=fO;function pO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ho(Array.isArray(t)?t.join(","):t)}function mO(t){return new dt(Ho(t))}ee.stringify=mO;function Ho(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ee.safeStringify=Ho;function hO(t){return typeof t=="string"&&ee.IDENTIFIER.test(t)?new dt(`.${t}`):vv`[${t}]`}ee.getProperty=hO;function gO(t){if(typeof t=="string"&&ee.IDENTIFIER.test(t))return new dt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ee.getEsmExportName=gO;function yO(t){return new dt(t.toString())}ee.regexpCode=yO});var yl=$(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.ValueScope=Je.ValueScopeName=Je.Scope=Je.varKinds=Je.UsedValueState=void 0;var Ge=Wo(),hl=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Wi;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Wi||(Je.UsedValueState=Wi={}));Je.varKinds={const:new Ge.Name("const"),let:new Ge.Name("let"),var:new Ge.Name("var")};var Gi=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=Gi;var Ji=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=Ji;var _O=(0,Ge._)`\n`,gl=class extends Gi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?_O:Ge.nil}}get(){return this._scope}name(e){return new Ji(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,Wi.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 hl(u);c.set(u,Wi.Completed)})}return s}};Je.ValueScope=gl});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=Wo(),$t=yl(),ur=Wo();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return ur._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return ur.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return ur.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return ur.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return ur.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return ur.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return ur.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return ur.Name}});var Xi=yl();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Xi.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Xi.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Xi.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Xi.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 Wt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_l=class extends Wt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?$t.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=En(this.rhs,e,r)),this}get names(){return this.rhs instanceof K._CodeOrName?this.rhs.names:{}}},Ki=class extends Wt{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=En(this.rhs,e,r),this}get names(){let e=this.lhs instanceof K.Name?{}:{...this.lhs.names};return Qi(e,this.rhs)}},vl=class extends Ki{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},bl=class extends Wt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},wl=class extends Wt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},xl=class extends Wt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Sl=class extends Wt{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=En(this.code,e,r),this}get names(){return this.code instanceof K._CodeOrName?this.code.names:{}}},Go=class extends Wt{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)||(vO(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Hr(e,r.names),{})}},Gt=class extends Go{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},$l=class extends Go{},kn=class extends Gt{};kn.kind="else";var Vr=class t extends Gt{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 kn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(wv(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=En(this.condition,e,r),this}get names(){let e=super.names;return Qi(e,this.condition),this.else&&Hr(e,this.else.names),e}};Vr.kind="if";var Br=class extends Gt{};Br.kind="for";var kl=class extends Br{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=En(this.iteration,e,r),this}get names(){return Hr(super.names,this.iteration.names)}},El=class extends Br{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?$t.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=Qi(super.names,this.from);return Qi(e,this.to)}},Yi=class extends Br{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=En(this.iterable,e,r),this}get names(){return Hr(super.names,this.iterable.names)}},Jo=class extends Gt{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)}};Jo.kind="func";var Ko=class extends Go{render(e){return"return "+super.render(e)}};Ko.kind="return";var zl=class extends Gt{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&&Hr(e,this.catch.names),this.finally&&Hr(e,this.finally.names),e}},Yo=class extends Gt{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yo.kind="catch";var Qo=class extends Gt{render(e){return"finally"+super.render(e)}};Qo.kind="finally";var Pl=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
25
- `:""},this._extScope=e,this._scope=new $t.Scope({parent:e}),this._nodes=[new $l]}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 _l(e,s,n)),s}const(e,r,n){return this._def($t.varKinds.const,e,r,n)}let(e,r,n){return this._def($t.varKinds.let,e,r,n)}var(e,r,n){return this._def($t.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ki(e,r,n))}add(e,r){return this._leafNode(new vl(e,V.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==K.nil&&this._leafNode(new Sl(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 Vr(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 Vr(e))}else(){return this._elseNode(new kn)}endIf(){return this._endBlockNode(Vr,kn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new kl(e),r)}forRange(e,r,n,o,s=this.opts.es5?$t.varKinds.var:$t.varKinds.let){let i=this._scope.toName(e);return this._for(new El(s,i,r,n),()=>o(i))}forOf(e,r,n,o=$t.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 Yi("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?$t.varKinds.var:$t.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 Yi("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Br)}label(e){return this._leafNode(new bl(e))}break(e){return this._leafNode(new wl(e))}return(e){let r=new Ko;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ko)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zl;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new Yo(s),r(s)}return n&&(this._currNode=o.finally=new Qo,this.code(n)),this._endBlockNode(Yo,Qo)}throw(e){return this._leafNode(new xl(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 Jo(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Jo)}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 Vr))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=Pl;function Hr(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Qi(t,e){return e instanceof K._CodeOrName?Hr(t,e.names):t}function En(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 vO(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function wv(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,K._)`!${Tl(t)}`}V.not=wv;var bO=xv(V.operators.AND);function wO(...t){return t.reduce(bO)}V.and=wO;var xO=xv(V.operators.OR);function SO(...t){return t.reduce(xO)}V.or=SO;function xv(t){return(e,r)=>e===K.nil?r:r===K.nil?e:(0,K._)`${Tl(e)} ${t} ${Tl(r)}`}function Tl(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(),$O=Wo();function kO(t){let e={};for(let r of t)e[r]=!0;return e}B.toHash=kO;function EO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(kv(t,e),!Ev(e,t.self.RULES.all))}B.alwaysValidSchema=EO;function kv(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]||Tv(t,`unknown keyword: "${s}"`)}B.checkUnknownRules=kv;function Ev(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}B.schemaHasRules=Ev;function zO(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=zO;function PO({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=PO;function TO(t){return zv(decodeURIComponent(t))}B.unescapeFragment=TO;function CO(t){return encodeURIComponent(Ol(t))}B.escapeFragment=CO;function Ol(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=Ol;function zv(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=zv;function OO(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}B.eachItem=OO;function Sv({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:Sv({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} || {}`),Il(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:Pv}),items:Sv({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 Pv(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ae._)`{}`);return e!==void 0&&Il(t,r,e),r}B.evaluatedPropsToName=Pv;function Il(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ae._)`${e}${(0,ae.getProperty)(n)}`,!0))}B.setEvaluated=Il;var $v={};function IO(t,e){return t.scopeValue("func",{ref:e,code:$v[e.code]||($v[e.code]=new $O._Code(e.code))})}B.useFunc=IO;var Cl;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Cl||(B.Type=Cl={}));function RO(t,e,r){if(t instanceof ae.Name){let n=e===Cl.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():"/"+Ol(t)}B.getErrorPath=RO;function Tv(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=Tv});var Jt=$(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var Ne=F(),DO={data:new Ne.Name("data"),valCxt:new Ne.Name("valCxt"),instancePath:new Ne.Name("instancePath"),parentData:new Ne.Name("parentData"),parentDataProperty:new Ne.Name("parentDataProperty"),rootData:new Ne.Name("rootData"),dynamicAnchors:new Ne.Name("dynamicAnchors"),vErrors:new Ne.Name("vErrors"),errors:new Ne.Name("errors"),this:new Ne.Name("this"),self:new Ne.Name("self"),scope:new Ne.Name("scope"),json:new Ne.Name("json"),jsonPos:new Ne.Name("jsonPos"),jsonLen:new Ne.Name("jsonLen"),jsonPart:new Ne.Name("jsonPart")};Rl.default=DO});var Xo=$(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(),ea=Q(),Ue=Jt();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 AO(t,e=je.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=Iv(t,e,r);n??(i||a)?Cv(s,c):Ov(o,(0,X._)`[${c}]`)}je.reportError=AO;function NO(t,e=je.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=Iv(t,e,r);Cv(o,a),s||i||Ov(n,Ue.default.vErrors)}je.reportExtraError=NO;function jO(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=jO;function MO({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=MO;function Cv(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 Ov(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 Wr={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 Iv(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,X._)`{}`:LO(t,e,r)}function LO(t,e,r={}){let{gen:n,it:o}=t,s=[ZO(o,r),qO(t,r)];return FO(t,e,s),n.object(...s)}function ZO({errorPath:t},{instancePath:e}){let r=e?(0,X.str)`${t}${(0,ea.getErrorPath)(e,ea.Type.Str)}`:t;return[Ue.default.instancePath,(0,X.strConcat)(Ue.default.instancePath,r)]}function qO({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,ea.getErrorPath)(r,ea.Type.Str)}`),[Wr.schemaPath,o]}function FO(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([Wr.keyword,o],[Wr.params,typeof e=="function"?e(t):e||(0,X._)`{}`]),c.messages&&n.push([Wr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Wr.schema,i],[Wr.parentSchema,(0,X._)`${l}${d}`],[Ue.default.data,s]),u&&n.push([Wr.propertyName,u])}});var Dv=$(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.boolOrEmptySchema=zn.topBoolOrEmptySchema=void 0;var UO=Xo(),VO=F(),BO=Jt(),HO={message:"boolean schema is false"};function WO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Rv(t,!1):typeof r=="object"&&r.$async===!0?e.return(BO.default.data):(e.assign((0,VO._)`${n}.errors`,null),e.return(!0))}zn.topBoolOrEmptySchema=WO;function GO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Rv(t)):r.var(e,!0)}zn.boolOrEmptySchema=GO;function Rv(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,UO.reportError)(o,HO,void 0,e)}});var Dl=$(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.getRules=Pn.isJSONType=void 0;var JO=["string","number","integer","boolean","null","object","array"],KO=new Set(JO);function YO(t){return typeof t=="string"&&KO.has(t)}Pn.isJSONType=YO;function QO(){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:{}}}Pn.getRules=QO});var Al=$(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.shouldUseRule=lr.shouldUseGroup=lr.schemaHasRulesForType=void 0;function XO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Av(t,n)}lr.schemaHasRulesForType=XO;function Av(t,e){return e.rules.some(r=>Nv(t,r))}lr.shouldUseGroup=Av;function Nv(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))}lr.shouldUseRule=Nv});var es=$(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 eI=Dl(),tI=Al(),rI=Xo(),q=F(),jv=Q(),Tn;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Tn||(Me.DataType=Tn={}));function nI(t){let e=Mv(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=nI;function Mv(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(eI.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Me.getJSONTypes=Mv;function oI(t,e){let{gen:r,data:n,opts:o}=t,s=sI(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,tI.schemaHasRulesForType)(t,e[0]));if(i){let a=jl(e,n,o.strictNumbers,Tn.Wrong);r.if(a,()=>{s.length?iI(t,e,s):Ml(t)})}return i}Me.coerceAndCheckDataType=oI;var Lv=new Set(["string","number","integer","boolean","null"]);function sI(t,e){return e?t.filter(r=>Lv.has(r)||e==="array"&&r==="array"):[]}function iI(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(jl(e,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,q._)`${a} !== undefined`);for(let u of r)(Lv.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Ml(t),n.endIf(),n.if((0,q._)`${a} !== undefined`,()=>{n.assign(o,a),aI(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
- || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,q._)`+${o}`);return;case"integer":n.elseIf((0,q._)`${i} === "boolean" || ${o} === null
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 aI({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,q._)`${e} !== undefined`,()=>t.assign((0,q._)`${e}[${r}]`,n))}function Nl(t,e,r,n=Tn.Correct){let o=n===Tn.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===Tn.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=Nl;function jl(t,e,r,n){if(t.length===1)return Nl(t[0],e,r,n);let o,s=(0,jv.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,Nl(i,e,r,n));return o}Me.checkDataTypes=jl;var cI={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,q._)`{type: ${t}}`:(0,q._)`{type: ${e}}`};function Ml(t){let e=uI(t);(0,rI.reportError)(e,cI)}Me.reportTypeError=Ml;function uI(t){let{gen:e,data:r,schema:n}=t,o=(0,jv.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var qv=$(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.assignDefaults=void 0;var Cn=F(),lI=Q();function dI(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Zv(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Zv(t,s,o.default))}ta.assignDefaults=dI;function Zv(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let a=(0,Cn._)`${s}${(0,Cn.getProperty)(e)}`;if(o){(0,lI.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Cn._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,Cn._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Cn._)`${a} = ${(0,Cn.stringify)(r)}`)}});var ft=$(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(),Ll=Q(),dr=Jt(),fI=Q();function pI(t,e){let{gen:r,data:n,it:o}=t;r.if(ql(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fe._)`${e}`},!0),t.error()})}ie.checkReportMissingProp=pI;function mI({gen:t,data:e,it:{opts:r}},n,o){return(0,fe.or)(...n.map(s=>(0,fe.and)(ql(t,e,s,r.ownProperties),(0,fe._)`${o} = ${s}`)))}ie.checkMissingProp=mI;function hI(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=hI;function Fv(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fe._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=Fv;function Zl(t,e,r){return(0,fe._)`${Fv(t)}.call(${e}, ${r})`}ie.isOwnProperty=Zl;function gI(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} !== undefined`;return n?(0,fe._)`${o} && ${Zl(t,e,r)}`:o}ie.propertyInData=gI;function ql(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} === undefined`;return n?(0,fe.or)(o,(0,fe.not)(Zl(t,e,r))):o}ie.noPropertyInData=ql;function Uv(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=Uv;function yI(t,e){return Uv(e).filter(r=>!(0,Ll.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=yI;function _I({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=[[dr.default.instancePath,(0,fe.strConcat)(dr.default.instancePath,s)],[dr.default.parentData,i.parentData],[dr.default.parentDataProperty,i.parentDataProperty],[dr.default.rootData,dr.default.rootData]];i.opts.dynamicRef&&d.push([dr.default.dynamicAnchors,dr.default.dynamicAnchors]);let p=(0,fe._)`${l}, ${r.object(...d)}`;return c!==fe.nil?(0,fe._)`${a}.call(${c}, ${p})`:(0,fe._)`${a}(${p})`}ie.callValidateCode=_I;var vI=(0,fe._)`new RegExp`;function bI({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"?vI:(0,fI.useFunc)(t,o)}(${r}, ${n})`})}ie.usePattern=bI;function wI(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:Ll.Type.Num},s),e.if((0,fe.not)(s),a)})}}ie.validateArray=wI;function xI(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,Ll.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=xI});var Hv=$(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateKeywordUsage=It.validSchemaType=It.funcKeywordCode=It.macroKeywordCode=void 0;var Ve=F(),Gr=Jt(),SI=ft(),$I=Xo();function kI(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Bv(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))}It.macroKeywordCode=kI;function EI(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;PI(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Bv(n,o,u),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)h(),e.modifying&&Vv(t),g(()=>t.error());else{let _=e.async?m():f();e.modifying&&Vv(t),g(()=>zI(t,_))}}function m(){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?Gr.default.this:Gr.default.self,w=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Ve._)`${_}${(0,SI.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),_)}}It.funcKeywordCode=EI;function Vv(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ve._)`${n.parentData}[${n.parentDataProperty}]`))}function zI(t,e){let{gen:r}=t;r.if((0,Ve._)`Array.isArray(${e})`,()=>{r.assign(Gr.default.vErrors,(0,Ve._)`${Gr.default.vErrors} === null ? ${e} : ${Gr.default.vErrors}.concat(${e})`).assign(Gr.default.errors,(0,Ve._)`${Gr.default.vErrors}.length`),(0,$I.extendErrors)(t)},()=>t.error())}function PI({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Bv(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 TI(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")}It.validSchemaType=TI;function CI({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)}}It.validateKeywordUsage=CI});var Gv=$(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.extendSubschemaMode=fr.extendSubschemaData=fr.getSubschema=void 0;var Rt=F(),Wv=Q();function OI(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,Rt._)`${t.schemaPath}${(0,Rt.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Rt._)`${t.schemaPath}${(0,Rt.getProperty)(e)}${(0,Rt.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Wv.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')}fr.getSubschema=OI;function II(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,p=a.let("data",(0,Rt._)`${e.data}${(0,Rt.getProperty)(r)}`,!0);c(p),t.errorPath=(0,Rt.str)`${u}${(0,Wv.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Rt._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof Rt.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]}}fr.extendSubschemaData=II;function RI(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}fr.extendSubschemaMode=RI});var Fl=$(($9,Jv)=>{"use strict";Jv.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 Yv=$((k9,Kv)=>{"use strict";var pr=Kv.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(){};ra(e,n,o,t,"",t)};pr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};pr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};pr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};pr.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 ra(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 pr.arrayKeywords)for(var p=0;p<d.length;p++)ra(t,e,r,d[p],o+"/"+l+"/"+p,s,o,l,n,p)}else if(l in pr.propsKeywords){if(d&&typeof d=="object")for(var m in d)ra(t,e,r,d[m],o+"/"+l+"/"+DI(m),s,o,l,n,m)}else(l in pr.keywords||t.allKeys&&!(l in pr.skipKeywords))&&ra(t,e,r,d,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,c,u)}}function DI(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ts=$(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getSchemaRefs=Ke.resolveUrl=Ke.normalizeId=Ke._getFullPath=Ke.getFullPath=Ke.inlineRef=void 0;var AI=Q(),NI=Fl(),jI=Yv(),MI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function LI(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ul(t):e?Qv(t)<=e:!1}Ke.inlineRef=LI;var ZI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ul(t){for(let e in t){if(ZI.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Ul)||typeof r=="object"&&Ul(r))return!0}return!1}function Qv(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!MI.has(r)&&(typeof t[r]=="object"&&(0,AI.eachItem)(t[r],n=>e+=Qv(n)),e===1/0))return 1/0}return e}function Xv(t,e="",r){r!==!1&&(e=On(e));let n=t.parse(e);return eb(t,n)}Ke.getFullPath=Xv;function eb(t,e){return t.serialize(e).split("#")[0]+"#"}Ke._getFullPath=eb;var qI=/#\/?$/;function On(t){return t?t.replace(qI,""):""}Ke.normalizeId=On;function FI(t,e,r){return r=On(r),t.resolve(e,r)}Ke.resolveUrl=FI;var UI=/^[a-z_][-a-z0-9._]*$/i;function VI(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=On(t[r]||e),s={"":o},i=Xv(n,o,!1),a={},c=new Set;return jI(t,{allKeys:!0},(d,p,m,f)=>{if(f===void 0)return;let h=i+p,g=s[f];typeof d[r]=="string"&&(g=_.call(this,d[r])),x.call(this,d.$anchor),x.call(this,d.$dynamicAnchor),s[p]=g;function _(w){let S=this.opts.uriResolver.resolve;if(w=On(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!==On(h)&&(w[0]==="#"?(u(d,a[w],w),a[w]=d):this.refs[w]=h),w}function x(w){if(typeof w=="string"){if(!UI.test(w))throw new Error(`invalid anchor "${w}"`);_.call(this,`#${w}`)}}}),a;function u(d,p,m){if(p!==void 0&&!NI(d,p))throw l(m)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ke.getSchemaRefs=VI});var os=$(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.getData=mr.KeywordCxt=mr.validateFunctionCode=void 0;var sb=Dv(),tb=es(),Bl=Al(),na=es(),BI=qv(),ns=Hv(),Vl=Gv(),O=F(),A=Jt(),HI=ts(),Kt=Q(),rs=Xo();function WI(t){if(cb(t)&&(ub(t),ab(t))){KI(t);return}ib(t,()=>(0,sb.topBoolOrEmptySchema)(t))}mr.validateFunctionCode=WI;function ib({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"; ${rb(r,o)}`),JI(t,o),t.code(s)}):t.func(e,(0,O._)`${A.default.data}, ${GI(o)}`,n.$async,()=>t.code(rb(r,o)).code(s))}function GI(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 JI(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 KI(t){let{schema:e,opts:r,gen:n}=t;ib(t,()=>{r.$comment&&e.$comment&&db(t),tR(t),n.let(A.default.vErrors,null),n.let(A.default.errors,0),r.unevaluated&&YI(t),lb(t),oR(t)})}function YI(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 rb(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 QI(t,e){if(cb(t)&&(ub(t),ab(t))){XI(t,e);return}(0,sb.boolOrEmptySchema)(t,e)}function ab({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 cb(t){return typeof t.schema!="boolean"}function XI(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&db(t),rR(t),nR(t);let s=n.const("_errs",A.default.errors);lb(t,s),n.var(e,(0,O._)`${s} === ${A.default.errors}`)}function ub(t){(0,Kt.checkUnknownRules)(t),eR(t)}function lb(t,e){if(t.opts.jtd)return nb(t,[],!1,e);let r=(0,tb.getSchemaTypes)(t.schema),n=(0,tb.coerceAndCheckDataType)(t,r);nb(t,r,!n,e)}function eR(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Kt.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tR(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Kt.checkStrictMode)(t,"default is ignored in the schema root")}function rR(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,HI.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function nR(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function db({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 oR(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&&sR(t),e.return((0,O._)`${A.default.errors} === 0`))}function sR({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 nb(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,Kt.schemaHasRulesButRef)(s,l))){o.block(()=>pb(t,"$ref",l.all.$ref.definition));return}c.jtd||iR(t,e),o.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,Bl.shouldUseGroup)(s,p)&&(p.type?(o.if((0,na.checkDataType)(p.type,i,c.strictNumbers)),ob(t,p),e.length===1&&e[0]===p.type&&r&&(o.else(),(0,na.reportTypeError)(t)),o.endIf()):ob(t,p),a||o.if((0,O._)`${A.default.errors} === ${n||0}`))}}function ob(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,BI.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Bl.shouldUseRule)(n,s)&&pb(t,s.keyword,s.definition,e.type)})}function iR(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(aR(t,e),t.opts.allowUnionTypes||cR(t,e),uR(t,t.dataTypes))}function aR(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{fb(t.dataTypes,r)||Hl(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),dR(t,e)}}function cR(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Hl(t,"use allowUnionTypes to allow union type keyword")}function uR(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Bl.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>lR(e,i))&&Hl(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function lR(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function fb(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function dR(t,e){let r=[];for(let n of t.dataTypes)fb(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Hl(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Kt.checkStrictMode)(t,e,t.opts.strictTypes)}var oa=class{constructor(e,r,n){if((0,ns.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,Kt.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",mb(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ns.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?rs.reportExtraError:rs.reportError)(this,this.def.error,r)}$dataError(){(0,rs.reportError)(this,this.def.$dataError||rs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,rs.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,na.checkDataTypes)(c,r,s.opts.strictNumbers,na.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,Vl.getSubschema)(this.it,e);(0,Vl.extendSubschemaData)(n,this.it,e),(0,Vl.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return QI(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Kt.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Kt.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}};mr.KeywordCxt=oa;function pb(t,e,r,n){let o=new oa(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ns.funcKeywordCode)(o,r):"macro"in r?(0,ns.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ns.funcKeywordCode)(o,r)}var fR=/^\/(?:[^~]|~0|~1)*$/,pR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function mb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return A.default.rootData;if(t[0]==="/"){if(!fR.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=A.default.rootData}else{let u=pR.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,Kt.unescapeJsonPointer)(u))}`,i=(0,O._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}mr.getData=mb});var sa=$(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var Wl=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Gl.default=Wl});var ss=$(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var Jl=ts(),Kl=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Jl.resolveUrl)(e,r,n),this.missingSchema=(0,Jl.normalizeId)((0,Jl.getFullPath)(e,this.missingRef))}};Yl.default=Kl});var aa=$(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.resolveSchema=pt.getCompilingSchema=pt.resolveRef=pt.compileSchema=pt.SchemaEnv=void 0;var kt=F(),mR=sa(),Jr=Jt(),Et=ts(),hb=Q(),hR=os(),In=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,Et.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};pt.SchemaEnv=In;function Xl(t){let e=gb.call(this,t);if(e)return e;let r=(0,Et.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new kt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:mR.default,code:(0,kt._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Jr.default.data,parentData:Jr.default.parentData,parentDataProperty:Jr.default.parentDataProperty,dataNames:[Jr.default.data],dataPathArr:[kt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,kt.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:kt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,kt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,hR.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(Jr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let m=new Function(`${Jr.default.self}`,`${Jr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=t.schema,m.schemaEnv=t,t.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:h}=u;m.evaluated={props:f instanceof kt.Name?void 0:f,items:h instanceof kt.Name?void 0:h,dynamicProps:f instanceof kt.Name,dynamicItems:h instanceof kt.Name},m.source&&(m.source.evaluated=(0,kt.stringify)(m.evaluated))}return t.validate=m,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)}}pt.compileSchema=Xl;function gR(t,e,r){var n;r=(0,Et.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=vR.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 In({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=yR.call(this,s)}pt.resolveRef=gR;function yR(t){return(0,Et.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Xl.call(this,t)}function gb(t){for(let e of this._compilations)if(_R(e,t))return e}pt.getCompilingSchema=gb;function _R(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function vR(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||ia.call(this,t,e)}function ia(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Et._getFullPath)(this.opts.uriResolver,r),o=(0,Et.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Ql.call(this,r,t);let s=(0,Et.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=ia.call(this,t,i);return typeof a?.schema!="object"?void 0:Ql.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||Xl.call(this,i),s===(0,Et.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Et.resolveUrl)(this.opts.uriResolver,o,u)),new In({schema:a,schemaId:c,root:t,baseId:o})}return Ql.call(this,r,i)}}pt.resolveSchema=ia;var bR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ql(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,hb.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!bR.has(a)&&u&&(e=(0,Et.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,hb.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Et.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=ia.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new In({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var yb=$((O9,wR)=>{wR.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 nd=$((I9,xb)=>{"use strict";var xR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vb=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),ca=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),ed=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),SR=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu),$R=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/?]$/iu);function td(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 kR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function _b(t){return t.length=0,!0}function ER(t,e,r){if(t.length){let n=td(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function zR(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=ER;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=_b}else{o.push(u);continue}}return o.length&&(a===_b?r.zone=o.join(""):i?n.push(o.join("")):n.push(td(o))),r.address=n.join(""),r}function bb(t){if(PR(t,":")<2)return{host:t,isIPV6:!1};let e=zR(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 PR(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function TR(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]==="."){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 CR={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},OR=/[@/?#:]/g,IR=/[@/?#]/g;function wb(t,e){let r=e?IR:OR;return r.lastIndex=0,t.replace(r,n=>CR[n])}function RR(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(ca(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&ed(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}var ot=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)ot[e]="%"+t[e>>4]+t[e&15]}function rd(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}function mt(t){return t<2048?ot[192|t>>6]+ot[128|t&63]:t<65536?ot[224|t>>12]+ot[128|t>>6&63]+ot[128|t&63]:ot[240|t>>18]+ot[128|t>>12&63]+ot[128|t>>6&63]+ot[128|t&63]}function DR(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(ca(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));i!=="."&&ed(i)?e+=i:e+="%"+s,r+=2;continue}}if(SR(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=rd(o)?n:ot[o];else if(o<55296||o>57343)e+=mt(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=mt(65536+(o-55296<<10)+(s-56320)),r++):e+=mt(65533)}else e+=mt(65533)}}return e}function AR(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(ca(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));ed(i)?e+=i:e+="%"+s,r+=2;continue}}if($R(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=rd(o)?n:ot[o];else if(o<55296||o>57343)e+=mt(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=mt(65536+(o-55296<<10)+(s-56320)),r++):e+=mt(65533)}else e+=mt(65533)}}return e}function NR(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let s=t.slice(r+1,r+3);if(ca(s)){e+="%"+s.toUpperCase(),r+=2;continue}}let o=t.charCodeAt(r);if(o<128)e+=rd(o)?n:ot[o];else if(o<55296||o>57343)e+=mt(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=mt(65536+(o-55296<<10)+(s-56320)),r++):e+=mt(65533)}else e+=mt(65533)}return e}function jR(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!vb(r)){let n=bb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=wb(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}xb.exports={nonSimpleDomain:kR,recomposeAuthority:jR,reescapeHostDelimiters:wb,normalizePercentEncoding:RR,normalizePathEncoding:DR,normalizeQueryFragmentEncoding:AR,escapePreservingEscapes:NR,removeDotSegments:TR,isIPv4:vb,isUUID:xR,normalizeIPv6:bb,stringArrayToHexStripped:td}});var zb=$((R9,Eb)=>{"use strict";var{isUUID:MR}=nd(),LR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ZR=["http","https","ws","wss","urn","urn:uuid"];function qR(t){return ZR.indexOf(t)!==-1}function od(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 Sb(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 FR(t){return t.secure=od(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function UR(t){if((t.port===(od(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 VR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(LR);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=sd(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function BR(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=sd(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 HR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!MR(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function WR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var kb={scheme:"http",domainHost:!0,parse:Sb,serialize:$b},GR={scheme:"https",domainHost:kb.domainHost,parse:Sb,serialize:$b},ua={scheme:"ws",domainHost:!0,parse:FR,serialize:UR},JR={scheme:"wss",domainHost:ua.domainHost,parse:ua.parse,serialize:ua.serialize},KR={scheme:"urn",parse:VR,serialize:BR,skipNormalize:!0},YR={scheme:"urn:uuid",parse:HR,serialize:WR,skipNormalize:!0},la={http:kb,https:GR,ws:ua,wss:JR,urn:KR,"urn:uuid":YR};Object.setPrototypeOf(la,null);function sd(t){return t&&(la[t]||la[t.toLowerCase()])||void 0}Eb.exports={wsIsSecure:od,SCHEMES:la,isValidSchemeName:qR,getSchemeHandler:sd}});var Rb=$((D9,pa)=>{"use strict";var{normalizeIPv6:QR,removeDotSegments:is,recomposeAuthority:XR,normalizePercentEncoding:eD,normalizePathEncoding:tD,normalizeQueryFragmentEncoding:Pb,escapePreservingEscapes:rD,reescapeHostDelimiters:nD,isIPv4:oD,nonSimpleDomain:sD}=nd(),{SCHEMES:iD,getSchemeHandler:Cb}=zb();function aD(t,e){return typeof t=="string"?t=mD(t,e):typeof t=="object"&&(t=fa(Kr(t,e),e)),t}function cD(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:s}=da(t,n),{parsed:i,malformedAuthorityOrPort:a}=da(e,n);if(s||a)throw new Error(o.error||i.error||"URI is malformed.");let c=Ob(o,i,n,!0);return n.skipEscape=!0,Kr(c,n)}function Ob(t,e,r,n){let o={};return n||(t=fa(Kr(t,r),r),e=fa(Kr(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=is(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=is(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=is(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=is(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 uD(t,e,r){let n=Tb(t,r),o=Tb(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Kr(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=Cb(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=eD(r.path):(r.path=rD(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=XR(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=is(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 lD=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,dD=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,fD=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function pD(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 da(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(dD);i!==null&&i[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let a=t.match(fD);if(a!==null){let u=a[1],l=u.replace(/[\t\n\r]/g,"");l.length>=2&&(l.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):u.length!==l.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let c=t.match(lD);if(c){n.scheme=c[1]===void 0?void 0:c[1].toLowerCase(),n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let u=pD(n,c);if(u!==void 0&&(n.error=n.error||u,o=!0),n.host)if(oD(n.host)===!1){let p=QR(n.host);n.host=p.host.toLowerCase(),s=p.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 l=Cb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&s===!1&&sD(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}(!l||l&&!l.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=nD(unescape(n.host),s))),n.path&&(n.path=tD(n.path)),n.query&&(n.query=Pb(n.query)),n.fragment&&(n.fragment=Pb(n.fragment))),l&&l.parse&&l.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function fa(t,e){return da(t,e).parsed}function mD(t,e){return Ib(t,e).normalized}function Ib(t,e){let{parsed:r,malformedAuthorityOrPort:n}=da(t,e);return{normalized:n?t:Kr(r,e),malformedAuthorityOrPort:n}}function Tb(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Ib(t,e);return n?void 0:r}if(typeof t=="object")return Kr(t,e)}var id={SCHEMES:iD,normalize:aD,resolve:cD,resolveComponent:Ob,equal:uD,serialize:Kr,parse:fa};pa.exports=id;pa.exports.default=id;pa.exports.fastUri=id});var Ab=$(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var Db=Rb();Db.code='require("ajv/dist/runtime/uri").default';ad.default=Db});var Ub=$(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 hD=os();Object.defineProperty(Re,"KeywordCxt",{enumerable:!0,get:function(){return hD.KeywordCxt}});var Rn=F();Object.defineProperty(Re,"_",{enumerable:!0,get:function(){return Rn._}});Object.defineProperty(Re,"str",{enumerable:!0,get:function(){return Rn.str}});Object.defineProperty(Re,"stringify",{enumerable:!0,get:function(){return Rn.stringify}});Object.defineProperty(Re,"nil",{enumerable:!0,get:function(){return Rn.nil}});Object.defineProperty(Re,"Name",{enumerable:!0,get:function(){return Rn.Name}});Object.defineProperty(Re,"CodeGen",{enumerable:!0,get:function(){return Rn.CodeGen}});var gD=sa(),Zb=ss(),yD=Dl(),as=aa(),_D=F(),cs=ts(),ma=es(),ud=Q(),Nb=yb(),vD=Ab(),qb=(t,e)=>new RegExp(t,e);qb.code="new RegExp";var bD=["removeAdditional","useDefaults","coerceTypes"],wD=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),xD={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."},SD={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jb=200;function $D(t){var e,r,n,o,s,i,a,c,u,l,d,p,m,f,h,g,_,x,w,S,k,W,L,re,U;let me=t.strict,Ee=(e=t.code)===null||e===void 0?void 0:e.optimize,Se=Ee===!0||Ee===void 0?1:Ee||0,Le=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:qb,Be=(o=t.uriResolver)!==null&&o!==void 0?o:vD.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:(p=(d=t.strictTuples)!==null&&d!==void 0?d:me)!==null&&p!==void 0?p:"log",strictRequired:(f=(m=t.strictRequired)!==null&&m!==void 0?m:me)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:Se,regExp:Le}:{optimize:Se,regExp:Le},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:jb,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:jb,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:(L=t.validateFormats)!==null&&L!==void 0?L:!0,unicodeRegExp:(re=t.unicodeRegExp)!==null&&re!==void 0?re:!0,int32range:(U=t.int32range)!==null&&U!==void 0?U:!0,uriResolver:Be}}var us=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,...$D(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new _D.ValueScope({scope:{},prefixes:wD,es5:r,lines:n}),this.logger=CD(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,yD.getRules)(),Mb.call(this,xD,e,"NOT SUPPORTED"),Mb.call(this,SD,e,"DEPRECATED","warn"),this._metaOpts=PD.call(this),e.formats&&ED.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&zD.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),kD.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Nb;n==="id"&&(o={...Nb},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 p=this._addSchema(l,d);return p.validate||i.call(this,p)}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 Zb.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,cs.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=Lb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new as.SchemaEnv({schema:{},schemaId:n});if(r=as.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=Lb.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,cs.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(ID.call(this,n,r),!r)return(0,ud.eachItem)(n,s=>cd.call(this,s)),this;DD.call(this,r);let o={...r,type:(0,ma.getJSONTypes)(r.type),schemaType:(0,ma.getJSONTypes)(r.schemaType)};return(0,ud.eachItem)(n,o.type.length===0?s=>cd.call(this,s,o):s=>o.type.forEach(i=>cd.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]=Fb(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,cs.normalizeId)(i||n);let u=cs.getSchemaRefs.call(this,e,n);return c=new as.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):as.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{as.compileSchema.call(this,e)}finally{this.opts=r}}};us.ValidationError=gD.default;us.MissingRefError=Zb.default;Re.default=us;function Mb(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 Lb(t){return t=(0,cs.normalizeId)(t),this.schemas[t]||this.refs[t]}function kD(){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 ED(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function zD(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 PD(){let t={...this.opts};for(let e of bD)delete t[e];return t}var TD={log(){},warn(){},error(){}};function CD(t){if(t===!1)return TD;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 OD=/^[a-z_$][a-z0-9_$:-]*$/i;function ID(t,e){let{RULES:r}=this;if((0,ud.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!OD.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 cd(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,ma.getJSONTypes)(e.type),schemaType:(0,ma.getJSONTypes)(e.schemaType)}};e.before?RD.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 RD(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 DD(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Fb(e)),t.validateSchema=this.compile(e,!0))}var AD={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Fb(t){return{anyOf:[t,AD]}}});var Vb=$(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var ND={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ld.default=ND});var Gb=$(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.callRef=Yr.getValidate=void 0;var jD=ss(),Bb=ft(),Ye=F(),Dn=Jt(),Hb=aa(),ha=Q(),MD={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=Hb.resolveRef.call(c,u,o,r);if(l===void 0)throw new jD.default(n.opts.uriResolver,o,r);if(l instanceof Hb.SchemaEnv)return p(l);return m(l);function d(){if(s===u)return ga(t,i,s,s.$async);let f=e.scopeValue("root",{ref:u});return ga(t,(0,Ye._)`${f}.validate`,u,u.$async)}function p(f){let h=Wb(t,f);ga(t,h,f,f.$async)}function m(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 Wb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ye._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Yr.getValidate=Wb;function ga(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?Dn.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,Bb.callValidateCode)(t,e,u)}`),m(e),i||o.assign(f,!0)},h=>{o.if((0,Ye._)`!(${h} instanceof ${s.ValidationError})`,()=>o.throw(h)),p(h),i||o.assign(f,!1)}),t.ok(f)}function d(){t.result((0,Bb.callValidateCode)(t,e,u),()=>m(e),()=>p(e))}function p(f){let h=(0,Ye._)`${f}.errors`;o.assign(Dn.default.vErrors,(0,Ye._)`${Dn.default.vErrors} === null ? ${h} : ${Dn.default.vErrors}.concat(${h})`),o.assign(Dn.default.errors,(0,Ye._)`${Dn.default.vErrors}.length`)}function m(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=ha.mergeEvaluated.props(o,g.props,s.props));else{let _=o.var("props",(0,Ye._)`${f}.evaluated.props`);s.props=ha.mergeEvaluated.props(o,_,s.props,Ye.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=ha.mergeEvaluated.items(o,g.items,s.items));else{let _=o.var("items",(0,Ye._)`${f}.evaluated.items`);s.items=ha.mergeEvaluated.items(o,_,s.items,Ye.Name)}}}Yr.callRef=ga;Yr.default=MD});var Jb=$(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var LD=Vb(),ZD=Gb(),qD=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",LD.default,ZD.default];dd.default=qD});var Kb=$(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var ya=F(),hr=ya.operators,_a={maximum:{okStr:"<=",ok:hr.LTE,fail:hr.GT},minimum:{okStr:">=",ok:hr.GTE,fail:hr.LT},exclusiveMaximum:{okStr:"<",ok:hr.LT,fail:hr.GTE},exclusiveMinimum:{okStr:">",ok:hr.GT,fail:hr.LTE}},FD={message:({keyword:t,schemaCode:e})=>(0,ya.str)`must be ${_a[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ya._)`{comparison: ${_a[t].okStr}, limit: ${e}}`},UD={keyword:Object.keys(_a),type:"number",schemaType:"number",$data:!0,error:FD,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ya._)`${r} ${_a[e].fail} ${n} || isNaN(${r})`)}};fd.default=UD});var Yb=$(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var ls=F(),VD={message:({schemaCode:t})=>(0,ls.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ls._)`{multipleOf: ${t}}`},BD={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:VD,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,ls._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,ls._)`${i} !== parseInt(${i})`;t.fail$data((0,ls._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};pd.default=BD});var Xb=$(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});function Qb(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}md.default=Qb;Qb.code='require("ajv/dist/runtime/ucs2length").default'});var ew=$(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var Qr=F(),HD=Q(),WD=Xb(),GD={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Qr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Qr._)`{limit: ${t}}`},JD={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:GD,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Qr.operators.GT:Qr.operators.LT,i=o.opts.unicode===!1?(0,Qr._)`${r}.length`:(0,Qr._)`${(0,HD.useFunc)(t.gen,WD.default)}(${r})`;t.fail$data((0,Qr._)`${i} ${s} ${n}`)}};hd.default=JD});var tw=$(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var KD=ft(),YD=Q(),An=F(),QD={message:({schemaCode:t})=>(0,An.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,An._)`{pattern: ${t}}`},XD={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QD,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,An._)`new RegExp`:(0,YD.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,An._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,An._)`!${l}`)}else{let c=(0,KD.usePattern)(t,o);t.fail$data((0,An._)`!${c}.test(${r})`)}}};gd.default=XD});var rw=$(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var ds=F(),eA={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,ds.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,ds._)`{limit: ${t}}`},tA={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:eA,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?ds.operators.GT:ds.operators.LT;t.fail$data((0,ds._)`Object.keys(${r}).length ${o} ${n}`)}};yd.default=tA});var nw=$(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var fs=ft(),ps=F(),rA=Q(),nA={message:({params:{missingProperty:t}})=>(0,ps.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ps._)`{missingProperty: ${t}}`},oA={keyword:"required",type:"object",schemaType:"array",$data:!0,error:nA,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 m=t.parentSchema.properties,{definedProperties:f}=t.it;for(let h of r)if(m?.[h]===void 0&&!f.has(h)){let g=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,rA.checkStrictMode)(i,_,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(ps.nil,d);else for(let m of r)(0,fs.checkReportMissingProp)(t,m)}function l(){let m=e.let("missing");if(c||s){let f=e.let("valid",!0);t.block$data(f,()=>p(m,f)),t.ok(f)}else e.if((0,fs.checkMissingProp)(t,r,m)),(0,fs.reportMissingProp)(t,m),e.else()}function d(){e.forOf("prop",n,m=>{t.setParams({missingProperty:m}),e.if((0,fs.noPropertyInData)(e,o,m,a.ownProperties),()=>t.error())})}function p(m,f){t.setParams({missingProperty:m}),e.forOf(m,n,()=>{e.assign(f,(0,fs.propertyInData)(e,o,m,a.ownProperties)),e.if((0,ps.not)(f),()=>{t.error(),e.break()})},ps.nil)}}};_d.default=oA});var ow=$(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var ms=F(),sA={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ms.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ms._)`{limit: ${t}}`},iA={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:sA,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?ms.operators.GT:ms.operators.LT;t.fail$data((0,ms._)`${r}.length ${o} ${n}`)}};vd.default=iA});var va=$(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var sw=Fl();sw.code='require("ajv/dist/runtime/equal").default';bd.default=sw});var iw=$(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});var wd=es(),De=F(),aA=Q(),cA=va(),uA={message:({params:{i:t,j:e}})=>(0,De.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,De._)`{i: ${t}, j: ${e}}`},lA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:uA,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,wd.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,De._)`${i} === false`),t.ok(c);function l(){let f=e.let("i",(0,De._)`${r}.length`),h=e.let("j");t.setParams({i:f,j:h}),e.assign(c,!0),e.if((0,De._)`${f} > 1`,()=>(d()?p:m)(f,h))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function p(f,h){let g=e.name("item"),_=(0,wd.checkDataTypes)(u,g,a.opts.strictNumbers,wd.DataType.Wrong),x=e.const("indices",(0,De._)`{}`);e.for((0,De._)`;${f}--;`,()=>{e.let(g,(0,De._)`${r}[${f}]`),e.if(_,(0,De._)`continue`),u.length>1&&e.if((0,De._)`typeof ${g} == "string"`,(0,De._)`${g} += "_"`),e.if((0,De._)`typeof ${x}[${g}] == "number"`,()=>{e.assign(h,(0,De._)`${x}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,De._)`${x}[${g}] = ${f}`)})}function m(f,h){let g=(0,aA.useFunc)(e,cA.default),_=e.name("outer");e.label(_).for((0,De._)`;${f}--;`,()=>e.for((0,De._)`${h} = ${f}; ${h}--;`,()=>e.if((0,De._)`${g}(${r}[${f}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};xd.default=lA});var aw=$($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var Sd=F(),dA=Q(),fA=va(),pA={message:"must be equal to constant",params:({schemaCode:t})=>(0,Sd._)`{allowedValue: ${t}}`},mA={keyword:"const",$data:!0,error:pA,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Sd._)`!${(0,dA.useFunc)(e,fA.default)}(${r}, ${o})`):t.fail((0,Sd._)`${s} !== ${r}`)}};$d.default=mA});var cw=$(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var hs=F(),hA=Q(),gA=va(),yA={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,hs._)`{allowedValues: ${t}}`},_A={keyword:"enum",schemaType:"array",$data:!0,error:yA,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,hA.useFunc)(e,gA.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 m=e.const("vSchema",s);l=(0,hs.or)(...o.map((f,h)=>p(m,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,m=>e.if((0,hs._)`${u()}(${r}, ${m})`,()=>e.assign(l,!0).break()))}function p(m,f){let h=o[f];return typeof h=="object"&&h!==null?(0,hs._)`${u()}(${r}, ${m}[${f}])`:(0,hs._)`${r} === ${h}`}}};kd.default=_A});var uw=$(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var vA=Kb(),bA=Yb(),wA=ew(),xA=tw(),SA=rw(),$A=nw(),kA=ow(),EA=iw(),zA=aw(),PA=cw(),TA=[vA.default,bA.default,wA.default,xA.default,SA.default,$A.default,kA.default,EA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},zA.default,PA.default];Ed.default=TA});var Pd=$(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.validateAdditionalItems=void 0;var Xr=F(),zd=Q(),CA={message:({params:{len:t}})=>(0,Xr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Xr._)`{limit: ${t}}`},OA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:CA,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,zd.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}lw(t,n)}};function lw(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Xr._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Xr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,zd.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,Xr._)`${a} <= ${e.length}`);r.if((0,Xr.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:zd.Type.Num},u),i.allErrors||r.if((0,Xr.not)(u),()=>r.break())})}}gs.validateAdditionalItems=lw;gs.default=OA});var Td=$(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.validateTuple=void 0;var dw=F(),ba=Q(),IA=ft(),RA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return fw(t,"additionalItems",e);r.items=!0,!(0,ba.alwaysValidSchema)(r,e)&&t.ok((0,IA.validateArray)(t))}};function fw(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=ba.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,dw._)`${s}.length`);r.forEach((d,p)=>{(0,ba.alwaysValidSchema)(a,d)||(n.if((0,dw._)`${u} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},c)),t.ok(c))});function l(d){let{opts:p,errSchemaPath:m}=a,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(p.strictTuples&&!h){let g=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${m}"`;(0,ba.checkStrictMode)(a,g,p.strictTuples)}}}ys.validateTuple=fw;ys.default=RA});var pw=$(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var DA=Td(),AA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,DA.validateTuple)(t,"items")};Cd.default=AA});var hw=$(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var mw=F(),NA=Q(),jA=ft(),MA=Pd(),LA={message:({params:{len:t}})=>(0,mw.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,mw._)`{limit: ${t}}`},ZA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:LA,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,NA.alwaysValidSchema)(n,e)&&(o?(0,MA.validateAdditionalItems)(t,o):t.ok((0,jA.validateArray)(t)))}};Od.default=ZA});var gw=$(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});var ht=F(),wa=Q(),qA={message:({params:{min:t,max:e}})=>e===void 0?(0,ht.str)`must contain at least ${t} valid item(s)`:(0,ht.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,ht._)`{minContains: ${t}}`:(0,ht._)`{minContains: ${t}, maxContains: ${e}}`},FA={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:qA,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,ht._)`${o}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,wa.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,wa.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,wa.alwaysValidSchema)(s,r)){let h=(0,ht._)`${l} >= ${i}`;a!==void 0&&(h=(0,ht._)`${h} && ${l} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?m(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,ht._)`${o}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let h=e.name("_valid"),g=e.let("count",0);m(h,()=>e.if(h,()=>f(g)))}function m(h,g){e.forRange("i",0,l,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:wa.Type.Num,compositeRule:!0},h),g()})}function f(h){e.code((0,ht._)`${h}++`),a===void 0?e.if((0,ht._)`${h} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,ht._)`${h} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,ht._)`${h} >= ${i}`,()=>e.assign(d,!0)))}}};Id.default=FA});var vw=$(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.validateSchemaDeps=Dt.validatePropertyDeps=Dt.error=void 0;var Rd=F(),UA=Q(),_s=ft();Dt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Rd.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Rd._)`{property: ${t},
24
+ `),Er=uT.bind(null,{[Yh]:"",[Xh]:i,[eg]:be,[Qh]:Zu,[Fu]:F,[tg]:ie}),Oc="";d!==null&&(p===void 0?Oc=Er(d):Oc=Er(Object.assign({},d,{name:p})));let gp=a instanceof Function?a:a?ag:CT,dS=gp().indexOf(":")+1;if(v&&!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"`);nT(m,f,v);let yp=sg(f,v);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:yp,messageKey:c,errorKey:u}}),iT(h);let fS=sT(h);return Object.assign(e,{levels:yp,[$T]:fS,[ET]:v,[gT]:n,[mT]:gp,[hT]:dS,[Qh]:Zu,[Fu]:F,[eg]:be,[_T]:We,[vT]:Ce,[bT]:c,[wT]:u,[xT]:l,[PT]:l?`,${JSON.stringify(l)}:{`:"",[Xh]:i,[ST]:g,[zT]:y,[Yh]:Oc,[tg]:ie,[kT]:S,silent:dT,onChild:A,[TT]:re}),Object.setPrototypeOf(e,tT()),oT(e),e[yT](m),e}lt.exports=qu;lt.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Kh(t.dest||process.stdout.fd),Jh(t)):Jh({dest:Kh(t),minLength:0});lt.exports.transport=Su();lt.exports.multistream=Gh();lt.exports.levels=sg();lt.exports.stdSerializers=NT;lt.exports.stdTimeFunctions=Object.assign({},ng);lt.exports.symbols=og;lt.exports.version=fT;lt.exports.default=qu;lt.exports.pino=qu});var fs=$(te=>{"use strict";Object.defineProperty(te,"__esModule",{value:!0});te.regexpCode=te.getEsmExportName=te.getProperty=te.safeStringify=te.stringify=te.strConcat=te.addCodeArg=te.str=te._=te.nil=te._Code=te.Name=te.IDENTIFIER=te._CodeOrName=void 0;var ls=class{};te._CodeOrName=ls;te.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Yr=class extends ls{constructor(e){if(super(),!te.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}}};te.Name=Yr;var mt=class extends ls{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 Yr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};te._Code=mt;te.nil=new mt("");function Qb(t,...e){let r=[t[0]],n=0;for(;n<e.length;)hd(r,e[n]),r.push(t[++n]);return new mt(r)}te._=Qb;var md=new mt("+");function ew(t,...e){let r=[ds(t[0])],n=0;for(;n<e.length;)r.push(md),hd(r,e[n]),r.push(md,ds(t[++n]));return GR(r),new mt(r)}te.str=ew;function hd(t,e){e instanceof mt?t.push(...e._items):e instanceof Yr?t.push(e):t.push(YR(e))}te.addCodeArg=hd;function GR(t){let e=1;for(;e<t.length-1;){if(t[e]===md){let r=JR(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function JR(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Yr||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 Yr))return`"${t}${e.slice(1)}`}function KR(t,e){return e.emptyStr()?t:t.emptyStr()?e:ew`${t}${e}`}te.strConcat=KR;function YR(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ds(Array.isArray(t)?t.join(","):t)}function XR(t){return new mt(ds(t))}te.stringify=XR;function ds(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}te.safeStringify=ds;function QR(t){return typeof t=="string"&&te.IDENTIFIER.test(t)?new mt(`.${t}`):Qb`[${t}]`}te.getProperty=QR;function eD(t){if(typeof t=="string"&&te.IDENTIFIER.test(t))return new mt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}te.getEsmExportName=eD;function tD(t){return new mt(t.toString())}te.regexpCode=tD});var _d=$(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.ValueScope=Xe.ValueScopeName=Xe.Scope=Xe.varKinds=Xe.UsedValueState=void 0;var Ye=fs(),gd=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Da;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Da||(Xe.UsedValueState=Da={}));Xe.varKinds={const:new Ye.Name("const"),let:new Ye.Name("let"),var:new Ye.Name("var")};var Aa=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ye.Name?e:this.name(e)}name(e){return new Ye.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}}};Xe.Scope=Aa;var Na=class extends Ye.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ye._)`.${new Ye.Name(r)}[${n}]`}};Xe.ValueScopeName=Na;var rD=(0,Ye._)`\n`,yd=class extends Aa{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?rD:Ye.nil}}get(){return this._scope}name(e){return new Na(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,Ye._)`${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=Ye.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,Da.Started);let l=r(u);if(l){let d=this.opts.es5?Xe.varKinds.var:Xe.varKinds.const;s=(0,Ye._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))s=(0,Ye._)`${s}${l}${this.opts._n}`;else throw new gd(u);c.set(u,Da.Completed)})}return s}};Xe.ValueScope=yd});var B=$(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.or=W.and=W.not=W.CodeGen=W.operators=W.varKinds=W.ValueScopeName=W.ValueScope=W.Scope=W.Name=W.regexpCode=W.stringify=W.getProperty=W.nil=W.strConcat=W.str=W._=void 0;var Y=fs(),Tt=_d(),hr=fs();Object.defineProperty(W,"_",{enumerable:!0,get:function(){return hr._}});Object.defineProperty(W,"str",{enumerable:!0,get:function(){return hr.str}});Object.defineProperty(W,"strConcat",{enumerable:!0,get:function(){return hr.strConcat}});Object.defineProperty(W,"nil",{enumerable:!0,get:function(){return hr.nil}});Object.defineProperty(W,"getProperty",{enumerable:!0,get:function(){return hr.getProperty}});Object.defineProperty(W,"stringify",{enumerable:!0,get:function(){return hr.stringify}});Object.defineProperty(W,"regexpCode",{enumerable:!0,get:function(){return hr.regexpCode}});Object.defineProperty(W,"Name",{enumerable:!0,get:function(){return hr.Name}});var Za=_d();Object.defineProperty(W,"Scope",{enumerable:!0,get:function(){return Za.Scope}});Object.defineProperty(W,"ValueScope",{enumerable:!0,get:function(){return Za.ValueScope}});Object.defineProperty(W,"ValueScopeName",{enumerable:!0,get:function(){return Za.ValueScopeName}});Object.defineProperty(W,"varKinds",{enumerable:!0,get:function(){return Za.varKinds}});W.operators={GT:new Y._Code(">"),GTE:new Y._Code(">="),LT:new Y._Code("<"),LTE:new Y._Code("<="),EQ:new Y._Code("==="),NEQ:new Y._Code("!=="),NOT:new Y._Code("!"),OR:new Y._Code("||"),AND:new Y._Code("&&"),ADD:new Y._Code("+")};var Qt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},vd=class extends Qt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Tt.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=Ln(this.rhs,e,r)),this}get names(){return this.rhs instanceof Y._CodeOrName?this.rhs.names:{}}},ja=class extends Qt{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 Y.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Ln(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Y.Name?{}:{...this.lhs.names};return La(e,this.rhs)}},bd=class extends ja{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},wd=class extends Qt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},xd=class extends Qt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Sd=class extends Qt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},$d=class extends Qt{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=Ln(this.code,e,r),this}get names(){return this.code instanceof Y._CodeOrName?this.code.names:{}}},ps=class extends Qt{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)||(nD(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>en(e,r.names),{})}},er=class extends ps{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Ed=class extends ps{},Mn=class extends er{};Mn.kind="else";var Xr=class t extends er{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 Mn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(tw(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=Ln(this.condition,e,r),this}get names(){let e=super.names;return La(e,this.condition),this.else&&en(e,this.else.names),e}};Xr.kind="if";var Qr=class extends er{};Qr.kind="for";var kd=class extends Qr{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=Ln(this.iteration,e,r),this}get names(){return en(super.names,this.iteration.names)}},Pd=class extends Qr{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?Tt.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=La(super.names,this.from);return La(e,this.to)}},Ma=class extends Qr{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=Ln(this.iterable,e,r),this}get names(){return en(super.names,this.iterable.names)}},ms=class extends er{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)}};ms.kind="func";var hs=class extends ps{render(e){return"return "+super.render(e)}};hs.kind="return";var zd=class extends er{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&&en(e,this.catch.names),this.finally&&en(e,this.finally.names),e}},gs=class extends er{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};gs.kind="catch";var ys=class extends er{render(e){return"finally"+super.render(e)}};ys.kind="finally";var Td=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
25
+ `:""},this._extScope=e,this._scope=new Tt.Scope({parent:e}),this._nodes=[new Ed]}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 vd(e,s,n)),s}const(e,r,n){return this._def(Tt.varKinds.const,e,r,n)}let(e,r,n){return this._def(Tt.varKinds.let,e,r,n)}var(e,r,n){return this._def(Tt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new ja(e,r,n))}add(e,r){return this._leafNode(new bd(e,W.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Y.nil&&this._leafNode(new $d(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,Y.addCodeArg)(r,o));return r.push("}"),new Y._Code(r)}if(e,r,n){if(this._blockNode(new Xr(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 Xr(e))}else(){return this._elseNode(new Mn)}endIf(){return this._endBlockNode(Xr,Mn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new kd(e),r)}forRange(e,r,n,o,s=this.opts.es5?Tt.varKinds.var:Tt.varKinds.let){let i=this._scope.toName(e);return this._for(new Pd(s,i,r,n),()=>o(i))}forOf(e,r,n,o=Tt.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof Y.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Y._)`${i}.length`,a=>{this.var(s,(0,Y._)`${i}[${a}]`),n(s)})}return this._for(new Ma("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?Tt.varKinds.var:Tt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Y._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Ma("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Qr)}label(e){return this._leafNode(new wd(e))}break(e){return this._leafNode(new xd(e))}return(e){let r=new hs;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(hs)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zd;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new gs(s),r(s)}return n&&(this._currNode=o.finally=new ys,this.code(n)),this._endBlockNode(gs,ys)}throw(e){return this._leafNode(new Sd(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=Y.nil,n,o){return this._blockNode(new ms(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(ms)}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 Xr))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}};W.CodeGen=Td;function en(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function La(t,e){return e instanceof Y._CodeOrName?en(t,e.names):t}function Ln(t,e,r){if(t instanceof Y.Name)return n(t);if(!o(t))return t;return new Y._Code(t._items.reduce((s,i)=>(i instanceof Y.Name&&(i=n(i)),i instanceof Y._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 Y._Code&&s._items.some(i=>i instanceof Y.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function nD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function tw(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Y._)`!${Cd(t)}`}W.not=tw;var oD=rw(W.operators.AND);function sD(...t){return t.reduce(oD)}W.and=sD;var iD=rw(W.operators.OR);function aD(...t){return t.reduce(iD)}W.or=aD;function rw(t){return(e,r)=>e===Y.nil?r:r===Y.nil?e:(0,Y._)`${Cd(e)} ${t} ${Cd(r)}`}function Cd(t){return t instanceof Y.Name?t:(0,Y._)`(${t})`}});var X=$(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;var ce=B(),cD=fs();function uD(t){let e={};for(let r of t)e[r]=!0;return e}G.toHash=uD;function lD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(sw(t,e),!iw(e,t.self.RULES.all))}G.alwaysValidSchema=lD;function sw(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]||uw(t,`unknown keyword: "${s}"`)}G.checkUnknownRules=sw;function iw(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}G.schemaHasRules=iw;function dD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}G.schemaHasRulesButRef=dD;function fD({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ce._)`${r}`}return(0,ce._)`${t}${e}${(0,ce.getProperty)(n)}`}G.schemaRefOrVal=fD;function pD(t){return aw(decodeURIComponent(t))}G.unescapeFragment=pD;function mD(t){return encodeURIComponent(Id(t))}G.escapeFragment=mD;function Id(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=Id;function aw(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=aw;function hD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}G.eachItem=hD;function nw({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof ce.Name?(s instanceof ce.Name?t(o,s,i):e(o,s,i),i):s instanceof ce.Name?(e(o,i,s),s):r(s,i);return a===ce.Name&&!(c instanceof ce.Name)?n(o,c):c}}G.mergeEvaluated={props:nw({mergeNames:(t,e,r)=>t.if((0,ce._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ce._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ce._)`${r} || {}`).code((0,ce._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ce._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ce._)`${r} || {}`),Rd(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:cw}),items:nw({mergeNames:(t,e,r)=>t.if((0,ce._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ce._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ce._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ce._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function cw(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ce._)`{}`);return e!==void 0&&Rd(t,r,e),r}G.evaluatedPropsToName=cw;function Rd(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ce._)`${e}${(0,ce.getProperty)(n)}`,!0))}G.setEvaluated=Rd;var ow={};function gD(t,e){return t.scopeValue("func",{ref:e,code:ow[e.code]||(ow[e.code]=new cD._Code(e.code))})}G.useFunc=gD;var Od;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Od||(G.Type=Od={}));function yD(t,e,r){if(t instanceof ce.Name){let n=e===Od.Num;return r?n?(0,ce._)`"[" + ${t} + "]"`:(0,ce._)`"['" + ${t} + "']"`:n?(0,ce._)`"/" + ${t}`:(0,ce._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ce.getProperty)(t).toString():"/"+Id(t)}G.getErrorPath=yD;function uw(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}G.checkStrictMode=uw});var tr=$(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var Me=B(),_D={data:new Me.Name("data"),valCxt:new Me.Name("valCxt"),instancePath:new Me.Name("instancePath"),parentData:new Me.Name("parentData"),parentDataProperty:new Me.Name("parentDataProperty"),rootData:new Me.Name("rootData"),dynamicAnchors:new Me.Name("dynamicAnchors"),vErrors:new Me.Name("vErrors"),errors:new Me.Name("errors"),this:new Me.Name("this"),self:new Me.Name("self"),scope:new Me.Name("scope"),json:new Me.Name("json"),jsonPos:new Me.Name("jsonPos"),jsonLen:new Me.Name("jsonLen"),jsonPart:new Me.Name("jsonPart")};Dd.default=_D});var _s=$(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.extendErrors=Le.resetErrorsCount=Le.reportExtraError=Le.reportError=Le.keyword$DataError=Le.keywordError=void 0;var Q=B(),Fa=X(),Be=tr();Le.keywordError={message:({keyword:t})=>(0,Q.str)`must pass "${t}" keyword validation`};Le.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Q.str)`"${t}" keyword must be ${e} ($data)`:(0,Q.str)`"${t}" keyword is invalid ($data)`};function vD(t,e=Le.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=fw(t,e,r);n??(i||a)?lw(s,c):dw(o,(0,Q._)`[${c}]`)}Le.reportError=vD;function bD(t,e=Le.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=fw(t,e,r);lw(o,a),s||i||dw(n,Be.default.vErrors)}Le.reportExtraError=bD;function wD(t,e){t.assign(Be.default.errors,e),t.if((0,Q._)`${Be.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Q._)`${Be.default.vErrors}.length`,e),()=>t.assign(Be.default.vErrors,null)))}Le.resetErrorsCount=wD;function xD({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,Be.default.errors,a=>{t.const(i,(0,Q._)`${Be.default.vErrors}[${a}]`),t.if((0,Q._)`${i}.instancePath === undefined`,()=>t.assign((0,Q._)`${i}.instancePath`,(0,Q.strConcat)(Be.default.instancePath,s.errorPath))),t.assign((0,Q._)`${i}.schemaPath`,(0,Q.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Q._)`${i}.schema`,r),t.assign((0,Q._)`${i}.data`,n))})}Le.extendErrors=xD;function lw(t,e){let r=t.const("err",e);t.if((0,Q._)`${Be.default.vErrors} === null`,()=>t.assign(Be.default.vErrors,(0,Q._)`[${r}]`),(0,Q._)`${Be.default.vErrors}.push(${r})`),t.code((0,Q._)`${Be.default.errors}++`)}function dw(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,Q._)`new ${t.ValidationError}(${e})`):(r.assign((0,Q._)`${n}.errors`,e),r.return(!1))}var tn={keyword:new Q.Name("keyword"),schemaPath:new Q.Name("schemaPath"),params:new Q.Name("params"),propertyName:new Q.Name("propertyName"),message:new Q.Name("message"),schema:new Q.Name("schema"),parentSchema:new Q.Name("parentSchema")};function fw(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Q._)`{}`:SD(t,e,r)}function SD(t,e,r={}){let{gen:n,it:o}=t,s=[$D(o,r),ED(t,r)];return kD(t,e,s),n.object(...s)}function $D({errorPath:t},{instancePath:e}){let r=e?(0,Q.str)`${t}${(0,Fa.getErrorPath)(e,Fa.Type.Str)}`:t;return[Be.default.instancePath,(0,Q.strConcat)(Be.default.instancePath,r)]}function ED({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,Q.str)`${e}/${t}`;return r&&(o=(0,Q.str)`${o}${(0,Fa.getErrorPath)(r,Fa.Type.Str)}`),[tn.schemaPath,o]}function kD(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([tn.keyword,o],[tn.params,typeof e=="function"?e(t):e||(0,Q._)`{}`]),c.messages&&n.push([tn.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([tn.schema,i],[tn.parentSchema,(0,Q._)`${l}${d}`],[Be.default.data,s]),u&&n.push([tn.propertyName,u])}});var mw=$(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.boolOrEmptySchema=Zn.topBoolOrEmptySchema=void 0;var PD=_s(),zD=B(),TD=tr(),CD={message:"boolean schema is false"};function OD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?pw(t,!1):typeof r=="object"&&r.$async===!0?e.return(TD.default.data):(e.assign((0,zD._)`${n}.errors`,null),e.return(!0))}Zn.topBoolOrEmptySchema=OD;function ID(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),pw(t)):r.var(e,!0)}Zn.boolOrEmptySchema=ID;function pw(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,PD.reportError)(o,CD,void 0,e)}});var Ad=$(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.getRules=Fn.isJSONType=void 0;var RD=["string","number","integer","boolean","null","object","array"],DD=new Set(RD);function AD(t){return typeof t=="string"&&DD.has(t)}Fn.isJSONType=AD;function ND(){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:{}}}Fn.getRules=ND});var Nd=$(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.shouldUseRule=gr.shouldUseGroup=gr.schemaHasRulesForType=void 0;function jD({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&hw(t,n)}gr.schemaHasRulesForType=jD;function hw(t,e){return e.rules.some(r=>gw(t,r))}gr.shouldUseGroup=hw;function gw(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))}gr.shouldUseRule=gw});var vs=$(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.reportTypeError=Ze.checkDataTypes=Ze.checkDataType=Ze.coerceAndCheckDataType=Ze.getJSONTypes=Ze.getSchemaTypes=Ze.DataType=void 0;var MD=Ad(),LD=Nd(),ZD=_s(),V=B(),yw=X(),qn;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(qn||(Ze.DataType=qn={}));function FD(t){let e=_w(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}Ze.getSchemaTypes=FD;function _w(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(MD.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Ze.getJSONTypes=_w;function qD(t,e){let{gen:r,data:n,opts:o}=t,s=UD(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,LD.schemaHasRulesForType)(t,e[0]));if(i){let a=Md(e,n,o.strictNumbers,qn.Wrong);r.if(a,()=>{s.length?VD(t,e,s):Ld(t)})}return i}Ze.coerceAndCheckDataType=qD;var vw=new Set(["string","number","integer","boolean","null"]);function UD(t,e){return e?t.filter(r=>vw.has(r)||e==="array"&&r==="array"):[]}function VD(t,e,r){let{gen:n,data:o,opts:s}=t,i=n.let("dataType",(0,V._)`typeof ${o}`),a=n.let("coerced",(0,V._)`undefined`);s.coerceTypes==="array"&&n.if((0,V._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,V._)`${o}[0]`).assign(i,(0,V._)`typeof ${o}`).if(Md(e,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,V._)`${a} !== undefined`);for(let u of r)(vw.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Ld(t),n.endIf(),n.if((0,V._)`${a} !== undefined`,()=>{n.assign(o,a),BD(t,a)});function c(u){switch(u){case"string":n.elseIf((0,V._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,V._)`"" + ${o}`).elseIf((0,V._)`${o} === null`).assign(a,(0,V._)`""`);return;case"number":n.elseIf((0,V._)`${i} == "boolean" || ${o} === null
26
+ || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,V._)`+${o}`);return;case"integer":n.elseIf((0,V._)`${i} === "boolean" || ${o} === null
27
+ || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,V._)`+${o}`);return;case"boolean":n.elseIf((0,V._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,V._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,V._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,V._)`${i} === "string" || ${i} === "number"
28
+ || ${i} === "boolean" || ${o} === null`).assign(a,(0,V._)`[${o}]`)}}}function BD({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,V._)`${e} !== undefined`,()=>t.assign((0,V._)`${e}[${r}]`,n))}function jd(t,e,r,n=qn.Correct){let o=n===qn.Correct?V.operators.EQ:V.operators.NEQ,s;switch(t){case"null":return(0,V._)`${e} ${o} null`;case"array":s=(0,V._)`Array.isArray(${e})`;break;case"object":s=(0,V._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,V._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,V._)`typeof ${e} ${o} ${t}`}return n===qn.Correct?s:(0,V.not)(s);function i(a=V.nil){return(0,V.and)((0,V._)`typeof ${e} == "number"`,a,r?(0,V._)`isFinite(${e})`:V.nil)}}Ze.checkDataType=jd;function Md(t,e,r,n){if(t.length===1)return jd(t[0],e,r,n);let o,s=(0,yw.toHash)(t);if(s.array&&s.object){let i=(0,V._)`typeof ${e} != "object"`;o=s.null?i:(0,V._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else o=V.nil;s.number&&delete s.integer;for(let i in s)o=(0,V.and)(o,jd(i,e,r,n));return o}Ze.checkDataTypes=Md;var HD={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,V._)`{type: ${t}}`:(0,V._)`{type: ${e}}`};function Ld(t){let e=WD(t);(0,ZD.reportError)(e,HD)}Ze.reportTypeError=Ld;function WD(t){let{gen:e,data:r,schema:n}=t,o=(0,yw.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var ww=$(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.assignDefaults=void 0;var Un=B(),GD=X();function JD(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)bw(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>bw(t,s,o.default))}qa.assignDefaults=JD;function bw(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let a=(0,Un._)`${s}${(0,Un.getProperty)(e)}`;if(o){(0,GD.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Un._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,Un._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Un._)`${a} = ${(0,Un.stringify)(r)}`)}});var ht=$(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.validateUnion=ae.validateArray=ae.usePattern=ae.callValidateCode=ae.schemaProperties=ae.allSchemaProperties=ae.noPropertyInData=ae.propertyInData=ae.isOwnProperty=ae.hasPropFunc=ae.reportMissingProp=ae.checkMissingProp=ae.checkReportMissingProp=void 0;var me=B(),Zd=X(),yr=tr(),KD=X();function YD(t,e){let{gen:r,data:n,it:o}=t;r.if(qd(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,me._)`${e}`},!0),t.error()})}ae.checkReportMissingProp=YD;function XD({gen:t,data:e,it:{opts:r}},n,o){return(0,me.or)(...n.map(s=>(0,me.and)(qd(t,e,s,r.ownProperties),(0,me._)`${o} = ${s}`)))}ae.checkMissingProp=XD;function QD(t,e){t.setParams({missingProperty:e},!0),t.error()}ae.reportMissingProp=QD;function xw(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,me._)`Object.prototype.hasOwnProperty`})}ae.hasPropFunc=xw;function Fd(t,e,r){return(0,me._)`${xw(t)}.call(${e}, ${r})`}ae.isOwnProperty=Fd;function eA(t,e,r,n){let o=(0,me._)`${e}${(0,me.getProperty)(r)} !== undefined`;return n?(0,me._)`${o} && ${Fd(t,e,r)}`:o}ae.propertyInData=eA;function qd(t,e,r,n){let o=(0,me._)`${e}${(0,me.getProperty)(r)} === undefined`;return n?(0,me.or)(o,(0,me.not)(Fd(t,e,r))):o}ae.noPropertyInData=qd;function Sw(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ae.allSchemaProperties=Sw;function tA(t,e){return Sw(e).filter(r=>!(0,Zd.alwaysValidSchema)(t,e[r]))}ae.schemaProperties=tA;function rA({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,c,u){let l=u?(0,me._)`${t}, ${e}, ${n}${o}`:e,d=[[yr.default.instancePath,(0,me.strConcat)(yr.default.instancePath,s)],[yr.default.parentData,i.parentData],[yr.default.parentDataProperty,i.parentDataProperty],[yr.default.rootData,yr.default.rootData]];i.opts.dynamicRef&&d.push([yr.default.dynamicAnchors,yr.default.dynamicAnchors]);let p=(0,me._)`${l}, ${r.object(...d)}`;return c!==me.nil?(0,me._)`${a}.call(${c}, ${p})`:(0,me._)`${a}(${p})`}ae.callValidateCode=rA;var nA=(0,me._)`new RegExp`;function oA({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,me._)`${o.code==="new RegExp"?nA:(0,KD.useFunc)(t,o)}(${r}, ${n})`})}ae.usePattern=oA;function sA(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,me._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Zd.Type.Num},s),e.if((0,me.not)(s),a)})}}ae.validateArray=sA;function iA(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,Zd.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,me._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,me.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}ae.validateUnion=iA});var kw=$(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.validateKeywordUsage=Nt.validSchemaType=Nt.funcKeywordCode=Nt.macroKeywordCode=void 0;var He=B(),rn=tr(),aA=ht(),cA=_s();function uA(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Ew(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:He.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Nt.macroKeywordCode=uA;function lA(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;fA(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Ew(n,o,u),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)h(),e.modifying&&$w(t),g(()=>t.error());else{let y=e.async?m():f();e.modifying&&$w(t),g(()=>dA(t,y))}}function m(){let y=n.let("ruleErrs",null);return n.try(()=>h((0,He._)`await `),v=>n.assign(d,!1).if((0,He._)`${v} instanceof ${c.ValidationError}`,()=>n.assign(y,(0,He._)`${v}.errors`),()=>n.throw(v))),y}function f(){let y=(0,He._)`${l}.errors`;return n.assign(y,null),h(He.nil),y}function h(y=e.async?(0,He._)`await `:He.nil){let v=c.opts.passContext?rn.default.this:rn.default.self,x=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,He._)`${y}${(0,aA.callValidateCode)(t,l,v,x)}`,e.modifying)}function g(y){var v;n.if((0,He.not)((v=e.valid)!==null&&v!==void 0?v:d),y)}}Nt.funcKeywordCode=lA;function $w(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,He._)`${n.parentData}[${n.parentDataProperty}]`))}function dA(t,e){let{gen:r}=t;r.if((0,He._)`Array.isArray(${e})`,()=>{r.assign(rn.default.vErrors,(0,He._)`${rn.default.vErrors} === null ? ${e} : ${rn.default.vErrors}.concat(${e})`).assign(rn.default.errors,(0,He._)`${rn.default.vErrors}.length`),(0,cA.extendErrors)(t)},()=>t.error())}function fA({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Ew(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,He.stringify)(r)})}function pA(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")}Nt.validSchemaType=pA;function mA({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)}}Nt.validateKeywordUsage=mA});var zw=$(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.extendSubschemaMode=_r.extendSubschemaData=_r.getSubschema=void 0;var jt=B(),Pw=X();function hA(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,jt._)`${t.schemaPath}${(0,jt.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,jt._)`${t.schemaPath}${(0,jt.getProperty)(e)}${(0,jt.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Pw.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')}_r.getSubschema=hA;function gA(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,p=a.let("data",(0,jt._)`${e.data}${(0,jt.getProperty)(r)}`,!0);c(p),t.errorPath=(0,jt.str)`${u}${(0,Pw.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,jt._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof jt.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]}}_r.extendSubschemaData=gA;function yA(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}_r.extendSubschemaMode=yA});var Ud=$((XB,Tw)=>{"use strict";Tw.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 Ow=$((QB,Cw)=>{"use strict";var vr=Cw.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(){};Ua(e,n,o,t,"",t)};vr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};vr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};vr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};vr.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 Ua(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 vr.arrayKeywords)for(var p=0;p<d.length;p++)Ua(t,e,r,d[p],o+"/"+l+"/"+p,s,o,l,n,p)}else if(l in vr.propsKeywords){if(d&&typeof d=="object")for(var m in d)Ua(t,e,r,d[m],o+"/"+l+"/"+_A(m),s,o,l,n,m)}else(l in vr.keywords||t.allKeys&&!(l in vr.skipKeywords))&&Ua(t,e,r,d,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,c,u)}}function _A(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var bs=$(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.getSchemaRefs=Qe.resolveUrl=Qe.normalizeId=Qe._getFullPath=Qe.getFullPath=Qe.inlineRef=void 0;var vA=X(),bA=Ud(),wA=Ow(),xA=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function SA(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Vd(t):e?Iw(t)<=e:!1}Qe.inlineRef=SA;var $A=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Vd(t){for(let e in t){if($A.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Vd)||typeof r=="object"&&Vd(r))return!0}return!1}function Iw(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!xA.has(r)&&(typeof t[r]=="object"&&(0,vA.eachItem)(t[r],n=>e+=Iw(n)),e===1/0))return 1/0}return e}function Rw(t,e="",r){r!==!1&&(e=Vn(e));let n=t.parse(e);return Dw(t,n)}Qe.getFullPath=Rw;function Dw(t,e){return t.serialize(e).split("#")[0]+"#"}Qe._getFullPath=Dw;var EA=/#\/?$/;function Vn(t){return t?t.replace(EA,""):""}Qe.normalizeId=Vn;function kA(t,e,r){return r=Vn(r),t.resolve(e,r)}Qe.resolveUrl=kA;var PA=/^[a-z_][-a-z0-9._]*$/i;function zA(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Vn(t[r]||e),s={"":o},i=Rw(n,o,!1),a={},c=new Set;return wA(t,{allKeys:!0},(d,p,m,f)=>{if(f===void 0)return;let h=i+p,g=s[f];typeof d[r]=="string"&&(g=y.call(this,d[r])),v.call(this,d.$anchor),v.call(this,d.$dynamicAnchor),s[p]=g;function y(x){let S=this.opts.uriResolver.resolve;if(x=Vn(g?S(g,x):x),c.has(x))throw l(x);c.add(x);let E=this.refs[x];return typeof E=="string"&&(E=this.refs[E]),typeof E=="object"?u(d,E.schema,x):x!==Vn(h)&&(x[0]==="#"?(u(d,a[x],x),a[x]=d):this.refs[x]=h),x}function v(x){if(typeof x=="string"){if(!PA.test(x))throw new Error(`invalid anchor "${x}"`);y.call(this,`#${x}`)}}}),a;function u(d,p,m){if(p!==void 0&&!bA(d,p))throw l(m)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Qe.getSchemaRefs=zA});var Ss=$(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.getData=br.KeywordCxt=br.validateFunctionCode=void 0;var Lw=mw(),Aw=vs(),Hd=Nd(),Va=vs(),TA=ww(),xs=kw(),Bd=zw(),I=B(),M=tr(),CA=bs(),rr=X(),ws=_s();function OA(t){if(qw(t)&&(Uw(t),Fw(t))){DA(t);return}Zw(t,()=>(0,Lw.topBoolOrEmptySchema)(t))}br.validateFunctionCode=OA;function Zw({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,I._)`${M.default.data}, ${M.default.valCxt}`,n.$async,()=>{t.code((0,I._)`"use strict"; ${Nw(r,o)}`),RA(t,o),t.code(s)}):t.func(e,(0,I._)`${M.default.data}, ${IA(o)}`,n.$async,()=>t.code(Nw(r,o)).code(s))}function IA(t){return(0,I._)`{${M.default.instancePath}="", ${M.default.parentData}, ${M.default.parentDataProperty}, ${M.default.rootData}=${M.default.data}${t.dynamicRef?(0,I._)`, ${M.default.dynamicAnchors}={}`:I.nil}}={}`}function RA(t,e){t.if(M.default.valCxt,()=>{t.var(M.default.instancePath,(0,I._)`${M.default.valCxt}.${M.default.instancePath}`),t.var(M.default.parentData,(0,I._)`${M.default.valCxt}.${M.default.parentData}`),t.var(M.default.parentDataProperty,(0,I._)`${M.default.valCxt}.${M.default.parentDataProperty}`),t.var(M.default.rootData,(0,I._)`${M.default.valCxt}.${M.default.rootData}`),e.dynamicRef&&t.var(M.default.dynamicAnchors,(0,I._)`${M.default.valCxt}.${M.default.dynamicAnchors}`)},()=>{t.var(M.default.instancePath,(0,I._)`""`),t.var(M.default.parentData,(0,I._)`undefined`),t.var(M.default.parentDataProperty,(0,I._)`undefined`),t.var(M.default.rootData,M.default.data),e.dynamicRef&&t.var(M.default.dynamicAnchors,(0,I._)`{}`)})}function DA(t){let{schema:e,opts:r,gen:n}=t;Zw(t,()=>{r.$comment&&e.$comment&&Bw(t),LA(t),n.let(M.default.vErrors,null),n.let(M.default.errors,0),r.unevaluated&&AA(t),Vw(t),qA(t)})}function AA(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,I._)`${r}.evaluated`),e.if((0,I._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,I._)`${t.evaluated}.props`,(0,I._)`undefined`)),e.if((0,I._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,I._)`${t.evaluated}.items`,(0,I._)`undefined`))}function Nw(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,I._)`/*# sourceURL=${r} */`:I.nil}function NA(t,e){if(qw(t)&&(Uw(t),Fw(t))){jA(t,e);return}(0,Lw.boolOrEmptySchema)(t,e)}function Fw({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 qw(t){return typeof t.schema!="boolean"}function jA(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&Bw(t),ZA(t),FA(t);let s=n.const("_errs",M.default.errors);Vw(t,s),n.var(e,(0,I._)`${s} === ${M.default.errors}`)}function Uw(t){(0,rr.checkUnknownRules)(t),MA(t)}function Vw(t,e){if(t.opts.jtd)return jw(t,[],!1,e);let r=(0,Aw.getSchemaTypes)(t.schema),n=(0,Aw.coerceAndCheckDataType)(t,r);jw(t,r,!n,e)}function MA(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,rr.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function LA(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,rr.checkStrictMode)(t,"default is ignored in the schema root")}function ZA(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,CA.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function FA(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function Bw({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,I._)`${M.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,I.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,I._)`${M.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function qA(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,I._)`${M.default.errors} === 0`,()=>e.return(M.default.data),()=>e.throw((0,I._)`new ${o}(${M.default.vErrors})`)):(e.assign((0,I._)`${n}.errors`,M.default.vErrors),s.unevaluated&&UA(t),e.return((0,I._)`${M.default.errors} === 0`))}function UA({gen:t,evaluated:e,props:r,items:n}){r instanceof I.Name&&t.assign((0,I._)`${e}.props`,r),n instanceof I.Name&&t.assign((0,I._)`${e}.items`,n)}function jw(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,rr.schemaHasRulesButRef)(s,l))){o.block(()=>Ww(t,"$ref",l.all.$ref.definition));return}c.jtd||VA(t,e),o.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,Hd.shouldUseGroup)(s,p)&&(p.type?(o.if((0,Va.checkDataType)(p.type,i,c.strictNumbers)),Mw(t,p),e.length===1&&e[0]===p.type&&r&&(o.else(),(0,Va.reportTypeError)(t)),o.endIf()):Mw(t,p),a||o.if((0,I._)`${M.default.errors} === ${n||0}`))}}function Mw(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,TA.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Hd.shouldUseRule)(n,s)&&Ww(t,s.keyword,s.definition,e.type)})}function VA(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(BA(t,e),t.opts.allowUnionTypes||HA(t,e),WA(t,t.dataTypes))}function BA(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{Hw(t.dataTypes,r)||Wd(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),JA(t,e)}}function HA(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Wd(t,"use allowUnionTypes to allow union type keyword")}function WA(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Hd.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>GA(e,i))&&Wd(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function GA(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function Hw(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function JA(t,e){let r=[];for(let n of t.dataTypes)Hw(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Wd(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,rr.checkStrictMode)(t,e,t.opts.strictTypes)}var Ba=class{constructor(e,r,n){if((0,xs.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,rr.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",Gw(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,xs.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",M.default.errors))}result(e,r,n){this.failResult((0,I.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,I.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,I._)`${r} !== undefined && (${(0,I.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?ws.reportExtraError:ws.reportError)(this,this.def.error,r)}$dataError(){(0,ws.reportError)(this,this.def.$dataError||ws.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ws.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=I.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=I.nil,r=I.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,I.or)((0,I._)`${o} === undefined`,r)),e!==I.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==I.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,I.or)(i(),a());function i(){if(n.length){if(!(r instanceof I.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,I._)`${(0,Va.checkDataTypes)(c,r,s.opts.strictNumbers,Va.DataType.Wrong)}`}return I.nil}function a(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,I._)`!${c}(${r})`}return I.nil}}subschema(e,r){let n=(0,Bd.getSubschema)(this.it,e);(0,Bd.extendSubschemaData)(n,this.it,e),(0,Bd.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return NA(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=rr.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=rr.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,I.Name)),!0}};br.KeywordCxt=Ba;function Ww(t,e,r,n){let o=new Ba(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,xs.funcKeywordCode)(o,r):"macro"in r?(0,xs.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,xs.funcKeywordCode)(o,r)}var KA=/^\/(?:[^~]|~0|~1)*$/,YA=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Gw(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return M.default.rootData;if(t[0]==="/"){if(!KA.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=M.default.rootData}else{let u=YA.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,I._)`${s}${(0,I.getProperty)((0,rr.unescapeJsonPointer)(u))}`,i=(0,I._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}br.getData=Gw});var Ha=$(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var Gd=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Jd.default=Gd});var $s=$(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});var Kd=bs(),Yd=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Kd.resolveUrl)(e,r,n),this.missingSchema=(0,Kd.normalizeId)((0,Kd.getFullPath)(e,this.missingRef))}};Xd.default=Yd});var Ga=$(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.resolveSchema=gt.getCompilingSchema=gt.resolveRef=gt.compileSchema=gt.SchemaEnv=void 0;var Ct=B(),XA=Ha(),nn=tr(),Ot=bs(),Jw=X(),QA=Ss(),Bn=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,Ot.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};gt.SchemaEnv=Bn;function ef(t){let e=Kw.call(this,t);if(e)return e;let r=(0,Ot.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new Ct.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:XA.default,code:(0,Ct._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:nn.default.data,parentData:nn.default.parentData,parentDataProperty:nn.default.parentDataProperty,dataNames:[nn.default.data],dataPathArr:[Ct.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ct.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ct.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ct._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,QA.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(nn.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let m=new Function(`${nn.default.self}`,`${nn.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=t.schema,m.schemaEnv=t,t.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:h}=u;m.evaluated={props:f instanceof Ct.Name?void 0:f,items:h instanceof Ct.Name?void 0:h,dynamicProps:f instanceof Ct.Name,dynamicItems:h instanceof Ct.Name},m.source&&(m.source.evaluated=(0,Ct.stringify)(m.evaluated))}return t.validate=m,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)}}gt.compileSchema=ef;function eN(t,e,r){var n;r=(0,Ot.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=nN.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 Bn({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=tN.call(this,s)}gt.resolveRef=eN;function tN(t){return(0,Ot.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:ef.call(this,t)}function Kw(t){for(let e of this._compilations)if(rN(e,t))return e}gt.getCompilingSchema=Kw;function rN(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function nN(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Wa.call(this,t,e)}function Wa(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Ot._getFullPath)(this.opts.uriResolver,r),o=(0,Ot.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Qd.call(this,r,t);let s=(0,Ot.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=Wa.call(this,t,i);return typeof a?.schema!="object"?void 0:Qd.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||ef.call(this,i),s===(0,Ot.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Ot.resolveUrl)(this.opts.uriResolver,o,u)),new Bn({schema:a,schemaId:c,root:t,baseId:o})}return Qd.call(this,r,i)}}gt.resolveSchema=Wa;var oN=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Qd(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,Jw.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!oN.has(a)&&u&&(e=(0,Ot.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,Jw.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Ot.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Wa.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new Bn({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var Yw=$((sH,sN)=>{sN.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 sf=$((iH,sx)=>{"use strict";var iN=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),tf=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),aN=RegExp.prototype.test.bind(/^\d*$/u),on=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),rf=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),ex=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),nf=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),cN=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),uN=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=]$/u),lN=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=]*$/u);function dN(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 fN=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),pN=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),mN=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),hN=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),gN=RegExp.prototype.test.bind(/[^\d!"$&'()*+,\-.;=_`a-z{}~]/u),yN=RegExp.prototype.test.bind(/(?:^|\.)\d+$/u);function _N(t){return gN(t)||yN(t)}function vN(t){if(t.length===0)return!1;for(let e=0;e<t.length;e++)if(!mN(t[e])){if(t[e]==="%"&&e+2<t.length&&on(t.slice(e+1,e+3))){e+=2;continue}return!1}return!0}function Xw(t){let e=-1,r=0,n=-1,o=0;for(let a=0;a<t.length;a++)t[a]==="0"?(n===-1&&(n=a),o++,o>r&&(r=o,e=n)):(n=-1,o=0);if(r<2)return t.join(":");let s=t.slice(0,e).join(":"),i=t.slice(e+r).join(":");return s+"::"+i}function bN(t){let e=t.indexOf("::");if(e!==-1&&t.indexOf("::",e+1)!==-1)return;let r=e===-1?t.split(":"):t.slice(0,e).split(":"),n=e===-1?[]:t.slice(e+2).split(":");e!==-1&&(r.length===1&&r[0]===""&&(r.length=0),n.length===1&&n[0]===""&&(n.length=0));let o=r.concat(n),s=0;for(let a=0;a<o.length;a++){let c=o[a];if(c==="")return;if(c.indexOf(".")!==-1){if(a!==o.length-1||e!==-1&&n.length===0||!tf(c))return;s+=2;continue}if(!fN(c))return;o[a]=parseInt(c,16).toString(16),s++}if(e===-1)return s!==8?void 0:Xw(o);if(s>=8)return;let i=o.slice(0,r.length);for(let a=s;a<8;a++)i.push("0");for(let a=r.length;a<o.length;a++)i.push(o[a]);return Xw(i)}function Ja(t){let e=t[0]==="["&&t[t.length-1]==="]";if((t[0]==="["||t[t.length-1]==="]")&&!e)return{host:t,isIPV6:!1,error:!0};let n=e?t.slice(1,-1):t;if(e&&pN(n))return n=n.toLowerCase(),{host:`[${n}]`,escapedHost:n,isIPV6:!1,isIPVFuture:!0};if(wN(n,":")<2)return{host:t,isIPV6:!1,error:e};let o="",s=n.indexOf("%");if(s!==-1){let a=n.slice(s,s+3).toLowerCase()==="%25"?3:1;if(o=n.slice(s+a),!vN(o))return{host:t,isIPV6:!1,error:!0};n=n.slice(0,s)}let i=bN(n);return i===void 0?{host:t,isIPV6:!1,error:!0}:{host:i+(o?"%"+o:""),escapedHost:i+(o?"%25"+o:""),isIPV6:!0}}function wN(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function tx(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]==="."){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("")}function xN(t){if(t===""||t[0]==="/")return tx(t);let e=t.split("/"),r=e.length-1,n=[],o=!1;for(let s=0;s<=r;s++){let i=e[s];i==="."||i===".."?(i===".."&&(n.length!==0&&n[n.length-1]!==".."?n.pop():n.push("..")),o=s===r):n.push(i)}return o&&n[n.length-1]!==".."&&n.push(""),(n.length===0||n[0]===""||n[0].includes(":"))&&n.unshift("."),n.join("/")}var SN={"@":"%40","/":"%2F","?":"%3F","#":"%23"},Qw=/[@/?#]/g;function rx(t,e,r=!1){return e?(Qw.lastIndex=0,t.replace(Qw,n=>SN[n])):lN(t)?t:Ka(t,uN,r)}function nx(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(on(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&rf(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}var Fe=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)Fe[e]="%"+t[e>>4]+t[e&15]}function of(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}function ke(t){return t<2048?Fe[192|t>>6]+Fe[128|t&63]:t<65536?Fe[224|t>>12]+Fe[128|t>>6&63]+Fe[128|t&63]:Fe[240|t>>18]+Fe[128|t>>12&63]+Fe[128|t>>6&63]+Fe[128|t&63]}function $N(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(on(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));i!=="."&&rf(i)?e+=i:e+="%"+s,r+=2;continue}}if(ex(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=of(o)?n:Fe[o];else if(o<55296||o>57343)e+=ke(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=ke(65536+(o-55296<<10)+(s-56320)),r++):e+=ke(65533)}else e+=ke(65533)}}return e}function EN(t,e=!1){let r="",n=e&&t[0]!=="/";for(let o=0;o<t.length;o++){let s=t[o];if(s==="%"&&o+2<t.length){let i=t.slice(o+1,o+3);if(on(i)){r+="%"+i.toUpperCase(),o+=2;continue}}if(s==="/"&&(n=!1),ex(s)&&(s!==":"||!n))r+=s;else{let i=t.charCodeAt(o);if(i<128)r+=Fe[i];else if(i<55296||i>57343)r+=ke(i);else if(i<=56319&&o+1<t.length){let a=t.charCodeAt(o+1);a>=56320&&a<=57343?(r+=ke(65536+(i-55296<<10)+(a-56320)),o++):r+=ke(65533)}else r+=ke(65533)}}return r}function kN(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(on(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));rf(i)?e+=i:e+="%"+s,r+=2;continue}}if(nf(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=of(o)?n:Fe[o];else if(o<55296||o>57343)e+=ke(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=ke(65536+(o-55296<<10)+(s-56320)),r++):e+=ke(65533)}else e+=ke(65533)}}return e}function Ka(t,e,r=!1){let n="";for(let o=0;o<t.length;o++){let s=t[o];if(s==="%"&&o+2<t.length){let i=t.slice(o+1,o+3);if(on(i)){n+="%"+i.toUpperCase(),o+=2;continue}}if(e(s))n+=s;else{let i=t.charCodeAt(o);if(i<128)n+=Fe[i];else if(i<55296||i>57343)n+=r?s:ke(i);else if(i<=56319&&o+1<t.length){let a=t.charCodeAt(o+1);a>=56320&&a<=57343?(n+=r?s+t[o+1]:ke(65536+(i-55296<<10)+(a-56320)),o++):n+=r?"\uFFFD":ke(65533)}else n+=r?"\uFFFD":ke(65533)}}return n}function ox(t){return Ka(t,cN)}function PN(t){return Ka(t,nf)}function zN(t){return Ka(t,nf)}function TN(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let s=t.slice(r+1,r+3);if(on(s)){e+="%"+s.toUpperCase(),r+=2;continue}}let o=t.charCodeAt(r);if(o<128)e+=of(o)?n:Fe[o];else if(o<55296||o>57343)e+=ke(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=ke(65536+(o-55296<<10)+(s-56320)),r++):e+=ke(65533)}else e+=ke(65533)}return e}function CN(t){let e=t.ipv6Zone;if(e===void 0)return;let r=t.host,n=r.indexOf("%");if(n===-1)return;let s=r.slice(0,n)+"%25"+e,i=Ja("["+s+"]");if(i.isIPV6===!0&&i.host===r)return"["+s+"]"}function ON(t,e=!1){let r=[];if(t.userinfo!==void 0&&(r.push(ox(t.userinfo)),r.push("@")),t.host!==void 0){let n=t.host;if(!tf(n)){let o=CN(t);if(o!==void 0)n=o;else{let s=Ja(n);s.isIPV6!==!0&&s.isIPVFuture!==!0&&(n=nx(n,!0),s=Ja(n)),s.isIPV6===!0||s.isIPVFuture===!0?n=`[${s.escapedHost}]`:n=rx(n,!1,e)}}r.push(n)}if(typeof t.port=="number"||typeof t.port=="string"){let n=String(t.port);if(!aN(n))throw new TypeError("URI port is malformed.");r.push(":"),r.push(n)}return r.length?r.join(""):void 0}sx.exports={BYTE_HEX:Fe,percentEncodeNonAscii:ke,nonSimpleDomain:hN,nonSimpleMailtoDomain:_N,recomposeAuthority:ON,encodeHost:rx,normalizePercentEncoding:nx,normalizePathEncoding:$N,serializePathEncoding:EN,normalizeQueryFragmentEncoding:kN,encodeUserinfo:ox,encodeQuery:PN,encodeFragment:zN,escapePreservingEscapes:TN,removeDotSegments:tx,removeDotSegmentsRelative:xN,isIPv4:tf,isUUID:iN,normalizeIPv6:Ja,stringArrayToHexStripped:dN}});var hx=$((aH,mx)=>{"use strict";var{isUUID:IN,BYTE_HEX:RN,percentEncodeNonAscii:af,nonSimpleMailtoDomain:DN}=sf(),AN=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,NN=["http","https","ws","wss","urn","urn:uuid","mailto"];function jN(t){return NN.indexOf(t)!==-1}function uf(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 cx(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ux(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 MN(t){return t.secure=uf(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function LN(t){if((t.port===(uf(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=t.resourceName.indexOf("?"),r=e===-1?t.resourceName:t.resourceName.slice(0,e);t.path=r&&r!=="/"?r:void 0,t.query=e===-1?void 0:t.resourceName.slice(e+1),t.resourceName=void 0}return t.fragment=void 0,t}function ZN(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(AN);if(r&&r[0]===t.path){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=lf(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function FN(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=lf(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 qN(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!IN(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function UN(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var lx={scheme:"http",domainHost:!0,parse:cx,serialize:ux},VN={scheme:"https",domainHost:lx.domainHost,parse:cx,serialize:ux},Ya={scheme:"ws",domainHost:!0,parse:MN,serialize:LN},BN={scheme:"wss",domainHost:Ya.domainHost,parse:Ya.parse,serialize:Ya.serialize},HN={scheme:"urn",parse:ZN,serialize:FN,skipNormalize:!0,absolutePath:!0},WN={scheme:"urn:uuid",parse:qN,serialize:UN,skipNormalize:!0},GN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+=",JN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+,;:@",dx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+;:";function Qa(t,e=!1){let r=new Uint8Array(128);for(let s=0;s<t.length;s++)r[t.charCodeAt(s)]=1;let n=t.replace(/[\\\]^-]/gu,"\\$&"),o=e?`[${n}]|[^\\0-\\x7F\\uD800-\\uDFFF]`:`[${n}]`;return{all:new RegExp(`^(?:${o})*$`,"u"),table:r,allowNonAscii:e}}var KN=Qa(GN),fx=Qa(JN),YN=Qa(dx),XN=Qa(dx,!0),QN=/^[\da-f]{2}$/iu,e1=/^\[[\x21-\x5A\x5E-\x7E]*\]$/u,cf="URI mailto has an invalid recipient domain.",t1="URI mailto must not have an authority component.",ix=/[\uD800-\uDFFF]/u;function wr(t){if(typeof t!="string"||t.indexOf("%")===-1)return t;try{return decodeURIComponent(t)}catch{return t}}function ax(t){let e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r);if(n>=55296&&n<=56319&&r+1<t.length){let o=t.charCodeAt(r+1);if(o>=56320&&o<=57343){e+=t[r]+t[r+1],r++;continue}}e+=n>=55296&&n<=57343?"\uFFFD":t[r]}return e}function Es(t,e){if(e.all.test(t))return t;let r=e.table,n="";for(let o=0;o<t.length;o++){let s=t.charCodeAt(o);if(s<128){r[s]===1?n+=t[o]:s===37&&o+2<t.length&&QN.test(t.slice(o+1,o+3))?(n+="%"+t.slice(o+1,o+3).toUpperCase(),o+=2):n+=RN[s];continue}if(s<55296||s>57343){n+=e.allowNonAscii?t[o]:af(s);continue}if(s<=56319&&o+1<t.length){let i=t.charCodeAt(o+1);if(i>=56320&&i<=57343){n+=e.allowNonAscii?t[o]+t[o+1]:af(65536+(s-55296<<10)+(i-56320)),o++;continue}}n+=e.allowNonAscii?"\uFFFD":af(65533)}return n}function px(t,e,r){let n=String(t).toLowerCase();if(e1.test(n)||n!==""&&!DN(n))return n;try{let o=new URL("http://"+n);if(o.username||o.password||o.port||o.pathname!=="/"||o.search||o.hash||!o.hostname)throw new Error(cf);return e&&e.unicodeSupport?n:o.hostname}catch{return r&&(r.error=r.error||cf),n}}function r1(t,e){let r=e&&e.unicodeSupport?XN:YN;return t.length>1&&t[0]==="["&&t[t.length-1]==="]"?"["+Es(t.slice(1,-1),r)+"]":Es(t,r)}function n1(t,e){let r=t,n=r.path,o=r.query;n&&ix.test(n)&&(n=ax(n)),o&&ix.test(o)&&(o=ax(o));let s=n?n.indexOf(",")===-1?[n]:n.split(","):[];if(r.path=void 0,o){let i=null,a=0;for(;a<=o.length;){let c=o.indexOf("&",a);c===-1&&(c=o.length);let u=o.slice(a,c);a=c+1;let l=u.indexOf("=");if(l!==u.lastIndexOf("=")){r.error=r.error||"URI mailto has malformed header fields.";continue}let d=wr(l===-1?u:u.slice(0,l)),p=d.toLowerCase(),m=l===-1?"":u.slice(l+1);if(p==="to"){let f=m.split(",");for(let h=0;h<f.length;h++)s.push(f[h]);continue}if(p==="subject"){r.subject=wr(m);continue}if(p==="body"){r.body=wr(m);continue}i===null&&(i=Object.create(null)),i[d]=wr(m)}i!==null&&(r.headers=i)}r.query=void 0,s.length>0&&(r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&(r.userinfo=void 0,r.host=void 0,r.port=void 0,r.error=r.error||t1);for(let i=0;i<s.length;i++){let a=s[i],c=a.lastIndexOf("@");if(c<0){r.error=r.error||cf,s[i]=wr(a);continue}let u=wr(a.slice(0,c)),l=px(wr(a.slice(c+1)),e,r);s[i]=u+"@"+l}return s.length&&(r.to=s),r}function o1(t){return Es(t.replace(/%/gu,"%25"),fx)}function s1(t,e){let r=t,n=Array.isArray(r.to)?r.to.slice():[],o=r.headers&&typeof r.headers=="object"?Object.assign(Object.create(null),r.headers):Object.create(null),s=Object.create(null);for(let c in o){let u=c.toLowerCase();if(u==="to"){let l=String(o[c]).split(",");for(let d=0;d<l.length;d++)n.push(l[d])}else u==="subject"||u==="body"?s[u]=o[c]:s[c]=o[c]}if(r.subject!==void 0&&(s.subject=r.subject),r.body!==void 0&&(s.body=r.body),r.headers=s,n.length){r.userinfo=void 0,r.host=void 0,r.port=void 0;for(let c=0;c<n.length;c++){let u=String(n[c]),l=u.lastIndexOf("@"),d=l>=0?u.slice(0,l):u,p=l>=0?u.slice(l+1):"",m=Es(d,KN),f=wr(p),h=px(f,e);n[c]=m+"@"+r1(h,e)}r.path=n.join(","),e.skipEscape=!0}else r.path=void 0;let i="",a=0;for(let c in s)a++!==0&&(i+="&"),i+=o1(c)+"="+Es(String(s[c]),fx);return a!==0?r.query=i:r.headers=void 0,r}var i1={scheme:"mailto",parse:n1,serialize:s1,domainHost:!1,unicodeSupport:!0,skipNormalize:!0,absolutePath:!0},Xa={http:lx,https:VN,ws:Ya,wss:BN,urn:HN,"urn:uuid":WN,mailto:i1};Object.setPrototypeOf(Xa,null);function lf(t){return t&&(Xa[t]||Xa[t.toLowerCase()])||void 0}mx.exports={wsIsSecure:uf,SCHEMES:Xa,isValidSchemeName:jN,getSchemeHandler:lf}});var Cx=$((cH,sc)=>{"use strict";var{normalizeIPv6:bx,removeDotSegments:Ps,removeDotSegmentsRelative:wx,recomposeAuthority:a1,normalizePercentEncoding:ff,normalizePathEncoding:c1,serializePathEncoding:gx,normalizeQueryFragmentEncoding:yx,encodeQuery:u1,encodeFragment:l1,encodeHost:d1,isIPv4:xx,nonSimpleDomain:f1}=sf(),{SCHEMES:Sx,getSchemeHandler:nc}=hx(),$x=/^[A-Za-z][A-Za-z0-9+.-]*$/u,Ex="URI scheme is malformed.",ec="URI host is malformed.",p1=/[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;function _x(t){let e=String(t);if(!$x.test(e))throw new TypeError(Ex);return e}function m1(t,e){return typeof t=="string"?t=S1(t,e):typeof t=="object"&&(t=rc(sn(t,e),e)),t}function h1(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:s,malformedReferenceEdge:i,malformedPercentEncoding:a,malformedSchemeSpecific:c,malformedHost:u,malformedScheme:l}=tc(t,n),{parsed:d,malformedAuthorityOrPort:p,malformedReferenceEdge:m,malformedPercentEncoding:f,malformedSchemeSpecific:h,malformedHost:g,malformedScheme:y}=tc(e,n);if(s||p||i||m||a||f||c||h||u||g||l||y)throw new Error(o.error||d.error||"URI is malformed.");let v=kx(o,d,n,!0),x=nc(r&&r.scheme||v.scheme),S=v.host;if((v.scheme==="http"||v.scheme==="https")&&!S)throw new Error("HTTP URIs must have a host.");let E=S!==void 0&&S!==""&&(xx(S)||bx(S).isIPV6);if(zx(v,r||{},x,E))throw new Error(ec);Px(v,r||{},x,E);let C=S&&S.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(S);if(v.error&&!C)throw new Error(v.error);return n.skipEscape=!0,x&&x.absolutePath&&(n.absolutePath=!0),sn(v,n)}function df(t,e){t.host=e.host,e.ipv6Zone!==void 0&&(t.ipv6Zone=e.ipv6Zone)}function kx(t,e,r,n){let o={};if(n||(t=rc(sn(t,r),r),e=rc(sn(e,r),r)),r=r||{},!r.tolerant&&e.scheme){o.scheme=e.scheme,o.userinfo=e.userinfo,df(o,e),o.port=e.port;let s=nc(e.scheme);o.path=s&&s.absolutePath?e.path||"":Ps(e.path||""),o.query=e.query}else{if(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)o.userinfo=e.userinfo,df(o,e),o.port=e.port,o.path=Ps(e.path||""),o.query=e.query;else{if(!e.path)o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query;else{if(e.path[0]==="/")o.path=Ps(e.path);else{let s=t.userinfo!==void 0||t.host!==void 0||t.port!==void 0;s&&!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=t.scheme===void 0&&!s&&o.path[0]!=="/"?wx(o.path):Ps(o.path)}o.query=e.query}o.userinfo=t.userinfo,df(o,t),o.port=t.port}o.scheme=t.scheme}return o.fragment=e.fragment,o}function g1(t,e,r){let n=vx(t,r),o=vx(e,r);return n!==void 0&&o!==void 0&&n===o}function sn(t,e){let r={host:t.host,ipv6Zone:t.ipv6Zone,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,to:t.to,subject:t.subject,body:t.body,headers:t.headers,error:""},n=Object.assign({},e),o=[];r.scheme&&(r.scheme=_x(r.scheme));let s=nc(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n);let i=r.userinfo!==void 0||r.host!==void 0||r.port!==void 0,a=(r.scheme===void 0||n.reference==="suffix")&&!i,c=!n.skipEscape&&a;r.path!==void 0&&(n.skipEscape?r.path=ff(r.path):r.path=gx(r.path,c)),n.reference!=="suffix"&&r.scheme&&(r.scheme=_x(r.scheme),o.push(r.scheme,":"));let u=n.unicodeSupport===!0||!!(s&&s.unicodeSupport),l=a1(r,u);if(l!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(l),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let d=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(d=a&&d[0]!=="/"?wx(d):Ps(d)),a&&(d=gx(d,!0)),l===void 0&&d[0]==="/"&&d[1]==="/"&&(d="/%2F"+d.slice(2)),o.push(d)}return r.query!==void 0&&o.push("?",u1(r.query)),r.fragment!==void 0&&o.push("#",l1(r.fragment)),o.join("")}var y1=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,_1=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,v1=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function b1(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 ks(t){if(t===void 0)return!1;let e=t.indexOf("%");for(;e!==-1;){if(e+2>=t.length||!/^[\da-f]{2}$/iu.test(t.slice(e+1,e+3)))return!0;e=t.indexOf("%",e+3)}return!1}function oc(t){return t[0]==="["&&t[t.length-1]==="]"}function w1(t){let e=t[4];return ks(t[3])||e!==void 0&&!oc(e)&&ks(e)||ks(t[6])||ks(t[7])||ks(t[8])}function Px(t,e,r,n){let o=t.host&&t.host[0]==="["&&t.host[t.host.length-1]==="]";if(zx(t,e,r,n))return t.error=t.error||ec,!0;if(!e.unicodeSupport&&(!r||!r.unicodeSupport)&&t.host&&!oc(t.host)&&(e.domainHost||r&&r.domainHost)&&n===!1&&!o&&f1(t.host)){let s;try{s=new URL("http://"+t.host)}catch(i){return t.error=t.error||"Host's domain name can not be converted to ASCII: "+i,!0}if(!x1(s))return t.error=t.error||ec,!0;t.host=s.hostname}return!1}function zx(t,e,r,n){return!!(t.host&&n===!1&&!oc(t.host)&&(e.domainHost||r&&r.domainHost)&&p1.test(t.host))}function x1(t){return t.username===""&&t.password===""&&t.port===""&&t.pathname==="/"&&t.search===""&&t.hash===""&&t.hostname!==""}function tc(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=t.length!==0&&(t.charCodeAt(0)<=32||t.charCodeAt(t.length-1)<=32),i=!1,a=!1,c=!1,u=!1,l=!1,d=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let p=t.match(_1);p!==null&&p[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let m=t.match(v1);if(m!==null){let h=m[1],g=h.replace(/[\t\n\r]/g,"");g.length>=2&&(g.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):h.length!==g.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}s&&(n.error=n.error||"URI must not contain leading or trailing C0 controls or spaces.");let f=t.match(y1);if(f){n.scheme=f[1],n.userinfo=f[3],n.host=f[4],n.port=parseInt(f[5],10),n.path=f[6]||"",n.query=f[7],n.fragment=f[8],n.scheme!==void 0&&($x.test(n.scheme)?n.scheme=n.scheme.toLowerCase():(n.error=n.error||Ex,l=!0)),i=w1(f),i&&(n.error=n.error||"URI contains malformed percent-encoding."),isNaN(n.port)&&(n.port=f[5]);let h=b1(n,f);if(h!==void 0&&(n.error=n.error||h,o=!0),n.host)if(xx(n.host)===!1){let v=oc(n.host),x=n.host.indexOf("[")!==-1||n.host.indexOf("]")!==-1,S=bx(n.host);d=S.isIPV6||S.isIPVFuture===!0,u=x&&(!v||S.error===!0),n.host=d?S.host:S.host.toLowerCase(),d&&S.isIPV6===!0&&n.host.indexOf("%")!==-1&&(n.ipv6Zone=n.host.slice(n.host.indexOf("%")+1)),u&&(n.error=n.error||ec,o=!0)}else d=!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 g=nc(r.scheme||n.scheme);if(u||(c=Px(n,r,g,d)),n.host!==void 0&&!u){let y=n.host;if(t.indexOf("%")!==-1&&!d&&(y=ff(y,!0),y=ff(y.toLowerCase())),r.scheme!=="null"){let v=r.unicodeSupport===!0||!!(g&&g.unicodeSupport);n.host=d1(y,d,v)}else n.host=y}(!g||g&&!g.skipNormalize)&&(n.path&&(n.path=c1(n.path)),n.query&&(n.query=yx(n.query)),n.fragment&&(n.fragment=yx(n.fragment))),g&&g.parse&&(g.parse(n,r),g===Sx.urn&&n.nid===void 0&&(a=!0))}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o,malformedReferenceEdge:s,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:l}}function rc(t,e){return tc(t,e).parsed}function S1(t,e){return Tx(t,e).normalized}function Tx(t,e){let{parsed:r,malformedAuthorityOrPort:n,malformedReferenceEdge:o,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}=tc(t,e);return{normalized:n||o||s||i||a||c?t:sn(r,e),malformedAuthorityOrPort:n,malformedReferenceEdge:o,malformedPercentEncoding:s,malformedSchemeSpecific:i,malformedHost:a,malformedScheme:c}}function vx(t,e){if(typeof t!="string"&&typeof t!="object")return;let r;try{r=typeof t=="string"?t:sn(t,e)}catch{return}let{normalized:n,malformedAuthorityOrPort:o,malformedReferenceEdge:s,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:c,malformedScheme:u}=Tx(r,e);return o||s||i||a||c||u?void 0:n}var pf={SCHEMES:Sx,normalize:m1,resolve:h1,resolveComponent:kx,equal:g1,serialize:sn,parse:rc};sc.exports=pf;sc.exports.default=pf;sc.exports.fastUri=pf});var Ix=$(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});var Ox=Cx();Ox.code='require("ajv/dist/runtime/uri").default';mf.default=Ox});var Zx=$(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.CodeGen=Ae.Name=Ae.nil=Ae.stringify=Ae.str=Ae._=Ae.KeywordCxt=void 0;var $1=Ss();Object.defineProperty(Ae,"KeywordCxt",{enumerable:!0,get:function(){return $1.KeywordCxt}});var Hn=B();Object.defineProperty(Ae,"_",{enumerable:!0,get:function(){return Hn._}});Object.defineProperty(Ae,"str",{enumerable:!0,get:function(){return Hn.str}});Object.defineProperty(Ae,"stringify",{enumerable:!0,get:function(){return Hn.stringify}});Object.defineProperty(Ae,"nil",{enumerable:!0,get:function(){return Hn.nil}});Object.defineProperty(Ae,"Name",{enumerable:!0,get:function(){return Hn.Name}});Object.defineProperty(Ae,"CodeGen",{enumerable:!0,get:function(){return Hn.CodeGen}});var E1=Ha(),jx=$s(),k1=Ad(),zs=Ga(),P1=B(),Ts=bs(),ic=vs(),gf=X(),Rx=Yw(),z1=Ix(),Mx=(t,e)=>new RegExp(t,e);Mx.code="new RegExp";var T1=["removeAdditional","useDefaults","coerceTypes"],C1=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),O1={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."},I1={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Dx=200;function R1(t){var e,r,n,o,s,i,a,c,u,l,d,p,m,f,h,g,y,v,x,S,E,C,A,re,F;let ie=t.strict,$e=(e=t.code)===null||e===void 0?void 0:e.optimize,be=$e===!0||$e===void 0?1:$e||0,Ce=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Mx,We=(o=t.uriResolver)!==null&&o!==void 0?o:z1.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:ie)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:ie)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:ie)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:ie)!==null&&p!==void 0?p:"log",strictRequired:(f=(m=t.strictRequired)!==null&&m!==void 0?m:ie)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:be,regExp:Ce}:{optimize:be,regExp:Ce},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Dx,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Dx,meta:(y=t.meta)!==null&&y!==void 0?y:!0,messages:(v=t.messages)!==null&&v!==void 0?v:!0,inlineRefs:(x=t.inlineRefs)!==null&&x!==void 0?x:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(E=t.addUsedSchema)!==null&&E!==void 0?E:!0,validateSchema:(C=t.validateSchema)!==null&&C!==void 0?C:!0,validateFormats:(A=t.validateFormats)!==null&&A!==void 0?A:!0,unicodeRegExp:(re=t.unicodeRegExp)!==null&&re!==void 0?re:!0,int32range:(F=t.int32range)!==null&&F!==void 0?F:!0,uriResolver:We}}var Cs=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,...R1(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new P1.ValueScope({scope:{},prefixes:C1,es5:r,lines:n}),this.logger=L1(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,k1.getRules)(),Ax.call(this,O1,e,"NOT SUPPORTED"),Ax.call(this,I1,e,"DEPRECATED","warn"),this._metaOpts=j1.call(this),e.formats&&A1.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&N1.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),D1.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Rx;n==="id"&&(o={...Rx},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 p=this._addSchema(l,d);return p.validate||i.call(this,p)}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 jx.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,Ts.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=Nx.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new zs.SchemaEnv({schema:{},schemaId:n});if(r=zs.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=Nx.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,Ts.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(F1.call(this,n,r),!r)return(0,gf.eachItem)(n,s=>hf.call(this,s)),this;U1.call(this,r);let o={...r,type:(0,ic.getJSONTypes)(r.type),schemaType:(0,ic.getJSONTypes)(r.schemaType)};return(0,gf.eachItem)(n,o.type.length===0?s=>hf.call(this,s,o):s=>o.type.forEach(i=>hf.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]=Lx(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,Ts.normalizeId)(i||n);let u=Ts.getSchemaRefs.call(this,e,n);return c=new zs.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):zs.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{zs.compileSchema.call(this,e)}finally{this.opts=r}}};Cs.ValidationError=E1.default;Cs.MissingRefError=jx.default;Ae.default=Cs;function Ax(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 Nx(t){return t=(0,Ts.normalizeId)(t),this.schemas[t]||this.refs[t]}function D1(){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 A1(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function N1(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 j1(){let t={...this.opts};for(let e of T1)delete t[e];return t}var M1={log(){},warn(){},error(){}};function L1(t){if(t===!1)return M1;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 Z1=/^[a-z_$][a-z0-9_$:-]*$/i;function F1(t,e){let{RULES:r}=this;if((0,gf.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!Z1.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 hf(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,ic.getJSONTypes)(e.type),schemaType:(0,ic.getJSONTypes)(e.schemaType)}};e.before?q1.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 q1(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 U1(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Lx(e)),t.validateSchema=this.compile(e,!0))}var V1={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Lx(t){return{anyOf:[t,V1]}}});var Fx=$(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var B1={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};yf.default=B1});var Bx=$(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.callRef=an.getValidate=void 0;var H1=$s(),qx=ht(),et=B(),Wn=tr(),Ux=Ga(),ac=X(),W1={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=Ux.resolveRef.call(c,u,o,r);if(l===void 0)throw new H1.default(n.opts.uriResolver,o,r);if(l instanceof Ux.SchemaEnv)return p(l);return m(l);function d(){if(s===u)return cc(t,i,s,s.$async);let f=e.scopeValue("root",{ref:u});return cc(t,(0,et._)`${f}.validate`,u,u.$async)}function p(f){let h=Vx(t,f);cc(t,h,f,f.$async)}function m(f){let h=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,et.stringify)(f)}:{ref:f}),g=e.name("valid"),y=t.subschema({schema:f,dataTypes:[],schemaPath:et.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(y),t.ok(g)}}};function Vx(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,et._)`${r.scopeValue("wrapper",{ref:e})}.validate`}an.getValidate=Vx;function cc(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?Wn.default.this:et.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,et._)`await ${(0,qx.callValidateCode)(t,e,u)}`),m(e),i||o.assign(f,!0)},h=>{o.if((0,et._)`!(${h} instanceof ${s.ValidationError})`,()=>o.throw(h)),p(h),i||o.assign(f,!1)}),t.ok(f)}function d(){t.result((0,qx.callValidateCode)(t,e,u),()=>m(e),()=>p(e))}function p(f){let h=(0,et._)`${f}.errors`;o.assign(Wn.default.vErrors,(0,et._)`${Wn.default.vErrors} === null ? ${h} : ${Wn.default.vErrors}.concat(${h})`),o.assign(Wn.default.errors,(0,et._)`${Wn.default.vErrors}.length`)}function m(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=ac.mergeEvaluated.props(o,g.props,s.props));else{let y=o.var("props",(0,et._)`${f}.evaluated.props`);s.props=ac.mergeEvaluated.props(o,y,s.props,et.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=ac.mergeEvaluated.items(o,g.items,s.items));else{let y=o.var("items",(0,et._)`${f}.evaluated.items`);s.items=ac.mergeEvaluated.items(o,y,s.items,et.Name)}}}an.callRef=cc;an.default=W1});var Hx=$(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});var G1=Fx(),J1=Bx(),K1=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",G1.default,J1.default];_f.default=K1});var Wx=$(vf=>{"use strict";Object.defineProperty(vf,"__esModule",{value:!0});var uc=B(),xr=uc.operators,lc={maximum:{okStr:"<=",ok:xr.LTE,fail:xr.GT},minimum:{okStr:">=",ok:xr.GTE,fail:xr.LT},exclusiveMaximum:{okStr:"<",ok:xr.LT,fail:xr.GTE},exclusiveMinimum:{okStr:">",ok:xr.GT,fail:xr.LTE}},Y1={message:({keyword:t,schemaCode:e})=>(0,uc.str)`must be ${lc[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,uc._)`{comparison: ${lc[t].okStr}, limit: ${e}}`},X1={keyword:Object.keys(lc),type:"number",schemaType:"number",$data:!0,error:Y1,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,uc._)`${r} ${lc[e].fail} ${n} || isNaN(${r})`)}};vf.default=X1});var Gx=$(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});var Os=B(),Q1={message:({schemaCode:t})=>(0,Os.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,Os._)`{multipleOf: ${t}}`},ej={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:Q1,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,Os._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,Os._)`${i} !== parseInt(${i})`;t.fail$data((0,Os._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};bf.default=ej});var Kx=$(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});function Jx(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}wf.default=Jx;Jx.code='require("ajv/dist/runtime/ucs2length").default'});var Yx=$(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});var cn=B(),tj=X(),rj=Kx(),nj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,cn.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,cn._)`{limit: ${t}}`},oj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:nj,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?cn.operators.GT:cn.operators.LT,i=o.opts.unicode===!1?(0,cn._)`${r}.length`:(0,cn._)`${(0,tj.useFunc)(t.gen,rj.default)}(${r})`;t.fail$data((0,cn._)`${i} ${s} ${n}`)}};xf.default=oj});var Xx=$(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});var sj=ht(),ij=X(),Gn=B(),aj={message:({schemaCode:t})=>(0,Gn.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Gn._)`{pattern: ${t}}`},cj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:aj,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,Gn._)`new RegExp`:(0,ij.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Gn._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Gn._)`!${l}`)}else{let c=(0,sj.usePattern)(t,o);t.fail$data((0,Gn._)`!${c}.test(${r})`)}}};Sf.default=cj});var Qx=$($f=>{"use strict";Object.defineProperty($f,"__esModule",{value:!0});var Is=B(),uj={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}}`},lj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:uj,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}`)}};$f.default=lj});var e0=$(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});var Rs=ht(),Ds=B(),dj=X(),fj={message:({params:{missingProperty:t}})=>(0,Ds.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,Ds._)`{missingProperty: ${t}}`},pj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:fj,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 m=t.parentSchema.properties,{definedProperties:f}=t.it;for(let h of r)if(m?.[h]===void 0&&!f.has(h)){let g=i.schemaEnv.baseId+i.errSchemaPath,y=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,dj.checkStrictMode)(i,y,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(Ds.nil,d);else for(let m of r)(0,Rs.checkReportMissingProp)(t,m)}function l(){let m=e.let("missing");if(c||s){let f=e.let("valid",!0);t.block$data(f,()=>p(m,f)),t.ok(f)}else e.if((0,Rs.checkMissingProp)(t,r,m)),(0,Rs.reportMissingProp)(t,m),e.else()}function d(){e.forOf("prop",n,m=>{t.setParams({missingProperty:m}),e.if((0,Rs.noPropertyInData)(e,o,m,a.ownProperties),()=>t.error())})}function p(m,f){t.setParams({missingProperty:m}),e.forOf(m,n,()=>{e.assign(f,(0,Rs.propertyInData)(e,o,m,a.ownProperties)),e.if((0,Ds.not)(f),()=>{t.error(),e.break()})},Ds.nil)}}};Ef.default=pj});var t0=$(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});var As=B(),mj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,As.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,As._)`{limit: ${t}}`},hj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:mj,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?As.operators.GT:As.operators.LT;t.fail$data((0,As._)`${r}.length ${o} ${n}`)}};kf.default=hj});var dc=$(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});var r0=Ud();r0.code='require("ajv/dist/runtime/equal").default';Pf.default=r0});var n0=$(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});var zf=vs(),Ne=B(),gj=X(),yj=dc(),_j={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}}`},vj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:_j,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,zf.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()?p:m)(f,h))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function p(f,h){let g=e.name("item"),y=(0,zf.checkDataTypes)(u,g,a.opts.strictNumbers,zf.DataType.Wrong),v=e.const("indices",(0,Ne._)`{}`);e.for((0,Ne._)`;${f}--;`,()=>{e.let(g,(0,Ne._)`${r}[${f}]`),e.if(y,(0,Ne._)`continue`),u.length>1&&e.if((0,Ne._)`typeof ${g} == "string"`,(0,Ne._)`${g} += "_"`),e.if((0,Ne._)`typeof ${v}[${g}] == "number"`,()=>{e.assign(h,(0,Ne._)`${v}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,Ne._)`${v}[${g}] = ${f}`)})}function m(f,h){let g=(0,gj.useFunc)(e,yj.default),y=e.name("outer");e.label(y).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(y)})))}}};Tf.default=vj});var o0=$(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});var Cf=B(),bj=X(),wj=dc(),xj={message:"must be equal to constant",params:({schemaCode:t})=>(0,Cf._)`{allowedValue: ${t}}`},Sj={keyword:"const",$data:!0,error:xj,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Cf._)`!${(0,bj.useFunc)(e,wj.default)}(${r}, ${o})`):t.fail((0,Cf._)`${s} !== ${r}`)}};Of.default=Sj});var s0=$(If=>{"use strict";Object.defineProperty(If,"__esModule",{value:!0});var Ns=B(),$j=X(),Ej=dc(),kj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Ns._)`{allowedValues: ${t}}`},Pj={keyword:"enum",schemaType:"array",$data:!0,error:kj,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,$j.useFunc)(e,Ej.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 m=e.const("vSchema",s);l=(0,Ns.or)(...o.map((f,h)=>p(m,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,m=>e.if((0,Ns._)`${u()}(${r}, ${m})`,()=>e.assign(l,!0).break()))}function p(m,f){let h=o[f];return typeof h=="object"&&h!==null?(0,Ns._)`${u()}(${r}, ${m}[${f}])`:(0,Ns._)`${r} === ${h}`}}};If.default=Pj});var i0=$(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});var zj=Wx(),Tj=Gx(),Cj=Yx(),Oj=Xx(),Ij=Qx(),Rj=e0(),Dj=t0(),Aj=n0(),Nj=o0(),jj=s0(),Mj=[zj.default,Tj.default,Cj.default,Oj.default,Ij.default,Rj.default,Dj.default,Aj.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Nj.default,jj.default];Rf.default=Mj});var Af=$(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.validateAdditionalItems=void 0;var un=B(),Df=X(),Lj={message:({params:{len:t}})=>(0,un.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,un._)`{limit: ${t}}`},Zj={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:Lj,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,Df.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}a0(t,n)}};function a0(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,un._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,un._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,Df.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,un._)`${a} <= ${e.length}`);r.if((0,un.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:Df.Type.Num},u),i.allErrors||r.if((0,un.not)(u),()=>r.break())})}}js.validateAdditionalItems=a0;js.default=Zj});var Nf=$(Ms=>{"use strict";Object.defineProperty(Ms,"__esModule",{value:!0});Ms.validateTuple=void 0;var c0=B(),fc=X(),Fj=ht(),qj={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return u0(t,"additionalItems",e);r.items=!0,!(0,fc.alwaysValidSchema)(r,e)&&t.ok((0,Fj.validateArray)(t))}};function u0(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=fc.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,c0._)`${s}.length`);r.forEach((d,p)=>{(0,fc.alwaysValidSchema)(a,d)||(n.if((0,c0._)`${u} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},c)),t.ok(c))});function l(d){let{opts:p,errSchemaPath:m}=a,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(p.strictTuples&&!h){let g=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${m}"`;(0,fc.checkStrictMode)(a,g,p.strictTuples)}}}Ms.validateTuple=u0;Ms.default=qj});var l0=$(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});var Uj=Nf(),Vj={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,Uj.validateTuple)(t,"items")};jf.default=Vj});var f0=$(Mf=>{"use strict";Object.defineProperty(Mf,"__esModule",{value:!0});var d0=B(),Bj=X(),Hj=ht(),Wj=Af(),Gj={message:({params:{len:t}})=>(0,d0.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,d0._)`{limit: ${t}}`},Jj={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Gj,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,Bj.alwaysValidSchema)(n,e)&&(o?(0,Wj.validateAdditionalItems)(t,o):t.ok((0,Hj.validateArray)(t)))}};Mf.default=Jj});var p0=$(Lf=>{"use strict";Object.defineProperty(Lf,"__esModule",{value:!0});var yt=B(),pc=X(),Kj={message:({params:{min:t,max:e}})=>e===void 0?(0,yt.str)`must contain at least ${t} valid item(s)`:(0,yt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,yt._)`{minContains: ${t}}`:(0,yt._)`{minContains: ${t}, maxContains: ${e}}`},Yj={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Kj,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,yt._)`${o}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,pc.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,pc.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,pc.alwaysValidSchema)(s,r)){let h=(0,yt._)`${l} >= ${i}`;a!==void 0&&(h=(0,yt._)`${h} && ${l} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?m(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,yt._)`${o}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let h=e.name("_valid"),g=e.let("count",0);m(h,()=>e.if(h,()=>f(g)))}function m(h,g){e.forRange("i",0,l,y=>{t.subschema({keyword:"contains",dataProp:y,dataPropType:pc.Type.Num,compositeRule:!0},h),g()})}function f(h){e.code((0,yt._)`${h}++`),a===void 0?e.if((0,yt._)`${h} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,yt._)`${h} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,yt._)`${h} >= ${i}`,()=>e.assign(d,!0)))}}};Lf.default=Yj});var g0=$(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.validateSchemaDeps=Mt.validatePropertyDeps=Mt.error=void 0;var Zf=B(),Xj=X(),Ls=ht();Mt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Zf.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Zf._)`{property: ${t},
29
29
  missingProperty: ${n},
30
30
  depsCount: ${e},
31
- deps: ${r}}`};var VA={keyword:"dependencies",type:"object",schemaType:"object",error:Dt.error,code(t){let[e,r]=BA(t);yw(t,e),_w(t,r)}};function BA({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 yw(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,_s.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,_s.checkReportMissingProp)(t,u)}):(r.if((0,Rd._)`${c} && (${(0,_s.checkMissingProp)(t,a,s)})`),(0,_s.reportMissingProp)(t,s),r.else())}}Dt.validatePropertyDeps=yw;function _w(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,UA.alwaysValidSchema)(s,e[a])||(r.if((0,_s.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))}Dt.validateSchemaDeps=_w;Dt.default=VA});var ww=$(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var bw=F(),HA=Q(),WA={message:"property name must be valid",params:({params:t})=>(0,bw._)`{propertyName: ${t.propertyName}}`},GA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:WA,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,HA.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,bw.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Dd.default=GA});var Nd=$(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var xa=ft(),zt=F(),JA=Jt(),Sa=Q(),KA={message:"must NOT have additional properties",params:({params:t})=>(0,zt._)`{additionalProperty: ${t.additionalProperty}}`},YA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:KA,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,Sa.alwaysValidSchema)(i,r))return;let u=(0,xa.allSchemaProperties)(n.properties),l=(0,xa.allSchemaProperties)(n.patternProperties);d(),t.ok((0,zt._)`${s} === ${JA.default.errors}`);function d(){e.forIn("key",o,g=>{!u.length&&!l.length?f(g):e.if(p(g),()=>f(g))})}function p(g){let _;if(u.length>8){let x=(0,Sa.schemaRefOrVal)(i,n.properties,"properties");_=(0,xa.isOwnProperty)(e,x,g)}else u.length?_=(0,zt.or)(...u.map(x=>(0,zt._)`${g} === ${x}`)):_=zt.nil;return l.length&&(_=(0,zt.or)(_,...l.map(x=>(0,zt._)`${(0,xa.usePattern)(t,x)}.test(${g})`))),(0,zt.not)(_)}function m(g){e.code((0,zt._)`delete ${o}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Sa.alwaysValidSchema)(i,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),e.if((0,zt.not)(_),()=>{t.reset(),m(g)})):(h(g,_),a||e.if((0,zt.not)(_),()=>e.break()))}}function h(g,_,x){let w={keyword:"additionalProperties",dataProp:g,dataPropType:Sa.Type.Str};x===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,_)}}};Ad.default=YA});var $w=$(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var QA=os(),xw=ft(),jd=Q(),Sw=Nd(),XA={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&&Sw.default.code(new QA.KeywordCxt(s,Sw.default,"additionalProperties"));let i=(0,xw.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=jd.mergeEvaluated.props(e,(0,jd.toHash)(i),s.props));let a=i.filter(d=>!(0,jd.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,xw.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)}}};Md.default=XA});var Pw=$(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var kw=ft(),$a=F(),Ew=Q(),zw=Q(),eN={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,kw.allSchemaProperties)(r),c=a.filter(h=>(0,Ew.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 $a.Name)&&(s.props=(0,zw.evaluatedPropsToName)(e,s.props));let{props:d}=s;p();function p(){for(let h of a)u&&m(h),s.allErrors?f(h):(e.var(l,!0),f(h),e.if(l))}function m(h){for(let g in u)new RegExp(h).test(g)&&(0,Ew.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,$a._)`${(0,kw.usePattern)(t,h)}.test(${g})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:zw.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,$a._)`${d}[${g}]`,!0):!_&&!s.allErrors&&e.if((0,$a.not)(l),()=>e.break())})})}}};Ld.default=eN});var Tw=$(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var tN=Q(),rN={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,tN.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"}};Zd.default=rN});var Cw=$(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var nN=ft(),oN={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:nN.validateUnion,error:{message:"must match a schema in anyOf"}};qd.default=oN});var Ow=$(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var ka=F(),sN=Q(),iN={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ka._)`{passingSchemas: ${t.passing}}`},aN={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:iN,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 p;(0,sN.alwaysValidSchema)(o,l)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ka._)`${c} && ${i}`).assign(i,!1).assign(a,(0,ka._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,ka.Name)})})}}};Fd.default=aN});var Iw=$(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var cN=Q(),uN={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,cN.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};Ud.default=uN});var Aw=$(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var Ea=F(),Dw=Q(),lN={message:({params:t})=>(0,Ea.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ea._)`{failingKeyword: ${t.ifClause}}`},dN={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:lN,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Dw.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Rw(n,"then"),s=Rw(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,Ea.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 p=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(p,i),d?e.assign(d,(0,Ea._)`${l}`):t.setParams({ifClause:l})}}}};function Rw(t,e){let r=t.schema[e];return r!==void 0&&!(0,Dw.alwaysValidSchema)(t,r)}Vd.default=dN});var Nw=$(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var fN=Q(),pN={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,fN.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Bd.default=pN});var jw=$(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var mN=Pd(),hN=pw(),gN=Td(),yN=hw(),_N=gw(),vN=vw(),bN=ww(),wN=Nd(),xN=$w(),SN=Pw(),$N=Tw(),kN=Cw(),EN=Ow(),zN=Iw(),PN=Aw(),TN=Nw();function CN(t=!1){let e=[$N.default,kN.default,EN.default,zN.default,PN.default,TN.default,bN.default,wN.default,vN.default,xN.default,SN.default];return t?e.push(hN.default,yN.default):e.push(mN.default,gN.default),e.push(_N.default),e}Hd.default=CN});var Mw=$(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var ke=F(),ON={message:({schemaCode:t})=>(0,ke.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ke._)`{format: ${t}}`},IN={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:ON,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?p():m();function p(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,ke._)`${f}[${i}]`),g=r.let("fType"),_=r.let("format");r.if((0,ke._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,ke._)`${h}.type || "string"`).assign(_,(0,ke._)`${h}.validate`),()=>r.assign(g,(0,ke._)`"string"`).assign(_,h)),t.fail$data((0,ke.or)(x(),w()));function x(){return c.strictSchema===!1?ke.nil:(0,ke._)`${i} && !${_}`}function w(){let S=l.$async?(0,ke._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,ke._)`${_}(${n})`,k=(0,ke._)`(typeof ${_} == "function" ? ${S} : ${_}.test(${n}))`;return(0,ke._)`${_} && ${_} !== true && ${g} === ${e} && !${k}`}}function m(){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,ke.regexpCode)(k):c.code.formats?(0,ke._)`${c.code.formats}${(0,ke.getProperty)(s)}`:void 0,L=r.scopeValue("formats",{key:s,ref:k,code:W});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,ke._)`${L}.validate`]:["string",k,L]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,ke._)`await ${_}(${n})`}return typeof g=="function"?(0,ke._)`${_}(${n})`:(0,ke._)`${_}.test(${n})`}}}};Wd.default=IN});var Lw=$(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var RN=Mw(),DN=[RN.default];Gd.default=DN});var Zw=$(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 Fw=$(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var AN=Jb(),NN=uw(),jN=jw(),MN=Lw(),qw=Zw(),LN=[AN.default,NN.default,(0,jN.default)(),MN.default,qw.metadataVocabulary,qw.contentVocabulary];Jd.default=LN});var Vw=$(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.DiscrError=void 0;var Uw;(function(t){t.Tag="tag",t.Mapping="mapping"})(Uw||(za.DiscrError=Uw={}))});var Hw=$(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var jn=F(),Kd=Vw(),Bw=aa(),ZN=ss(),qN=Q(),FN={message:({params:{discrError:t,tagName:e}})=>t===Kd.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,jn._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},UN={keyword:"discriminator",type:"object",schemaType:"object",error:FN,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,jn._)`${r}${(0,jn.getProperty)(a)}`);e.if((0,jn._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Kd.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let m=p();e.if(!1);for(let f in m)e.elseIf((0,jn._)`${u} === ${f}`),e.assign(c,d(m[f]));e.else(),t.error(!1,{discrError:Kd.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(m){let f=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:m},f);return t.mergeEvaluated(h,jn.Name),f}function p(){var m;let f={},h=_(o),g=!0;for(let S=0;S<i.length;S++){let k=i[S];if(k?.$ref&&!(0,qN.schemaHasRulesButRef)(k,s.self.RULES)){let L=k.$ref;if(k=Bw.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,L),k instanceof Bw.SchemaEnv&&(k=k.schema),k===void 0)throw new ZN.default(s.opts.uriResolver,s.baseId,L)}let W=(m=k?.properties)===null||m===void 0?void 0:m[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}}}};Yd.default=UN});var Ww=$((xU,VN)=>{VN.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 Xd=$((pe,Qd)=>{"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 BN=Ub(),HN=Fw(),WN=Hw(),Gw=Ww(),GN=["/properties"],Pa="http://json-schema.org/draft-07/schema",Mn=class extends BN.default{_addVocabularies(){super._addVocabularies(),HN.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(WN.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Gw,GN):Gw;this.addMetaSchema(e,Pa,!1),this.refs["http://json-schema.org/schema"]=Pa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Pa)?Pa:void 0)}};pe.Ajv=Mn;Qd.exports=pe=Mn;Qd.exports.Ajv=Mn;Object.defineProperty(pe,"__esModule",{value:!0});pe.default=Mn;var JN=os();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return JN.KeywordCxt}});var Ln=F();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return Ln._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return Ln.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return Ln.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return Ln.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return Ln.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return Ln.CodeGen}});var KN=sa();Object.defineProperty(pe,"ValidationError",{enumerable:!0,get:function(){return KN.default}});var YN=ss();Object.defineProperty(pe,"MissingRefError",{enumerable:!0,get:function(){return YN.default}})});var rx=$(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.formatNames=Nt.fastFormats=Nt.fullFormats=void 0;function At(t,e){return{validate:t,compare:e}}Nt.fullFormats={date:At(Qw,nf),time:At(tf(!0),of),"date-time":At(Jw(!0),ex),"iso-time":At(tf(),Xw),"iso-date-time":At(Jw(),tx),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:n1,"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:l1,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:o1,int32:{type:"number",validate:a1},int64:{type:"number",validate:c1},float:{type:"number",validate:Yw},double:{type:"number",validate:Yw},password:!0,binary:!0};Nt.fastFormats={...Nt.fullFormats,date:At(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,nf),time:At(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,of),"date-time":At(/^\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,ex),"iso-time":At(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Xw),"iso-date-time":At(/^\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,tx),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 QN(t){return t%4===0&&(t%100!==0||t%400===0)}var XN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,e1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Qw(t){let e=XN.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&&QN(r)?29:e1[n])}function nf(t,e){if(t&&e)return t>e?1:t<e?-1:0}var ef=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function tf(t){return function(r){let n=ef.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,p=o-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61}}function of(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 Xw(t,e){if(!(t&&e))return;let r=ef.exec(t),n=ef.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 rf=/t|\s/i;function Jw(t){let e=tf(t);return function(n){let o=n.split(rf);return o.length===2&&Qw(o[0])&&e(o[1])}}function ex(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function tx(t,e){if(!(t&&e))return;let[r,n]=t.split(rf),[o,s]=e.split(rf),i=nf(r,o);if(i!==void 0)return i||of(n,s)}var t1=/\/|:/,r1=/^(?:[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 n1(t){return t1.test(t)&&r1.test(t)}var Kw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function o1(t){return Kw.lastIndex=0,Kw.test(t)}var s1=-(2**31),i1=2**31-1;function a1(t){return Number.isInteger(t)&&t<=i1&&t>=s1}function c1(t){return Number.isInteger(t)}function Yw(){return!0}var u1=/[^\\]\\Z/;function l1(t){if(u1.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var nx=$(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.formatLimitDefinition=void 0;var d1=Xd(),Pt=F(),gr=Pt.operators,Ta={formatMaximum:{okStr:"<=",ok:gr.LTE,fail:gr.GT},formatMinimum:{okStr:">=",ok:gr.GTE,fail:gr.LT},formatExclusiveMaximum:{okStr:"<",ok:gr.LT,fail:gr.GTE},formatExclusiveMinimum:{okStr:">",ok:gr.GT,fail:gr.LTE}},f1={message:({keyword:t,schemaCode:e})=>(0,Pt.str)`should be ${Ta[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Pt._)`{comparison: ${Ta[t].okStr}, limit: ${e}}`};Zn.formatLimitDefinition={keyword:Object.keys(Ta),type:"string",schemaType:"string",$data:!0,error:f1,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 d1.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),m=e.const("fmt",(0,Pt._)`${p}[${c.schemaCode}]`);t.fail$data((0,Pt.or)((0,Pt._)`typeof ${m} != "object"`,(0,Pt._)`${m} instanceof RegExp`,(0,Pt._)`typeof ${m}.compare != "function"`,d(m)))}function l(){let p=c.schema,m=a.formats[p];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${o}": format "${p}" does not define "compare" function`);let f=e.scopeValue("formats",{key:p,ref:m,code:i.code.formats?(0,Pt._)`${i.code.formats}${(0,Pt.getProperty)(p)}`:void 0});t.fail$data(d(f))}function d(p){return(0,Pt._)`${p}.compare(${r}, ${n}) ${Ta[o].fail} 0`}},dependencies:["format"]};var p1=t=>(t.addKeyword(Zn.formatLimitDefinition),t);Zn.default=p1});var ax=$((vs,ix)=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var qn=rx(),m1=nx(),sf=F(),ox=new sf.Name("fullFormats"),h1=new sf.Name("fastFormats"),af=(t,e={keywords:!0})=>{if(Array.isArray(e))return sx(t,e,qn.fullFormats,ox),t;let[r,n]=e.mode==="fast"?[qn.fastFormats,h1]:[qn.fullFormats,ox],o=e.formats||qn.formatNames;return sx(t,o,r,n),e.keywords&&(0,m1.default)(t),t};af.get=(t,e="full")=>{let n=(e==="fast"?qn.fastFormats:qn.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function sx(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,sf._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}ix.exports=vs=af;Object.defineProperty(vs,"__esModule",{value:!0});vs.default=af});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 Fa;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Fa||(Fa={}));var z=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yt=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"]),xx=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 to=(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}},hf=to;function Sx(t){hf=t}function $s(){return hf}var ks=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}},$x=[];function T(t,e){let r=ks({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$s(),to].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 N;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 N;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}}},N=Object.freeze({status:"aborted"}),gf=t=>({status:"dirty",value:t}),Ze=t=>({status:"valid",value:t}),Ua=t=>t.status==="aborted",Va=t=>t.status==="dirty",ro=t=>t.status==="valid",Es=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 st=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}},pf=(t,e)=>{if(ro(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 Yt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Yt(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:Yt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Es(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:Yt(e)},s=this._parseSync({data:e,path:o.path,parent:o});return pf(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:Yt(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Es(o)?o:Promise.resolve(o));return pf(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:D.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return yt.create(this,this._def)}nullable(){return Lt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mt.create(this,this._def)}promise(){return er.create(this,this._def)}or(e){return kr.create([this,e],this._def)}and(e){return Er.create(this,e,this._def)}transform(e){return new Xe({...j(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Or({...j(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new Cs({typeName:D.ZodBranded,type:this,...j(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new sn({...j(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return no.create(this,e)}readonly(){return cn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},kx=/^c[^\s-]{8,}$/i,Ex=/^[a-z][a-z0-9]*$/,zx=/^[0-9A-HJKMNP-TV-Z]{26}$/,Px=/^[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,Tx=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qa,Ox=/^(((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}))$/,Ix=/^(([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})))$/,Rx=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 Dx(t,e){return!!((e==="v4"||!e)&&Ox.test(t)||(e==="v6"||!e)&&Ix.test(t))}var Qt=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}),N}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")Tx.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")qa||(qa=new RegExp(Cx,"u")),qa.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")Px.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")kx.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")Ex.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")zx.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"?Rx(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"?Dx(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}};Qt.create=t=>{var e;return new Qt({checks:[],typeName:D.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};function Ax(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 vr=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}),N}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"?Ax(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)}};vr.create=t=>new vr({checks:[],typeName:D.ZodNumber,coerce:t?.coerce||!1,...j(t)});var br=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}),N}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}};br.create=t=>{var e;return new br({checks:[],typeName:D.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};var wr=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}),N}return Ze(e.data)}};wr.create=t=>new wr({typeName:D.ZodBoolean,coerce:t?.coerce||!1,...j(t)});var xr=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}),N}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),N}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}};xr.create=t=>new xr({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...j(t)});var tn=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}),N}return Ze(e.data)}};tn.create=t=>new tn({typeName:D.ZodSymbol,...j(t)});var Sr=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}),N}return Ze(e.data)}};Sr.create=t=>new Sr({typeName:D.ZodUndefined,...j(t)});var $r=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}),N}return Ze(e.data)}};$r.create=t=>new $r({typeName:D.ZodNull,...j(t)});var Xt=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return Ze(e.data)}};Xt.create=t=>new Xt({typeName:D.ZodAny,...j(t)});var jt=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ze(e.data)}};jt.create=t=>new jt({typeName:D.ZodUnknown,...j(t)});var _t=class extends M{_parse(e){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:z.never,received:r.parsedType}),N}};_t.create=t=>new _t({typeName:D.ZodNever,...j(t)});var rn=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}),N}return Ze(e.data)}};rn.create=t=>new rn({typeName:D.ZodVoid,...j(t)});var Mt=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}),N;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 st(r,i,r.path,a)))).then(i=>Ae.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new st(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)}};Mt.create=(t,e)=>new Mt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...j(e)});function en(t){if(t instanceof He){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=yt.create(en(n))}return new He({...t._def,shape:()=>e})}else return t instanceof Mt?new Mt({...t._def,type:en(t.element)}):t instanceof yt?yt.create(en(t.unwrap())):t instanceof Lt?Lt.create(en(t.unwrap())):t instanceof Tt?Tt.create(t.items.map(e=>en(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}),N}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof _t&&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 st(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof _t){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 st(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:D.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 en(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 yt;)s=s._def.innerType;r[n]=s}}),new t({...this._def,shape:()=>r})}keyof(){return yf(te.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:_t.create(),typeName:D.ZodObject,...j(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:_t.create(),typeName:D.ZodObject,...j(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:_t.create(),typeName:D.ZodObject,...j(e)});var kr=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}),N}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}),N}}get options(){return this._def.options}};kr.create=(t,e)=>new kr({options:t,typeName:D.ZodUnion,...j(e)});var Ss=t=>t instanceof zr?Ss(t.schema):t instanceof Xe?Ss(t.innerType()):t instanceof Pr?[t.value]:t instanceof Tr?t.options:t instanceof Cr?Object.keys(t.enum):t instanceof Or?Ss(t._def.innerType):t instanceof Sr?[void 0]:t instanceof $r?[null]:null,zs=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}),N;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]}),N)}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=Ss(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:D.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...j(n)})}};function Ba(t,e){let r=Yt(t),n=Yt(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=Ba(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=Ba(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 Er=class extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,i)=>{if(Ua(s)||Ua(i))return N;let a=Ba(s.value,i.value);return a.valid?((Va(s)||Va(i))&&r.dirty(),{status:r.value,value:a.data}):(T(n,{code:E.invalid_intersection_types}),N)};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}))}};Er.create=(t,e,r)=>new Er({left:t,right:e,typeName:D.ZodIntersection,...j(r)});var Tt=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}),N;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"}),N;!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 st(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})}};Tt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tt({items:t,typeName:D.ZodTuple,rest:null,...j(e)})};var Ps=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}),N;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new st(n,a,n.path,a)),value:i._parse(new st(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:D.ZodRecord,...j(n)}):new t({keyType:Qt.create(),valueType:e,typeName:D.ZodRecord,...j(r)})}},nn=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}),N;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new st(n,a,n.path,[u,"key"])),value:s._parse(new st(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 N;(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 N;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};nn.create=(t,e,r)=>new nn({valueType:e,keyType:t,typeName:D.ZodMap,...j(r)});var on=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}),N;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 N;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 st(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)}};on.create=(t,e)=>new on({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...j(e)});var Ts=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}),N;function n(a,c){return ks({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,$s(),to].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return ks({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,$s(),to].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 er){let a=this;return Ze(async function(...c){let u=new Qe([]),l=await a._def.args.parseAsync(c,s).catch(m=>{throw u.addIssue(n(c,m)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(m=>{throw u.addIssue(o(d,m)),u})})}else{let a=this;return Ze(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:Tt.create(e).rest(jt.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||Tt.create([]).rest(jt.create()),returns:r||jt.create(),typeName:D.ZodFunction,...j(n)})}},zr=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})}};zr.create=(t,e)=>new zr({getter:t,typeName:D.ZodLazy,...j(e)});var Pr=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}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}};Pr.create=(t,e)=>new Pr({value:t,typeName:D.ZodLiteral,...j(e)});function yf(t,e){return new Tr({values:t,typeName:D.ZodEnum,...j(e)})}var Tr=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}),N}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}),N}return Ze(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)))}};Tr.create=yf;var Cr=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}),N}if(r.indexOf(e.data)===-1){let o=te.objectValues(r);return T(n,{received:n.data,code:E.invalid_enum_value,options:o}),N}return Ze(e.data)}get enum(){return this._def.values}};Cr.create=(t,e)=>new Cr({values:t,typeName:D.ZodNativeEnum,...j(e)});var er=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}),N;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Ze(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};er.create=(t,e)=>new er({type:t,typeName:D.ZodPromise,...j(e)});var Xe=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.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"?N:(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"?N:(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(!ro(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=>ro(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:D.ZodEffects,effect:e,...j(r)});Xe.createWithPreprocess=(t,e,r)=>new Xe({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...j(r)});var yt=class extends M{_parse(e){return this._getType(e)===z.undefined?Ze(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yt.create=(t,e)=>new yt({innerType:t,typeName:D.ZodOptional,...j(e)});var Lt=class extends M{_parse(e){return this._getType(e)===z.null?Ze(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({innerType:t,typeName:D.ZodNullable,...j(e)});var Or=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}};Or.create=(t,e)=>new Or({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});var sn=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 Es(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}};sn.create=(t,e)=>new sn({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});var an=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}),N}return{status:"valid",value:e.data}}};an.create=t=>new an({typeName:D.ZodNaN,...j(t)});var Nx=Symbol("zod_brand"),Cs=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}},no=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"?N:s.status==="dirty"?(r.dirty(),gf(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"?N: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:D.ZodPipeline})}},cn=class extends M{_parse(e){let r=this._def.innerType._parse(e);return ro(r)&&(r.value=Object.freeze(r.value)),r}};cn.create=(t,e)=>new cn({innerType:t,typeName:D.ZodReadonly,...j(e)});var _f=(t,e={},r)=>t?Xt.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})}}):Xt.create(),jx={object:He.lazycreate},D;(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"})(D||(D={}));var Mx=(t,e={message:`Input not instance of ${t.name}`})=>_f(r=>r instanceof t,e),vf=Qt.create,bf=vr.create,Lx=an.create,Zx=br.create,wf=wr.create,qx=xr.create,Fx=tn.create,Ux=Sr.create,Vx=$r.create,Bx=Xt.create,Hx=jt.create,Wx=_t.create,Gx=rn.create,Jx=Mt.create,Kx=He.create,Yx=He.strictCreate,Qx=kr.create,Xx=zs.create,e0=Er.create,t0=Tt.create,r0=Ps.create,n0=nn.create,o0=on.create,s0=Ts.create,i0=zr.create,a0=Pr.create,c0=Tr.create,u0=Cr.create,l0=er.create,mf=Xe.create,d0=yt.create,f0=Lt.create,p0=Xe.createWithPreprocess,m0=no.create,h0=()=>vf().optional(),g0=()=>bf().optional(),y0=()=>wf().optional(),_0={string:(t=>Qt.create({...t,coerce:!0})),number:(t=>vr.create({...t,coerce:!0})),boolean:(t=>wr.create({...t,coerce:!0})),bigint:(t=>br.create({...t,coerce:!0})),date:(t=>xr.create({...t,coerce:!0}))},v0=N,xe=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:Sx,getErrorMap:$s,makeIssue:ks,EMPTY_PATH:$x,addIssueToContext:T,ParseStatus:Ae,INVALID:N,DIRTY:gf,OK:Ze,isAborted:Ua,isDirty:Va,isValid:ro,isAsync:Es,get util(){return te},get objectUtil(){return Fa},ZodParsedType:z,getParsedType:Yt,ZodType:M,ZodString:Qt,ZodNumber:vr,ZodBigInt:br,ZodBoolean:wr,ZodDate:xr,ZodSymbol:tn,ZodUndefined:Sr,ZodNull:$r,ZodAny:Xt,ZodUnknown:jt,ZodNever:_t,ZodVoid:rn,ZodArray:Mt,ZodObject:He,ZodUnion:kr,ZodDiscriminatedUnion:zs,ZodIntersection:Er,ZodTuple:Tt,ZodRecord:Ps,ZodMap:nn,ZodSet:on,ZodFunction:Ts,ZodLazy:zr,ZodLiteral:Pr,ZodEnum:Tr,ZodNativeEnum:Cr,ZodPromise:er,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:yt,ZodNullable:Lt,ZodDefault:Or,ZodCatch:sn,ZodNaN:an,BRAND:Nx,ZodBranded:Cs,ZodPipeline:no,ZodReadonly:cn,custom:_f,Schema:M,ZodSchema:M,late:jx,get ZodFirstPartyTypeKind(){return D},coerce:_0,any:Bx,array:Jx,bigint:Zx,boolean:wf,date:qx,discriminatedUnion:Xx,effect:mf,enum:c0,function:s0,instanceof:Mx,intersection:e0,lazy:i0,literal:a0,map:n0,nan:Lx,nativeEnum:u0,never:Wx,null:Vx,nullable:f0,number:bf,object:Kx,oboolean:y0,onumber:g0,optional:d0,ostring:h0,pipeline:m0,preprocess:p0,promise:l0,record:r0,set:o0,strictObject:Yx,string:vf,symbol:Fx,transformer:mf,tuple:t0,undefined:Ux,union:Qx,unknown:Hx,void:Gx,NEVER:v0,ZodIssueCode:E,quotelessJson:xx,ZodError:Qe});var Zt=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 b0=xe.object({name:xe.string().default("eui-compodoc-mcp"),version:xe.string().default("1.0.0")}),w0=xe.object({path:xe.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://")?Zt.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}).default("__bundled__"),watchForChanges:xe.boolean().default(!0),reloadDebounce:xe.number().min(0).default(1e3),timeout:xe.number().min(1e3).default(1e4),maxRetries:xe.number().min(0).max(10).default(3),pollingInterval:xe.number().min(5e3).default(6e4)}).default({}),x0=xe.object({maxResults:xe.number().min(1).max(1e3).default(50),minQueryLength:xe.number().min(1).default(2)}),S0=xe.object({level:xe.enum(["debug","info","warn","error"]).default("info"),format:xe.enum(["json","text"]).default("text")}),$0=xe.object({path:xe.string().optional()}).default({}),k0=xe.object({path:xe.string().optional()}).default({}),xf=xe.object({server:b0.default({}),documentation:w0,search:x0.default({}),logging:S0.default({}),accessibility:$0.default({}),examples:k0.default({})}),Os={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 Ha(t){return xf.safeParse(t)}var un=gt(require("fs")),oo=gt(require("path"));function E0(){let t=oo.join(__dirname,"documentation.json.gz");if(un.existsSync(t))return t;let e=oo.join(__dirname,"documentation.json");return un.existsSync(e)?e:Os.documentation.path}function Sf(){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}),process.env.COMPODOC_MCP_EXAMPLES_PATH&&(t.examples={path:process.env.COMPODOC_MCP_EXAMPLES_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"--examples-path":e.examples||(e.examples={}),e.examples.path=t[++r];break;case"--help":case"-h":P0(),process.exit(0);break}return e}function kf(t){try{if(!un.existsSync(t))return process.stderr.write(`Configuration file not found: ${t}
32
- `),{};let e=un.readFileSync(t,"utf-8"),r=oo.extname(t).toLowerCase();return r===".json"?JSON.parse(e):(process.stderr.write(`Unsupported configuration file format: ${r}
31
+ deps: ${r}}`};var Qj={keyword:"dependencies",type:"object",schemaType:"object",error:Mt.error,code(t){let[e,r]=eM(t);m0(t,e),h0(t,r)}};function eM({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 m0(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,Ls.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,Ls.checkReportMissingProp)(t,u)}):(r.if((0,Zf._)`${c} && (${(0,Ls.checkMissingProp)(t,a,s)})`),(0,Ls.reportMissingProp)(t,s),r.else())}}Mt.validatePropertyDeps=m0;function h0(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,Xj.alwaysValidSchema)(s,e[a])||(r.if((0,Ls.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))}Mt.validateSchemaDeps=h0;Mt.default=Qj});var _0=$(Ff=>{"use strict";Object.defineProperty(Ff,"__esModule",{value:!0});var y0=B(),tM=X(),rM={message:"property name must be valid",params:({params:t})=>(0,y0._)`{propertyName: ${t.propertyName}}`},nM={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:rM,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,tM.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,y0.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Ff.default=nM});var Uf=$(qf=>{"use strict";Object.defineProperty(qf,"__esModule",{value:!0});var mc=ht(),It=B(),oM=tr(),hc=X(),sM={message:"must NOT have additional properties",params:({params:t})=>(0,It._)`{additionalProperty: ${t.additionalProperty}}`},iM={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:sM,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,hc.alwaysValidSchema)(i,r))return;let u=(0,mc.allSchemaProperties)(n.properties),l=(0,mc.allSchemaProperties)(n.patternProperties);d(),t.ok((0,It._)`${s} === ${oM.default.errors}`);function d(){e.forIn("key",o,g=>{!u.length&&!l.length?f(g):e.if(p(g),()=>f(g))})}function p(g){let y;if(u.length>8){let v=(0,hc.schemaRefOrVal)(i,n.properties,"properties");y=(0,mc.isOwnProperty)(e,v,g)}else u.length?y=(0,It.or)(...u.map(v=>(0,It._)`${g} === ${v}`)):y=It.nil;return l.length&&(y=(0,It.or)(y,...l.map(v=>(0,It._)`${(0,mc.usePattern)(t,v)}.test(${g})`))),(0,It.not)(y)}function m(g){e.code((0,It._)`delete ${o}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,hc.alwaysValidSchema)(i,r)){let y=e.name("valid");c.removeAdditional==="failing"?(h(g,y,!1),e.if((0,It.not)(y),()=>{t.reset(),m(g)})):(h(g,y),a||e.if((0,It.not)(y),()=>e.break()))}}function h(g,y,v){let x={keyword:"additionalProperties",dataProp:g,dataPropType:hc.Type.Str};v===!1&&Object.assign(x,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(x,y)}}};qf.default=iM});var w0=$(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});var aM=Ss(),v0=ht(),Vf=X(),b0=Uf(),cM={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&&b0.default.code(new aM.KeywordCxt(s,b0.default,"additionalProperties"));let i=(0,v0.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=Vf.mergeEvaluated.props(e,(0,Vf.toHash)(i),s.props));let a=i.filter(d=>!(0,Vf.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,v0.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)}}};Bf.default=cM});var E0=$(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});var x0=ht(),gc=B(),S0=X(),$0=X(),uM={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,x0.allSchemaProperties)(r),c=a.filter(h=>(0,S0.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 gc.Name)&&(s.props=(0,$0.evaluatedPropsToName)(e,s.props));let{props:d}=s;p();function p(){for(let h of a)u&&m(h),s.allErrors?f(h):(e.var(l,!0),f(h),e.if(l))}function m(h){for(let g in u)new RegExp(h).test(g)&&(0,S0.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,gc._)`${(0,x0.usePattern)(t,h)}.test(${g})`,()=>{let y=c.includes(h);y||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:$0.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,gc._)`${d}[${g}]`,!0):!y&&!s.allErrors&&e.if((0,gc.not)(l),()=>e.break())})})}}};Hf.default=uM});var k0=$(Wf=>{"use strict";Object.defineProperty(Wf,"__esModule",{value:!0});var lM=X(),dM={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,lM.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"}};Wf.default=dM});var P0=$(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});var fM=ht(),pM={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fM.validateUnion,error:{message:"must match a schema in anyOf"}};Gf.default=pM});var z0=$(Jf=>{"use strict";Object.defineProperty(Jf,"__esModule",{value:!0});var yc=B(),mM=X(),hM={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,yc._)`{passingSchemas: ${t.passing}}`},gM={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:hM,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 p;(0,mM.alwaysValidSchema)(o,l)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,yc._)`${c} && ${i}`).assign(i,!1).assign(a,(0,yc._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,yc.Name)})})}}};Jf.default=gM});var T0=$(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});var yM=X(),_M={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,yM.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};Kf.default=_M});var I0=$(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});var _c=B(),O0=X(),vM={message:({params:t})=>(0,_c.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,_c._)`{failingKeyword: ${t.ifClause}}`},bM={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:vM,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,O0.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=C0(n,"then"),s=C0(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,_c.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 p=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(p,i),d?e.assign(d,(0,_c._)`${l}`):t.setParams({ifClause:l})}}}};function C0(t,e){let r=t.schema[e];return r!==void 0&&!(0,O0.alwaysValidSchema)(t,r)}Yf.default=bM});var R0=$(Xf=>{"use strict";Object.defineProperty(Xf,"__esModule",{value:!0});var wM=X(),xM={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,wM.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Xf.default=xM});var D0=$(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var SM=Af(),$M=l0(),EM=Nf(),kM=f0(),PM=p0(),zM=g0(),TM=_0(),CM=Uf(),OM=w0(),IM=E0(),RM=k0(),DM=P0(),AM=z0(),NM=T0(),jM=I0(),MM=R0();function LM(t=!1){let e=[RM.default,DM.default,AM.default,NM.default,jM.default,MM.default,TM.default,CM.default,zM.default,OM.default,IM.default];return t?e.push($M.default,kM.default):e.push(SM.default,EM.default),e.push(PM.default),e}Qf.default=LM});var A0=$(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});var Pe=B(),ZM={message:({schemaCode:t})=>(0,Pe.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Pe._)`{format: ${t}}`},FM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:ZM,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?p():m();function p(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,Pe._)`${f}[${i}]`),g=r.let("fType"),y=r.let("format");r.if((0,Pe._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,Pe._)`${h}.type || "string"`).assign(y,(0,Pe._)`${h}.validate`),()=>r.assign(g,(0,Pe._)`"string"`).assign(y,h)),t.fail$data((0,Pe.or)(v(),x()));function v(){return c.strictSchema===!1?Pe.nil:(0,Pe._)`${i} && !${y}`}function x(){let S=l.$async?(0,Pe._)`(${h}.async ? await ${y}(${n}) : ${y}(${n}))`:(0,Pe._)`${y}(${n})`,E=(0,Pe._)`(typeof ${y} == "function" ? ${S} : ${y}.test(${n}))`;return(0,Pe._)`${y} && ${y} !== true && ${g} === ${e} && !${E}`}}function m(){let f=d.formats[s];if(!f){v();return}if(f===!0)return;let[h,g,y]=x(f);h===e&&t.pass(S());function v(){if(c.strictSchema===!1){d.logger.warn(E());return}throw new Error(E());function E(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function x(E){let C=E instanceof RegExp?(0,Pe.regexpCode)(E):c.code.formats?(0,Pe._)`${c.code.formats}${(0,Pe.getProperty)(s)}`:void 0,A=r.scopeValue("formats",{key:s,ref:E,code:C});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0,Pe._)`${A}.validate`]:["string",E,A]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,Pe._)`await ${y}(${n})`}return typeof g=="function"?(0,Pe._)`${y}(${n})`:(0,Pe._)`${y}.test(${n})`}}}};ep.default=FM});var N0=$(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var qM=A0(),UM=[qM.default];tp.default=UM});var j0=$(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.contentVocabulary=Jn.metadataVocabulary=void 0;Jn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Jn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var L0=$(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var VM=Hx(),BM=i0(),HM=D0(),WM=N0(),M0=j0(),GM=[VM.default,BM.default,(0,HM.default)(),WM.default,M0.metadataVocabulary,M0.contentVocabulary];rp.default=GM});var F0=$(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.DiscrError=void 0;var Z0;(function(t){t.Tag="tag",t.Mapping="mapping"})(Z0||(vc.DiscrError=Z0={}))});var U0=$(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});var Kn=B(),np=F0(),q0=Ga(),JM=$s(),KM=X(),YM={message:({params:{discrError:t,tagName:e}})=>t===np.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Kn._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},XM={keyword:"discriminator",type:"object",schemaType:"object",error:YM,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,Kn._)`${r}${(0,Kn.getProperty)(a)}`);e.if((0,Kn._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:np.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let m=p();e.if(!1);for(let f in m)e.elseIf((0,Kn._)`${u} === ${f}`),e.assign(c,d(m[f]));e.else(),t.error(!1,{discrError:np.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(m){let f=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:m},f);return t.mergeEvaluated(h,Kn.Name),f}function p(){var m;let f={},h=y(o),g=!0;for(let S=0;S<i.length;S++){let E=i[S];if(E?.$ref&&!(0,KM.schemaHasRulesButRef)(E,s.self.RULES)){let A=E.$ref;if(E=q0.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,A),E instanceof q0.SchemaEnv&&(E=E.schema),E===void 0)throw new JM.default(s.opts.uriResolver,s.baseId,A)}let C=(m=E?.properties)===null||m===void 0?void 0:m[a];if(typeof C!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||y(E)),v(C,S)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return f;function y({required:S}){return Array.isArray(S)&&S.includes(a)}function v(S,E){if(S.const)x(S.const,E);else if(S.enum)for(let C of S.enum)x(C,E);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function x(S,E){if(typeof S!="string"||S in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[S]=E}}}};op.default=XM});var V0=$((KH,QM)=>{QM.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 ip=$((he,sp)=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.MissingRefError=he.ValidationError=he.CodeGen=he.Name=he.nil=he.stringify=he.str=he._=he.KeywordCxt=he.Ajv=void 0;var eL=Zx(),tL=L0(),rL=U0(),B0=V0(),nL=["/properties"],bc="http://json-schema.org/draft-07/schema",Yn=class extends eL.default{_addVocabularies(){super._addVocabularies(),tL.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(rL.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(B0,nL):B0;this.addMetaSchema(e,bc,!1),this.refs["http://json-schema.org/schema"]=bc}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(bc)?bc:void 0)}};he.Ajv=Yn;sp.exports=he=Yn;sp.exports.Ajv=Yn;Object.defineProperty(he,"__esModule",{value:!0});he.default=Yn;var oL=Ss();Object.defineProperty(he,"KeywordCxt",{enumerable:!0,get:function(){return oL.KeywordCxt}});var Xn=B();Object.defineProperty(he,"_",{enumerable:!0,get:function(){return Xn._}});Object.defineProperty(he,"str",{enumerable:!0,get:function(){return Xn.str}});Object.defineProperty(he,"stringify",{enumerable:!0,get:function(){return Xn.stringify}});Object.defineProperty(he,"nil",{enumerable:!0,get:function(){return Xn.nil}});Object.defineProperty(he,"Name",{enumerable:!0,get:function(){return Xn.Name}});Object.defineProperty(he,"CodeGen",{enumerable:!0,get:function(){return Xn.CodeGen}});var sL=Ha();Object.defineProperty(he,"ValidationError",{enumerable:!0,get:function(){return sL.default}});var iL=$s();Object.defineProperty(he,"MissingRefError",{enumerable:!0,get:function(){return iL.default}})});var Q0=$(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.formatNames=Zt.fastFormats=Zt.fullFormats=void 0;function Lt(t,e){return{validate:t,compare:e}}Zt.fullFormats={date:Lt(J0,lp),time:Lt(cp(!0),dp),"date-time":Lt(H0(!0),Y0),"iso-time":Lt(cp(),K0),"iso-date-time":Lt(H0(),X0),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:fL,"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:vL,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:pL,int32:{type:"number",validate:gL},int64:{type:"number",validate:yL},float:{type:"number",validate:G0},double:{type:"number",validate:G0},password:!0,binary:!0};Zt.fastFormats={...Zt.fullFormats,date:Lt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,lp),time:Lt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,dp),"date-time":Lt(/^\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,Y0),"iso-time":Lt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,K0),"iso-date-time":Lt(/^\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,X0),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};Zt.formatNames=Object.keys(Zt.fullFormats);function aL(t){return t%4===0&&(t%100!==0||t%400===0)}var cL=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,uL=[0,31,28,31,30,31,30,31,31,30,31,30,31];function J0(t){let e=cL.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&&aL(r)?29:uL[n])}function lp(t,e){if(t&&e)return t>e?1:t<e?-1:0}var ap=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function cp(t){return function(r){let n=ap.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,p=o-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61}}function dp(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 K0(t,e){if(!(t&&e))return;let r=ap.exec(t),n=ap.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 up=/t|\s/i;function H0(t){let e=cp(t);return function(n){let o=n.split(up);return o.length===2&&J0(o[0])&&e(o[1])}}function Y0(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function X0(t,e){if(!(t&&e))return;let[r,n]=t.split(up),[o,s]=e.split(up),i=lp(r,o);if(i!==void 0)return i||dp(n,s)}var lL=/\/|:/,dL=/^(?:[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 fL(t){return lL.test(t)&&dL.test(t)}var W0=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function pL(t){return W0.lastIndex=0,W0.test(t)}var mL=-(2**31),hL=2**31-1;function gL(t){return Number.isInteger(t)&&t<=hL&&t>=mL}function yL(t){return Number.isInteger(t)}function G0(){return!0}var _L=/[^\\]\\Z/;function vL(t){if(_L.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var eS=$(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.formatLimitDefinition=void 0;var bL=ip(),Rt=B(),Sr=Rt.operators,wc={formatMaximum:{okStr:"<=",ok:Sr.LTE,fail:Sr.GT},formatMinimum:{okStr:">=",ok:Sr.GTE,fail:Sr.LT},formatExclusiveMaximum:{okStr:"<",ok:Sr.LT,fail:Sr.GTE},formatExclusiveMinimum:{okStr:">",ok:Sr.GT,fail:Sr.LTE}},wL={message:({keyword:t,schemaCode:e})=>(0,Rt.str)`should be ${wc[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Rt._)`{comparison: ${wc[t].okStr}, limit: ${e}}`};Qn.formatLimitDefinition={keyword:Object.keys(wc),type:"string",schemaType:"string",$data:!0,error:wL,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 bL.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),m=e.const("fmt",(0,Rt._)`${p}[${c.schemaCode}]`);t.fail$data((0,Rt.or)((0,Rt._)`typeof ${m} != "object"`,(0,Rt._)`${m} instanceof RegExp`,(0,Rt._)`typeof ${m}.compare != "function"`,d(m)))}function l(){let p=c.schema,m=a.formats[p];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${o}": format "${p}" does not define "compare" function`);let f=e.scopeValue("formats",{key:p,ref:m,code:i.code.formats?(0,Rt._)`${i.code.formats}${(0,Rt.getProperty)(p)}`:void 0});t.fail$data(d(f))}function d(p){return(0,Rt._)`${p}.compare(${r}, ${n}) ${wc[o].fail} 0`}},dependencies:["format"]};var xL=t=>(t.addKeyword(Qn.formatLimitDefinition),t);Qn.default=xL});var oS=$((Zs,nS)=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});var eo=Q0(),SL=eS(),fp=B(),tS=new fp.Name("fullFormats"),$L=new fp.Name("fastFormats"),pp=(t,e={keywords:!0})=>{if(Array.isArray(e))return rS(t,e,eo.fullFormats,tS),t;let[r,n]=e.mode==="fast"?[eo.fastFormats,$L]:[eo.fullFormats,tS],o=e.formats||eo.formatNames;return rS(t,o,r,n),e.keywords&&(0,SL.default)(t),t};pp.get=(t,e="full")=>{let n=(e==="fast"?eo.fastFormats:eo.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function rS(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,fp._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}nS.exports=Zs=pp;Object.defineProperty(Zs,"__esModule",{value:!0});Zs.default=pp});var ne;(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})(ne||(ne={}));var Dc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Dc||(Dc={}));var P=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),nr=t=>{switch(typeof t){case"undefined":return P.undefined;case"string":return P.string;case"number":return isNaN(t)?P.nan:P.number;case"boolean":return P.boolean;case"function":return P.function;case"bigint":return P.bigint;case"symbol":return P.symbol;case"object":return Array.isArray(t)?P.array:t===null?P.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?P.promise:typeof Map<"u"&&t instanceof Map?P.map:typeof Set<"u"&&t instanceof Set?P.set:typeof Date<"u"&&t instanceof Date?P.date:P.object;default:return P.unknown}},k=ne.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"]),vS=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),tt=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,ne.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()}};tt.create=t=>new tt(t);var ho=(t,e)=>{let r;switch(t.code){case k.invalid_type:t.received===P.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case k.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ne.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:r=`Unrecognized key(s) in object: ${ne.joinValues(t.keys,", ")}`;break;case k.invalid_union:r="Invalid input";break;case k.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ne.joinValues(t.options)}`;break;case k.invalid_enum_value:r=`Invalid enum value. Expected ${ne.joinValues(t.options)}, received '${t.received}'`;break;case k.invalid_arguments:r="Invalid function arguments";break;case k.invalid_return_type:r="Invalid function return type";break;case k.invalid_date:r="Invalid date";break;case k.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}"`:ne.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case k.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 k.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 k.custom:r="Invalid input";break;case k.invalid_intersection_types:r="Intersection results could not be merged";break;case k.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case k.not_finite:r="Number must be finite";break;default:r=e.defaultError,ne.assertNever(t)}return{message:r}},wp=ho;function bS(t){wp=t}function Bs(){return wp}var Hs=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}},wS=[];function T(t,e){let r=Hs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bs(),ho].filter(n=>!!n)});t.common.issues.push(r)}var je=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 L;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 L;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}}},L=Object.freeze({status:"aborted"}),xp=t=>({status:"dirty",value:t}),qe=t=>({status:"valid",value:t}),Ac=t=>t.status==="aborted",Nc=t=>t.status==="dirty",go=t=>t.status==="valid",Ws=t=>typeof Promise<"u"&&t instanceof Promise,R;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(R||(R={}));var ct=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}},vp=(t,e)=>{if(go(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 tt(t.common.issues);return this._error=r,this._error}}};function q(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 U=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 nr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:nr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new je,ctx:{common:e.parent.common,data:e.data,parsedType:nr(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:nr(e)},s=this._parseSync({data:e,path:o.path,parent:o});return vp(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:nr(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Ws(o)?o:Promise.resolve(o));return vp(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:k.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 rt({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return vt.create(this,this._def)}nullable(){return Ut.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return qt.create(this,this._def)}promise(){return ir.create(this,this._def)}or(e){return Ir.create([this,e],this._def)}and(e){return Rr.create(this,e,this._def)}transform(e){return new rt({...q(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Mr({...q(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new Ys({typeName:N.ZodBranded,type:this,...q(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new hn({...q(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 yo.create(this,e)}readonly(){return yn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xS=/^c[^\s-]{8,}$/i,SS=/^[a-z][a-z0-9]*$/,$S=/^[0-9A-HJKMNP-TV-Z]{26}$/,ES=/^[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,kS=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PS="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rc,zS=/^(((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}))$/,TS=/^(([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})))$/,CS=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 OS(t,e){return!!((e==="v4"||!e)&&zS.test(t)||(e==="v6"||!e)&&TS.test(t))}var or=class t extends U{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==P.string){let s=this._getOrReturnCtx(e);return T(s,{code:k.invalid_type,expected:P.string,received:s.parsedType}),L}let n=new je,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:k.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:k.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:k.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&T(o,{code:k.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")kS.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"email",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Rc||(Rc=new RegExp(PS,"u")),Rc.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"emoji",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")ES.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"uuid",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")xS.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")SS.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid2",code:k.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")$S.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ulid",code:k.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:k.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:k.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:k.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:k.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:k.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?CS(s).test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{code:k.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?OS(e.data,s.version)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ip",code:k.invalid_string,message:s.message}),n.dirty()):ne.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:k.invalid_string,...R.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...R.errToObj(e)})}url(e){return this._addCheck({kind:"url",...R.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...R.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...R.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...R.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...R.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...R.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,...R.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...R.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...R.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...R.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...R.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...R.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...R.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...R.errToObj(r)})}nonempty(e){return this.min(1,R.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}};or.create=t=>{var e;return new or({checks:[],typeName:N.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...q(t)})};function IS(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 kr=class t extends U{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)!==P.number){let s=this._getOrReturnCtx(e);return T(s,{code:k.invalid_type,expected:P.number,received:s.parsedType}),L}let n,o=new je;for(let s of this._def.checks)s.kind==="int"?ne.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:k.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:k.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:k.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?IS(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:k.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:k.not_finite,message:s.message}),o.dirty()):ne.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,R.toString(r))}gt(e,r){return this.setLimit("min",e,!1,R.toString(r))}lte(e,r){return this.setLimit("max",e,!0,R.toString(r))}lt(e,r){return this.setLimit("max",e,!1,R.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:R.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:R.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:R.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:R.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.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"&&ne.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)}};kr.create=t=>new kr({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...q(t)});var Pr=class t extends U{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)!==P.bigint){let s=this._getOrReturnCtx(e);return T(s,{code:k.invalid_type,expected:P.bigint,received:s.parsedType}),L}let n,o=new je;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:k.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:k.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:k.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ne.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,R.toString(r))}gt(e,r){return this.setLimit("min",e,!1,R.toString(r))}lte(e,r){return this.setLimit("max",e,!0,R.toString(r))}lt(e,r){return this.setLimit("max",e,!1,R.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:R.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:R.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:R.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}};Pr.create=t=>{var e;return new Pr({checks:[],typeName:N.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...q(t)})};var zr=class extends U{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==P.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:k.invalid_type,expected:P.boolean,received:n.parsedType}),L}return qe(e.data)}};zr.create=t=>new zr({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...q(t)});var Tr=class t extends U{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==P.date){let s=this._getOrReturnCtx(e);return T(s,{code:k.invalid_type,expected:P.date,received:s.parsedType}),L}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:k.invalid_date}),L}let n=new je,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:k.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:k.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):ne.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:R.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:R.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}};Tr.create=t=>new Tr({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...q(t)});var dn=class extends U{_parse(e){if(this._getType(e)!==P.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:k.invalid_type,expected:P.symbol,received:n.parsedType}),L}return qe(e.data)}};dn.create=t=>new dn({typeName:N.ZodSymbol,...q(t)});var Cr=class extends U{_parse(e){if(this._getType(e)!==P.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:k.invalid_type,expected:P.undefined,received:n.parsedType}),L}return qe(e.data)}};Cr.create=t=>new Cr({typeName:N.ZodUndefined,...q(t)});var Or=class extends U{_parse(e){if(this._getType(e)!==P.null){let n=this._getOrReturnCtx(e);return T(n,{code:k.invalid_type,expected:P.null,received:n.parsedType}),L}return qe(e.data)}};Or.create=t=>new Or({typeName:N.ZodNull,...q(t)});var sr=class extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return qe(e.data)}};sr.create=t=>new sr({typeName:N.ZodAny,...q(t)});var Ft=class extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return qe(e.data)}};Ft.create=t=>new Ft({typeName:N.ZodUnknown,...q(t)});var bt=class extends U{_parse(e){let r=this._getOrReturnCtx(e);return T(r,{code:k.invalid_type,expected:P.never,received:r.parsedType}),L}};bt.create=t=>new bt({typeName:N.ZodNever,...q(t)});var fn=class extends U{_parse(e){if(this._getType(e)!==P.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:k.invalid_type,expected:P.void,received:n.parsedType}),L}return qe(e.data)}};fn.create=t=>new fn({typeName:N.ZodVoid,...q(t)});var qt=class t extends U{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==P.array)return T(r,{code:k.invalid_type,expected:P.array,received:r.parsedType}),L;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?k.too_big:k.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:k.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:k.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 ct(r,i,r.path,a)))).then(i=>je.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new ct(r,i,r.path,a)));return je.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:R.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:R.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:R.toString(r)}})}nonempty(e){return this.min(1,e)}};qt.create=(t,e)=>new qt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...q(e)});function ln(t){if(t instanceof Ge){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=vt.create(ln(n))}return new Ge({...t._def,shape:()=>e})}else return t instanceof qt?new qt({...t._def,type:ln(t.element)}):t instanceof vt?vt.create(ln(t.unwrap())):t instanceof Ut?Ut.create(ln(t.unwrap())):t instanceof Dt?Dt.create(t.items.map(e=>ln(e))):t}var Ge=class t extends U{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=ne.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==P.object){let u=this._getOrReturnCtx(e);return T(u,{code:k.invalid_type,expected:P.object,received:u.parsedType}),L}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof bt&&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 ct(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof bt){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:k.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 ct(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=>je.mergeObjectSync(n,u)):je.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return R.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=R.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 ne.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 ne.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return ln(this)}partial(e){let r={};return ne.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 ne.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof vt;)s=s._def.innerType;r[n]=s}}),new t({...this._def,shape:()=>r})}keyof(){return Sp(ne.objectKeys(this.shape))}};Ge.create=(t,e)=>new Ge({shape:()=>t,unknownKeys:"strip",catchall:bt.create(),typeName:N.ZodObject,...q(e)});Ge.strictCreate=(t,e)=>new Ge({shape:()=>t,unknownKeys:"strict",catchall:bt.create(),typeName:N.ZodObject,...q(e)});Ge.lazycreate=(t,e)=>new Ge({shape:t,unknownKeys:"strip",catchall:bt.create(),typeName:N.ZodObject,...q(e)});var Ir=class extends U{_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 tt(a.ctx.common.issues));return T(r,{code:k.invalid_union,unionErrors:i}),L}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 tt(c));return T(r,{code:k.invalid_union,unionErrors:a}),L}}get options(){return this._def.options}};Ir.create=(t,e)=>new Ir({options:t,typeName:N.ZodUnion,...q(e)});var Vs=t=>t instanceof Dr?Vs(t.schema):t instanceof rt?Vs(t.innerType()):t instanceof Ar?[t.value]:t instanceof Nr?t.options:t instanceof jr?Object.keys(t.enum):t instanceof Mr?Vs(t._def.innerType):t instanceof Cr?[void 0]:t instanceof Or?[null]:null,Gs=class t extends U{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==P.object)return T(r,{code:k.invalid_type,expected:P.object,received:r.parsedType}),L;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:k.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}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=Vs(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,...q(n)})}};function jc(t,e){let r=nr(t),n=nr(e);if(t===e)return{valid:!0,data:t};if(r===P.object&&n===P.object){let o=ne.objectKeys(e),s=ne.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=jc(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===P.array&&n===P.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=jc(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===P.date&&n===P.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Rr=class extends U{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,i)=>{if(Ac(s)||Ac(i))return L;let a=jc(s.value,i.value);return a.valid?((Nc(s)||Nc(i))&&r.dirty(),{status:r.value,value:a.data}):(T(n,{code:k.invalid_intersection_types}),L)};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}))}};Rr.create=(t,e,r)=>new Rr({left:t,right:e,typeName:N.ZodIntersection,...q(r)});var Dt=class t extends U{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.array)return T(n,{code:k.invalid_type,expected:P.array,received:n.parsedType}),L;if(n.data.length<this._def.items.length)return T(n,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),L;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:k.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 ct(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>je.mergeArray(r,i)):je.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Dt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dt({items:t,typeName:N.ZodTuple,rest:null,...q(e)})};var Js=class t extends U{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!==P.object)return T(n,{code:k.invalid_type,expected:P.object,received:n.parsedType}),L;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new ct(n,a,n.path,a)),value:i._parse(new ct(n,n.data[a],n.path,a))});return n.common.async?je.mergeObjectAsync(r,o):je.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof U?new t({keyType:e,valueType:r,typeName:N.ZodRecord,...q(n)}):new t({keyType:or.create(),valueType:e,typeName:N.ZodRecord,...q(r)})}},pn=class extends U{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!==P.map)return T(n,{code:k.invalid_type,expected:P.map,received:n.parsedType}),L;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new ct(n,a,n.path,[u,"key"])),value:s._parse(new ct(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 L;(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 L;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};pn.create=(t,e,r)=>new pn({valueType:e,keyType:t,typeName:N.ZodMap,...q(r)});var mn=class t extends U{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.set)return T(n,{code:k.invalid_type,expected:P.set,received:n.parsedType}),L;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(T(n,{code:k.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:k.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 L;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 ct(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:R.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:R.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};mn.create=(t,e)=>new mn({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...q(e)});var Ks=class t extends U{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==P.function)return T(r,{code:k.invalid_type,expected:P.function,received:r.parsedType}),L;function n(a,c){return Hs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),ho].filter(u=>!!u),issueData:{code:k.invalid_arguments,argumentsError:c}})}function o(a,c){return Hs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bs(),ho].filter(u=>!!u),issueData:{code:k.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof ir){let a=this;return qe(async function(...c){let u=new tt([]),l=await a._def.args.parseAsync(c,s).catch(m=>{throw u.addIssue(n(c,m)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(m=>{throw u.addIssue(o(d,m)),u})})}else{let a=this;return qe(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new tt([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new tt([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:Dt.create(e).rest(Ft.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||Dt.create([]).rest(Ft.create()),returns:r||Ft.create(),typeName:N.ZodFunction,...q(n)})}},Dr=class extends U{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})}};Dr.create=(t,e)=>new Dr({getter:t,typeName:N.ZodLazy,...q(e)});var Ar=class extends U{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return T(r,{received:r.data,code:k.invalid_literal,expected:this._def.value}),L}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ar.create=(t,e)=>new Ar({value:t,typeName:N.ZodLiteral,...q(e)});function Sp(t,e){return new Nr({values:t,typeName:N.ZodEnum,...q(e)})}var Nr=class t extends U{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{expected:ne.joinValues(n),received:r.parsedType,code:k.invalid_type}),L}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{received:r.data,code:k.invalid_enum_value,options:n}),L}return qe(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)))}};Nr.create=Sp;var jr=class extends U{_parse(e){let r=ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==P.string&&n.parsedType!==P.number){let o=ne.objectValues(r);return T(n,{expected:ne.joinValues(o),received:n.parsedType,code:k.invalid_type}),L}if(r.indexOf(e.data)===-1){let o=ne.objectValues(r);return T(n,{received:n.data,code:k.invalid_enum_value,options:o}),L}return qe(e.data)}get enum(){return this._def.values}};jr.create=(t,e)=>new jr({values:t,typeName:N.ZodNativeEnum,...q(e)});var ir=class extends U{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==P.promise&&r.common.async===!1)return T(r,{code:k.invalid_type,expected:P.promise,received:r.parsedType}),L;let n=r.parsedType===P.promise?r.data:Promise.resolve(r.data);return qe(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ir.create=(t,e)=>new ir({type:t,typeName:N.ZodPromise,...q(e)});var rt=class extends U{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"?L:(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"?L:(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(!go(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=>go(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):i);ne.assertNever(o)}};rt.create=(t,e,r)=>new rt({schema:t,typeName:N.ZodEffects,effect:e,...q(r)});rt.createWithPreprocess=(t,e,r)=>new rt({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...q(r)});var vt=class extends U{_parse(e){return this._getType(e)===P.undefined?qe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};vt.create=(t,e)=>new vt({innerType:t,typeName:N.ZodOptional,...q(e)});var Ut=class extends U{_parse(e){return this._getType(e)===P.null?qe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ut.create=(t,e)=>new Ut({innerType:t,typeName:N.ZodNullable,...q(e)});var Mr=class extends U{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===P.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...q(e)});var hn=class extends U{_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 tt(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};hn.create=(t,e)=>new hn({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...q(e)});var gn=class extends U{_parse(e){if(this._getType(e)!==P.nan){let n=this._getOrReturnCtx(e);return T(n,{code:k.invalid_type,expected:P.nan,received:n.parsedType}),L}return{status:"valid",value:e.data}}};gn.create=t=>new gn({typeName:N.ZodNaN,...q(t)});var RS=Symbol("zod_brand"),Ys=class extends U{_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}},yo=class t extends U{_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"?L:s.status==="dirty"?(r.dirty(),xp(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"?L: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})}},yn=class extends U{_parse(e){let r=this._def.innerType._parse(e);return go(r)&&(r.value=Object.freeze(r.value)),r}};yn.create=(t,e)=>new yn({innerType:t,typeName:N.ZodReadonly,...q(e)});var $p=(t,e={},r)=>t?sr.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})}}):sr.create(),DS={object:Ge.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 AS=(t,e={message:`Input not instance of ${t.name}`})=>$p(r=>r instanceof t,e),Ep=or.create,kp=kr.create,NS=gn.create,jS=Pr.create,Pp=zr.create,MS=Tr.create,LS=dn.create,ZS=Cr.create,FS=Or.create,qS=sr.create,US=Ft.create,VS=bt.create,BS=fn.create,HS=qt.create,WS=Ge.create,GS=Ge.strictCreate,JS=Ir.create,KS=Gs.create,YS=Rr.create,XS=Dt.create,QS=Js.create,e$=pn.create,t$=mn.create,r$=Ks.create,n$=Dr.create,o$=Ar.create,s$=Nr.create,i$=jr.create,a$=ir.create,bp=rt.create,c$=vt.create,u$=Ut.create,l$=rt.createWithPreprocess,d$=yo.create,f$=()=>Ep().optional(),p$=()=>kp().optional(),m$=()=>Pp().optional(),h$={string:(t=>or.create({...t,coerce:!0})),number:(t=>kr.create({...t,coerce:!0})),boolean:(t=>zr.create({...t,coerce:!0})),bigint:(t=>Pr.create({...t,coerce:!0})),date:(t=>Tr.create({...t,coerce:!0}))},g$=L,Se=Object.freeze({__proto__:null,defaultErrorMap:ho,setErrorMap:bS,getErrorMap:Bs,makeIssue:Hs,EMPTY_PATH:wS,addIssueToContext:T,ParseStatus:je,INVALID:L,DIRTY:xp,OK:qe,isAborted:Ac,isDirty:Nc,isValid:go,isAsync:Ws,get util(){return ne},get objectUtil(){return Dc},ZodParsedType:P,getParsedType:nr,ZodType:U,ZodString:or,ZodNumber:kr,ZodBigInt:Pr,ZodBoolean:zr,ZodDate:Tr,ZodSymbol:dn,ZodUndefined:Cr,ZodNull:Or,ZodAny:sr,ZodUnknown:Ft,ZodNever:bt,ZodVoid:fn,ZodArray:qt,ZodObject:Ge,ZodUnion:Ir,ZodDiscriminatedUnion:Gs,ZodIntersection:Rr,ZodTuple:Dt,ZodRecord:Js,ZodMap:pn,ZodSet:mn,ZodFunction:Ks,ZodLazy:Dr,ZodLiteral:Ar,ZodEnum:Nr,ZodNativeEnum:jr,ZodPromise:ir,ZodEffects:rt,ZodTransformer:rt,ZodOptional:vt,ZodNullable:Ut,ZodDefault:Mr,ZodCatch:hn,ZodNaN:gn,BRAND:RS,ZodBranded:Ys,ZodPipeline:yo,ZodReadonly:yn,custom:$p,Schema:U,ZodSchema:U,late:DS,get ZodFirstPartyTypeKind(){return N},coerce:h$,any:qS,array:HS,bigint:jS,boolean:Pp,date:MS,discriminatedUnion:KS,effect:bp,enum:s$,function:r$,instanceof:AS,intersection:YS,lazy:n$,literal:o$,map:e$,nan:NS,nativeEnum:i$,never:VS,null:FS,nullable:u$,number:kp,object:WS,oboolean:m$,onumber:p$,optional:c$,ostring:f$,pipeline:d$,preprocess:l$,promise:a$,record:QS,set:t$,strictObject:GS,string:Ep,symbol:LS,transformer:bp,tuple:XS,undefined:ZS,union:JS,unknown:US,void:BS,NEVER:g$,ZodIssueCode:k,quotelessJson:vS,ZodError:tt});var Vt=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 y$=Se.object({name:Se.string().default("eui-compodoc-mcp"),version:Se.string().default("1.0.0")}),_$=Se.object({path:Se.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://")?Vt.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}).default("__bundled__"),watchForChanges:Se.boolean().default(!0),reloadDebounce:Se.number().min(0).default(1e3),timeout:Se.number().min(1e3).default(1e4),maxRetries:Se.number().min(0).max(10).default(3),pollingInterval:Se.number().min(5e3).default(6e4)}).default({}),v$=Se.object({maxResults:Se.number().min(1).max(1e3).default(50),minQueryLength:Se.number().min(1).default(2)}),b$=Se.object({level:Se.enum(["debug","info","warn","error"]).default("info"),format:Se.enum(["json","text"]).default("text")}),w$=Se.object({path:Se.string().optional()}).default({}),x$=Se.object({path:Se.string().optional()}).default({}),zp=Se.object({server:y$.default({}),documentation:_$,search:v$.default({}),logging:b$.default({}),accessibility:w$.default({}),examples:x$.default({})}),Xs={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 Mc(t){return zp.safeParse(t)}var _n=_t(require("fs")),_o=_t(require("path"));function S$(){let t=_o.join(__dirname,"documentation.json.gz");if(_n.existsSync(t))return t;let e=_o.join(__dirname,"documentation.json");return _n.existsSync(e)?e:Xs.documentation.path}function Tp(){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}),process.env.COMPODOC_MCP_EXAMPLES_PATH&&(t.examples={path:process.env.COMPODOC_MCP_EXAMPLES_PATH}),t}function Cp(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"--examples-path":e.examples||(e.examples={}),e.examples.path=t[++r];break;case"--help":case"-h":E$(),process.exit(0);break}return e}function Op(t){try{if(!_n.existsSync(t))return process.stderr.write(`Configuration file not found: ${t}
32
+ `),{};let e=_n.readFileSync(t,"utf-8"),r=_o.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 Is(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]=Is(s,o):o!==void 0&&(r[n]=o)}return r}function Wa(t=process.argv.slice(2)){try{let e=t.indexOf("--config"),r=e>=0?t[e+1]:void 0,n=r?kf(r):{},o=Sf(),s=$f(t),i={...Os};i=Is(i,n),i=Is(i,o),i=Is(i,s);let a=Ha(i);if(!a.success){let c=z0(a.error);return process.stderr.write(`Configuration validation failed:
34
+ `),{}}}function Qs(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]=Qs(s,o):o!==void 0&&(r[n]=o)}return r}function Lc(t=process.argv.slice(2)){try{let e=t.indexOf("--config"),r=e>=0?t[e+1]:void 0,n=r?Op(r):{},o=Tp(),s=Cp(t),i={...Xs};i=Qs(i,n),i=Qs(i,o),i=Qs(i,s);let a=Mc(i);if(!a.success){let c=$$(a.error);return process.stderr.write(`Configuration validation failed:
35
35
  `),c.forEach(u=>process.stderr.write(` - ${u}
36
- `)),{success:!1,errors:c}}return a.data.documentation.path==="__bundled__"&&(a.data.documentation.path=E0()),{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function z0(t){return t.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function P0(){process.stderr.write(`
36
+ `)),{success:!1,errors:c}}return a.data.documentation.path==="__bundled__"&&(a.data.documentation.path=S$()),{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function $$(t){return t.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function E$(){process.stderr.write(`
37
37
  EUI Compodoc MCP Server - Model Context Protocol server for Angular component documentation
38
38
 
39
39
  Usage:
@@ -91,72 +91,65 @@ Examples:
91
91
  COMPODOC_MCP_DOC_PATH=./documentation.json eui-compodoc-mcp
92
92
 
93
93
  For more information, visit: https://github.com/your-org/eui-compodoc-mcp
94
- `)}var mo=gt(require("fs")),nh=gt(require("path")),oh=require("zlib");var qf=require("node:events"),Ff=require("node:fs"),Zs=require("node:fs/promises"),H=gt(require("node:path"),1);var qt=require("node:fs/promises"),Ir=require("node:path"),Tf=require("node:stream"),et={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},ln={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:et.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:256};Object.freeze(ln);var Cf="READDIRP_RECURSIVE_ERROR",T0=new Set(["ENOENT","EPERM","EACCES","ELOOP",Cf]),Ef=[et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE],C0=new Set([et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE]),O0=new Set([et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE]),I0=t=>T0.has(t.code),R0=process.platform==="win32",zf=t=>!0,Pf=t=>{if(t===void 0)return zf;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 zf},Ga=class extends Tf.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;_relStart;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark??ln.highWaterMark});let r={...ln,...e},n=r.root??ln.root,o=r.type??ln.type;this._fileFilter=Pf(r.fileFilter),this._directoryFilter=Pf(r.directoryFilter);let s=r.lstat?qt.lstat:qt.stat;R0?this._stat=a=>s(a,{bigint:!0}):this._stat=s,this._maxDepth=r.depth!=null&&Number.isSafeInteger(r.depth)?r.depth:ln.depth,this._wantsDir=C0.has(o),this._wantsFile=O0.has(o),this._wantsEverything=o===et.EVERYTHING_TYPE,this._root=(0,Ir.resolve)(n),this._relStart=this._root.endsWith(Ir.sep)?this._root.length:this._root.length+1,this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};let i={path:this._root,depth:1};i.pending=this._exploreDir(this._root,1),this.parents=[i],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=this._isDirent?i:await Promise.all(i);for(let c of a){if(!c)continue;if(this.destroyed)return;let u=this._getEntryType(c);typeof u!="string"&&(u=await u),u==="directory"&&this._directoryFilter(c)?(s<=this._maxDepth&&this.parents.push({path:c.fullPath,depth: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}let s=o.pending??this._exploreDir(o.path,o.depth),i=this.parents[this.parents.length-1];if(i&&!i.pending&&(i.pending=this._exploreDir(i.path,i.depth)),this.parent=await s,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await(0,qt.readdir)(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:r,path:e}}_formatEntry(e,r){let n=this._isDirent?e.name:e,o=(0,Ir.join)(r,n),s={path:o.slice(this._relStart),fullPath:o,basename:n};return this._isDirent?(s.dirent=e,s):this._stat(o).then(i=>(s.stats=i,s),i=>{this._onError(i)})}_onError(e){I0(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}_getEntryType(e){if(!e||!(this._statsProp in e))return"";let r=e[this._statsProp];return r.isFile()?"file":r.isDirectory()?"directory":r.isSymbolicLink()?this._getSymlinkEntryType(e):""}async _getSymlinkEntryType(e){let r=e.fullPath;try{let n=await(0,qt.realpath)(r),o=await(0,qt.lstat)(n);if(o.isFile())return"file";if(o.isDirectory()){let s=n.length;if(r.startsWith(n)&&r[s]===Ir.sep){let i=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return i.code=Cf,this._onError(i),""}return"directory"}}catch(n){this._onError(n)}return""}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function Of(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=et.FILE_DIR_TYPE),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!Ef.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${Ef.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");let n={...e,root:t};return r&&(n.type=r),new Ga(n)}var Dr=require("node:fs"),bt=require("node:fs/promises"),Rf=require("node:os"),he=gt(require("node:path"),1),D0="data",Ya="end",Df="close",js=()=>{};var Ms=process.platform,Qa=Ms==="win32",A0=Ms==="darwin",N0=Ms==="linux",j0=Ms==="freebsd",Af=(0,Rf.type)()==="OS400",be={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},vt=be,M0="watch",L0={lstat:bt.lstat,stat:bt.stat},Rr="listeners",Rs="errHandlers",dn="rawEmitters",Z0=[Rr,Rs,dn],q0=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"]),F0=t=>q0.has(he.extname(t).slice(1).toLowerCase()),Ka=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},so=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},U0=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},io=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},Nf=t=>t instanceof Set?t.size===0:!t,Ds=new Map;function If(t,e,r,n,o){let s=(i,a)=>{r(t),o(i,a,{watchedPath:t}),a&&t!==a&&As(he.resolve(t,a),Rr,he.join(t,a))};try{return(0,Dr.watch)(t,{persistent:e.persistent},s)}catch(i){n(i);return}}var As=(t,e,r,n,o)=>{let s=Ds.get(t);s&&Ka(s[e],i=>{i(r,n,o)})},V0=(t,e,r,n)=>{let{listener:o,errHandler:s,rawEmitter:i}=n,a=Ds.get(e),c;if(!r.persistent)return c=If(t,r,o,s,i),c?c.close.bind(c):void 0;if(a)so(a,Rr,o),so(a,Rs,s),so(a,dn,i);else{if(c=If(t,r,As.bind(null,e,Rr),s,As.bind(null,e,dn)),!c)return;c.on(vt.ERROR,async u=>{let l=As.bind(null,e,Rs);if(a&&(a.watcherUnusable=!0),Qa&&u.code==="EPERM")try{await(await(0,bt.open)(t,"r")).close(),l(u)}catch{}else l(u)}),a={listeners:o,errHandlers:s,rawEmitters:i,watcher:c},Ds.set(e,a)}return()=>{io(a,Rr,o),io(a,Rs,s),io(a,dn,i),Nf(a.listeners)&&(a.watcher.close(),Ds.delete(e),Z0.forEach(U0(a)),a.watcher=void 0,Object.freeze(a))}},Ja=new Map,B0=(t,e,r,n)=>{let{listener:o,rawEmitter:s}=n,i=Ja.get(e),a=i&&i.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&((0,Dr.unwatchFile)(e),i=void 0),i?(so(i,Rr,o),so(i,dn,s)):(i={listeners:o,rawEmitters:s,options:r,watcher:(0,Dr.watchFile)(e,r,(c,u)=>{Ka(i.rawEmitters,d=>{d(vt.CHANGE,e,{curr:c,prev:u})});let l=c.mtimeMs;(c.size!==u.size||l>u.mtimeMs||l===0)&&Ka(i.listeners,d=>d(t,c))})},Ja.set(e,i)),()=>{io(i,Rr,o),io(i,dn,s),Nf(i.listeners)&&(Ja.delete(e),(0,Dr.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=js);let u;if(n.usePolling){let l=n.interval!==n.binaryInterval;c.interval=l&&F0(s)?n.binaryInterval:n.interval,u=B0(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})}else u=V0(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(M0,e,5)){if(!d||d.mtimeMs===0)try{let p=await(0,bt.stat)(e);if(this.fsw.closed)return;let m=p.atimeMs,f=p.mtimeMs;if((!m||m<=f||f!==a.mtimeMs)&&this.fsw._emit(vt.CHANGE,e,p),(A0||N0||j0)&&a.ino!==p.ino){this.fsw._closeFile(l),a=p;let h=this._watchWithNodeFs(e,c);h&&this.fsw._addPathCloser(l,h)}else a=p}catch{this.fsw._remove(o,s)}else if(i.has(s)){let p=d.atimeMs,m=d.mtimeMs;(!p||p<=m||m!==a.mtimeMs)&&this.fsw._emit(vt.CHANGE,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(vt.ADD,e,0))return;this.fsw._emit(vt.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,bt.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(vt.CHANGE,n,e.stats)):(i.add(o),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(vt.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:p=>n.filterPath(p),directoryFilter:p=>n.filterDir(p)});if(d)return d.on(D0,async p=>{if(this.fsw.closed){d=void 0;return}let m=p.path,f=he.join(e,m);if(l.add(m),!(p.stats.isSymbolicLink()&&await this._handleSymlink(p,e,f,m))){if(this.fsw.closed){d=void 0;return}(m===o||!o&&!u.has(m))&&(this.fsw._incrReadyCount(),f=he.join(s,he.relative(s,f)),this._addToNodeFs(f,r,n,i+1))}}).on(vt.ERROR,this._boundHandleError),new Promise((p,m)=>{if(!d)return m();d.once(Ya,()=>{if(this.fsw.closed){d=void 0;return}let f=a?a.clear():!1;p(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(vt.ADD_DIR,e,r),c.add(he.basename(e)),this.fsw._getWatchedDir(e);let l,d,p=this.fsw.options.depth;if((p==null||o<=p)&&!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,(m,f)=>{f&&f.mtimeMs===0||this._handleRead(m,!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 L0[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),p=u?await(0,bt.realpath)(e):e;if(this.fsw.closed||(l=await this._handleDir(a.watchPath,c,r,o,s,a,p),this.fsw.closed))return;d!==p&&p!==void 0&&this.fsw._symlinkPaths.set(d,p)}else if(c.isSymbolicLink()){let d=u?await(0,bt.realpath)(e):e;if(this.fsw.closed)return;let p=he.dirname(a.watchPath);if(this.fsw._getWatchedDir(p).add(a.watchPath),this.fsw._emit(vt.ADD,a.watchPath,c),l=await this._handleDir(p,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 Xa="/",H0="//",Uf=".",W0="..",G0="string",J0=/\\/g,Vf=/\/\//g,K0=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Y0=/^\.[/\\]/;function Ls(t){return Array.isArray(t)?t:[t]}var ec=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function Q0(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 X0(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(Vf,"/"),e&&(t="/"+t),t}function jf(t,e,r){let n=X0(e);for(let o=0;o<t.length;o++){let s=t[o];if(s(n,r))return!0}return!1}function eS(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=Ls(t).map(o=>Q0(o));return e==null?(o,s)=>jf(n,o,s):jf(n,e)}var Mf=t=>{let e=Ls(t).flat();if(!e.every(r=>typeof r===G0))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Bf)},Lf=t=>{let e=t.replace(J0,Xa),r=!1;return e.startsWith(H0)&&(r=!0),e=e.replace(Vf,Xa),r&&(e=Xa+e),e},Bf=t=>Lf(H.normalize(Lf(t))),Zf=(t="")=>e=>typeof e=="string"?Bf(H.isAbsolute(e)?e:H.join(t,e)):e,tS=(t,e)=>H.isAbsolute(t)?t:H.join(e,t),rS=Object.freeze(new Set),tc=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!==Uf&&e!==W0&&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,Zs.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=js,this.items=rS,Object.freeze(this)}},nS="stat",oS="lstat",rc=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,r,n){this.fsw=n;let o=e;this.path=e=e.replace(Y0,""),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?nS:oS}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)}},nc=class extends qf.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?Ls(e.ignored):Ls([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};Af&&(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=js,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(ec(e)){for(let r of this._ignoredPaths)if(ec(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)ec(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=Mf(e);return o&&(s=s.map(i=>tS(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=Mf(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)||Uf;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;Qa&&(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,Zs.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(p){(0,Ff.stat)(c,(m,f)=>{if(m||!l.has(e)){m&&m.code!=="ENOENT"&&o(m);return}let h=Number(new Date);p&&f.size!==p.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&&K0.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=(this.options.ignored||[]).map(Zf(n)),a=[...[...this._ignoredPaths].map(Zf(n)),...s];this._userIgnored=eS(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new rc(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=H.resolve(e);return this._watched.has(r)||this._watched.set(r,new tc(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(p=>this._remove(o,p));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=Of(e,n);return this._streams.add(o),o.once(Df,()=>{o=void 0}),o.once(Ya,()=>{o&&(this._streams.delete(o),o=void 0)}),o}};function Hf(t,e={}){let r=new nc(e);return r.add(t),r}var Yc=gt(rh()),po=class t{pino;context;constructor(e){this.context=e.context,this.pino=(0,Yc.default)({level:e.level},Yc.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)}},fo=null;function Qc(t){return fo=new po(t),fo}function ne(){return fo||(fo=new po({level:"info",format:"text"})),fo}var Zz={failureThreshold:5,successThreshold:2,timeout:1e4,resetTimeout:6e4},si=class{state="CLOSED";failureCount=0;successCount=0;nextAttempt=Date.now();options;name;constructor(e,r={}){this.name=e,this.options={...Zz,...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})}},ii=class{breakers=new Map;get(e,r){return this.breakers.has(e)||this.breakers.set(e,new si(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}},qz=new ii;var ai=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=nh.resolve(e.path),this.watchForChanges=e.watchForChanges,this.reloadDebounce=e.reloadDebounce,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError}async load(){try{if(!mo.existsSync(this.filePath))return{success:!1,error:`Documentation file not found: ${this.filePath}`};let e;if(this.filePath.endsWith(".gz")){let o=await mo.promises.readFile(this.filePath);e=(0,oh.gunzipSync)(o).toString("utf-8")}else e=await mo.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=Hf(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 Zr=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 ci=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 Xc=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 ho=class t extends Xc{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},go=class t extends Error{constructor(r,n){super(r);this.content=n;this.name="ParseError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}content};var ui=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 Zr(r),this.cacheManager=new ci}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 go(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 ho(`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 ho(`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 go(`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 yo=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=Zt.detect(e.path);return r.type==="local"?new ai({path:r.normalizedPath,watchForChanges:e.watchForChanges??!0,reloadDebounce:e.reloadDebounce??1e3,onReload:e.onReload,onError:e.onError}):new ui({url:r.normalizedPath,timeout:e.timeout??1e4,maxRetries:e.maxRetries??3,pollingInterval:e.pollingInterval??6e4,onReload:e.onReload,onError:e.onError})}};var _o=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 sh;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 p=l[d];p in a||(a[p]=u[p].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 Ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},hn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(sh=globalThis).__zod_globalConfig??(sh.__zod_globalConfig={});var gn=globalThis.__zod_globalConfig;function tt(t){return t&&Object.assign(gn,t),gn}var Y={};ff(Y,{BIGINT_FORMAT_RANGES:()=>uh,Class:()=>tu,NUMBER_FORMAT_RANGES:()=>au,aborted:()=>or,allowsEval:()=>ou,assert:()=>Gz,assertEqual:()=>Vz,assertIs:()=>Hz,assertNever:()=>Wz,assertNotEqual:()=>Bz,assignProp:()=>rr,base64ToUint8Array:()=>dh,base64urlToUint8Array:()=>dP,cached:()=>_n,captureStackTrace:()=>fi,cleanEnum:()=>lP,cleanRegex:()=>xo,clone:()=>St,cloneDef:()=>Kz,createTransparentProxy:()=>rP,defineLazy:()=>oe,esc:()=>di,escapeRegex:()=>Vt,explicitlyAborted:()=>cu,extend:()=>sP,finalizeIssue:()=>ct,floatSafeRemainder:()=>ru,getElementAtPath:()=>Yz,getEnumValues:()=>bo,getLengthableOrigin:()=>So,getParsedType:()=>tP,getSizableOrigin:()=>lh,hexToUint8Array:()=>pP,isObject:()=>qr,isPlainObject:()=>nr,issue:()=>vn,joinValues:()=>li,jsonStringifyReplacer:()=>yn,merge:()=>aP,mergeDefs:()=>Ut,normalizeParams:()=>R,nullish:()=>wo,numKeys:()=>eP,objectClone:()=>Jz,omit:()=>oP,optionalKeys:()=>iu,parsedType:()=>uu,partial:()=>cP,pick:()=>nP,prefixIssues:()=>Bt,primitiveTypes:()=>ch,promiseAllObject:()=>Qz,propertyKeyTypes:()=>su,randomString:()=>Xz,required:()=>uP,safeExtend:()=>iP,shallowClone:()=>ah,slugify:()=>nu,stringifyPrimitive:()=>pi,uint8ArrayToBase64:()=>fh,uint8ArrayToBase64url:()=>fP,uint8ArrayToHex:()=>mP,unwrapMessage:()=>vo});function Vz(t){return t}function Bz(t){return t}function Hz(t){}function Wz(t){throw new Error("Unexpected value in exhaustive check")}function Gz(t){}function bo(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 li(t,e="|"){return t.map(r=>pi(r)).join(e)}function yn(t,e){return typeof e=="bigint"?e.toString():e}function _n(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function wo(t){return t==null}function xo(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function ru(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 ih=Symbol("evaluating");function oe(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==ih)return n===void 0&&(n=ih,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Jz(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function rr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ut(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Kz(t){return Ut(t._zod.def)}function Yz(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Qz(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 Xz(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function di(t){return JSON.stringify(t)}function nu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fi="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function qr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var ou=_n(()=>{if(gn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function nr(t){if(qr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(qr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ah(t){return nr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function eP(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var tP=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}`)}},su=new Set(["string","number","symbol"]),ch=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Vt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function St(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 rP(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 pi(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function iu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var au={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]},uh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function nP(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=Ut(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 rr(this,"shape",i),i},checks:[]});return St(t,s)}function oP(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=Ut(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 rr(this,"shape",i),i},checks:[]});return St(t,s)}function sP(t,e){if(!nr(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=Ut(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return rr(this,"shape",s),s}});return St(t,o)}function iP(t,e){if(!nr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ut(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return rr(this,"shape",n),n}});return St(t,r)}function aP(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=Ut(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return rr(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return St(t,r)}function cP(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=Ut(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 rr(this,"shape",c),c},checks:[]});return St(e,i)}function uP(t,e,r){let n=Ut(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 rr(this,"shape",s),s}});return St(e,n)}function or(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 cu(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 Bt(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function vo(t){return typeof t=="string"?t:t?.message}function ct(t,e,r){let n=t.message?t.message:vo(t.inst?._zod.def?.error?.(t))??vo(e?.error?.(t))??vo(r.customError?.(t))??vo(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 lh(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function So(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function uu(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 vn(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function lP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function dh(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 fh(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function dP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return dh(e+r)}function fP(t){return fh(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pP(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 mP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var tu=class{constructor(...e){}};var ph=(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,yn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},mi=v("$ZodError",ph),lu=v("$ZodError",ph,{Parent:Error});function mh(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 hh(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 hi=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 Ot;if(i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>ct(c,s,tt())));throw fi(a,o?.callee),a}return i.value};var gi=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=>ct(c,s,tt())));throw fi(a,o?.callee),a}return i.value};var $o=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 Ot;return s.issues.length?{success:!1,error:new(t??mi)(s.issues.map(i=>ct(i,o,tt())))}:{success:!0,data:s.value}},ko=$o(lu),Eo=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=>ct(i,o,tt())))}:{success:!0,data:s.value}},yi=Eo(lu),gh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return hi(t)(e,r,o)};var yh=t=>(e,r,n)=>hi(t)(e,r,n);var _h=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return gi(t)(e,r,o)};var vh=t=>async(e,r,n)=>gi(t)(e,r,n);var bh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return $o(t)(e,r,o)};var wh=t=>(e,r,n)=>$o(t)(e,r,n);var xh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Eo(t)(e,r,o)};var Sh=t=>async(e,r,n)=>Eo(t)(e,r,n);var $h=/^[cC][0-9a-z]{6,}$/,kh=/^[0-9a-z]+$/,Eh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zh=/^[0-9a-vA-V]{20}$/,Ph=/^[A-Za-z0-9]{27}$/,Th=/^[a-zA-Z0-9_-]{21}$/,Ch=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Oh=/^([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})$/,du=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 Ih=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var gP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Rh(){return new RegExp(gP,"u")}var Dh=/^(?:(?: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])$/,Ah=/^(([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 Nh=/^((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])$/,jh=/^(([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])$/,Mh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fu=/^[A-Za-z0-9_-]*$/;var Lh=/^https?$/,Zh=/^\+[1-9]\d{6,14}$/,qh="(?:(?:\\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])))",Fh=new RegExp(`^${qh}$`);function Uh(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 Vh(t){return new RegExp(`^${Uh(t)}$`)}function Bh(t){let e=Uh({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(`^${qh}T(?:${n})$`)}var Hh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Wh=/^-?\d+$/,pu=/^-?\d+(?:\.\d+)?$/,Gh=/^(?:true|false)$/i,Jh=/^null$/i;var Kh=/^[^A-Z]*$/,Yh=/^[^a-z]*$/;var Pe=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Qh={number:"number",bigint:"bigint",object:"date"},mu=v("$ZodCheckLessThan",(t,e)=>{Pe.init(t,e);let r=Qh[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})}}),hu=v("$ZodCheckGreaterThan",(t,e)=>{Pe.init(t,e);let r=Qh[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})}}),Xh=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):ru(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})}}),eg=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]=au[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=Wh)}),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 tg=v("$ZodCheckMaxLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!wo(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=So(o);n.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),rg=v("$ZodCheckMinLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!wo(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=So(o);n.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),ng=v("$ZodCheckLengthEquals",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!wo(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=So(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})}}),zo=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=()=>{})}),og=v("$ZodCheckRegex",(t,e)=>{zo.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})}}),sg=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Kh),zo.init(t,e)}),ig=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Yh),zo.init(t,e)}),ag=v("$ZodCheckIncludes",(t,e)=>{Pe.init(t,e);let r=Vt(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})}}),cg=v("$ZodCheckStartsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`^${Vt(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})}}),ug=v("$ZodCheckEndsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`.*${Vt(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 lg=v("$ZodCheckOverwrite",(t,e)=>{Pe.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var vi=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(`
95
- `).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(`
96
- `))}};var fg={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=fg;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=or(i),l;for(let d of a){if(d._zod.def.when){if(cu(i)||!d._zod.def.when(i))continue}else if(u)continue;let p=i.issues.length,m=d._zod.check(i);if(m instanceof Promise&&c?.async===!1)throw new Ot;if(l||m instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await m,i.issues.length!==p&&(u||(u=or(i,p)))});else{if(i.issues.length===p)continue;u||(u=or(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(or(i))return i.aborted=!0,i;let u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Ot;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 Ot;return c.then(u=>o(u,n,a))}return o(c,n,a)}}oe(t,"~standard",()=>({validate:o=>{try{let s=ko(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return yi(t,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),xi=v("$ZodString",(t,e)=>{le.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Hh(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)=>{zo.init(t,e),xi.init(t,e)}),wg=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Oh),de.init(t,e)}),xg=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=du(n))}else e.pattern??(e.pattern=du());de.init(t,e)}),Sg=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ih),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===Lh.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})}}}),kg=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Rh()),de.init(t,e)}),Eg=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Th),de.init(t,e)}),zg=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=$h),de.init(t,e)}),Pg=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=kh),de.init(t,e)}),Tg=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Eh),de.init(t,e)}),Cg=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=zh),de.init(t,e)}),Og=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ph),de.init(t,e)}),Ig=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Bh(e)),de.init(t,e)}),Rg=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Fh),de.init(t,e)}),Dg=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Vh(e)),de.init(t,e)}),Ag=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Ch),de.init(t,e)}),Ng=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Dh),de.init(t,e),t._zod.bag.format="ipv4"}),jg=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Ah),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 Mg=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Nh),de.init(t,e)}),Lg=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=jh),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 Zg(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var qg=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Mh),de.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Zg(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function vP(t){if(!fu.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Zg(r)}var Fg=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=fu),de.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{vP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Ug=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Zh),de.init(t,e)});function bP(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 Vg=v("$ZodJWT",(t,e)=>{de.init(t,e),t._zod.check=r=>{bP(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var yu=v("$ZodNumber",(t,e)=>{le.init(t,e),t._zod.pattern=t._zod.bag.pattern??pu,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}}),Bg=v("$ZodNumberFormat",(t,e)=>{eg.init(t,e),yu.init(t,e)}),Hg=v("$ZodBoolean",(t,e)=>{le.init(t,e),t._zod.pattern=Gh,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 Wg=v("$ZodNull",(t,e)=>{le.init(t,e),t._zod.pattern=Jh,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 Gg=v("$ZodUnknown",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Jg=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 pg(t,e,r){t.issues.length&&e.issues.push(...Bt(r,t.issues)),e.value[r]=t.value}var Kg=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=>pg(u,r,i))):pg(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function wi(t,e,r,n,o,s){let i=r in n;if(t.issues.length){if(o&&s&&!i)return;e.issues.push(...Bt(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 Yg(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=iu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Qg(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 p in e){if(p==="__proto__"||a.has(p))continue;if(u==="never"){i.push(p);continue}let m=c.run({value:e[p],issues:[]},n);m instanceof Promise?t.push(m.then(f=>wi(f,r,p,e,l,d))):wi(m,r,p,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 wP=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=_n(()=>Yg(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=qr,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 p of i.keys){let m=d[p],f=m._zod.optin==="optional",h=m._zod.optout==="optional",g=m._zod.run({value:u[p],issues:[]},c);g instanceof Promise?l.push(g.then(_=>wi(_,a,p,u,f,h))):wi(g,a,p,u,f,h)}return s?Qg(l,u,a,c,n.value,t):l.length?Promise.all(l).then(()=>a):a}}),Xg=v("$ZodObjectJIT",(t,e)=>{wP.init(t,e);let r=t._zod.parse,n=_n(()=>Yg(e)),o=p=>{let m=new vi(["shape","payload","ctx"]),f=n.value,h=w=>{let S=di(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");let g=Object.create(null),_=0;for(let w of f.keys)g[w]=`key_${_++}`;m.write("const newResult = {};");for(let w of f.keys){let S=g[w],k=di(w),W=p[w],L=W?._zod?.optin==="optional",re=W?._zod?.optout==="optional";m.write(`const ${S} = ${h(w)};`),L&&re?m.write(`
97
- if (${S}.issues.length) {
98
- if (${k} in input) {
99
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
100
- ...iss,
101
- path: iss.path ? [${k}, ...iss.path] : [${k}]
102
- })));
94
+ `)}var Po=_t(require("fs")),ug=_t(require("path")),lg=require("zlib");var Wp=require("node:events"),Gp=require("node:fs"),ai=require("node:fs/promises"),J=_t(require("node:path"),1);var Bt=require("node:fs/promises"),Lr=require("node:path"),Ap=require("node:stream"),nt={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},vn={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:nt.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:256};Object.freeze(vn);var Np="READDIRP_RECURSIVE_ERROR",k$=new Set(["ENOENT","EPERM","EACCES","ELOOP",Np]),Ip=[nt.DIR_TYPE,nt.EVERYTHING_TYPE,nt.FILE_DIR_TYPE,nt.FILE_TYPE],P$=new Set([nt.DIR_TYPE,nt.EVERYTHING_TYPE,nt.FILE_DIR_TYPE]),z$=new Set([nt.EVERYTHING_TYPE,nt.FILE_DIR_TYPE,nt.FILE_TYPE]),T$=t=>k$.has(t.code),C$=process.platform==="win32",Rp=t=>!0,Dp=t=>{if(t===void 0)return Rp;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 Rp},Zc=class extends Ap.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;_relStart;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark??vn.highWaterMark});let r={...vn,...e},n=r.root??vn.root,o=r.type??vn.type;this._fileFilter=Dp(r.fileFilter),this._directoryFilter=Dp(r.directoryFilter);let s=r.lstat?Bt.lstat:Bt.stat;C$?this._stat=a=>s(a,{bigint:!0}):this._stat=s,this._maxDepth=r.depth!=null&&Number.isSafeInteger(r.depth)?r.depth:vn.depth,this._wantsDir=P$.has(o),this._wantsFile=z$.has(o),this._wantsEverything=o===nt.EVERYTHING_TYPE,this._root=(0,Lr.resolve)(n),this._relStart=this._root.endsWith(Lr.sep)?this._root.length:this._root.length+1,this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};let i={path:this._root,depth:1};i.pending=this._exploreDir(this._root,1),this.parents=[i],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=this._isDirent?i:await Promise.all(i);for(let c of a){if(!c)continue;if(this.destroyed)return;let u=this._getEntryType(c);typeof u!="string"&&(u=await u),u==="directory"&&this._directoryFilter(c)?(s<=this._maxDepth&&this.parents.push({path:c.fullPath,depth: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}let s=o.pending??this._exploreDir(o.path,o.depth),i=this.parents[this.parents.length-1];if(i&&!i.pending&&(i.pending=this._exploreDir(i.path,i.depth)),this.parent=await s,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await(0,Bt.readdir)(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:r,path:e}}_formatEntry(e,r){let n=this._isDirent?e.name:e,o=(0,Lr.join)(r,n),s={path:o.slice(this._relStart),fullPath:o,basename:n};return this._isDirent?(s.dirent=e,s):this._stat(o).then(i=>(s.stats=i,s),i=>{this._onError(i)})}_onError(e){T$(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}_getEntryType(e){if(!e||!(this._statsProp in e))return"";let r=e[this._statsProp];return r.isFile()?"file":r.isDirectory()?"directory":r.isSymbolicLink()?this._getSymlinkEntryType(e):""}async _getSymlinkEntryType(e){let r=e.fullPath;try{let n=await(0,Bt.realpath)(r),o=await(0,Bt.lstat)(n);if(o.isFile())return"file";if(o.isDirectory()){let s=n.length;if(r.startsWith(n)&&r[s]===Lr.sep){let i=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return i.code=Np,this._onError(i),""}return"directory"}}catch(n){this._onError(n)}return""}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function jp(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=nt.FILE_DIR_TYPE),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!Ip.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${Ip.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");let n={...e,root:t};return r&&(n.type=r),new Zc(n)}var Fr=require("node:fs"),xt=require("node:fs/promises"),Lp=require("node:os"),ge=_t(require("node:path"),1),O$="data",Uc="end",Zp="close",oi=()=>{};var si=process.platform,Vc=si==="win32",I$=si==="darwin",R$=si==="linux",D$=si==="freebsd",Fp=(0,Lp.type)()==="OS400",we={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},wt=we,A$="watch",N$={lstat:xt.lstat,stat:xt.stat},Zr="listeners",ei="errHandlers",bn="rawEmitters",j$=[Zr,ei,bn],M$=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"]),L$=t=>M$.has(ge.extname(t).slice(1).toLowerCase()),qc=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},vo=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},Z$=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},bo=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},qp=t=>t instanceof Set?t.size===0:!t,ti=new Map;function Mp(t,e,r,n,o){let s=(i,a)=>{r(t),o(i,a,{watchedPath:t}),a&&t!==a&&ri(ge.resolve(t,a),Zr,ge.join(t,a))};try{return(0,Fr.watch)(t,{persistent:e.persistent},s)}catch(i){n(i);return}}var ri=(t,e,r,n,o)=>{let s=ti.get(t);s&&qc(s[e],i=>{i(r,n,o)})},F$=(t,e,r,n)=>{let{listener:o,errHandler:s,rawEmitter:i}=n,a=ti.get(e),c;if(!r.persistent)return c=Mp(t,r,o,s,i),c?c.close.bind(c):void 0;if(a)vo(a,Zr,o),vo(a,ei,s),vo(a,bn,i);else{if(c=Mp(t,r,ri.bind(null,e,Zr),s,ri.bind(null,e,bn)),!c)return;c.on(wt.ERROR,async u=>{let l=ri.bind(null,e,ei);if(a&&(a.watcherUnusable=!0),Vc&&u.code==="EPERM")try{await(await(0,xt.open)(t,"r")).close(),l(u)}catch{}else l(u)}),a={listeners:o,errHandlers:s,rawEmitters:i,watcher:c},ti.set(e,a)}return()=>{bo(a,Zr,o),bo(a,ei,s),bo(a,bn,i),qp(a.listeners)&&(a.watcher.close(),ti.delete(e),j$.forEach(Z$(a)),a.watcher=void 0,Object.freeze(a))}},Fc=new Map,q$=(t,e,r,n)=>{let{listener:o,rawEmitter:s}=n,i=Fc.get(e),a=i&&i.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&((0,Fr.unwatchFile)(e),i=void 0),i?(vo(i,Zr,o),vo(i,bn,s)):(i={listeners:o,rawEmitters:s,options:r,watcher:(0,Fr.watchFile)(e,r,(c,u)=>{qc(i.rawEmitters,d=>{d(wt.CHANGE,e,{curr:c,prev:u})});let l=c.mtimeMs;(c.size!==u.size||l>u.mtimeMs||l===0)&&qc(i.listeners,d=>d(t,c))})},Fc.set(e,i)),()=>{bo(i,Zr,o),bo(i,bn,s),qp(i.listeners)&&(Fc.delete(e),(0,Fr.unwatchFile)(e),i.options=i.watcher=void 0,Object.freeze(i))}},ni=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let n=this.fsw.options,o=ge.dirname(e),s=ge.basename(e);this.fsw._getWatchedDir(o).add(s);let a=ge.resolve(e),c={persistent:n.persistent};r||(r=oi);let u;if(n.usePolling){let l=n.interval!==n.binaryInterval;c.interval=l&&L$(s)?n.binaryInterval:n.interval,u=q$(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})}else u=F$(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=ge.dirname(e),s=ge.basename(e),i=this.fsw._getWatchedDir(o),a=r;if(i.has(s))return;let c=async(l,d)=>{if(this.fsw._throttle(A$,e,5)){if(!d||d.mtimeMs===0)try{let p=await(0,xt.stat)(e);if(this.fsw.closed)return;let m=p.atimeMs,f=p.mtimeMs;if((!m||m<=f||f!==a.mtimeMs)&&this.fsw._emit(wt.CHANGE,e,p),(I$||R$||D$)&&a.ino!==p.ino){this.fsw._closeFile(l),a=p;let h=this._watchWithNodeFs(e,c);h&&this.fsw._addPathCloser(l,h)}else a=p}catch{this.fsw._remove(o,s)}else if(i.has(s)){let p=d.atimeMs,m=d.mtimeMs;(!p||p<=m||m!==a.mtimeMs)&&this.fsw._emit(wt.CHANGE,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(wt.ADD,e,0))return;this.fsw._emit(wt.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,xt.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(wt.CHANGE,n,e.stats)):(i.add(o),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(wt.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=ge.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:p=>n.filterPath(p),directoryFilter:p=>n.filterDir(p)});if(d)return d.on(O$,async p=>{if(this.fsw.closed){d=void 0;return}let m=p.path,f=ge.join(e,m);if(l.add(m),!(p.stats.isSymbolicLink()&&await this._handleSymlink(p,e,f,m))){if(this.fsw.closed){d=void 0;return}(m===o||!o&&!u.has(m))&&(this.fsw._incrReadyCount(),f=ge.join(s,ge.relative(s,f)),this._addToNodeFs(f,r,n,i+1))}}).on(wt.ERROR,this._boundHandleError),new Promise((p,m)=>{if(!d)return m();d.once(Uc,()=>{if(this.fsw.closed){d=void 0;return}let f=a?a.clear():!1;p(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(ge.dirname(e)),u=c.has(ge.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&this.fsw._emit(wt.ADD_DIR,e,r),c.add(ge.basename(e)),this.fsw._getWatchedDir(e);let l,d,p=this.fsw.options.depth;if((p==null||o<=p)&&!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,(m,f)=>{f&&f.mtimeMs===0||this._handleRead(m,!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 N$[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=ge.resolve(e),p=u?await(0,xt.realpath)(e):e;if(this.fsw.closed||(l=await this._handleDir(a.watchPath,c,r,o,s,a,p),this.fsw.closed))return;d!==p&&p!==void 0&&this.fsw._symlinkPaths.set(d,p)}else if(c.isSymbolicLink()){let d=u?await(0,xt.realpath)(e):e;if(this.fsw.closed)return;let p=ge.dirname(a.watchPath);if(this.fsw._getWatchedDir(p).add(a.watchPath),this.fsw._emit(wt.ADD,a.watchPath,c),l=await this._handleDir(p,c,r,o,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(ge.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 Bc="/",U$="//",Jp=".",V$="..",B$="string",H$=/\\/g,Kp=/\/\//g,W$=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,G$=/^\.[/\\]/;function ii(t){return Array.isArray(t)?t:[t]}var Hc=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function J$(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=J.relative(t.path,e);return r?!r.startsWith("..")&&!J.isAbsolute(r):!1}return!1}:()=>!1}function K$(t){if(typeof t!="string")throw new Error("string expected");t=J.normalize(t),t=t.replace(/\\/g,"/");let e=!1;return t.startsWith("//")&&(e=!0),t=t.replace(Kp,"/"),e&&(t="/"+t),t}function Up(t,e,r){let n=K$(e);for(let o=0;o<t.length;o++){let s=t[o];if(s(n,r))return!0}return!1}function Y$(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=ii(t).map(o=>J$(o));return e==null?(o,s)=>Up(n,o,s):Up(n,e)}var Vp=t=>{let e=ii(t).flat();if(!e.every(r=>typeof r===B$))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Yp)},Bp=t=>{let e=t.replace(H$,Bc),r=!1;return e.startsWith(U$)&&(r=!0),e=e.replace(Kp,Bc),r&&(e=Bc+e),e},Yp=t=>Bp(J.normalize(Bp(t))),Hp=(t="")=>e=>typeof e=="string"?Yp(J.isAbsolute(e)?e:J.join(t,e)):e,X$=(t,e)=>J.isAbsolute(t)?t:J.join(e,t),Q$=Object.freeze(new Set),Wc=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!==Jp&&e!==V$&&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,ai.readdir)(n)}catch{this._removeWatcher&&this._removeWatcher(J.dirname(n),J.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=oi,this.items=Q$,Object.freeze(this)}},eE="stat",tE="lstat",Gc=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,r,n){this.fsw=n;let o=e;this.path=e=e.replace(G$,""),this.watchPath=o,this.fullWatchPath=J.resolve(o),this.dirParts=[],this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?eE:tE}entryPath(e){return J.join(this.watchPath,J.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)}},Jc=class extends Wp.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?ii(e.ignored):ii([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};Fp&&(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=oi,this._readyEmitted=!0,process.nextTick(()=>this.emit(we.READY)))},this._emitRaw=(...c)=>this.emit(we.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=o,this._nodeFsHandler=new ni(this),Object.freeze(o)}_addIgnoredPath(e){if(Hc(e)){for(let r of this._ignoredPaths)if(Hc(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)Hc(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=Vp(e);return o&&(s=s.map(i=>X$(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(J.dirname(a),J.basename(r||a))})}),this}unwatch(e){if(this.closed)return this;let r=Vp(e),{cwd:n}=this.options;return r.forEach(o=>{!J.isAbsolute(o)&&!this._closers.has(o)&&(n&&(o=J.join(n,o)),o=J.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?J.relative(this.options.cwd,n):n)||Jp;e[s]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(e,...r),e!==we.ERROR&&this.emit(we.ALL,e,...r)}async _emit(e,r,n){if(this.closed)return;let o=this.options;Vc&&(r=J.normalize(r)),o.cwd&&(r=J.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===we.UNLINK)return this._pendingUnlinks.set(r,[e,...s]),setTimeout(()=>{this._pendingUnlinks.forEach((c,u)=>{this.emit(...c),this.emit(we.ALL,...c),this._pendingUnlinks.delete(u)})},typeof o.atomic=="number"?o.atomic:100),this;e===we.ADD&&this._pendingUnlinks.has(r)&&(e=we.CHANGE,this._pendingUnlinks.delete(r))}if(i&&(e===we.ADD||e===we.CHANGE)&&this._readyEmitted){let c=(u,l)=>{u?(e=we.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===we.CHANGE&&!this._throttle(we.CHANGE,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===we.ADD||e===we.ADD_DIR||e===we.CHANGE)){let c=o.cwd?J.join(o.cwd,r):r,u;try{u=await(0,ai.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(we.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&&!J.isAbsolute(e)&&(c=J.join(this.options.cwd,e));let u=new Date,l=this._pendingWrites;function d(p){(0,Gp.stat)(c,(m,f)=>{if(m||!l.has(e)){m&&m.code!=="ENOENT"&&o(m);return}let h=Number(new Date);p&&f.size!==p.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&&W$.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=(this.options.ignored||[]).map(Hp(n)),a=[...[...this._ignoredPaths].map(Hp(n)),...s];this._userIgnored=Y$(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new Gc(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=J.resolve(e);return this._watched.has(r)||this._watched.set(r,new Wc(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,r,n){let o=J.join(e,r),s=J.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(p=>this._remove(o,p));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=J.relative(this.options.cwd,o)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===we.ADD)return;this._watched.delete(o),this._watched.delete(s);let d=n?we.UNLINK_DIR:we.UNLINK;u&&!this._isIgnored(o)&&this._emit(d,o),this._closePath(o)}_closePath(e){this._closeFile(e);let r=J.dirname(e);this._getWatchedDir(r).remove(J.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:we.ALL,alwaysStat:!0,lstat:!0,...r,depth:0},o=jp(e,n);return this._streams.add(o),o.once(Zp,()=>{o=void 0}),o.once(Uc,()=>{o&&(this._streams.delete(o),o=void 0)}),o}};function Xp(t,e={}){let r=new Jc(e);return r.add(t),r}var Uu=_t(cg()),ko=class t{pino;context;constructor(e){this.context=e.context,this.pino=(0,Uu.default)({level:e.level},Uu.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)}},Eo=null;function Vu(t){return Eo=new ko(t),Eo}function oe(){return Eo||(Eo=new ko({level:"info",format:"text"})),Eo}var jT={failureThreshold:5,successThreshold:2,timeout:1e4,resetTimeout:6e4},ki=class{state="CLOSED";failureCount=0;successCount=0;nextAttempt=Date.now();options;name;constructor(e,r={}){this.name=e,this.options={...jT,...r}}getState(){return this.state}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,nextAttempt:this.nextAttempt}}async execute(e){let r=oe();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=oe();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=oe();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=oe();this.state="CLOSED",this.failureCount=0,this.successCount=0,this.nextAttempt=Date.now(),e.info("Circuit breaker manually reset",{name:this.name})}},Pi=class{breakers=new Map;get(e,r){return this.breakers.has(e)||this.breakers.set(e,new ki(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}},MT=new Pi;var zi=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=ug.resolve(e.path),this.watchForChanges=e.watchForChanges,this.reloadDebounce=e.reloadDebounce,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError}async load(){try{if(!Po.existsSync(this.filePath))return{success:!1,error:`Documentation file not found: ${this.filePath}`};let e;if(this.filePath.endsWith(".gz")){let o=await Po.promises.readFile(this.filePath);e=(0,lg.gunzipSync)(o).toString("utf-8")}else e=await Po.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,oe().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=Xp(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));oe().error("File watcher error",r),this.onErrorCallback&&this.onErrorCallback(r)}),oe().info(`Watching for changes: ${this.filePath}`))}scheduleReload(){this.reloadTimer&&clearTimeout(this.reloadTimer),this.reloadTimer=setTimeout(()=>{this.reload()},this.reloadDebounce)}async reload(){oe().info("Reloading documentation...");let e=await this.load();e.success&&e.data?(oe().info("Documentation reloaded successfully"),this.onReloadCallback&&this.onReloadCallback(e.data)):(oe().error("Failed to reload documentation",new Error(e.error)),this.onErrorCallback&&this.onErrorCallback(new Error(e.error)))}};var Wr=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 Ti=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 Bu=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 zo=class t extends Bu{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},To=class t extends Error{constructor(r,n){super(r);this.content=n;this.name="ParseError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}content};var Ci=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 Wr(r),this.cacheManager=new Ti}async load(){return this.fetchDocumentation()}startMonitoring(){this.pollingTimer||(this.pollingTimer=setInterval(()=>{this.poll()},this.pollingInterval),oe().info(`Started polling ${this.url} every ${this.pollingInterval}ms`))}async stopMonitoring(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=void 0,oe().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{oe().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){oe().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 To(o,r.data);this.cacheManager.set(this.url,n,r.headers),this.currentData=n,oe().info(`Documentation updated from ${this.url}`),this.onReloadCallback&&this.onReloadCallback(n);return}throw new zo(`HTTP ${r.status}: ${r.statusText}`,this.url,r.status,r.statusText)}catch(e){let r=e instanceof Error?e.message:String(e);oe().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 oe().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 zo(`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 To(`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 Co=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=Vt.detect(e.path);return r.type==="local"?new zi({path:r.normalizedPath,watchForChanges:e.watchForChanges??!0,reloadDebounce:e.reloadDebounce??1e3,onReload:e.onReload,onError:e.onError}):new Ci({url:r.normalizedPath,timeout:e.timeout??1e4,maxRetries:e.maxRetries??3,pollingInterval:e.pollingInterval??6e4,onReload:e.onReload,onError:e.onError})}};var Oo=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 j={};_p(j,{BIGINT_FORMAT_RANGES:()=>Di,CONSTANT_CATCH:()=>wg,Class:()=>Gu,NUMBER_FORMAT_RANGES:()=>Ro,aborted:()=>kt,allowsEval:()=>Qu,assert:()=>HT,assertEqual:()=>FT,assertIs:()=>VT,assertNever:()=>BT,assertNotEqual:()=>qT,assignProp:()=>ot,attachSchema:()=>Do,base64ToUint8Array:()=>vg,base64urlToUint8Array:()=>dC,cached:()=>Pn,captureStackTrace:()=>Ii,cleanEnum:()=>lC,cleanRegex:()=>Io,clone:()=>Et,cloneDef:()=>JT,codePointLength:()=>Ao,constantCatch:()=>xg,createTransparentProxy:()=>tC,defineLazy:()=>fg,defineLazyInternal:()=>ee,derived:()=>hC,esc:()=>Yu,escapeRegex:()=>Jt,explicitlyAborted:()=>rl,extend:()=>oC,finalizeIssue:()=>Pt,floatSafeRemainder:()=>Ku,getElementAtPath:()=>KT,getEnumValues:()=>En,getLengthableOrigin:()=>No,getParsedType:()=>eC,getSizableOrigin:()=>_g,hexToUint8Array:()=>pC,hide:()=>ji,installLazyProp:()=>vC,isObject:()=>Jr,isPlainObject:()=>lr,issue:()=>Tn,joinValues:()=>Oi,jsonStringifyReplacer:()=>kn,members:()=>ol,merge:()=>iC,mergeDefs:()=>Gt,normalizeParams:()=>D,nullish:()=>Ju,numKeys:()=>QT,objectClone:()=>WT,omit:()=>nC,optionalKeys:()=>tl,own:()=>ur,parsedType:()=>nl,partial:()=>aC,pick:()=>rC,prefixIssues:()=>Kt,primitiveTypes:()=>gg,promiseAllObject:()=>YT,propertyKeyTypes:()=>el,randomString:()=>XT,rawShape:()=>zn,required:()=>cC,safeExtend:()=>sC,shallowClone:()=>hg,sizeCaps:()=>Ni,slugify:()=>Xu,stringifyPrimitive:()=>Ri,toZod:()=>UT,uint8ArrayToBase64:()=>bg,uint8ArrayToBase64url:()=>fC,uint8ArrayToHex:()=>mC,unwrapMessage:()=>$n});function FT(t){return t}function qT(t){return t}function UT(){return t=>t}function VT(t){}function BT(t){throw new Error("Unexpected value in exhaustive check")}function HT(t){}function En(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 Oi(t,e="|"){return t.map(r=>Ri(r)).join(e)}function kn(t,e){return typeof e=="bigint"?e.toString():e}var Wu=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Pn(t){return new Wu(t)}function Ju(t){return t==null}function Io(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Ku(t,e){let r=t/e,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var dg=Symbol("evaluating");function fg(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==dg)return n===void 0&&(n=dg,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function WT(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function ot(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function zn(t){let e=Object.getOwnPropertyDescriptor(t,"shape");return e?.get?e.get.raw:e?.value}function Wt(t){return zn(t._zod.def)??t._zod.def.shape}function pg(t,e,r){Object.defineProperty(t,e,{get(){let n=r();return ot(this,e,n),n},enumerable:!0,configurable:!0})}function mg(t,e,r){e in t?ot(t,e,r):t[e]=r}function Gr(t,e,r,n){let o=Wt(e);for(let s of r){let i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?pg(t,s,()=>{let a=e._zod.def.shape[s];return n?n(a,s):a}):mg(t,s,n?n(i.value,s):i.value))}}function GT(t,e){for(let r of Reflect.ownKeys(e)){let n=Object.getOwnPropertyDescriptor(e,r);n.enumerable&&(n.get?pg(t,r,()=>e[r]):mg(t,r,n.value))}}function Gt(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function JT(t){return Gt(t._zod.def)}function KT(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function YT(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 XT(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function Yu(t){return JSON.stringify(t)}function Xu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ii="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Jr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Qu=Pn(()=>{if(Je.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function lr(t){if(Jr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Jr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function hg(t){return lr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function QT(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var eC=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}`)}},el=new Set(["string","number","symbol"]),gg=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Jt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Et(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function D(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 tC(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 Ri(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function tl(t){return Object.keys(t).filter(e=>t[e]._zod.optin!==void 0&&t[e]._zod.optout==="optional")}var Ro={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]},Di={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rC(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={};return Gr(s,t,Ai(t,e)),Et(t,Gt(r,{shape:s,checks:[]}))}function Ai(t,e){let r=Wt(t),n=[];for(let o of Reflect.ownKeys(e)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);e[o]&&n.push(o)}return n}function nC(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=new Set(Ai(t,e)),i={};return Gr(i,t,Reflect.ownKeys(Wt(t)).filter(a=>!s.has(a))),Et(t,Gt(r,{shape:i,checks:[]}))}function oC(t,e){if(!lr(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let o=Wt(t);for(let s of Reflect.ownKeys(e))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Et(t,Gt(t._zod.def,{shape:yg(t,e)}))}function yg(t,e){let r={};return Gr(r,t,Reflect.ownKeys(Wt(t))),GT(r,e),r}function sC(t,e){if(!lr(e))throw new Error("Invalid input to safeExtend: expected a plain object");return Et(t,Gt(t._zod.def,{shape:yg(t,e)}))}function iC(t,e){if(!e?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Gr(r,t,Reflect.ownKeys(Wt(t))),Gr(r,e,Reflect.ownKeys(Wt(e)));let n=Gt(t._zod.def,{shape:r,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Et(t,n)}function aC(t,e,r,n="partial"){let s=e._zod.def.checks;if(s&&s.length>0)throw new Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(Ai(e,r)):void 0,c={};return Gr(c,e,Reflect.ownKeys(Wt(e)),t&&((u,l)=>a&&!a.has(l)?u:new t({type:"optional",innerType:u}))),Et(e,Gt(e._zod.def,{shape:c,checks:[]}))}function cC(t,e,r){let n=r?new Set(Ai(e,r)):void 0,o={};return Gr(o,e,Reflect.ownKeys(Wt(e)),(s,i)=>n&&!n.has(i)?s:new t({type:"nonoptional",innerType:s})),Et(e,Gt(e._zod.def,{shape:o}))}function kt(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 rl(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 Kt(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function $n(t){return typeof t=="string"?t:t?.message}function Ni(t){let e=[];for(let r of t??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;o>=0&&e.push([o,r])}return e}function Do(t,e,r){var n;for(let o=e;o<t.length;o++)(n=t[o]).schema??(n.schema=r)}function Pt(t,e,r){var n;let o=t.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(n=t).schema??(n.schema=t.inst):t.schema=t.inst);let s=t.schema!==t.inst?t.schema?._zod.def?.error:void 0,i=t.message?t.message:$n(t.inst?._zod.def?.error?.(t))??$n(s?.(t))??$n(e?.error?.(t))??$n(r.customError?.(t))??$n(r.localeError?.(t))??"Invalid input",a={};for(let c of Object.keys(t))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=t[c]);return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=t.input),a}function _g(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}var uC=/[\uD800-\uDBFF]/;function Ao(t){let e=t.length;if(!uC.test(t))return e;let r=e;for(let n=0;n<e-1;n++)(t.charCodeAt(n)&64512)===55296&&(t.charCodeAt(n+1)&64512)===56320&&(r--,n++);return r}function No(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function nl(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 Tn(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function lC(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function vg(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 bg(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function dC(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return vg(e+r)}function fC(t){return bg(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pC(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 mC(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Gu=class{constructor(...e){}};function ol(t,e){for(let r in e){let n=Object.getOwnPropertyDescriptor(e,r);n.get?Object.defineProperty(t,r,{...n,enumerable:!1}):gC(t,r,n.value)}}function ur(t,e,r,n=!0){return Object.defineProperty(t,e,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function ji(t,e,r){return ur(t,e,r,!1)}function hC(t,e){for(let r in t){let n=t[r];Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get(){return ur(this,r,n(this))},set(o){ur(this,r,o)}})}return e}function gC(t,e,r){Object.defineProperty(t,e,{configurable:!0,get(){return this==null?r:ur(this,e,r.bind(this))},set(n){ur(this,e,n)}})}function yC(t,e){let r=Object.getPrototypeOf(t);return e in r?void 0:r}var Hu,cr=!1,_C={configurable:!0,get(){cr=!0}};function ee(t,e,r){let n=Object.getPrototypeOf(t._zod);if(e in n&&Hu!==t._zod){Hu=void 0;return}Hu=t._zod,Object.defineProperty(n,e,{configurable:!0,get(){Object.defineProperty(this,e,_C);let o=cr;cr=!1;try{let s=r(this);return cr?delete this[e]:Object.defineProperty(this,e,{configurable:!0,writable:!0,value:s}),cr=cr||o,s}catch(s){throw delete this[e],cr=cr||o,s}},set(o){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:o})}})}function vC(t,e,r,n){let o=yC(t,e);o&&Object.defineProperty(o,e,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,e,s),s.value=r(this),Object.defineProperty(this,e,s),s.value},set(s){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var wg="~constantCatch";function xg(t){let e=()=>t;return e[wg]=!0,e}var Sg;var sl={value:void 0,enumerable:!1},$g="captureStackTrace"in Error?Error:null;function bC(t){let e=$g;if(e){let r=e.stackTraceLimit;if(typeof r=="number"){try{e.stackTraceLimit=0}catch{return $g=null,new t}try{return new t}finally{e.stackTraceLimit=r}}}return new t}function b(t,e,r,n){let o={};function s(p){this.def=p,this.constr=d,this.traits=new Set}s.prototype=o;let i=r,a=i&&new WeakSet;function c(p,m){if(p._zod){if(p._zod.traits.has(t))return}else{sl.value=new s(m);try{Object.defineProperty(p,"_zod",sl)}finally{sl.value=void 0}}if(p._zod.traits.add(t),e(p,m),a){let h=Object.getPrototypeOf(p),g=p._zod.constr.prototype,y=h;for(;y&&y!==g;)y=Object.getPrototypeOf(y);let v=y??h;a.has(v)||(a.add(v),ol(v,i))}let f=d.prototype;for(let h in f)Object.prototype.hasOwnProperty.call(f,h)&&(h in p||(p[h]=f[h].bind(p)))}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:t});function d(p){let m=n?.Parent?bC(l):this;c(m,p);let f=m._zod.deferred;if(f){for(let g of f)g();m._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;return h&&h(m),m}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>n?.Parent&&p instanceof n.Parent?!0:p?._zod?.traits?.has(t)}),Object.defineProperty(d,"name",{value:t}),d}var zt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Cn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Sg=globalThis).__zod_globalConfig??(Sg.__zod_globalConfig={});var Je=globalThis.__zod_globalConfig;function st(t){return t&&Object.assign(Je,t),Je}function wC(){let t=this._zod;return t.message??(t.message=JSON.stringify(t.def,kn,2)),t.message}function xC(t){this._zod.message=t}var SC={get:wC,set:xC,enumerable:!0,configurable:!0},al={value:void 0,enumerable:!1},Eg=new WeakSet([Object.prototype,Error.prototype]),kg=(t,e)=>{t.name="$ZodError",al.value=e,Object.defineProperty(t,"issues",al),al.value=void 0,Object.defineProperty(t,"message",SC);let r=Object.getPrototypeOf(t);Eg.has(r)||(Eg.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}}))},Pg=b("$ZodError",kg),zg=b("$ZodError",kg,void 0,{Parent:Error});function $C(t,e,r){return Object.prototype.hasOwnProperty.call(t,e)||(e==="__proto__"?Object.defineProperty(t,e,{value:r(),writable:!0,enumerable:!0,configurable:!0}):t[e]=r()),t[e]}function Tg(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?$C(r,o.path[0],()=>[]).push(e(o)):n.push(e(o));return{formErrors:n,fieldErrors:r}}function Cg(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],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(e(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let p=c[l];d&&p._errors.push(e(i)),c=p,u++}}}};return n(t),r}function Mi(t,e){return{callee:e?.callee??t,Err:e?.Err}}var Li=t=>{let e=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new zt;if(a.issues.length){let c=new(s?.Err??t)(a.issues.map(u=>Pt(u,i,st())));throw Ii(c,s?.callee??e),c}return a.value};return e};var Zi=t=>{let e=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??t)(a.issues.map(u=>Pt(u,i,st())));throw Ii(c,s?.callee??e),c}return a.value};return e};var jo=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 zt;return s.issues.length?Og(t,s.issues,o):{success:!0,data:s.value}},cl=jo(zg);function Og(t,e,r){let n;return{success:!1,get error(){return n||(n=new t(e.map(o=>Pt(o,r,st()))),e=void 0,r=void 0),n},set error(o){n=o,e=void 0,r=void 0}}}var Fi=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?Og(t,s.issues,o):{success:!0,data:s.value}};var kC=Symbol.for("zod.compile.invalid"),PC=Symbol.for("zod.compile.fallback"),qi=((t,e,r)=>{let n=t._zod.bag.validator;if(n!==void 0){if(n(e)!==kC)return!0;if(n.definite===!0&&r===void 0)return!1}return zC(t,e,r)});function zC(t,e,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=t._zod.bag.fallbackRun,s;if(o?(n[PC]=!0,s=o({value:e,issues:[]},n)):s=t._zod.run({value:e,issues:[]},n),s instanceof Promise)throw new zt;return s.issues.length===0}var Ui=async(t,e,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=t._zod.run({value:e,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length===0},Ig=t=>{let e=Li(t),r=(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return e(n,o,a,Mi(r,i))};return r};var Rg=t=>{let e=Li(t),r=(n,o,s,i)=>e(n,o,s,Mi(r,i));return r};var Dg=t=>{let e=Zi(t),r=async(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await e(n,o,a,Mi(r,i))};return r};var Ag=t=>{let e=Zi(t),r=async(n,o,s,i)=>await e(n,o,s,Mi(r,i));return r};var Ng=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return jo(t)(e,r,o)};var jg=t=>(e,r,n)=>jo(t)(e,r,n);var Mg=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Fi(t)(e,r,o)};var Lg=t=>async(e,r,n)=>Fi(t)(e,r,n);var Zg=/^[cC][0-9a-z]{6,}$/,Fg=/^[0-9a-z]+$/,qg=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ug=/^[0-9a-vA-V]{20}$/,Vg=/^[A-Za-z0-9]{27}$/,Bg=/^[a-zA-Z0-9_-]{21}$/;function Hg(t){return new RegExp(`^[a-zA-Z0-9_-]{${t}}$`)}var Wg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Gg=/^([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})$/,ll=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 Jg=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var TC="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Kg(){return new RegExp(TC,"u")}var Yg=/^(?:(?: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])$/,Xg=/^(([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 Qg=/^((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])$/,ey=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ty=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ry=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var ny=/^https?$/,oy=/^\+[1-9]\d{6,14}$/;var sy="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function CC(t){return new RegExp(`^${t}$`)}var iy=CC(sy);function ul(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}}`:t.seconds?`${e}:[0-5]\\d(?:\\.\\d+)?`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ay(t){return new RegExp(`^${ul(t)}$`)}function cy(t){let e=["Z"];t.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${ul({precision:t.precision,seconds:!0})}(?:${e.join("|")})`,n=t.local?`${r}|${ul({precision:t.precision})}`:r;return new RegExp(`^${sy}T(?:${n})$`)}var uy=/^[\s\S]{0,}$/;var dl=/^-?\d+$/,Mo=/^-?\d+(?:\.\d+)?$/,ly=/^(?:true|false)$/i,dy=/^null$/i;var fy=/^[^A-Z]*$/,py=/^[^a-z]*$/;var Oe=b("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])});var fl=t=>{let e=t.value;return!Ju(e)&&e.length!==void 0},Vi={number:"number",bigint:"bigint",object:"date"},pl=b("$ZodCheckLessThan",(t,e)=>{Oe.init(t,e);let r=Vi[typeof e.value];t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:Vi[typeof n.value]??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})}}),ml=b("$ZodCheckGreaterThan",(t,e)=>{Oe.init(t,e);let r=Vi[typeof e.value];t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:Vi[typeof n.value]??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})}}),my=b("$ZodCheckMultipleOf",(t,e)=>{Oe.init(t,e),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"?e.value!==BigInt(0)&&r.value%e.value===BigInt(0):Ku(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})}}),hy=b("$ZodCheckNumberFormat",(t,e)=>{Oe.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=Ro[e.format];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 gy=b("$ZodCheckMaxLength",(t,e)=>{var r;Oe.init(t,e),(r=t._zod.def).when??(r.when=fl),t._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>e.maximum?Ao(o):s)<=e.maximum)return;let a=No(o);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),yy=b("$ZodCheckMinLength",(t,e)=>{var r;Oe.init(t,e),(r=t._zod.def).when??(r.when=fl),t._zod.check=n=>{let o=n.value,s=o.length;if((typeof o=="string"&&s>=e.minimum&&s<e.minimum*2?Ao(o):s)>=e.minimum)return;let a=No(o);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),_y=b("$ZodCheckLengthEquals",(t,e)=>{var r;Oe.init(t,e),(r=t._zod.def).when??(r.when=fl),t._zod.check=n=>{let o=n.value,s=o.length,i=typeof o=="string"&&s>=e.length&&s<=e.length*2?Ao(o):s;if(i===e.length)return;let a=No(o),c=i>e.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),Zo=b("$ZodCheckStringFormat",(t,e)=>{var r,n;Oe.init(t,e),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=()=>{})}),vy=b("$ZodCheckRegex",(t,e)=>{Zo.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})}}),by=b("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=fy),Zo.init(t,e)}),wy=b("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=py),Zo.init(t,e)}),xy=b("$ZodCheckIncludes",(t,e)=>{Oe.init(t,e);let r=Jt(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position},}${r}`:r);e.pattern=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})}}),Sy=b("$ZodCheckStartsWith",(t,e)=>{Oe.init(t,e);let r=new RegExp(`^${Jt(e.prefix)}.*`);e.pattern??(e.pattern=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})}}),$y=b("$ZodCheckEndsWith",(t,e)=>{Oe.init(t,e);let r=new RegExp(`.*${Jt(e.suffix)}$`);e.pattern??(e.pattern=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 Ey=b("$ZodCheckOverwrite",(t,e)=>{Oe.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var Bi=class{constructor(e=[],r={}){this.content=[],this.indent=0,this.args=e,this.closed=r}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
95
+ `).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?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
96
+ ${r.join(`
97
+ `)}
98
+ };`)(...Object.values(this.closed))}};var Py={major:4,minor:6,patch:7};var de=b("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Py;let n=t._zod.def.checks,o=t._zod.traits.has("$ZodCheck")?[t,...n??[]]:n?.length?[...n]:[];for(let s of o)for(let i of s._zod.onattach)i(t);if(o.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let l=kt(a),d;for(let p of c){if(p._zod.def.when){if(rl(a)||!p._zod.def.when(a))continue}else if(l)continue;let m=a.issues.length,f=p._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new zt;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await f,a.issues.length!==m&&(Do(a.issues,m,t),l||(l=kt(a,m)))});else{if(a.issues.length===m)continue;Do(a.issues,m,t),l||(l=kt(a,m))}}return d?d.then(()=>a):a},i=(a,c,u)=>{if(kt(a))return a.aborted=!0,a;let l=s(c,o,u);if(l instanceof Promise){if(u.async===!1)throw new zt;return l.then(d=>t._zod.parse(d,u))}return t._zod.parse(l,u)};t._zod.run=(a,c)=>{if(c.skipChecks)return t._zod.parse(a,c);if(c.direction==="backward"){let l=t._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,a,c)):i(l,a,c)}let u=t._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new zt;return u.then(l=>s(l,o,c))}return s(u,o,c)}}},{get"~standard"(){return ji(this,"~standard",gl(this))},set"~standard"(t){ur(this,"~standard",t)}}),My=(t,e)=>t.issues.length?{issues:t.issues.map(r=>Pt(r,e,st()))}:{value:t.value};async function OC(t,e){let r={async:!0};return My(await t._zod.run({value:e,issues:[]},r),r)}function gl(t){return{validate:e=>{let r={async:!1};try{let n=t._zod.run({value:e,issues:[]},r);if(!(n instanceof Promise))return My(n,r)}catch{}return OC(t,e)},vendor:"zod",version:1}}var Ji=b("$ZodString",(t,e)=>{de.init(t,e),t._zod.pattern=e.pattern??uy,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}}),fe=b("$ZodStringFormat",(t,e)=>{Zo.init(t,e),Ji.init(t,e)}),Ly=b("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Gg),fe.init(t,e)}),Zy=b("$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=ll(n))}else e.pattern??(e.pattern=ll());fe.init(t,e)}),Fy=b("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Jg),fe.init(t,e)}),qy=1,Wi=2;function Uy(t){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(t):(new URL(t),!0)}catch{return!1}}function IC(t,e){return!("normalize"in e)&&!("hostname"in e)&&!("protocol"in e)?Uy(t)||Wi:RC(t,e)}function RC(t,e){if(!e.normalize&&e.protocol?.source===ny.source&&!/^https?:\/\//i.test(t))return qy;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(t)??Wi}return new URL(t)}catch{return Wi}}var DC=/[\t\n\r]/g;function zy(t){return t.replace(DC,"")}function AC(t,e){return e.lastIndex=0,e.test(t.hostname)}function NC(t,e){return e.lastIndex=0,e.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)}var Vy=b("$ZodURL",(t,e)=>{fe.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),o=IC(n,e);if(o===qy){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}if(o===Wi){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});return}if(o===!0){r.value=zy(n);return}e.hostname&&!AC(o,e.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&&!NC(o,e.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort}),r.value=e.normalize?o.href:zy(n);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),By=b("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Kg()),fe.init(t,e)}),Hy=b("$ZodNanoID",(t,e)=>{if(e.length!==void 0&&(!Number.isInteger(e.length)||e.length<1))throw new Error(`Invalid nanoid length: ${e.length}`);e.pattern??(e.pattern=e.length===void 0?Bg:Hg(e.length)),fe.init(t,e)}),Wy=b("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Zg),fe.init(t,e)}),Gy=b("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Fg),fe.init(t,e)}),Jy=b("$ZodULID",(t,e)=>{e.pattern??(e.pattern=qg),fe.init(t,e)}),Ky=b("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Ug),fe.init(t,e)}),Yy=b("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Vg),fe.init(t,e)}),Xy=b("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=cy(e)),fe.init(t,e)}),Qy=b("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=iy),fe.init(t,e)}),e_=b("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=ay(e)),fe.init(t,e)}),t_=b("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Wg),fe.init(t,e)}),r_=b("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Yg),fe.init(t,e)}),jC=/^[0-9a-fA-F:.]+$/;function n_(t){return jC.test(t)?Uy(`http://[${t}]`):!1}var o_=b("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Xg),fe.init(t,e),t._zod.check=r=>{n_(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}});var s_=b("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Qg),fe.init(t,e)});function MC(t){let e=t.split("/");if(e.length!==2)return!1;let[r,n]=e;if(!n)return!1;let o=Number(n);return`${o}`!==n||o<0||o>128?!1:n_(r)}var i_=b("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=ey),fe.init(t,e),t._zod.check=r=>{MC(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}});function a_(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var yl=/^[0-9a-zA-Z+/]*={0,2}$/,c_=b("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=yl),fe.init(t,e),t._zod.check=r=>{a_(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}}),Ki=/^[A-Za-z0-9_-]*$/;function LC(t){if(!Ki.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return a_(r)}var u_=b("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ki),fe.init(t,e),t._zod.check=r=>{LC(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),l_=b("$ZodE164",(t,e)=>{e.pattern??(e.pattern=oy),fe.init(t,e)});function ZC(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 d_=b("$ZodJWT",(t,e)=>{fe.init(t,e),t._zod.check=r=>{ZC(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var _l=b("$ZodNumber",(t,e)=>{de.init(t,e),t._zod.pattern=Mo,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:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),f_=b("$ZodNumberFormat",(t,e)=>{hy.init(t,e),_l.init(t,e)}),p_=b("$ZodBoolean",(t,e)=>{de.init(t,e),t._zod.pattern=ly,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 m_=b("$ZodNull",(t,e)=>{de.init(t,e),t._zod.pattern=dy,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 h_=b("$ZodUnknown",(t,e)=>{de.init(t,e),t._zod.parse=r=>r}),g_=b("$ZodNever",(t,e)=>{de.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function FC(t,e){let r=Ni(t._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map(s=>s[0])),o=t._zod.parse;t._zod.parse=(s,i)=>{let a=e(s.value);if(a>n&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of Ni(t._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Do(s.issues,l,t),s}}return o(s,i)}}var qC=t=>Array.isArray(t)?t.length:-1;function Ty(t,e,r){t.issues.length&&e.issues.push(...Kt(r,t.issues)),e.value[r]=t.value}var y_=b("$ZodArray",(t,e)=>{de.init(t,e);let r=Je.memoizer;r?.attach(t),t._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:t}),n;n.value=r?r.alloc(t,n,Array(s.length),o):Array(s.length);let i=[],a=o?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=e.element._zod.run({value:u,issues:[]},o);if(l instanceof Promise)i.push(l.then(d=>Ty(d,n,c)));else if(Ty(l,n,c),a&&l.issues.length!==0&&kt(l))break}return i.length?Promise.all(i).then(()=>n):n},FC(t,qC)});function Gi(t,e,r,n,o,s){let i=r in n,a=s==="optional";if(!(!i&&a&&o==="optional")){if(t.issues.length){if(o!==void 0&&a&&!i)return;e.issues.push(...Kt(r,t.issues))}if(!i&&o===void 0){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?(i||o==="defaulted"&&!a)&&(e.value[r]=void 0):e.value[r]=t.value}}var UC=[];function __(t){let e=Object.keys(t.shape),r=Object.getOwnPropertySymbols(t.shape),n=r.length?r:UC,o=n.length?[...e,...n]:e;for(let i of o)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=tl(t.shape);return{...t,allKeys:o,symbolKeys:n,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(s)}}function v_(t,e,r,n,o,s,i){let a=[],c=o.keySet,u=o.catchall._zod,l=u.def.type,d=u.optin,p=u.optout,m=0;for(let f in e){if(i&&r.issues.length!==m){if(kt(r,m))break;m=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){l==="never"&&a.push(f);continue}if(l==="never"){a.push(f);continue}let h=u.run({value:e[f],issues:[]},n);h instanceof Promise?t.push(h.then(g=>Gi(g,r,f,e,d,p))):Gi(h,r,f,e,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:e,inst:s,continue:!0}),t.length?Promise.all(t).then(()=>r):r}var VC=b("$ZodObject",(t,e)=>{de.init(t,e);let r=Object.getOwnPropertyDescriptor(e,"shape"),n=r?.get?r.get.raw:e.shape??{};if(n){let u=()=>{let l={...n};return Object.defineProperty(e,"shape",{value:l}),u.raw=l,l};u.raw=n,Object.defineProperty(e,"shape",{get:u})}let o=Pn(()=>__(e));ee(t,"propValues",u=>{let l=u.def.shape,d={};for(let p in l){let m=l[p]._zod;if(m.values){Object.prototype.hasOwnProperty.call(d,p)||ot(d,p,new Set);for(let f of m.values)d[p].add(f);m.optin!==void 0&&d[p].add(void 0)}}return d});let s=Jr,i=e.catchall,a,c=Je.memoizer;c?.attach(t),t._zod.parse=(u,l)=>{a??(a=o.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:t}),u;u.value=c?c.alloc(t,u,{},l):{};let p=[],m=a.shape,f=l?.abortEarly,h=u.issues.length;for(let g of a.allKeys){if(f&&u.issues.length!==h){if(kt(u,h))break;h=u.issues.length}if(g==="__proto__")continue;let y=m[g],v=y._zod.optin,x=y._zod.optout,S=y._zod.run({value:d[g],issues:[]},l);S instanceof Promise?p.push(S.then(E=>Gi(E,u,g,d,v,x))):Gi(S,u,g,d,v,x)}return i?v_(p,d,u,l,o.value,t,f===!0):p.length?Promise.all(p).then(()=>u):u}}),b_=b("$ZodObjectJIT",(t,e)=>{VC.init(t,e);let r=t._zod.parse,n=Pn(()=>__(e)),o=Je.memoizer,s=m=>{let f=n.value,h=f.symbolKeys,g=new Bi(["payload","ctx"],{shape:m,inst:t,memo:o,syms:h}),y=E=>`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`,v=(E,C)=>`
99
+ let ${E}_ab = false;
100
+ for (let i = 0; i < ${E}.issues.length; i++) {
101
+ const iss = ${E}.issues[i];
102
+ iss.path = iss.path ? [${C}, ...iss.path] : [${C}];
103
+ payload.issues.push(iss);
104
+ if (iss.continue !== true) ${E}_ab = true;
103
105
  }
104
- }
105
-
106
- if (${S}.value === undefined) {
107
- if (${k} in input) {
108
- newResult[${k}] = undefined;
106
+ if (${E}_ab && ctx && ctx.abortEarly) {
107
+ payload.value = newResult;
108
+ return payload;
109
+ }`;g.write("const input = payload.value;");let x=Object.create(null),S=0;for(let E of f.allKeys)x[E]=`key_${S++}`;g.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let E of f.allKeys){if(E==="__proto__")continue;let C=x[E],A=typeof E=="symbol"?`syms[${h.indexOf(E)}]`:Yu(E),re=`${A} in input`,F=m[E],ie=F?._zod?.optin,$e=ie!==void 0,be=F?._zod?.optout==="optional";if(g.write(`const ${C} = ${y(A)};`),$e&&be){let Ce=ie==="optional"?`${C}_present`:`${C}.value !== undefined || ${C}_present`;g.write(`
110
+ const ${C}_present = ${re};
111
+ if (!${C}.issues.length || ${C}_present) {
112
+ if (${C}.issues.length) {${v(C,A)}
113
+ }
114
+
115
+ if (${Ce}) {
116
+ newResult[${A}] = ${C}.value;
109
117
  }
110
- } else {
111
- newResult[${k}] = ${S}.value;
112
118
  }
113
-
114
- `):L?m.write(`
115
- if (${S}.issues.length) {
116
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
117
- ...iss,
118
- path: iss.path ? [${k}, ...iss.path] : [${k}]
119
- })));
119
+
120
+ `)}else $e?(g.write(`
121
+ if (${C}.issues.length) {${v(C,A)}
120
122
  }
121
-
122
- if (${S}.value === undefined) {
123
- if (${k} in input) {
124
- newResult[${k}] = undefined;
125
- }
126
- } else {
127
- newResult[${k}] = ${S}.value;
123
+ `),ie==="defaulted"?g.write(`newResult[${A}] = ${C}.value;`):g.write(`
124
+ if (${C}.value !== undefined || ${re}) {
125
+ newResult[${A}] = ${C}.value;
128
126
  }
129
-
130
- `):m.write(`
131
- const ${S}_present = ${k} in input;
132
- if (${S}.issues.length) {
133
- payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
134
- ...iss,
135
- path: iss.path ? [${k}, ...iss.path] : [${k}]
136
- })));
127
+ `)):g.write(`
128
+ const ${C}_present = ${re};
129
+ if (${C}.issues.length) {${v(C,A)}
137
130
  }
138
- if (!${S}_present && !${S}.issues.length) {
131
+ if (!${C}_present && !${C}.issues.length) {
139
132
  payload.issues.push({
140
133
  code: "invalid_type",
141
134
  expected: "nonoptional",
142
135
  input: undefined,
143
- path: [${k}]
136
+ path: [${A}]
144
137
  });
138
+ if (ctx && ctx.abortEarly) {
139
+ payload.value = newResult;
140
+ return payload;
141
+ }
145
142
  }
146
143
 
147
- if (${S}_present) {
148
- if (${S}.value === undefined) {
149
- newResult[${k}] = undefined;
150
- } else {
151
- newResult[${k}] = ${S}.value;
152
- }
144
+ if (${C}_present) {
145
+ newResult[${A}] = ${C}.value;
153
146
  }
154
147
 
155
- `)}m.write("payload.value = newResult;"),m.write("return payload;");let x=m.compile();return(w,S)=>x(p,w,S)},s,i=qr,a=!gn.jitless,u=a&&ou.value,l=e.catchall,d;t._zod.parse=(p,m)=>{d??(d=n.value);let f=p.value;return i(f)?a&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(e.shape)),p=s(p,m),l?Qg([],f,p,m,d,t):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),p)}});function mg(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=>!or(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=>ct(i,n,tt())))}),e)}var _u=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=>xo(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=>mg(a,n,t,o)):mg(i,n,t,o)}});var ey=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,_u.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=_n(()=>{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(!qr(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)}}),ty=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])=>hg(r,c,u)):hg(r,s,i)}});function gu(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(nr(t)&&nr(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=gu(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=gu(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 hg(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}),or(t))return t;let i=gu(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 ry=v("$ZodRecord",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!nr(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(m=>ct(m,n,tt())),input:u,path:[u],inst:t});continue}let d=l.value,p=e.valueType._zod.run({value:o[u],issues:[]},n);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&r.issues.push(...Bt(u,m.issues)),r.value[d]=m.value})):(p.issues.length&&r.issues.push(...Bt(u,p.issues)),r.value[d]=p.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"&&pu.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=>ct(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(...Bt(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Bt(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var ny=v("$ZodEnum",(t,e)=>{le.init(t,e);let r=bo(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>su.has(typeof o)).map(o=>typeof o=="string"?Vt(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}}),oy=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"?Vt(n):n?Vt(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 sy=v("$ZodTransform",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new hn(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 Ot;return r.value=o,r.fallback=!0,r}});function gg(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var vu=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(`^(${xo(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=>gg(i,o)):gg(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),iy=v("$ZodExactOptional",(t,e)=>{vu.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)}),ay=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(`^(${xo(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)}),cy=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=>yg(s,e)):yg(o,e)}});function yg(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var uy=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))}),ly=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=>_g(s,t)):_g(o,t)}});function _g(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 dy=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=>ct(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=>ct(s,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var bu=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=>bi(i,e.in,n)):bi(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>bi(s,e.out,n)):bi(o,e.out,n)}});function bi(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 fy=v("$ZodPreprocess",(t,e)=>{bu.init(t,e)}),py=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(vg):vg(o)}});function vg(t){return t.value=Object.freeze(t.value),t}var my=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=>bg(s,r,n,t));bg(o,r,n,t)}});function bg(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(vn(o))}}var xP=()=>{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=uu(o.input),a=n[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${pi(o.values[0])}`:`Invalid option: expected one of ${li(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":""}: ${li(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 hy(){return{localeError:xP()}}var gy;var wu=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 SP(){return new wu}(gy=globalThis).__zod_globalRegistry??(gy.__zod_globalRegistry=SP());var Fr=globalThis.__zod_globalRegistry;function yy(t,e){return new t({type:"string",...R(e)})}function _y(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...R(e)})}function xu(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...R(e)})}function vy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}function by(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}function wy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}function xy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}function Sy(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 ky(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}function Ey(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}function zy(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}function Py(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}function Ty(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}function Cy(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}function Oy(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}function Iy(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}function Ry(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}function Dy(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}function Ay(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...R(e)})}function Ny(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...R(e)})}function jy(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}function My(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}function Ly(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(e)})}function Zy(t,e){return new t({type:"string",format:"date",check:"string_format",...R(e)})}function qy(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}function Fy(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}function Uy(t,e){return new t({type:"number",checks:[],...R(e)})}function Vy(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}function By(t,e){return new t({type:"boolean",...R(e)})}function Hy(t,e){return new t({type:"null",...R(e)})}function Wy(t){return new t({type:"unknown"})}function Gy(t,e){return new t({type:"never",...R(e)})}function Si(t,e){return new mu({check:"less_than",...R(e),value:t,inclusive:!1})}function Po(t,e){return new mu({check:"less_than",...R(e),value:t,inclusive:!0})}function $i(t,e){return new hu({check:"greater_than",...R(e),value:t,inclusive:!1})}function To(t,e){return new hu({check:"greater_than",...R(e),value:t,inclusive:!0})}function ki(t,e){return new Xh({check:"multiple_of",...R(e),value:t})}function Ei(t,e){return new tg({check:"max_length",...R(e),maximum:t})}function bn(t,e){return new rg({check:"min_length",...R(e),minimum:t})}function zi(t,e){return new ng({check:"length_equals",...R(e),length:t})}function Su(t,e){return new og({check:"string_format",format:"regex",...R(e),pattern:t})}function $u(t){return new sg({check:"string_format",format:"lowercase",...R(t)})}function ku(t){return new ig({check:"string_format",format:"uppercase",...R(t)})}function Eu(t,e){return new ag({check:"string_format",format:"includes",...R(e),includes:t})}function zu(t,e){return new cg({check:"string_format",format:"starts_with",...R(e),prefix:t})}function Pu(t,e){return new ug({check:"string_format",format:"ends_with",...R(e),suffix:t})}function sr(t){return new lg({check:"overwrite",tx:t})}function Tu(t){return sr(e=>e.normalize(t))}function Cu(){return sr(t=>t.trim())}function Ou(){return sr(t=>t.toLowerCase())}function Iu(){return sr(t=>t.toUpperCase())}function Ru(){return sr(t=>nu(t))}function Jy(t,e,r){return new t({type:"array",element:e,...R(r)})}function Ky(t,e,r){let n=R(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Yy(t,e,r){return new t({type:"custom",check:"custom",fn:e,...R(r)})}function Qy(t,e){let r=$P(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(vn(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(vn(s))}},t(n.value,n)),e);return r}function $P(t,e){let r=new Pe({check:"custom",...R(e)});return r._zod.check=t,r}function Du(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??Fr,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 $e(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 p=i.schema,m=e.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(t,e,p,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),$e(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 Au(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,p=t.external.uri??(f=>f);if(d)return{ref:p(d)};let m=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${m}`}}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>
148
+ `)}return g.write("payload.value = newResult;"),g.write("return payload;"),g.compile()},i,a=Jr,c=!Je.jitless,l=c&&Qu.value,d=e.catchall,p;t._zod.parse=(m,f)=>{p??(p=n.value);let h=m.value;return a(h)?c&&l&&f?.async===!1&&f.jitless!==!0?(i||(i=s(e.shape)),m=i(m,f),d?v_([],h,m,f,p,t,f?.abortEarly===!0):m):r(m,f):(m.issues.push({expected:"object",code:"invalid_type",input:h,inst:t}),m)}});function Cy(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=>!kt(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=>Pt(i,n,st())))}),e)}var vl=b("$ZodUnion",(t,e)=>{de.init(t,e),ee(t,"optin",n=>n.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),ee(t,"optout",n=>n.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ee(t,"values",n=>{if(n.def.options.every(o=>o._zod.values))return new Set(n.def.options.flatMap(o=>Array.from(o._zod.values)))}),ee(t,"pattern",n=>{if(n.def.options.every(o=>o._zod.pattern)){let o=n.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Io(s.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=>Cy(a,n,t,o)):Cy(i,n,t,o)}});function BC(t){let e=new Map;for(let r of t.options){let n=r._zod.propValues?.[t.discriminator];if(!n||n.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let o of n)if(e.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);e.set(o,null)}else e.set(o,r)}return e}var w_=b("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,vl.init(t,e);let r=t._zod.parse;ee(t,"propValues",o=>{let s={},i=0;for(let a of o.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(a)}"`);c[o.def.discriminator]?.has(void 0)&&i++;for(let[u,l]of Object.entries(c)){Object.prototype.hasOwnProperty.call(s,u)||ot(s,u,new Set);for(let d of l)s[u].add(d)}}return!o.def.unionFallback&&i>1&&s[o.def.discriminator]?.delete(void 0),s}),e.options.forEach((o,s)=>{let i=zn(o._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,e.discriminator))throw new Error(`Invalid discriminated union option at index "${s}"`)});let n=Pn(()=>BC(e));t._zod.parse=(o,s)=>{let i=o.value;if(!Jr(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),o;let a=i?.[e.discriminator],c=n.value.get(a);return c&&(a!==void 0||s.direction!=="backward")?c._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()).filter(u=>n.value.get(u)!==null),input:i,path:[e.discriminator],inst:t}),o)}}),x_=b("$ZodIntersection",(t,e)=>{de.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])=>Oy(r,c,u)):Oy(r,s,i)}});function hl(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(lr(t)&&lr(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let s of n){if(s==="__proto__")continue;let i=hl(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=hl(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 Oy(t,e,r){let n=new Map,o,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);s.has(p)||s.set(p,u),d=[p]}else return!1;for(let p of d)n.has(p)||n.set(p,{}),n.get(p)[l]=!0;return!0};for(let u of e.issues)i(u,"l")||t.issues.push(u);for(let u of r.issues)i(u,"r")||t.issues.push(u);let a=[...n].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(l=>o.keys.includes(l)):[];u.length&&t.issues.push({...o,keys:u});for(let l of a)!u.includes(l)&&s.has(l)&&t.issues.push(s.get(l))}let c=hl(e.value,r.value);if(!c.valid){if(kt(t))return t;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return t.value=c.data,t}var S_=b("$ZodRecord",(t,e)=>{de.init(t,e);let r=Je.memoizer;r?.attach(t),t._zod.parse=(n,o)=>{let s=n.value;if(!lr(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:t}),n;let i=[],a=e.keyType._zod.values;if(a&&!e.partial){n.value=r?r.alloc(t,n,{},o):{};let c=new Set;for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(c.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;let d=e.keyType._zod.run({value:l,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(f=>Pt(f,o,st())),input:l,path:[l],inst:t});continue}let p=d.value;if(p==="__proto__")continue;let m=e.valueType._zod.run({value:s[l],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&n.issues.push(...Kt(l,f.issues)),n.value[p]=f.value})):(m.issues.length&&n.issues.push(...Kt(l,m.issues)),n.value[p]=m.value)}let u;for(let l in s)if(!c.has(l))if(e.mode==="loose"){if(l==="__proto__")continue;n.value[l]=s[l]}else u=u??[],u.push(l);u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:u,continue:!0})}else{n.value=r?r.alloc(t,n,{},o):{};let c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=e.keyType._zod.run({value:u,issues:[]},o);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&Mo.test(u)&&l.issues.length){let f=e.keyType._zod.run({value:Number(u),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(l=f)}if(l.issues.length){e.mode==="loose"?n.value[u]=s[u]:a?(c=c??[],c.push(u)):n.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(f=>Pt(f,o,st())),input:u,path:[u],inst:t});continue}let p=l.value;if(p==="__proto__")continue;let m=e.valueType._zod.run({value:s[u],issues:[]},o);m instanceof Promise?i.push(m.then(f=>{f.issues.length&&n.issues.push(...Kt(u,f.issues)),n.value[p]=f.value})):(m.issues.length&&n.issues.push(...Kt(u,m.issues)),n.value[p]=m.value)}c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:t,keys:c,continue:!0})}return i.length?Promise.all(i).then(()=>n):n}});var $_=b("$ZodEnum",(t,e)=>{de.init(t,e);let r=En(e.entries),n=new Set(r);t._zod.values=n,ee(t,"pattern",o=>{let s=En(o.def.entries).filter(i=>el.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>Jt(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),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}}),E_=b("$ZodLiteral",(t,e)=>{de.init(t,e);let r=new Set(e.values);t._zod.values=r,ee(t,"pattern",n=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map(s=>typeof s=="string"?Jt(s):s?Jt(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),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 k_=b("$ZodTransform",(t,e)=>{de.init(t,e),t._zod.optin="optional",Je.memoizer?.guard(t),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Cn(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));if(o instanceof Promise)throw new zt;return r.value=o,r}});function Iy(t,e){return t.value=e.issues.length?void 0:e.value,t}var bl=b("$ZodOptional",(t,e)=>{de.init(t,e),ee(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),t._zod.optout="optional",ee(t,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),ee(t,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Io(n.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(r.value===void 0){if(e.innerType._zod.optin!=="defaulted")return r;let o=e.innerType._zod.run({value:r.value,issues:[]},n);return o instanceof Promise?o.then(s=>Iy(r,s)):Iy(r,o)}return e.innerType._zod.run(r,n)}}),P_=b("$ZodExactOptional",(t,e)=>{bl.init(t,e),ee(t,"values",r=>r.def.innerType._zod.values),ee(t,"pattern",r=>r.def.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),z_=b("$ZodNullable",(t,e)=>{de.init(t,e),ee(t,"optin",r=>r.def.innerType._zod.optin),ee(t,"optout",r=>r.def.innerType._zod.optout),ee(t,"pattern",r=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Io(n.source)}|null)$`):void 0}),ee(t,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),T_=b("$ZodDefault",(t,e)=>{de.init(t,e),t._zod.optin="defaulted",ee(t,"values",r=>r.def.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=>Ry(s,e)):Ry(o,e)}});function Ry(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var C_=b("$ZodPrefault",(t,e)=>{de.init(t,e),t._zod.optin="defaulted",ee(t,"values",r=>r.def.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))}),O_=b("$ZodNonOptional",(t,e)=>{de.init(t,e),ee(t,"values",r=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Dy(s,t)):Dy(o,t)}});function Dy(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function Ay(t,e,r,n){return e.issues.length?(t.value=r.catchValue({...e,value:t.value,error:{issues:e.issues.map(o=>Pt(o,n,st()))},input:t.value}),t):(t.value=e.value,e.memo&&(t.memo=!0),t)}var I_=b("$ZodCatch",(t,e)=>{de.init(t,e),ee(t,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ee(t,"optout",r=>r.def.innerType._zod.optout),ee(t,"values",r=>r.def.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({value:r.value,issues:[]},n);return o instanceof Promise?o.then(s=>Ay(r,s,e,n)):Ay(r,o,e,n)}});var wl=b("$ZodPipe",(t,e)=>{de.init(t,e),ee(t,"values",r=>r.def.in._zod.values),ee(t,"optin",r=>r.def.in._zod.optin),ee(t,"optout",r=>r.def.out._zod.optout),ee(t,"propValues",r=>r.def.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=>Hi(i,e.in,n)):Hi(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Hi(s,e.out,n)):Hi(o,e.out,n)}});function Hi(t,e,r){return t.issues.some(n=>n.code!=="unrecognized_keys")?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}var R_=b("$ZodPreprocess",(t,e)=>{wl.init(t,e)}),D_=b("$ZodReadonly",(t,e)=>{de.init(t,e),ee(t,"propValues",r=>r.def.innerType._zod.propValues),ee(t,"values",r=>r.def.innerType._zod.values),ee(t,"optin",r=>r.def.innerType?._zod?.optin),ee(t,"optout",r=>r.def.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(Ny):Ny(o)}});function Ny(t){return t.memo||(t.value=Object.freeze(t.value)),t}var A_=b("$ZodCustom",(t,e)=>{Oe.init(t,e),de.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=>jy(s,r,n,t));jy(o,r,n,t)}});function jy(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(Tn(o))}}var Sl=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},$l="~memo",N_=[];function j_(t){return t!==null&&typeof t=="object"}function xl(t){return t.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var M_=new WeakMap,Fo=0,Qi=1,qo=2;function ea(t,e,r){let n=M_.get(t);if(n!==void 0)return n?qo:Fo;if(e.has(t))return qo;e.add(t);let o=Fo,s=l=>{if(o!==qo&&l?._zod){let d=ea(l,e,r);d>o&&(o=d)}},i=(l,d)=>{let p=Fo;for(let m of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,m);if(d&&!f.enumerable)continue;let h=f.get?Qi:f.value?._zod?ea(f.value,e,r):Fo;h>p&&(p=h)}return p},a=l=>{l>o&&(o=l)},c=t._zod.def,u=c.type;switch(u){case"object":{let l=zn(c);a(l?i(l,!0):Qi),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?t._zod.innerType:void 0);a(l?ea(l,e,!1):Qi);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)s(p);else if(Array.isArray(p))for(let m of p)s(m)}}}return e.delete(t),HC(t,o)}function HC(t,e){return e!==Qi&&M_.set(t,e===qo),e}function WC(t,e){let r=t.buckets.get(e);return r||(r=new WeakMap,t.buckets.set(e,r)),r}var Yi,Xi=[],GC={alloc(t,e,r){let n=Yi;if(!n)return r;Yi=void 0;let o={value:r,issues:null};return n.set(e.value,o),Xi.push(o),r},guard(t){var e;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let r=t._zod.parse,n=(o,s)=>{if(s.direction!=="backward"&&JC(s,o.value))throw new Sl;return r(o,s)};t._zod.parse=n,t._zod.run===r&&(t._zod.run=n)})},attach(t){var e;let r,n=!1,o,s;(e=t._zod).deferred??(e.deferred=[]),t._zod.deferred.push(()=>{let i=t._zod.parse,a=(c,u)=>{if(r===void 0){let y=ea(t,new Set,!1);if(y===Fo)return t._zod.parse=i,t._zod.run===a&&(t._zod.run=i),i(c,u);y===qo||n?r=!0:n=!0}let l=c.value;if(!j_(l))return i(c,u);let d=u[$l];d||(d={buckets:new WeakMap,backEdges:void 0},u[$l]=d);let p;o===u?p=s:(p=WC(d,t),o=u,s=p);let m=p.get(l);if(m)return c.value=m.value,m.issues?m.issues.length&&c.issues.push(...xl(m.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(m.value)),c;Yi=p;let f=Xi.length,h=i(c,u);Yi=void 0;let g=Xi.length>f?Xi.pop():void 0;return h instanceof Promise?h.then(y=>(g&&(g.issues=y.issues.length?xl(y.issues):N_),y)):(g&&(g.issues=h.issues.length?xl(h.issues):N_),h)};t._zod.parse=a,t._zod.run===i&&(t._zod.run=a)})}};function L_(){return GC}function JC(t,e){let r=t[$l]?.backEdges;return r!==void 0&&j_(e)&&r.has(e)}var KC=()=>{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(s){return t[s]??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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):n[s]??s}return s=>{switch(s.code){case"invalid_type":{let i=o(s.expected),a=nl(s.input),c=o(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${Ri(s.values[0])}`:`Invalid option: expected one of ${Oi(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=e(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=e(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Oi(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function Z_(){return{localeError:KC()}}var F_;var El=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 YC(){return new El}(F_=globalThis).__zod_globalRegistry??(F_.__zod_globalRegistry=YC());var Kr=globalThis.__zod_globalRegistry;function q_(t){return t.checks&&(t.checks=[...t.checks]),t}function U_(t,e){return new t(q_({type:"string",...D(e)}))}function V_(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...D(e)})}function B_(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...D(e)})}function H_(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...D(e)})}function W_(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...D(e)})}function G_(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...D(e)})}function J_(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...D(e)})}function K_(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...D(e)})}function Y_(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...D(e)})}function X_(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...D(e)})}function Q_(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...D(e)})}function ev(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...D(e)})}function tv(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...D(e)})}function rv(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...D(e)})}function nv(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...D(e)})}function ov(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...D(e)})}function sv(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...D(e)})}function iv(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...D(e)})}function av(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...D(e)})}function cv(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...D(e)})}function uv(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...D(e)})}function lv(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...D(e)})}function dv(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...D(e)})}function ta(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...D(e)})}function ra(t,e){return new t({type:"string",format:"date",check:"string_format",...D(e)})}function na(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...D(e)})}function oa(t,e){return new t({type:"string",format:"duration",check:"string_format",...D(e)})}function fv(t,e){return new t(q_({type:"number",checks:[],...D(e)}))}function pv(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...D(e)})}function mv(t,e){return new t({type:"boolean",...D(e)})}function hv(t,e){return new t({type:"null",...D(e)})}function gv(t){return new t({type:"unknown"})}function yv(t,e){return new t({type:"never",...D(e)})}function sa(t,e){return new pl({check:"less_than",...D(e),value:t,inclusive:!1})}function Uo(t,e){return new pl({check:"less_than",...D(e),value:t,inclusive:!0})}function ia(t,e){return new ml({check:"greater_than",...D(e),value:t,inclusive:!1})}function Vo(t,e){return new ml({check:"greater_than",...D(e),value:t,inclusive:!0})}function aa(t,e){return new my({check:"multiple_of",...D(e),value:t})}function ca(t,e){return new gy({check:"max_length",...D(e),maximum:t})}function On(t,e){return new yy({check:"min_length",...D(e),minimum:t})}function ua(t,e){return new _y({check:"length_equals",...D(e),length:t})}function kl(t,e){return new vy({check:"string_format",format:"regex",...D(e),pattern:t})}function Pl(t){return new by({check:"string_format",format:"lowercase",...D(t)})}function zl(t){return new wy({check:"string_format",format:"uppercase",...D(t)})}function Tl(t,e){return new xy({check:"string_format",format:"includes",...D(e),includes:t})}function Cl(t,e){return new Sy({check:"string_format",format:"starts_with",...D(e),prefix:t})}function Ol(t,e){return new $y({check:"string_format",format:"ends_with",...D(e),suffix:t})}function dr(t){return new Ey({check:"overwrite",tx:t})}function Il(t){return dr(e=>e.normalize(t))}function Rl(){return dr(t=>t.trim())}function Dl(){return dr(t=>t.toLowerCase())}function Al(){return dr(t=>t.toUpperCase())}function Nl(){return dr(t=>Xu(t))}function _v(t,e,r){return new t({type:"array",element:e,...D(r)})}function vv(t,e,r){let n=D(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function bv(t,e,r){return new t({type:"custom",check:"custom",fn:e,...D(r)})}function wv(t,e){let r=XC(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Tn(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Tn(s))}},t(n.value,n)),e);return r}function XC(t,e){let r=new Oe({check:"custom",...D(e)});return r._zod.check=t,r}function Bo(t,...e){for(let r of e)for(let n of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,n)&&ot(t,n,r[n]);return t}function Ml(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??Kr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:t?.cycles??"ref",reused:t?.reused??"inline",intersections:[],deferred:[],external:t?.external??void 0}}function Yt(t,e,r,n,o){let s=typeof e.unrepresentable=="function"?e.unrepresentable({zodSchema:t,path:n.path,message:o}):e.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(r,s),!0}function Ee(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),e.sharedDefsExtractedFor=void 0,e.sharedEmitDoneFor=void 0;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 p=i.schema,m=e.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(t,e,p,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),Ee(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Bo(i.schema,c),e.io==="input"&&Ue(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 xv(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function Ll(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(t.external&&t.sharedDefsExtractedFor===t.external)return;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,p=t.external.uri??(f=>f);if(d)return{ref:p(d)};let m=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${xv(m)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+xv(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>
156
149
 
157
- 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 Nu(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 m=t.seen.get(d),f=m.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&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g]}let p=a._zod.parent;if(p&&p!==d){n(p);let m=t.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let f in u)f==="$ref"||f==="allOf"||f in m.def&&JSON.stringify(u[f])===JSON.stringify(m.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:Co(e,"input",t.processors),output:Co(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 Xy=(t,e={})=>r=>{let n=Du({...r,processors:e});return $e(t,n),Au(n,t),Nu(n,t)},Co=(t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Du({...o??{},target:s,io:e,processors:r});return $e(t,i),Au(i,t),Nu(i,t)};var kP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},e_=(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=kP[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}))])}},t_=(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),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),m=e.target==="draft-04"||e.target==="openapi-3.0";d?m?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof s=="number"&&(o.minimum=s),p?m?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},r_=(t,e,r,n)=>{r.type="boolean"};var n_=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var o_=(t,e,r,n)=>{r.not={}};var s_=(t,e,r,n)=>{};var i_=(t,e,r,n)=>{let o=t._zod.def,s=bo(o.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},a_=(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 c_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var u_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var l_=(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=$e(s.element,e,{...n,path:[...n.path,"items"]})},d_=(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]=$e(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=$e(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},f_=(t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>$e(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},p_=(t,e,r,n)=>{let o=t._zod.def,s=$e(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=$e(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 m_=(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=$e(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=$e(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=$e(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)}},h_=(t,e,r,n)=>{let o=t._zod.def,s=$e(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"}]},g_=(t,e,r,n)=>{let o=t._zod.def;$e(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},y_=(t,e,r,n)=>{let o=t._zod.def;$e(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},__=(t,e,r,n)=>{let o=t._zod.def;$e(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)))},v_=(t,e,r,n)=>{let o=t._zod.def;$e(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},b_=(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;$e(i,e,n);let a=e.seen.get(t);a.ref=i},w_=(t,e,r,n)=>{let o=t._zod.def;$e(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0};var ju=(t,e,r,n)=>{let o=t._zod.def;$e(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType};function wn(t){return!!t._zod}function ir(t,e){return wn(t)?ko(t,e):t.safeParse(e)}function Pi(t){if(!t)return;let e;if(wn(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function x_(t){if(wn(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 Io={};ff(Io,{ZodISODate:()=>$_,ZodISODateTime:()=>S_,ZodISODuration:()=>E_,ZodISOTime:()=>k_,date:()=>Lu,datetime:()=>Mu,duration:()=>qu,time:()=>Zu});var S_=v("ZodISODateTime",(t,e)=>{Ig.init(t,e),ge.init(t,e)});function Mu(t){return Ly(S_,t)}var $_=v("ZodISODate",(t,e)=>{Rg.init(t,e),ge.init(t,e)});function Lu(t){return Zy($_,t)}var k_=v("ZodISOTime",(t,e)=>{Dg.init(t,e),ge.init(t,e)});function Zu(t){return qy(k_,t)}var E_=v("ZodISODuration",(t,e)=>{Ag.init(t,e),ge.init(t,e)});function qu(t){return Fy(E_,t)}var DP=(t,e)=>{mi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>hh(t,r)},flatten:{value:r=>mh(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,yn,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,yn,2)}},isEmpty:{get(){return t.issues.length===0}}})};var rt=v("ZodError",DP,{Parent:Error});var z_=hi(rt),P_=gi(rt),T_=$o(rt),C_=Eo(rt),O_=gh(rt),I_=yh(rt),R_=_h(rt),D_=vh(rt),A_=bh(rt),N_=wh(rt),j_=xh(rt),M_=Sh(rt);var L_=new WeakMap;function Ro(t,e,r){let n=Object.getPrototypeOf(t),o=L_.get(n);if(o||(o=new Set,L_.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:Co(t,"input"),output:Co(t,"output")}}),t.toJSONSchema=Xy(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>z_(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>T_(t,r,n),t.parseAsync=async(r,n)=>P_(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>C_(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>O_(t,r,n),t.decode=(r,n)=>I_(t,r,n),t.encodeAsync=async(r,n)=>R_(t,r,n),t.decodeAsync=async(r,n)=>D_(t,r,n),t.safeEncode=(r,n)=>A_(t,r,n),t.safeDecode=(r,n)=>N_(t,r,n),t.safeEncodeAsync=async(r,n)=>j_(t,r,n),t.safeDecodeAsync=async(r,n)=>M_(t,r,n),Ro(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 St(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check($T(r,n))},superRefine(r,n){return this.check(kT(r,n))},overwrite(r){return this.check(sr(r))},optional(){return we(this)},exactOptional(){return fT(this)},nullable(){return U_(this)},nullish(){return we(U_(this))},nonoptional(r){return _T(this,r)},array(){return J(this)},or(r){return ce([this,r])},and(r){return Ci(this,r)},transform(r){return V_(this,J_(r))},default(r){return hT(this,r)},prefault(r){return yT(this,r)},catch(r){return bT(this,r)},pipe(r){return V_(this,r)},readonly(){return ST(this)},describe(r){let n=this.clone();return Fr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Fr.get(this);let n=this.clone();return Fr.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 Fr.get(t)?.description},configurable:!0}),t)),B_=v("_ZodString",(t,e)=>{xi.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>e_(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Ro(t,"_ZodString",{regex(...n){return this.check(Su(...n))},includes(...n){return this.check(Eu(...n))},startsWith(...n){return this.check(zu(...n))},endsWith(...n){return this.check(Pu(...n))},min(...n){return this.check(bn(...n))},max(...n){return this.check(Ei(...n))},length(...n){return this.check(zi(...n))},nonempty(...n){return this.check(bn(1,...n))},lowercase(n){return this.check($u(n))},uppercase(n){return this.check(ku(n))},trim(){return this.check(Cu())},normalize(...n){return this.check(Tu(...n))},toLowerCase(){return this.check(Ou())},toUpperCase(){return this.check(Iu())},slugify(){return this.check(Ru())}})}),NP=v("ZodString",(t,e)=>{xi.init(t,e),B_.init(t,e),t.email=r=>t.check(_y(jP,r)),t.url=r=>t.check(Sy(MP,r)),t.jwt=r=>t.check(My(XP,r)),t.emoji=r=>t.check($y(LP,r)),t.guid=r=>t.check(xu(Z_,r)),t.uuid=r=>t.check(vy(Ti,r)),t.uuidv4=r=>t.check(by(Ti,r)),t.uuidv6=r=>t.check(wy(Ti,r)),t.uuidv7=r=>t.check(xy(Ti,r)),t.nanoid=r=>t.check(ky(ZP,r)),t.guid=r=>t.check(xu(Z_,r)),t.cuid=r=>t.check(Ey(qP,r)),t.cuid2=r=>t.check(zy(FP,r)),t.ulid=r=>t.check(Py(UP,r)),t.base64=r=>t.check(Ay(KP,r)),t.base64url=r=>t.check(Ny(YP,r)),t.xid=r=>t.check(Ty(VP,r)),t.ksuid=r=>t.check(Cy(BP,r)),t.ipv4=r=>t.check(Oy(HP,r)),t.ipv6=r=>t.check(Iy(WP,r)),t.cidrv4=r=>t.check(Ry(GP,r)),t.cidrv6=r=>t.check(Dy(JP,r)),t.e164=r=>t.check(jy(QP,r)),t.datetime=r=>t.check(Mu(r)),t.date=r=>t.check(Lu(r)),t.time=r=>t.check(Zu(r)),t.duration=r=>t.check(qu(r))});function y(t){return yy(NP,t)}var ge=v("ZodStringFormat",(t,e)=>{de.init(t,e),B_.init(t,e)}),jP=v("ZodEmail",(t,e)=>{Sg.init(t,e),ge.init(t,e)});var Z_=v("ZodGUID",(t,e)=>{wg.init(t,e),ge.init(t,e)});var Ti=v("ZodUUID",(t,e)=>{xg.init(t,e),ge.init(t,e)});var MP=v("ZodURL",(t,e)=>{$g.init(t,e),ge.init(t,e)});var LP=v("ZodEmoji",(t,e)=>{kg.init(t,e),ge.init(t,e)});var ZP=v("ZodNanoID",(t,e)=>{Eg.init(t,e),ge.init(t,e)});var qP=v("ZodCUID",(t,e)=>{zg.init(t,e),ge.init(t,e)});var FP=v("ZodCUID2",(t,e)=>{Pg.init(t,e),ge.init(t,e)});var UP=v("ZodULID",(t,e)=>{Tg.init(t,e),ge.init(t,e)});var VP=v("ZodXID",(t,e)=>{Cg.init(t,e),ge.init(t,e)});var BP=v("ZodKSUID",(t,e)=>{Og.init(t,e),ge.init(t,e)});var HP=v("ZodIPv4",(t,e)=>{Ng.init(t,e),ge.init(t,e)});var WP=v("ZodIPv6",(t,e)=>{jg.init(t,e),ge.init(t,e)});var GP=v("ZodCIDRv4",(t,e)=>{Mg.init(t,e),ge.init(t,e)});var JP=v("ZodCIDRv6",(t,e)=>{Lg.init(t,e),ge.init(t,e)});var KP=v("ZodBase64",(t,e)=>{qg.init(t,e),ge.init(t,e)});var YP=v("ZodBase64URL",(t,e)=>{Fg.init(t,e),ge.init(t,e)});var QP=v("ZodE164",(t,e)=>{Ug.init(t,e),ge.init(t,e)});var XP=v("ZodJWT",(t,e)=>{Vg.init(t,e),ge.init(t,e)});var H_=v("ZodNumber",(t,e)=>{yu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>t_(t,n,o,s),Ro(t,"ZodNumber",{gt(n,o){return this.check($i(n,o))},gte(n,o){return this.check(To(n,o))},min(n,o){return this.check(To(n,o))},lt(n,o){return this.check(Si(n,o))},lte(n,o){return this.check(Po(n,o))},max(n,o){return this.check(Po(n,o))},int(n){return this.check(q_(n))},safe(n){return this.check(q_(n))},positive(n){return this.check($i(0,n))},nonnegative(n){return this.check(To(0,n))},negative(n){return this.check(Si(0,n))},nonpositive(n){return this.check(Po(0,n))},multipleOf(n,o){return this.check(ki(n,o))},step(n,o){return this.check(ki(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 Uy(H_,t)}var eT=v("ZodNumberFormat",(t,e)=>{Bg.init(t,e),H_.init(t,e)});function q_(t){return Vy(eT,t)}var tT=v("ZodBoolean",(t,e)=>{Hg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>r_(t,r,n,o)});function ze(t){return By(tT,t)}var rT=v("ZodNull",(t,e)=>{Wg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>n_(t,r,n,o)});function Uu(t){return Hy(rT,t)}var nT=v("ZodUnknown",(t,e)=>{Gg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>s_(t,r,n,o)});function ye(){return Wy(nT)}var oT=v("ZodNever",(t,e)=>{Jg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>o_(t,r,n,o)});function sT(t){return Gy(oT,t)}var iT=v("ZodArray",(t,e)=>{Kg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>l_(t,r,n,o),t.element=e.element,Ro(t,"ZodArray",{min(r,n){return this.check(bn(r,n))},nonempty(r){return this.check(bn(1,r))},max(r,n){return this.check(Ei(r,n))},length(r,n){return this.check(zi(r,n))},unwrap(){return this.element}})});function J(t,e){return Jy(iT,t,e)}var W_=v("ZodObject",(t,e)=>{Xg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>d_(t,r,n,o),Y.defineLazy(t,"shape",()=>e.shape),Ro(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:sT()})},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(K_,this,r[0])},required(...r){return Y.required(Y_,this,r[0])}})});function P(t,e){let r={type:"object",shape:t??{},...Y.normalizeParams(e)};return new W_(r)}function Fe(t,e){return new W_({type:"object",shape:t,catchall:ye(),...Y.normalizeParams(e)})}var G_=v("ZodUnion",(t,e)=>{_u.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>f_(t,r,n,o),t.options=e.options});function ce(t,e){return new G_({type:"union",options:t,...Y.normalizeParams(e)})}var aT=v("ZodDiscriminatedUnion",(t,e)=>{G_.init(t,e),ey.init(t,e)});function Vu(t,e,r){return new aT({type:"union",options:e,discriminator:t,...Y.normalizeParams(r)})}var cT=v("ZodIntersection",(t,e)=>{ty.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>p_(t,r,n,o)});function Ci(t,e){return new cT({type:"intersection",left:t,right:e})}var F_=v("ZodRecord",(t,e)=>{ry.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>m_(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ve(t,e,r){return!e||!e._zod?new F_({type:"record",keyType:y(),valueType:t,...Y.normalizeParams(e)}):new F_({type:"record",keyType:t,valueType:e,...Y.normalizeParams(r)})}var Fu=v("ZodEnum",(t,e)=>{ny.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>i_(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 Fu({...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 Fu({...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 Fu({type:"enum",entries:r,...Y.normalizeParams(e)})}var uT=v("ZodLiteral",(t,e)=>{oy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>a_(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 uT({type:"literal",values:Array.isArray(t)?t:[t],...Y.normalizeParams(e)})}var lT=v("ZodTransform",(t,e)=>{sy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>u_(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new hn(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 J_(t){return new lT({type:"transform",transform:t})}var K_=v("ZodOptional",(t,e)=>{vu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ju(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function we(t){return new K_({type:"optional",innerType:t})}var dT=v("ZodExactOptional",(t,e)=>{iy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ju(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function fT(t){return new dT({type:"optional",innerType:t})}var pT=v("ZodNullable",(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 U_(t){return new pT({type:"nullable",innerType:t})}var mT=v("ZodDefault",(t,e)=>{cy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>y_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function hT(t,e){return new mT({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var gT=v("ZodPrefault",(t,e)=>{uy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>__(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function yT(t,e){return new gT({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var Y_=v("ZodNonOptional",(t,e)=>{ly.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>g_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function _T(t,e){return new Y_({type:"nonoptional",innerType:t,...Y.normalizeParams(e)})}var vT=v("ZodCatch",(t,e)=>{dy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>v_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function bT(t,e){return new vT({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Q_=v("ZodPipe",(t,e)=>{bu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>b_(t,r,n,o),t.in=e.in,t.out=e.out});function V_(t,e){return new Q_({type:"pipe",in:t,out:e})}var wT=v("ZodPreprocess",(t,e)=>{Q_.init(t,e),fy.init(t,e)}),xT=v("ZodReadonly",(t,e)=>{py.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>w_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ST(t){return new xT({type:"readonly",innerType:t})}var X_=v("ZodCustom",(t,e)=>{my.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>c_(t,r,n,o)});function ev(t,e){return Ky(X_,t??(()=>!0),e)}function $T(t,e={}){return Yy(X_,t,e)}function kT(t,e){return Qy(t,e)}function Bu(t,e){return new wT({type:"pipe",in:J_(t),out:e})}tt(hy());var Wu="2025-11-25";var tv=[Wu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ar="io.modelcontextprotocol/related-task",Ii="2.0",Te=ev(t=>t!==null&&(typeof t=="object"||typeof t=="function")),rv=ce([y(),se().int()]),nv=y(),xq=Fe({ttl:ce([se(),Uu()]).optional(),pollInterval:se().optional()}),ET=P({ttl:se().optional()}),zT=P({taskId:y()}),Gu=Fe({progressToken:rv.optional(),[ar]:zT.optional()}),nt=P({_meta:Gu.optional()}),Do=nt.extend({task:ET.optional()}),ov=t=>Do.safeParse(t).success,Ce=P({method:y(),params:nt.loose().optional()}),ut=P({_meta:Gu.optional()}),lt=P({method:y(),params:ut.loose().optional()}),Oe=Fe({_meta:Gu.optional()}),Ri=ce([y(),se().int()]),sv=P({jsonrpc:C(Ii),id:Ri,...Ce.shape}).strict(),Ju=t=>sv.safeParse(t).success,iv=P({jsonrpc:C(Ii),...lt.shape}).strict(),av=t=>iv.safeParse(t).success,Ku=P({jsonrpc:C(Ii),id:Ri,result:Oe}).strict(),Ao=t=>Ku.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 Yu=P({jsonrpc:C(Ii),id:Ri.optional(),error:P({code:se().int(),message:y(),data:ye().optional()})}).strict();var cv=t=>Yu.safeParse(t).success;var uv=ce([sv,iv,Ku,Yu]),Sq=ce([Ku,Yu]),Di=Oe.strict(),PT=ut.extend({requestId:Ri.optional(),reason:y().optional()}),Ai=lt.extend({method:C("notifications/cancelled"),params:PT}),TT=P({src:y(),mimeType:y().optional(),sizes:J(y()).optional(),theme:We(["light","dark"]).optional()}),No=P({icons:J(TT).optional()}),xn=P({name:y(),title:y().optional()}),lv=xn.extend({...xn.shape,...No.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),CT=Ci(P({applyDefaults:ze().optional()}),ve(y(),ye())),OT=Bu(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Ci(P({form:CT.optional(),url:Te.optional()}),ve(y(),ye()).optional())),IT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({sampling:Fe({createMessage:Te.optional()}).optional(),elicitation:Fe({create:Te.optional()}).optional()}).optional()}),RT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({tools:Fe({call:Te.optional()}).optional()}).optional()}),DT=P({experimental:ve(y(),Te).optional(),sampling:P({context:Te.optional(),tools:Te.optional()}).optional(),elicitation:OT.optional(),roots:P({listChanged:ze().optional()}).optional(),tasks:IT.optional()}),AT=nt.extend({protocolVersion:y(),capabilities:DT,clientInfo:lv}),Qu=Ce.extend({method:C("initialize"),params:AT});var NT=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:RT.optional()}),jT=Oe.extend({protocolVersion:y(),capabilities:NT,serverInfo:lv,instructions:y().optional()}),Xu=lt.extend({method:C("notifications/initialized"),params:ut.optional()});var Ni=Ce.extend({method:C("ping"),params:nt.optional()}),MT=P({progress:se(),total:we(se()),message:we(y())}),LT=P({...ut.shape,...MT.shape,progressToken:rv}),ji=lt.extend({method:C("notifications/progress"),params:LT}),ZT=nt.extend({cursor:nv.optional()}),jo=Ce.extend({params:ZT.optional()}),Mo=Oe.extend({nextCursor:nv.optional()}),qT=We(["working","input_required","completed","failed","cancelled"]),Lo=P({taskId:y(),status:qT,ttl:ce([se(),Uu()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:we(se()),statusMessage:we(y())}),Sn=Oe.extend({task:Lo}),FT=ut.merge(Lo),Zo=lt.extend({method:C("notifications/tasks/status"),params:FT}),Mi=Ce.extend({method:C("tasks/get"),params:nt.extend({taskId:y()})}),Li=Oe.merge(Lo),Zi=Ce.extend({method:C("tasks/result"),params:nt.extend({taskId:y()})}),$q=Oe.loose(),qi=jo.extend({method:C("tasks/list")}),Fi=Mo.extend({tasks:J(Lo)}),Ui=Ce.extend({method:C("tasks/cancel"),params:nt.extend({taskId:y()})}),dv=Oe.merge(Lo),fv=P({uri:y(),mimeType:we(y()),_meta:ve(y(),ye()).optional()}),pv=fv.extend({text:y()}),el=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),mv=fv.extend({blob:el}),qo=We(["user","assistant"]),$n=P({audience:J(qo).optional(),priority:se().min(0).max(1).optional(),lastModified:Io.datetime({offset:!0}).optional()}),hv=P({...xn.shape,...No.shape,uri:y(),description:we(y()),mimeType:we(y()),annotations:$n.optional(),_meta:we(Fe({}))}),UT=P({...xn.shape,...No.shape,uriTemplate:y(),description:we(y()),mimeType:we(y()),annotations:$n.optional(),_meta:we(Fe({}))}),VT=jo.extend({method:C("resources/list")}),BT=Mo.extend({resources:J(hv)}),HT=jo.extend({method:C("resources/templates/list")}),WT=Mo.extend({resourceTemplates:J(UT)}),tl=nt.extend({uri:y()}),GT=tl,JT=Ce.extend({method:C("resources/read"),params:GT}),KT=Oe.extend({contents:J(ce([pv,mv]))}),YT=lt.extend({method:C("notifications/resources/list_changed"),params:ut.optional()}),QT=tl,XT=Ce.extend({method:C("resources/subscribe"),params:QT}),eC=tl,tC=Ce.extend({method:C("resources/unsubscribe"),params:eC}),rC=ut.extend({uri:y()}),nC=lt.extend({method:C("notifications/resources/updated"),params:rC}),oC=P({name:y(),description:we(y()),required:we(ze())}),sC=P({...xn.shape,...No.shape,description:we(y()),arguments:we(J(oC)),_meta:we(Fe({}))}),iC=jo.extend({method:C("prompts/list")}),aC=Mo.extend({prompts:J(sC)}),cC=nt.extend({name:y(),arguments:ve(y(),y()).optional()}),uC=Ce.extend({method:C("prompts/get"),params:cC}),rl=P({type:C("text"),text:y(),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),nl=P({type:C("image"),data:el,mimeType:y(),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),ol=P({type:C("audio"),data:el,mimeType:y(),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),lC=P({type:C("tool_use"),name:y(),id:y(),input:ve(y(),ye()),_meta:ve(y(),ye()).optional()}),dC=P({type:C("resource"),resource:ce([pv,mv]),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),fC=hv.extend({type:C("resource_link")}),sl=ce([rl,nl,ol,fC,dC]),pC=P({role:qo,content:sl}),mC=Oe.extend({description:y().optional(),messages:J(pC)}),hC=lt.extend({method:C("notifications/prompts/list_changed"),params:ut.optional()}),gC=P({title:y().optional(),readOnlyHint:ze().optional(),destructiveHint:ze().optional(),idempotentHint:ze().optional(),openWorldHint:ze().optional()}),yC=P({taskSupport:We(["required","optional","forbidden"]).optional()}),gv=P({...xn.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:gC.optional(),execution:yC.optional(),_meta:ve(y(),ye()).optional()}),il=jo.extend({method:C("tools/list")}),_C=Mo.extend({tools:J(gv)}),Vi=Oe.extend({content:J(sl).default([]),structuredContent:ve(y(),ye()).optional(),isError:ze().optional()}),kq=Vi.or(Oe.extend({toolResult:ye()})),vC=Do.extend({name:y(),arguments:ve(y(),ye()).optional()}),Fo=Ce.extend({method:C("tools/call"),params:vC}),bC=lt.extend({method:C("notifications/tools/list_changed"),params:ut.optional()}),Eq=P({autoRefresh:ze().default(!0),debounceMs:se().int().nonnegative().default(300)}),Uo=We(["debug","info","notice","warning","error","critical","alert","emergency"]),wC=nt.extend({level:Uo}),al=Ce.extend({method:C("logging/setLevel"),params:wC}),xC=ut.extend({level:Uo,logger:y().optional(),data:ye()}),SC=lt.extend({method:C("notifications/message"),params:xC}),$C=P({name:y().optional()}),kC=P({hints:J($C).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),EC=P({mode:We(["auto","required","none"]).optional()}),zC=P({type:C("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:J(sl).default([]),structuredContent:P({}).loose().optional(),isError:ze().optional(),_meta:ve(y(),ye()).optional()}),PC=Vu("type",[rl,nl,ol]),Oi=Vu("type",[rl,nl,ol,lC,zC]),TC=P({role:qo,content:ce([Oi,J(Oi)]),_meta:ve(y(),ye()).optional()}),CC=Do.extend({messages:J(TC),modelPreferences:kC.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(gv).optional(),toolChoice:EC.optional()}),OC=Ce.extend({method:C("sampling/createMessage"),params:CC}),cl=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens"]).or(y())),role:qo,content:PC}),ul=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:qo,content:ce([Oi,J(Oi)])}),IC=P({type:C("boolean"),title:y().optional(),description:y().optional(),default:ze().optional()}),RC=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()}),DC=P({type:We(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),AC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),default:y().optional()}),NC=P({type:C("string"),title:y().optional(),description:y().optional(),oneOf:J(P({const:y(),title:y()})),default:y().optional()}),jC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),enumNames:J(y()).optional(),default:y().optional()}),MC=ce([AC,NC]),LC=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()}),ZC=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()}),qC=ce([LC,ZC]),FC=ce([jC,MC,qC]),UC=ce([FC,IC,RC,DC]),VC=Do.extend({mode:C("form").optional(),message:y(),requestedSchema:P({type:C("object"),properties:ve(y(),UC),required:J(y()).optional()})}),BC=Do.extend({mode:C("url"),message:y(),elicitationId:y(),url:y().url()}),HC=ce([VC,BC]),WC=Ce.extend({method:C("elicitation/create"),params:HC}),GC=ut.extend({elicitationId:y()}),JC=lt.extend({method:C("notifications/elicitation/complete"),params:GC}),Bi=Oe.extend({action:We(["accept","decline","cancel"]),content:Bu(t=>t===null?void 0:t,ve(y(),ce([y(),se(),ze(),J(y())])).optional())}),KC=P({type:C("ref/resource"),uri:y()});var YC=P({type:C("ref/prompt"),name:y()}),QC=nt.extend({ref:ce([YC,KC]),argument:P({name:y(),value:y()}),context:P({arguments:ve(y(),y()).optional()}).optional()}),XC=Ce.extend({method:C("completion/complete"),params:QC});var eO=Oe.extend({completion:Fe({values:J(y()).max(100),total:we(se().int()),hasMore:we(ze())})}),tO=P({uri:y().startsWith("file://"),name:y().optional(),_meta:ve(y(),ye()).optional()}),rO=Ce.extend({method:C("roots/list"),params:nt.optional()}),ll=Oe.extend({roots:J(tO)}),nO=lt.extend({method:C("notifications/roots/list_changed"),params:ut.optional()}),zq=ce([Ni,Qu,XC,al,uC,iC,VT,HT,JT,XT,tC,Fo,il,Mi,Zi,qi,Ui]),Pq=ce([Ai,ji,Xu,nO,Zo]),Tq=ce([Di,cl,ul,Bi,ll,Li,Fi,Sn]),Cq=ce([Ni,OC,WC,rO,Mi,Zi,qi,Ui]),Oq=ce([Ai,ji,SC,nC,YT,bC,hC,Zo,JC]),Iq=ce([Di,jT,eO,mC,aC,BT,WT,KT,Vi,_C,Li,Fi,Sn]),Z=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 Hu(o.elicitations,r)}return new t(e,r,n)}},Hu=class extends Z{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(G.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function cr(t){return t==="completed"||t==="failed"||t==="cancelled"}var d2=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function dl(t){let r=Pi(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=x_(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function fl(t,e){let r=ir(t,e);if(!r.success)throw r.error;return r.data}var uO=6e4,Hi=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(Ai,r=>{this._oncancel(r)}),this.setNotificationHandler(ji,r=>{this._onprogress(r)}),this.setRequestHandler(Ni,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Mi,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(G.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Zi,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,p=new Z(d.error.code,d.error.message,d.error.data);l(p)}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 Z(G.InvalidParams,`Task not found: ${s}`);if(!cr(i.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(cr(i.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ar]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(qi,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 Z(G.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Ui,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(G.InvalidParams,`Task not found: ${r.params.taskId}`);if(cr(o.status))throw new Z(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 Z(G.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Z?o:new Z(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),Z.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),Ao(s)||cv(s)?this._onresponse(s):Ju(s)?this._onrequest(s,i):av(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=Z.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?.[ar]?.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=ov(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,p)=>{if(i.signal.aborted)throw new Z(G.ConnectionClosed,"Request was cancelled");let m={...p,relatedRequestId:e.id};s&&!m.relatedTask&&(m.relatedTask={taskId:s});let f=m.relatedTask?.taskId??s;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(l,d,m)},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),Ao(e))n(e);else{let i=new Z(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(Ao(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),Ao(e))o(e);else{let i=Z.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 Z?i:new Z(G.InternalError,String(i))}}return}let s;try{let i=await this.request(e,Sn,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new Z(G.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},cr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new Z(G.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Z(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 Z?i:new Z(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 p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(m.params={...m.params,task:a}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[ar]:c}});let f=x=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(x)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let w=x instanceof Z?x:new Z(G.RequestTimeout,String(x));l(w)};this._responseHandlers.set(p,x=>{if(!n?.signal?.aborted){if(x instanceof Error)return l(x);try{let w=ir(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??uO,g=()=>f(Z.fromError(G.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(p,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let x=w=>{let S=this._responseHandlers.get(p);S?S(w):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,x),this._enqueueTaskMessage(_,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(p),l(w)})}else this._transport.send(m,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(x=>{this._cleanupTimeout(p),l(x)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Li,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},Fi,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},dv,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||{},[ar]: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||{},[ar]: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||{},[ar]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=dl(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=fl(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=dl(e);this._notificationHandlers.set(n,o=>{let s=fl(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"&&Ju(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new Z(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 Z(G.InvalidRequest,"Request cancelled"));return}let i=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(i),s(new Z(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 Z(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=Zo.parse({method:"notifications/tasks/status",params:a});await this.notification(c),cr(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 Z(G.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(cr(a.status))throw new Z(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=Zo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),cr(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function yv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function _v(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];yv(i)&&yv(s)?r[o]={...i,...s}:r[o]=s}return r}var cx=gt(Xd(),1),ux=gt(ax(),1);function g1(){let t=new cx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,ux.default)(t),t}var Ca=class{constructor(e){this._ajv=e??g1()}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 Oa=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 lx(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 dx(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 Ia=class extends Hi{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Uo.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 Ca,this.setRequestHandler(Qu,n=>this._oninitialize(n)),this.setNotificationHandler(Xu,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(al,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,a=Uo.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Oa(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=_v(this._capabilities,e)}setRequestHandler(e,r){let o=Pi(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(wn(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=ir(Fo,c);if(!l.success){let f=l.error instanceof Error?l.error.message:String(l.error);throw new Z(G.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let f=ir(Sn,p);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new Z(G.InvalidParams,`Invalid task creation result: ${h}`)}return f.data}let m=ir(Vi,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new Z(G.InvalidParams,`Invalid tools/call result: ${f}`)}return m.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){dx(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&lx(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:tv.includes(r)?r:Wu,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"},Di)}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},ul,r):this.request({method:"sampling/createMessage",params:e},cl,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},Bi,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},Bi,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!a.valid)throw new Z(G.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof Z?i:new Z(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},ll,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 cf=gt(require("node:process"),1);var Ra=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
158
- `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),y1(r)}clear(){this._buffer=void 0}};function y1(t){return uv.parse(JSON.parse(t))}function fx(t){return JSON.stringify(t)+`
159
- `}var Da=class{constructor(e=cf.default.stdin,r=cf.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Ra,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=fx(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var bs=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 ws=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 m of c){if(!o&&m.deprecated)continue;let f=this.calculateRelevanceScore(m,a);f>0&&u.push({doc:m,relevanceScore:f})}u.sort((m,f)=>f.relevanceScore-m.relevanceScore);let l=u.length,d=u.slice(i,i+s),p=i+s<l;return{items:d,total:l,hasMore:p}}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 Aa=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):
150
+ 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}a.count>1&&t.reused==="ref"&&s(i)}t.external&&(t.sharedDefsExtractedFor=t.external)}function Ev(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let r=[];for(let n of e){if(!n||typeof n!="object")return;Ev(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let s=n.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;r.includes(i)||r.push(i)}}delete t.anyOf,t.type=r.length===1?r[0]:r}var kv=new Set(["type","properties","required","additionalProperties"]),Sv=["oneOf","anyOf"];function $v(t){let e=t.additionalProperties;return e===void 0||e===!1||typeof e!="object"||e===null?null:Object.keys(e).length?e:null}function jl(t){let e=[];for(let s of t){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!kv.has(i))return null;e.push(s)}let r={},n=new Set;for(let s of e){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of e){let l=u.properties?.[i]??$v(u);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}let c=a.length===1?a[0]:jl(a)??{allOf:a};ot(r,i,c)}for(let i of s.required??[])n.add(i)}let o={type:"object",properties:r};if(n.size&&(o.required=[...n]),e.every(s=>s.additionalProperties===!1))o.additionalProperties=!1;else{let s=[];for(let i of e){let a=$v(i);a&&!s.some(c=>JSON.stringify(c)===JSON.stringify(a))&&s.push(a)}s.length===1?o.additionalProperties=s[0]:s.length>1&&(o.additionalProperties={allOf:s})}return o}function QC(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let o of kv)if(o in t)return;let r=e.filter(o=>Sv.some(s=>Array.isArray(o[s]))),n=null;if(!r.length)n=jl(e);else{let o=r[0],s=Sv.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let i=e.filter(c=>c!==o),a=o[s].map(c=>jl([...i,c]));if(a.some(c=>!c))return;n={[s]:a}}n&&(delete t.allOf,Bo(t,n))}function Zl(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 m=t.seen.get(d),f=m.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)):Bo(u,f),Bo(u,l),a._zod.parent===d)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(f.$ref&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g]}let p=a._zod.parent;if(p&&p!==d){n(p);let m=t.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let f in u)f==="$ref"||f==="allOf"||f in m.def&&JSON.stringify(u[f])===JSON.stringify(m.def[f])&&delete u[f]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!t.external||t.sharedEmitDoneFor!==t.external){for(let a of[...t.seen.entries()].reverse())n(a[0]);if(t.target!=="openapi-3.0")for(let a of t.seen.entries())Ev(a[1].def??a[1].schema);for(let a of t.deferred)a();if(t.intersections.length){let a=new Map;for(let c of t.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);d?d.push(u):a.set(l,[u])}for(let c of t.intersections)for(let u of a.get(c)??[])QC(u)}}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)}Bo(o,r.defId?r.schema: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??{};if(!t.external||t.sharedEmitDoneFor!==t.external)for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,ot(i,c.defId,c.def))}t.external&&(t.sharedEmitDoneFor=t.external),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:Ho(e,"input",t.processors),output:Ho(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Ue(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 Ue(n.element,r);if(n.type==="set")return Ue(n.valueType,r);if(n.type==="lazy")return Ue(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"||n.type==="catch")return Ue(n.innerType,r);if(n.type==="intersection")return Ue(n.left,r)||Ue(n.right,r);if(n.type==="record"||n.type==="map")return Ue(n.keyType,r)||Ue(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:Ue(n.in,r)||Ue(n.out,r);if(n.type==="object"){for(let o in n.shape)if(Ue(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Ue(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Ue(o,r))return!0;return!!(n.rest&&Ue(n.rest,r))}return!1}var Pv=(t,e={})=>r=>{let n=Ml({...r,processors:e});return Ee(t,n),Ll(n,t),Zl(n,t)},Ho=(t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Ml({...o??{},target:s,io:e,processors:r});return Ee(t,i),Ll(i,t),Zl(i,t)};var In=(t,e,r)=>{(t[e]===void 0||r>t[e])&&(t[e]=r)},Rn=(t,e,r)=>{(t[e]===void 0||r<t[e])&&(t[e]=r)},zv=(t,e)=>{In(t,"minimum",e),Rn(t,"maximum",e)},Iv=(t,e)=>{t.multipleOf??(t.multipleOf=[]),t.multipleOf.includes(e)||t.multipleOf.push(e)},Rv=(t,e)=>{t.patterns??(t.patterns=new Set),t.patterns.add(e)},Dv=(t,e)=>{t.mime=t.mime?t.mime.filter(r=>e.includes(r)):[...e]},Av=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},Tv=(t,e)=>In(t,"minimum",e.minimum),Cv=(t,e)=>Rn(t,"maximum",e.maximum),Ov=t=>(e,r)=>{Av(e,r.format);let[n,o]=t[r.format];In(e,"minimum",n),Rn(e,"maximum",o)},eO={greater_than:(t,e)=>In(t,e.inclusive?"minimum":"exclusiveMinimum",e.value),less_than:(t,e)=>Rn(t,e.inclusive?"maximum":"exclusiveMaximum",e.value),multiple_of:(t,e)=>Iv(t,e.value),number_format:Ov(Ro),bigint_format:Ov(Di),min_length:Tv,max_length:Cv,length_equals:(t,e)=>zv(t,e.length),min_size:Tv,max_size:Cv,size_equals:(t,e)=>zv(t,e.size),string_format:(t,e)=>{Av(t,e.format),e.pattern&&Rv(t,e.pattern),(e.format==="base64"||e.format==="base64url")&&(t.contentEncoding=e.format),(e.local||e.precision===-1)&&(t.laxFormat=!0)},mime_type:(t,e)=>Dv(t,e.mime)};function dt(t){let e={},r=t._zod.def,n=t._zod.traits.has("$ZodCheck")?[t,...r.checks??[]]:r.checks??[];for(let s of n)eO[s._zod.def.check]?.(e,s._zod.def);let o=t._zod.bag;o.minimum!==void 0&&In(e,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&In(e,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Rn(e,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Rn(e,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Iv(e,o.multipleOf),o.format!==void 0&&(e.format??(e.format=o.format),o.format.includes("int")&&(e.isInt=!0)),o.mime&&Dv(e,o.mime);for(let s of o.patterns??[])Rv(e,s);return e}var tO={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rO=new Map([[yl,ty],[Ki,ry]]),Nv=t=>rO.get(t)??t,jv=(t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=dt(t);if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=tO[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let d=[...c].map(Nv);d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(p=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Mv=(t,e,r,n)=>{let o=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=dt(t);o.type=l?"integer":"number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),m=e.target==="draft-04"||e.target==="openapi-3.0";if(d?m?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),p?m?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof i=="number"&&(o.maximum=i),a){let f=new Set;for(let y of a)Number.isFinite(y)&&y!==0?f.add(Math.abs(y)):Yt(t,e,o,n,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);let[h,...g]=f;h!==void 0&&(o.multipleOf=h),g.length&&(o.allOf=[...o.allOf??[],...g.map(y=>({multipleOf:y}))])}},Lv=(t,e,r,n)=>{r.type="boolean"};var Zv=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var Fv=(t,e,r,n)=>{r.not={}};var qv=(t,e,r,n)=>{};var Uv=(t,e,r,n)=>{let o=t._zod.def,s=En(o.entries);if(s.length===0){r.not={};return}s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},Vv=(t,e,r,n)=>{let o=t._zod.def;if(o.values.length===0){r.not={};return}let s=[];for(let i of o.values)if(i===void 0){if(Yt(t,e,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i=="bigint"){if(Yt(t,e,r,n,"BigInt literals cannot be represented in JSON Schema"))return;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 Bv=(t,e,r,n)=>{Yt(t,e,r,n,"Custom types cannot be represented in JSON Schema")};var Hv=(t,e,r,n)=>{Yt(t,e,r,n,"Transforms cannot be represented in JSON Schema")};var Wv=(t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:i,maximum:a}=dt(t);typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Ee(s.element,e,{...n,path:[...n.path,"items"]})};function la(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?la(e.out):e.type==="catch"?la(e.innerType):t._zod.optin}var Gv=(t,e,r,n)=>{let o=r,s=t._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Yt(t,e,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in i)ot(o.properties,u,Ee(i[u],e,{...n,path:[...n.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];(e.io==="input"?la(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(o.required=c),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Ee(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},Jv=(t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Ee(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},Kv=(t,e,r,n)=>{let o=t._zod.def,s=Ee(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=Ee(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,e.intersections.push(c)};function Fl(t,e,r){if(e.$ref){if(r.has(e))return e;r.add(e);let f=t.get(e)?.def;if(!f)return e;let h=Fl(t,f,r);return h===f?e:h}for(let f of["anyOf","oneOf"]){let h=e[f];if(!Array.isArray(h))continue;let g=h.map(y=>Fl(t,y,r));g.some((y,v)=>y!==h[v])&&(e={...e,[f]:g})}let n=Array.isArray(e.type)?e.type:[e.type],o=!n.includes("string")&&n.some(f=>f==="number"||f==="integer"),s=e.enum??(e.const!==void 0?[e.const]:void 0);if(!o&&!s?.some(f=>typeof f=="number"))return e;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:p,...m}=e;return m.enum?m.enum=m.enum.map(f=>typeof f=="number"?String(f):f):typeof m.const=="number"&&(m.const=String(m.const)),o&&(m.type="string",s||(m.pattern=(n.includes("number")?Mo:dl).source)),m}var ql=new WeakMap;function nO(t){let e=new Map;for(let n of t.seen.values())n.def&&!e.has(n.schema)&&e.set(n.schema,n);let r=new Map;for(let n of ql.get(t)??[]){let o=t.seen.get(n),s=(o?.def??o?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Fl(e,s,new Set);i!==s&&r.set(s,i)}if(r.size)for(let n of t.seen.values())for(let o of[n.schema,n.def]){let s=o&&r.get(o.propertyNames);s&&(o.propertyNames=s)}}var Yv=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let i=s.keyType,a=dt(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Ee(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let d of a)ot(o.patternProperties,Nv(d).source,l)}else{if(e.target==="draft-07"||e.target==="draft-2020-12"){o.propertyNames=Ee(s.keyType,e,{...n,path:[...n.path,"propertyNames"]});let l=ql.get(e);l||(l=[],ql.set(e,l),e.deferred.push(()=>nO(e))),l.push(t)}o.additionalProperties=Ee(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]})}let c=i._zod.values,u=e.io==="input"&&la(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l.map(String))}},Xv=(t,e,r,n)=>{let o=t._zod.def,s=Ee(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"}]},Qv=(t,e,r,n)=>{let o=t._zod.def;Ee(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},Ul=Symbol();function eb(t,e,r,n,o){let s=!1,i=JSON.stringify(t,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Yt(e,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Ul):JSON.parse(i)}var tb=(t,e,r,n)=>{let o=t._zod.def;Ee(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let i=eb(o.defaultValue,t,e,r,n);i!==Ul&&(r.default=i)},rb=(t,e,r,n)=>{let o=t._zod.def;Ee(o.innerType,e,n);let s=e.seen.get(t);if(s.ref=o.innerType,e.io!=="input")return;let i=eb(o.defaultValue,t,e,r,n);i!==Ul&&(r._prefault=i)},nb=(t,e,r,n)=>{let o=t._zod.def;Ee(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Yt(t,e,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},ob=(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;Ee(i,e,n);let a=e.seen.get(t);a.ref=i},sb=(t,e,r,n)=>{let o=t._zod.def;Ee(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0};var Vl=(t,e,r,n)=>{let o=t._zod.def;Ee(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType};function da(t){return!!t._zod}function fr(t,e){return da(t)?cl(t,e):t.safeParse(e)}function fa(t){if(!t)return;let e;if(da(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function pa(t){if(da(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 ib=new WeakSet([Object.prototype,Error.prototype]);function ma(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,e,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,e,{value:n,configurable:!0,writable:!0})}})}var pO=(t,e)=>{Pg.init(t,e),t.name="ZodError";let r=Object.getPrototypeOf(t);ib.has(r)||(ib.add(r),ma(r,"format",n=>o=>Cg(n,o)),ma(r,"flatten",n=>o=>Tg(n,o)),ma(r,"addIssue",n=>o=>{n.issues.push(o),n.message=JSON.stringify(n.issues,kn,2)}),ma(r,"addIssues",n=>o=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,kn,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var it=b("ZodError",pO,void 0,{Parent:Error});var ab=Li(it),cb=Zi(it),ub=jo(it),lb=Fi(it),db=Ig(it),fb=Rg(it),pb=Dg(it),mb=Ag(it),hb=Ng(it),gb=jg(it),yb=Mg(it),_b=Lg(it);function hO(){Je.localeError||st(Z_())}function ga(){Je.memoizer||st({memoizer:L_()})}var ve=b("ZodType",(t,e)=>(hO(),de.init(t,e),t.def=e,t.type=e.type,t),{check(...t){let e=this.def;return this.clone(j.mergeDefs(e,{checks:[...e.checks??[],...t.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...t){return this.check(...t)},clone(t,e){return Et(this,t,e)},brand(){return this},register(t,e){return t.add(this,e),this},refine(t,e){return this.check(oI(t,e))},superRefine(t,e){return this.check(sI(t,e))},overwrite(t){return this.check(dr(t))},optional(){return _e(this)},exactOptional(){return HO(this)},nullable(){return wb(this)},nullish(){return _e(wb(this))},nonoptional(t){return XO(this,t)},array(){return K(this)},or(t){return pe([this,t])},and(t){return ya(this,t)},transform(t){return xb(this,zb(t))},default(t){return JO(this,t)},prefault(t){return YO(this,t)},catch(t){return eI(this,t)},pipe(t){return xb(this,t)},readonly(){return nI(this)},describe(t){let e=this.clone();return Kr.add(e,{description:t}),e},meta(...t){if(t.length===0)return Kr.get(this);let e=this.clone();return Kr.add(e,t[0]),e},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(t,...e){return e.length===0?t(this):t(this,...e)},get"~standard"(){return j.hide(this,"~standard",{...gl(this),jsonSchema:{input:Ho(this,"input"),output:Ho(this,"output")}})},set"~standard"(t){j.own(this,"~standard",t)},parse:function t(e,r){return ab(this,e,r,{callee:t})},parseAsync:async function t(e,r){return await cb(this,e,r,{callee:t})},safeParse(t,e){return ub(this,t,e)},async safeParseAsync(t,e){return lb(this,t,e)},get spa(){return this?.safeParseAsync},set spa(t){j.own(this,"spa",t)},validate(t,e){return qi(this,t,e)},validateAsync(t,e){return Ui(this,t,e)},encode:function t(e,r){return db(this,e,r,{callee:t})},decode:function t(e,r){return fb(this,e,r,{callee:t})},encodeAsync:async function t(e,r){return await pb(this,e,r,{callee:t})},decodeAsync:async function t(e,r){return await mb(this,e,r,{callee:t})},safeEncode(t,e){return hb(this,t,e)},safeDecode(t,e){return gb(this,t,e)},async safeEncodeAsync(t,e){return yb(this,t,e)},async safeDecodeAsync(t,e){return _b(this,t,e)},toJSONSchema(t){return Pv(this,{})(t)},get description(){return Kr.get(this)?.description},get _def(){return this._zod.def}}),Sb=b("_ZodString",(t,e)=>{Ji.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>jv(t,r,n,o)},j.derived({format:t=>dt(t).format??null,minLength:t=>dt(t).minimum??null,maxLength:t=>dt(t).maximum??null},{regex(...t){return this.check(kl(...t))},includes(...t){return this.check(Tl(...t))},startsWith(...t){return this.check(Cl(...t))},endsWith(...t){return this.check(Ol(...t))},min(...t){return this.check(On(...t))},max(...t){return this.check(ca(...t))},length(...t){return this.check(ua(...t))},nonempty(...t){return this.check(On(1,...t))},lowercase(t){return this.check(Pl(t))},uppercase(t){return this.check(zl(t))},trim(){return this.check(Rl())},normalize(...t){return this.check(Il(...t))},toLowerCase(){return this.check(Dl())},toUpperCase(){return this.check(Al())},slugify(){return this.check(Nl())}})),gO=b("ZodString",(t,e)=>{Ji.init(t,e),Sb.init(t,e)},{email(t){return this.check(V_(yO,t))},url(t){return this.check(K_(vO,t))},jwt(t){return this.check(dv(DO,t))},emoji(t){return this.check(Y_(bO,t))},guid(t){return this.check(B_(_O,t))},uuid(t){return this.check(H_(ha,t))},uuidv4(t){return this.check(W_(ha,t))},uuidv6(t){return this.check(G_(ha,t))},uuidv7(t){return this.check(J_(ha,t))},nanoid(t){return this.check(X_(wO,t))},cuid(t){return this.check(Q_(xO,t))},cuid2(t){return this.check(ev(SO,t))},ulid(t){return this.check(tv($O,t))},base64(t){return this.check(cv(OO,t))},base64url(t){return this.check(uv(IO,t))},xid(t){return this.check(rv(EO,t))},ksuid(t){return this.check(nv(kO,t))},ipv4(t){return this.check(ov(PO,t))},ipv6(t){return this.check(sv(zO,t))},cidrv4(t){return this.check(iv(TO,t))},cidrv6(t){return this.check(av(CO,t))},e164(t){return this.check(lv(RO,t))},datetime(t){return this.check(ta(Go,t))},date(t){return this.check(ra(Jo,t))},time(t){return this.check(na(Ko,t))},duration(t){return this.check(oa(Yo,t))}});function _(t){return U_(gO,t)}var xe=b("ZodStringFormat",(t,e)=>{fe.init(t,e),Sb.init(t,e)}),Go=b("ZodISODateTime",(t,e)=>{Xy.init(t,e),xe.init(t,e)}),Jo=b("ZodISODate",(t,e)=>{Qy.init(t,e),xe.init(t,e)}),Ko=b("ZodISOTime",(t,e)=>{e_.init(t,e),xe.init(t,e)}),Yo=b("ZodISODuration",(t,e)=>{t_.init(t,e),xe.init(t,e)}),yO=b("ZodEmail",(t,e)=>{Fy.init(t,e),xe.init(t,e)});var _O=b("ZodGUID",(t,e)=>{Ly.init(t,e),xe.init(t,e)});var ha=b("ZodUUID",(t,e)=>{Zy.init(t,e),xe.init(t,e)});var vO=b("ZodURL",(t,e)=>{Vy.init(t,e),xe.init(t,e)});var bO=b("ZodEmoji",(t,e)=>{By.init(t,e),xe.init(t,e)});var wO=b("ZodNanoID",(t,e)=>{Hy.init(t,e),xe.init(t,e)});var xO=b("ZodCUID",(t,e)=>{Wy.init(t,e),xe.init(t,e)});var SO=b("ZodCUID2",(t,e)=>{Gy.init(t,e),xe.init(t,e)});var $O=b("ZodULID",(t,e)=>{Jy.init(t,e),xe.init(t,e)});var EO=b("ZodXID",(t,e)=>{Ky.init(t,e),xe.init(t,e)});var kO=b("ZodKSUID",(t,e)=>{Yy.init(t,e),xe.init(t,e)});var PO=b("ZodIPv4",(t,e)=>{r_.init(t,e),xe.init(t,e)});var zO=b("ZodIPv6",(t,e)=>{o_.init(t,e),xe.init(t,e)});var TO=b("ZodCIDRv4",(t,e)=>{s_.init(t,e),xe.init(t,e)});var CO=b("ZodCIDRv6",(t,e)=>{i_.init(t,e),xe.init(t,e)});var OO=b("ZodBase64",(t,e)=>{c_.init(t,e),xe.init(t,e)});var IO=b("ZodBase64URL",(t,e)=>{u_.init(t,e),xe.init(t,e)});var RO=b("ZodE164",(t,e)=>{l_.init(t,e),xe.init(t,e)});var DO=b("ZodJWT",(t,e)=>{d_.init(t,e),xe.init(t,e)});var $b=b("ZodNumber",(t,e)=>{_l.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Mv(t,r,n,o),t.isFinite=!0},j.derived({minValue:t=>{let{minimum:e,exclusiveMinimum:r}=dt(t);return Math.max(e??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:t=>{let{maximum:e,exclusiveMaximum:r}=dt(t);return Math.min(e??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:t=>{let{isInt:e,multipleOf:r}=dt(t);return!!e||!!r?.some(Number.isSafeInteger)},format:t=>dt(t).format??null},{gt(t,e){return this.check(ia(t,e))},gte(t,e){return this.check(Vo(t,e))},min(t,e){return this.check(Vo(t,e))},lt(t,e){return this.check(sa(t,e))},lte(t,e){return this.check(Uo(t,e))},max(t,e){return this.check(Uo(t,e))},int(t){return this.check(vb(t))},safe(t){return this.check(vb(t))},positive(t){return this.check(ia(0,t))},nonnegative(t){return this.check(Vo(0,t))},negative(t){return this.check(sa(0,t))},nonpositive(t){return this.check(Uo(0,t))},multipleOf(t,e){return this.check(aa(t,e))},step(t,e){return this.check(aa(t,e))},finite(){return this}}));function se(t){return fv($b,t)}var AO=b("ZodNumberFormat",(t,e)=>{f_.init(t,e),$b.init(t,e)});function vb(t){return pv(AO,t)}var NO=b("ZodBoolean",(t,e)=>{p_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Lv(t,r,n,o)});function Te(t){return mv(NO,t)}var jO=b("ZodNull",(t,e)=>{m_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Zv(t,r,n,o)});function Eb(t){return hv(jO,t)}var MO=b("ZodUnknown",(t,e)=>{h_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>qv(t,r,n,o)});function ye(){return gv(MO)}var LO=b("ZodNever",(t,e)=>{g_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Fv(t,r,n,o)});function ZO(t){return yv(LO,t)}var FO=b("ZodArray",(t,e)=>{ga(),y_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Wv(t,r,n,o),t.element=e.element},{min(t,e){return this.check(On(t,e))},nonempty(t){return this.check(On(1,t))},max(t,e){return this.check(ca(t,e))},length(t,e){return this.check(ua(t,e))},unwrap(){return this.element}});function K(t,e){return _v(FO,t,e)}var kb=b("ZodObject",(t,e)=>{ga(),b_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Gv(t,r,n,o),j.installLazyProp(t,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Ke(Object.keys(this._zod.def.shape))},catchall(t){return this.clone(j.mergeDefs(this._zod.def,{catchall:t}))},passthrough(){return this.clone(j.mergeDefs(this._zod.def,{catchall:ye()}))},loose(){return this.clone(j.mergeDefs(this._zod.def,{catchall:ye()}))},strict(){return this.clone(j.mergeDefs(this._zod.def,{catchall:ZO()}))},strip(){return this.clone(j.mergeDefs(this._zod.def,{catchall:void 0}))},extend(t){return j.extend(this,t)},safeExtend(t){return j.safeExtend(this,t)},merge(t){return j.merge(this,t)},pick(t){return j.pick(this,t)},omit(t){return j.omit(this,t)},partial(...t){return j.partial(Tb,this,t[0])},exactPartial(...t){return j.partial(Cb,this,t[0],"exactPartial")},required(...t){return j.required(Ob,this,t[0])}});function z(t,e){let r={type:"object",shape:t??{},...j.normalizeParams(e)};return new kb(r)}function Ve(t,e){return new kb({type:"object",shape:t,catchall:ye(),...j.normalizeParams(e)})}var Pb=b("ZodUnion",(t,e)=>{vl.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Jv(t,r,n,o),t.options=e.options});function pe(t,e){return new Pb({type:"union",options:t,...j.normalizeParams(e)})}var qO=b("ZodDiscriminatedUnion",(t,e)=>{Pb.init(t,e),w_.init(t,e)});function Hl(t,e,r){return new qO({type:"union",options:e,discriminator:t,...j.normalizeParams(r)})}var UO=b("ZodIntersection",(t,e)=>{x_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Kv(t,r,n,o)});function ya(t,e){return new UO({type:"intersection",left:t,right:e})}var bb=b("ZodRecord",(t,e)=>{ga(),S_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Yv(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ue(t,e,r){return!e||!e._zod?new bb({type:"record",keyType:_(),valueType:t,...j.normalizeParams(e)}):new bb({type:"record",keyType:t,valueType:e,...j.normalizeParams(r)})}var Bl=b("ZodEnum",(t,e)=>{$_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Uv(t,n,o,s),t.enum=e.entries,t.options=[...t._zod.values];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 Bl({...e,checks:[],...j.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 Bl({...e,checks:[],...j.normalizeParams(o),entries:s})}});function Ke(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Bl({type:"enum",entries:r,...j.normalizeParams(e)})}var VO=b("ZodLiteral",(t,e)=>{E_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Vv(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 O(t,e){return new VO({type:"literal",values:Array.isArray(t)?t:[t],...j.normalizeParams(e)})}var BO=b("ZodTransform",(t,e)=>{ga(),k_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Hv(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Cn(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(j.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=t),r.issues.push(j.issue(i))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function zb(t){return new BO({type:"transform",transform:t})}var Tb=b("ZodOptional",(t,e)=>{bl.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Vl(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function _e(t){return new Tb({type:"optional",innerType:t})}var Cb=b("ZodExactOptional",(t,e)=>{P_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Vl(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function HO(t){return new Cb({type:"optional",innerType:t})}var WO=b("ZodNullable",(t,e)=>{z_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Xv(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function wb(t){return new WO({type:"nullable",innerType:t})}var GO=b("ZodDefault",(t,e)=>{T_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>tb(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function JO(t,e){return new GO({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var KO=b("ZodPrefault",(t,e)=>{C_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>rb(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function YO(t,e){return new KO({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():j.shallowClone(e)}})}var Ob=b("ZodNonOptional",(t,e)=>{O_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qv(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function XO(t,e){return new Ob({type:"nonoptional",innerType:t,...j.normalizeParams(e)})}var QO=b("ZodCatch",(t,e)=>{I_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>nb(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function eI(t,e){return new QO({type:"catch",innerType:t,catchValue:typeof e=="function"?e:j.constantCatch(e)})}var Ib=b("ZodPipe",(t,e)=>{wl.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ob(t,r,n,o),t.in=e.in,t.out=e.out});function xb(t,e){return new Ib({type:"pipe",in:t,out:e})}var tI=b("ZodPreprocess",(t,e)=>{Ib.init(t,e),R_.init(t,e)}),rI=b("ZodReadonly",(t,e)=>{D_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>sb(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function nI(t){return new rI({type:"readonly",innerType:t})}var Rb=b("ZodCustom",(t,e)=>{A_.init(t,e),ve.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Bv(t,r,n,o)});function Db(t,e){return vv(Rb,t??(()=>!0),e)}function oI(t,e={}){return bv(Rb,t,e)}function sI(t,e){return wv(t,e)}function Wl(t,e){return new tI({type:"pipe",in:zb(t),out:e})}var _a={};_p(_a,{ZodISODate:()=>Jo,ZodISODateTime:()=>Go,ZodISODuration:()=>Yo,ZodISOTime:()=>Ko,date:()=>aI,datetime:()=>iI,duration:()=>uI,time:()=>cI});function iI(t){return ta(Go,t)}function aI(t){return ra(Jo,t)}function cI(t){return na(Ko,t)}function uI(t){return oa(Yo,t)}var Jl="2025-11-25";var Ab=[Jl,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],pr="io.modelcontextprotocol/related-task",ba="2.0",ze=Db(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Nb=pe([_(),se().int()]),jb=_(),K4=Ve({ttl:se().optional(),pollInterval:se().optional()}),lI=z({ttl:se().optional()}),dI=z({taskId:_()}),Kl=Ve({progressToken:Nb.optional(),[pr]:dI.optional()}),at=z({_meta:Kl.optional()}),Xo=at.extend({task:lI.optional()}),Mb=t=>Xo.safeParse(t).success,Ie=z({method:_(),params:at.loose().optional()}),ft=z({_meta:Kl.optional()}),pt=z({method:_(),params:ft.loose().optional()}),Re=Ve({_meta:Kl.optional()}),wa=pe([_(),se().int()]),Lb=z({jsonrpc:O(ba),id:wa,...Ie.shape}).strict(),Yl=t=>Lb.safeParse(t).success,Zb=z({jsonrpc:O(ba),...pt.shape}).strict(),Fb=t=>Zb.safeParse(t).success,Xl=z({jsonrpc:O(ba),id:wa,result:Re}).strict(),Qo=t=>Xl.safeParse(t).success;var H;(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"})(H||(H={}));var Ql=z({jsonrpc:O(ba),id:wa.optional(),error:z({code:se().int(),message:_(),data:ye().optional()})}).strict();var qb=t=>Ql.safeParse(t).success;var Ub=pe([Lb,Zb,Xl,Ql]),Y4=pe([Xl,Ql]),xa=Re.strict(),fI=ft.extend({requestId:wa.optional(),reason:_().optional()}),Sa=pt.extend({method:O("notifications/cancelled"),params:fI}),pI=z({src:_(),mimeType:_().optional(),sizes:K(_()).optional(),theme:Ke(["light","dark"]).optional()}),es=z({icons:K(pI).optional()}),Dn=z({name:_(),title:_().optional()}),Vb=Dn.extend({...Dn.shape,...es.shape,version:_(),websiteUrl:_().optional(),description:_().optional()}),mI=ya(z({applyDefaults:Te().optional()}),ue(_(),ye())),hI=Wl(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,ya(z({form:mI.optional(),url:ze.optional()}),ue(_(),ye()).optional())),gI=Ve({list:ze.optional(),cancel:ze.optional(),requests:Ve({sampling:Ve({createMessage:ze.optional()}).optional(),elicitation:Ve({create:ze.optional()}).optional()}).optional()}),yI=Ve({list:ze.optional(),cancel:ze.optional(),requests:Ve({tools:Ve({call:ze.optional()}).optional()}).optional()}),_I=z({experimental:ue(_(),ze).optional(),sampling:z({context:ze.optional(),tools:ze.optional()}).optional(),elicitation:hI.optional(),roots:z({listChanged:Te().optional()}).optional(),tasks:gI.optional(),extensions:ue(_(),ze).optional()}),vI=at.extend({protocolVersion:_(),capabilities:_I,clientInfo:Vb}),ed=Ie.extend({method:O("initialize"),params:vI});var bI=z({experimental:ue(_(),ze).optional(),logging:ze.optional(),completions:ze.optional(),prompts:z({listChanged:Te().optional()}).optional(),resources:z({subscribe:Te().optional(),listChanged:Te().optional()}).optional(),tools:z({listChanged:Te().optional()}).optional(),tasks:yI.optional(),extensions:ue(_(),ze).optional()}),wI=Re.extend({protocolVersion:_(),capabilities:bI,serverInfo:Vb,instructions:_().optional()}),td=pt.extend({method:O("notifications/initialized"),params:ft.optional()});var $a=Ie.extend({method:O("ping"),params:at.optional()}),xI=z({progress:se(),total:_e(se()),message:_e(_())}),SI=z({...ft.shape,...xI.shape,progressToken:Nb}),Ea=pt.extend({method:O("notifications/progress"),params:SI}),$I=at.extend({cursor:jb.optional()}),ts=Ie.extend({params:$I.optional()}),rs=Re.extend({nextCursor:jb.optional()}),EI=Ke(["working","input_required","completed","failed","cancelled"]),ns=z({taskId:_(),status:EI,ttl:pe([se(),Eb()]),createdAt:_(),lastUpdatedAt:_(),pollInterval:_e(se()),statusMessage:_e(_())}),An=Re.extend({task:ns}),kI=ft.merge(ns),os=pt.extend({method:O("notifications/tasks/status"),params:kI}),ka=Ie.extend({method:O("tasks/get"),params:at.extend({taskId:_()})}),Pa=Re.merge(ns),za=Ie.extend({method:O("tasks/result"),params:at.extend({taskId:_()})}),X4=Re.loose(),Ta=ts.extend({method:O("tasks/list")}),Ca=rs.extend({tasks:K(ns)}),Oa=Ie.extend({method:O("tasks/cancel"),params:at.extend({taskId:_()})}),Bb=Re.merge(ns),Hb=z({uri:_(),mimeType:_e(_()),_meta:ue(_(),ye()).optional()}),Wb=Hb.extend({text:_()}),rd=_().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Gb=Hb.extend({blob:rd}),ss=Ke(["user","assistant"]),Nn=z({audience:K(ss).optional(),priority:se().min(0).max(1).optional(),lastModified:_a.datetime({offset:!0}).optional()}),Jb=z({...Dn.shape,...es.shape,uri:_(),description:_e(_()),mimeType:_e(_()),size:_e(se()),annotations:Nn.optional(),_meta:_e(Ve({}))}),PI=z({...Dn.shape,...es.shape,uriTemplate:_(),description:_e(_()),mimeType:_e(_()),annotations:Nn.optional(),_meta:_e(Ve({}))}),zI=ts.extend({method:O("resources/list")}),TI=rs.extend({resources:K(Jb)}),CI=ts.extend({method:O("resources/templates/list")}),OI=rs.extend({resourceTemplates:K(PI)}),nd=at.extend({uri:_()}),II=nd,RI=Ie.extend({method:O("resources/read"),params:II}),DI=Re.extend({contents:K(pe([Wb,Gb]))}),AI=pt.extend({method:O("notifications/resources/list_changed"),params:ft.optional()}),NI=nd,jI=Ie.extend({method:O("resources/subscribe"),params:NI}),MI=nd,LI=Ie.extend({method:O("resources/unsubscribe"),params:MI}),ZI=ft.extend({uri:_()}),FI=pt.extend({method:O("notifications/resources/updated"),params:ZI}),qI=z({name:_(),description:_e(_()),required:_e(Te())}),UI=z({...Dn.shape,...es.shape,description:_e(_()),arguments:_e(K(qI)),_meta:_e(Ve({}))}),VI=ts.extend({method:O("prompts/list")}),BI=rs.extend({prompts:K(UI)}),HI=at.extend({name:_(),arguments:ue(_(),_()).optional()}),WI=Ie.extend({method:O("prompts/get"),params:HI}),od=z({type:O("text"),text:_(),annotations:Nn.optional(),_meta:ue(_(),ye()).optional()}),sd=z({type:O("image"),data:rd,mimeType:_(),annotations:Nn.optional(),_meta:ue(_(),ye()).optional()}),id=z({type:O("audio"),data:rd,mimeType:_(),annotations:Nn.optional(),_meta:ue(_(),ye()).optional()}),GI=z({type:O("tool_use"),name:_(),id:_(),input:ue(_(),ye()),_meta:ue(_(),ye()).optional()}),JI=z({type:O("resource"),resource:pe([Wb,Gb]),annotations:Nn.optional(),_meta:ue(_(),ye()).optional()}),KI=Jb.extend({type:O("resource_link")}),ad=pe([od,sd,id,KI,JI]),YI=z({role:ss,content:ad}),XI=Re.extend({description:_().optional(),messages:K(YI)}),QI=pt.extend({method:O("notifications/prompts/list_changed"),params:ft.optional()}),eR=z({title:_().optional(),readOnlyHint:Te().optional(),destructiveHint:Te().optional(),idempotentHint:Te().optional(),openWorldHint:Te().optional()}),tR=z({taskSupport:Ke(["required","optional","forbidden"]).optional()}),Kb=z({...Dn.shape,...es.shape,description:_().optional(),inputSchema:z({type:O("object"),properties:ue(_(),ze).optional(),required:K(_()).optional()}).catchall(ye()),outputSchema:z({type:O("object"),properties:ue(_(),ze).optional(),required:K(_()).optional()}).catchall(ye()).optional(),annotations:eR.optional(),execution:tR.optional(),_meta:ue(_(),ye()).optional()}),cd=ts.extend({method:O("tools/list")}),rR=rs.extend({tools:K(Kb)}),Ia=Re.extend({content:K(ad).default([]),structuredContent:ue(_(),ye()).optional(),isError:Te().optional()}),Q4=Ia.or(Re.extend({toolResult:ye()})),nR=Xo.extend({name:_(),arguments:ue(_(),ye()).optional()}),is=Ie.extend({method:O("tools/call"),params:nR}),oR=pt.extend({method:O("notifications/tools/list_changed"),params:ft.optional()}),eU=z({autoRefresh:Te().default(!0),debounceMs:se().int().nonnegative().default(300)}),as=Ke(["debug","info","notice","warning","error","critical","alert","emergency"]),sR=at.extend({level:as}),ud=Ie.extend({method:O("logging/setLevel"),params:sR}),iR=ft.extend({level:as,logger:_().optional(),data:ye()}),aR=pt.extend({method:O("notifications/message"),params:iR}),cR=z({name:_().optional()}),uR=z({hints:K(cR).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),lR=z({mode:Ke(["auto","required","none"]).optional()}),dR=z({type:O("tool_result"),toolUseId:_().describe("The unique identifier for the corresponding tool call."),content:K(ad).default([]),structuredContent:z({}).loose().optional(),isError:Te().optional(),_meta:ue(_(),ye()).optional()}),fR=Hl("type",[od,sd,id]),va=Hl("type",[od,sd,id,GI,dR]),pR=z({role:ss,content:pe([va,K(va)]),_meta:ue(_(),ye()).optional()}),mR=Xo.extend({messages:K(pR),modelPreferences:uR.optional(),systemPrompt:_().optional(),includeContext:Ke(["none","thisServer","allServers"]).optional(),temperature:se().optional(),maxTokens:se().int(),stopSequences:K(_()).optional(),metadata:ze.optional(),tools:K(Kb).optional(),toolChoice:lR.optional()}),hR=Ie.extend({method:O("sampling/createMessage"),params:mR}),cs=Re.extend({model:_(),stopReason:_e(Ke(["endTurn","stopSequence","maxTokens"]).or(_())),role:ss,content:fR}),ld=Re.extend({model:_(),stopReason:_e(Ke(["endTurn","stopSequence","maxTokens","toolUse"]).or(_())),role:ss,content:pe([va,K(va)])}),gR=z({type:O("boolean"),title:_().optional(),description:_().optional(),default:Te().optional()}),yR=z({type:O("string"),title:_().optional(),description:_().optional(),minLength:se().optional(),maxLength:se().optional(),format:Ke(["email","uri","date","date-time"]).optional(),default:_().optional()}),_R=z({type:Ke(["number","integer"]),title:_().optional(),description:_().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),vR=z({type:O("string"),title:_().optional(),description:_().optional(),enum:K(_()),default:_().optional()}),bR=z({type:O("string"),title:_().optional(),description:_().optional(),oneOf:K(z({const:_(),title:_()})),default:_().optional()}),wR=z({type:O("string"),title:_().optional(),description:_().optional(),enum:K(_()),enumNames:K(_()).optional(),default:_().optional()}),xR=pe([vR,bR]),SR=z({type:O("array"),title:_().optional(),description:_().optional(),minItems:se().optional(),maxItems:se().optional(),items:z({type:O("string"),enum:K(_())}),default:K(_()).optional()}),$R=z({type:O("array"),title:_().optional(),description:_().optional(),minItems:se().optional(),maxItems:se().optional(),items:z({anyOf:K(z({const:_(),title:_()}))}),default:K(_()).optional()}),ER=pe([SR,$R]),kR=pe([wR,xR,ER]),PR=pe([kR,gR,yR,_R]),zR=Xo.extend({mode:O("form").optional(),message:_(),requestedSchema:z({type:O("object"),properties:ue(_(),PR),required:K(_()).optional()})}),TR=Xo.extend({mode:O("url"),message:_(),elicitationId:_(),url:_().url()}),CR=pe([zR,TR]),OR=Ie.extend({method:O("elicitation/create"),params:CR}),IR=ft.extend({elicitationId:_()}),RR=pt.extend({method:O("notifications/elicitation/complete"),params:IR}),jn=Re.extend({action:Ke(["accept","decline","cancel"]),content:Wl(t=>t===null?void 0:t,ue(_(),pe([_(),se(),Te(),K(_())])).optional())}),DR=z({type:O("ref/resource"),uri:_()});var AR=z({type:O("ref/prompt"),name:_()}),NR=at.extend({ref:pe([AR,DR]),argument:z({name:_(),value:_()}),context:z({arguments:ue(_(),_()).optional()}).optional()}),jR=Ie.extend({method:O("completion/complete"),params:NR});var MR=Re.extend({completion:Ve({values:K(_()).max(100),total:_e(se().int()),hasMore:_e(Te())})}),LR=z({uri:_().startsWith("file://"),name:_().optional(),_meta:ue(_(),ye()).optional()}),ZR=Ie.extend({method:O("roots/list"),params:at.optional()}),dd=Re.extend({roots:K(LR)}),FR=pt.extend({method:O("notifications/roots/list_changed"),params:ft.optional()}),tU=pe([$a,ed,jR,ud,WI,VI,zI,CI,RI,jI,LI,is,cd,ka,za,Ta,Oa]),rU=pe([Sa,Ea,td,FR,os]),nU=pe([xa,cs,ld,jn,dd,Pa,Ca,An]),oU=pe([$a,hR,OR,ZR,ka,za,Ta,Oa]),sU=pe([Sa,Ea,aR,FI,AI,oR,QI,os,RR]),iU=pe([xa,wI,MR,XI,BI,TI,OI,DI,Ia,rR,Pa,Ca,An]),Z=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===H.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Gl(o.elicitations,r)}return new t(e,r,n)}},Gl=class extends Z{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(H.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function mr(t){return t==="completed"||t==="failed"||t==="cancelled"}var LU=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function fd(t){let r=fa(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=pa(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function pd(t,e){let r=fr(t,e);if(!r.success)throw r.error;return r.data}var WR=6e4,Ra=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(Sa,r=>{this._oncancel(r)}),this.setNotificationHandler(Ea,r=>{this._onprogress(r)}),this.setRequestHandler($a,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ka,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(H.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(za,async(r,n)=>{let o=async()=>{let s=r.params.taskId;if(!await this._taskStore.getTask(s,n.sessionId))throw new Z(H.InvalidParams,`Task not found: ${s}`);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,p=new Z(d.error.code,d.error.message,d.error.data);l(p)}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 Z(H.InvalidParams,`Task not found: ${s}`);if(!mr(i.status))return await this._waitForTaskUpdate(s,n.signal,n.sessionId),await o();if(mr(i.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s,n.sessionId),{...a,_meta:{...a._meta,[pr]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(Ta,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 Z(H.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Oa,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new Z(H.InvalidParams,`Task not found: ${r.params.taskId}`);if(mr(o.status))throw new Z(H.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,n.sessionId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new Z(H.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Z?o:new Z(H.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),Z.fromError(H.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),Qo(s)||qb(s)?this._onresponse(s):Yl(s)?this._onrequest(s,i):Fb(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._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=Z.fromError(H.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?.[pr]?.taskId,i=o?.sessionId,a=this._taskStore,c=!0,u;if(s&&a&&this._taskMessageQueue&&i!==void 0&&(c=!1,u=(async()=>{if(!await a.getTask(s,i))throw new Z(H.InvalidParams,`Task not found: ${s}`);c=!0})()),n===void 0){let f={jsonrpc:"2.0",id:e.id,error:{code:H.MethodNotFound,message:"Method not found"}};if(s&&u){let h={type:"error",message:f,timestamp:Date.now()};u.then(()=>this._enqueueTaskMessage(s,h,i),()=>o?.send(f)).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)))}else s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:f,timestamp:Date.now()},o?.sessionId).catch(h=>this._onerror(new Error(`Failed to enqueue error response: ${h}`))):o?.send(f).catch(h=>this._onerror(new Error(`Failed to send an error response: ${h}`)));return}let l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);let d=Mb(e.params)?e.params.task:void 0,p=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,m={signal:l.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async f=>{if(l.signal.aborted)return;let h={relatedRequestId:e.id};s&&(h.relatedTask={taskId:s}),await this.notification(f,h)},sendRequest:async(f,h,g)=>{if(l.signal.aborted)throw new Z(H.ConnectionClosed,"Request was cancelled");let y={...g,relatedRequestId:e.id};s&&!y.relatedTask&&(y.relatedTask={taskId:s});let v=y.relatedTask?.taskId??s;return v&&p&&await p.updateTaskStatus(v,"input_required"),await this.request(f,h,y)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:p,taskRequestedTtl:d?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};(u??Promise.resolve()).then(()=>{if(u&&l.signal.aborted)throw new Z(H.ConnectionClosed,"Request was cancelled");d&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,m)).then(async f=>{if(l.signal.aborted)return;let h={result:f,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)},async f=>{if(l.signal.aborted)return;let h={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(f.code)?f.code:H.InternalError,message:f.message??"Internal error",...f.data!==void 0&&{data:f.data}}};s&&this._taskMessageQueue&&c?await this._enqueueTaskMessage(s,{type:"error",message:h,timestamp:Date.now()},o?.sessionId):await o?.send(h)}).catch(f=>this._onerror(new Error(`Failed to send response: ${f}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===l&&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),Qo(e))n(e);else{let i=new Z(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(Qo(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),Qo(e))o(e);else{let i=Z.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 Z?i:new Z(H.InternalError,String(i))}}return}let s;try{let i=await this.request(e,An,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new Z(H.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},mr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new Z(H.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Z(H.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 Z?i:new Z(H.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=v=>{l(v)};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(v){d(v);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(m.params={...m.params,task:a}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[pr]:c}});let f=v=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(v)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let x=v instanceof Z?v:new Z(H.RequestTimeout,String(v));l(x)};this._responseHandlers.set(p,v=>{if(!n?.signal?.aborted){if(v instanceof Error)return l(v);try{let x=fr(r,v.result);x.success?u(x.data):l(x.error)}catch(x){l(x)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let h=n?.timeout??WR,g=()=>f(Z.fromError(H.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(p,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let y=c?.taskId;if(y){let v=x=>{let S=this._responseHandlers.get(p);S?S(x):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,v),this._enqueueTaskMessage(y,{type:"request",message:m,timestamp:Date.now()}).catch(x=>{this._cleanupTimeout(p),l(x)})}else this._transport.send(m,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(v=>{this._cleanupTimeout(p),l(v)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Pa,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},Ca,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},Bb,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||{},[pr]: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||{},[pr]: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||{},[pr]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=fd(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=pd(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=fd(e);this._notificationHandlers.set(n,o=>{let s=pd(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??this._transport?.sessionId,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"&&Yl(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new Z(H.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,n){let o=this._options?.defaultTaskPollInterval??1e3;try{let s=await this._taskStore?.getTask(e,n);s?.pollInterval&&(o=s.pollInterval)}catch{}return new Promise((s,i)=>{if(r.aborted){i(new Z(H.InvalidRequest,"Request cancelled"));return}let a=setTimeout(s,o);r.addEventListener("abort",()=>{clearTimeout(a),i(new Z(H.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 Z(H.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=os.parse({method:"notifications/tasks/status",params:a});await this.notification(c),mr(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 Z(H.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(mr(a.status))throw new Z(H.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=os.parse({method:"notifications/tasks/status",params:c});await this.notification(u),mr(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function Yb(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Xb(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];Yb(i)&&Yb(s)?r[o]={...i,...s}:r[o]=s}return r}var sS=_t(ip(),1),iS=_t(oS(),1);function EL(){let t=new sS.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,iS.default)(t),t}var xc=class{constructor(e){this._ajv=e??EL()}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 Sc=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}createMessageStream(e,r){let n=this._server.getClientCapabilities();if((e.tools||e.toolChoice)&&!n?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let o=e.messages[e.messages.length-1],s=Array.isArray(o.content)?o.content:[o.content],i=s.some(l=>l.type==="tool_result"),a=e.messages.length>1?e.messages[e.messages.length-2]:void 0,c=a?Array.isArray(a.content)?a.content:[a.content]:[],u=c.some(l=>l.type==="tool_use");if(i){if(s.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!u)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(u){let l=new Set(c.filter(p=>p.type==="tool_use").map(p=>p.id)),d=new Set(s.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(l.size!==d.size||![...l].every(p=>d.has(p)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:e},cs,r)}elicitInputStream(e,r){let n=this._server.getClientCapabilities(),o=e.mode??"form";switch(o){case"url":{if(!n?.elicitation?.url)throw new Error("Client does not support url elicitation.");break}case"form":{if(!n?.elicitation?.form)throw new Error("Client does not support form elicitation.");break}}let s=o==="form"&&e.mode===void 0?{...e,mode:"form"}:e;return this.requestStream({method:"elicitation/create",params:s},jn,r)}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 aS(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 cS(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 $c=class extends Ra{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(as.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 xc,this.setRequestHandler(ed,n=>this._oninitialize(n)),this.setNotificationHandler(td,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(ud,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,a=as.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Sc(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=Xb(this._capabilities,e)}setRequestHandler(e,r){let o=fa(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s=pa(o);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=fr(is,c);if(!l.success){let f=l.error instanceof Error?l.error.message:String(l.error);throw new Z(H.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let f=fr(An,p);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new Z(H.InvalidParams,`Invalid task creation result: ${h}`)}return f.data}let m=fr(Ia,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new Z(H.InvalidParams,`Invalid tools/call result: ${f}`)}return m.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){cS(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&aS(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:Ab.includes(r)?r:Jl,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"},xa)}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},ld,r):this.request({method:"sampling/createMessage",params:e},cs,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},jn,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},jn,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!a.valid)throw new Z(H.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof Z?i:new Z(H.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},dd,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 mp=_t(require("node:process"),1);var kL=10*1024*1024,Ec=class{constructor(e){this._maxBufferSize=e?.maxBufferSize??kL}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
151
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),PL(r)}clear(){this._buffer=void 0}};function PL(t){return Ub.parse(JSON.parse(t))}function uS(t){return JSON.stringify(t)+`
152
+ `}var kc=class{constructor(e=mp.default.stdin,r=mp.default.stdout,n){this._stdin=e,this._stdout=r,this._started=!1,this._ondata=o=>{try{this._readBuffer.append(o),this.processReadBuffer()}catch(s){this.onerror?.(s),this.close().catch(()=>{})}},this._onerror=o=>{this.onerror?.(o)},this._readBuffer=new Ec({maxBufferSize:n?.maxBufferSize})}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=uS(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var Fs=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 qs=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 m of c){if(!o&&m.deprecated)continue;let f=this.calculateRelevanceScore(m,a);f>0&&u.push({doc:m,relevanceScore:f})}u.sort((m,f)=>f.relevanceScore-m.relevanceScore);let l=u.length,d=u.slice(i,i+s),p=i+s<l;return{items:d,total:l,hasMore:p}}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 Pc=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):
160
153
 
161
154
  `;for(let[s,i]of Object.entries(n)){o+=`## ${s.charAt(0).toUpperCase()+s.slice(1)}s
162
155
 
@@ -175,7 +168,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
175
168
 
176
169
  `),e.replacementSuggestion&&(r+=`**Recommended replacement**: ${e.replacementSuggestion}
177
170
 
178
- `),r}};var Fn=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(p=>!p.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 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`);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 Vn=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 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.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 Hn=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"]}}}};function _1(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 Wn=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)return{componentName:r.trim(),examples:[]};let n=_1(r.trim()),o=r.trim().toLowerCase(),s=this.data.find(i=>i.component===n)??this.data.find(i=>i.component===`eui-${n}`)??this.data.find(i=>i.component===`ecl-${n}`)??this.data.find(i=>i.component===`eds-${n}`)??this.data.find(i=>i.component===o);return{componentName:s?.component??r.trim(),examples:s?.examples??[]}}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 Gn=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 Na=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 Jn=class{constructor(e){this.index=e;this.parser=new Na}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 Kn=class{query;formatter;constructor(e,r){this.query=new Jn(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 Yn=class{query;formatter;constructor(e,r){this.query=new Jn(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 Qn=class{execute(e={}){return Promise.resolve({content:v1,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:{}}}}},v1=`# Getting Started with EUI CLI
171
+ `),r}};var to=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(p=>!p.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 ro=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 no=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 oo=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 so=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"]}}}};function zL(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 io=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)return{componentName:r.trim(),examples:[]};let n=zL(r.trim()),o=r.trim().toLowerCase(),s=this.data.find(i=>i.component===n)??this.data.find(i=>i.component===`eui-${n}`)??this.data.find(i=>i.component===`ecl-${n}`)??this.data.find(i=>i.component===`eds-${n}`)??this.data.find(i=>i.component===o);return{componentName:s?.component??r.trim(),examples:s?.examples??[]}}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 ao=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 zc=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 co=class{constructor(e){this.index=e;this.parser=new zc}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 uo=class{query;formatter;constructor(e,r){this.query=new co(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 lo=class{query;formatter;constructor(e,r){this.query=new co(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 fo=class{execute(e={}){return Promise.resolve({content:TL,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:{}}}}},TL=`# Getting Started with EUI CLI
179
172
 
180
173
  The EUI CLI is a command-line tool for scaffolding and managing EUI applications.
181
174
 
@@ -300,7 +293,7 @@ my-app/
300
293
  \`\`\`
301
294
 
302
295
  The application will be available at \`http://localhost:4200\`
303
- `;var Xn=class{execute(e={}){return Promise.resolve({content:b1,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:{}}}}},b1=`# eUI CLI - Complete Options Report
296
+ `;var po=class{execute(e={}){return Promise.resolve({content:CL,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:{}}}}},CL=`# eUI CLI - Complete Options Report
304
297
 
305
298
  ## Overview
306
299
 
@@ -640,9 +633,9 @@ eui-cli serve-app --maxSpaceSize
640
633
 
641
634
  - **Node.js**: >=24.0.0
642
635
  - **Yarn**: >=1.22.4 <2
643
- `;function w1(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 eo=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=w1(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 xs=class{server;index;query;searchEngine;formatter;accessibilityData;examplesData;tools;isRunning=!1;constructor(e,r,n,o){this.index=r,this.accessibilityData=n??null,this.examplesData=o??null,this.query=new bs(r),this.searchEngine=new ws(r),this.formatter=new Aa,this.tools=new Map,this.server=new Ia({name:e.name,version:e.version},{capabilities:{tools:{}}}),this.registerTools(),this.setupHandlers()}registerTools(){let e=new Fn(this.query,this.formatter),r=new Un(this.query,this.formatter),n=new Vn(this.searchEngine,this.formatter),o=new Bn(this.query,this.formatter),s=new Hn(this.query,this.formatter),i=new Wn(this.examplesData),a=new Gn,c=new Kn(this.index,this.formatter),u=new Yn(this.index,this.formatter),l=new Qn,d=new Xn,p=new eo(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",p)}setupHandlers(){this.server.setRequestHandler(il,()=>({tools:[Fn.getToolDefinition(),Un.getToolDefinition(),Vn.getToolDefinition(),Bn.getToolDefinition(),Hn.getToolDefinition(),Wn.getToolDefinition(),Gn.getToolDefinition(),Kn.getToolDefinition(),Yn.getToolDefinition(),Qn.getToolDefinition(),Xn.getToolDefinition(),eo.getToolDefinition()]})),this.server.setRequestHandler(Fo,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 Da;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 bs(e),this.searchEngine=new ws(e),this.registerTools()}updateAccessibilityData(e){this.accessibilityData=e;let r=this.tools.get("get-component-accessibility");r&&r.updateData(e)}updateExamplesData(e){this.examplesData=e;let r=this.tools.get("get-component-examples");r&&r.updateData(e)}};var uf=gt(require("fs")),yr=null,Ma=null,px=!1;async function x1(t,e){let r=Zt.detect(t);if(r.type==="local"){let s=uf.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new Zr({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 S1(t,e){let r=Zt.detect(t);if(r.type==="local"){let s=uf.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new Zr({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 $1(){try{let t=Wa();(!t.success||!t.config)&&(process.stderr.write(`Failed to load configuration
636
+ `;function OL(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 mo=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=OL(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 Us=class{server;index;query;searchEngine;formatter;accessibilityData;examplesData;tools;isRunning=!1;constructor(e,r,n,o){this.index=r,this.accessibilityData=n??null,this.examplesData=o??null,this.query=new Fs(r),this.searchEngine=new qs(r),this.formatter=new Pc,this.tools=new Map,this.server=new $c({name:e.name,version:e.version},{capabilities:{tools:{}}}),this.registerTools(),this.setupHandlers()}registerTools(){let e=new to(this.query,this.formatter),r=new ro(this.query,this.formatter),n=new no(this.searchEngine,this.formatter),o=new oo(this.query,this.formatter),s=new so(this.query,this.formatter),i=new io(this.examplesData),a=new ao,c=new uo(this.index,this.formatter),u=new lo(this.index,this.formatter),l=new fo,d=new po,p=new mo(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",p)}setupHandlers(){this.server.setRequestHandler(cd,()=>({tools:[to.getToolDefinition(),ro.getToolDefinition(),no.getToolDefinition(),oo.getToolDefinition(),so.getToolDefinition(),io.getToolDefinition(),ao.getToolDefinition(),uo.getToolDefinition(),lo.getToolDefinition(),fo.getToolDefinition(),po.getToolDefinition(),mo.getToolDefinition()]})),this.server.setRequestHandler(is,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 kc;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 Fs(e),this.searchEngine=new qs(e),this.registerTools()}updateAccessibilityData(e){this.accessibilityData=e;let r=this.tools.get("get-component-accessibility");r&&r.updateData(e)}updateExamplesData(e){this.examplesData=e;let r=this.tools.get("get-component-examples");r&&r.updateData(e)}};var hp=_t(require("fs")),$r=null,Cc=null,lS=!1;async function IL(t,e){let r=Vt.detect(t);if(r.type==="local"){let s=hp.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new Wr({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 RL(t,e){let r=Vt.detect(t);if(r.type==="local"){let s=hp.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new Wr({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 DL(){try{let t=Lc();(!t.success||!t.config)&&(process.stderr.write(`Failed to load configuration
644
637
  `),t.errors&&t.errors.forEach(u=>process.stderr.write(` - ${u}
645
- `)),process.exit(1));let e=t.config,r=Qc({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}),Ma=new yo({path:e.documentation.path,watchForChanges:e.documentation.watchForChanges,reloadDebounce:e.documentation.reloadDebounce,onReload:k1,onError:E1});let n=await Ma.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 _o,s;try{s=o.build(n.data);let u=o.getStatistics(s);r.info("Index built successfully",{totalCount:u.totalCount,components:u.componentCount,directives:u.directiveCount,pipes:u.pipeCount,services:u.serviceCount})}catch(u){r.error("Failed to build index",u instanceof Error?u:new Error(String(u))),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 x1(e.accessibility.path,e.documentation.timeout),r.info("Accessibility data loaded successfully",{entries:i.length})}catch(u){r.warn("Failed to load accessibility data - tool will be unavailable",{error:u instanceof Error?u.message:String(u)})}}else r.info("No accessibility path configured - get-component-accessibility tool will report not configured");let a=null;if(e.examples?.path){r.info("Loading examples data...",{path:e.examples.path});try{a=await S1(e.examples.path,e.documentation.timeout),r.info("Examples data loaded successfully",{entries:a.length})}catch(u){r.warn("Failed to load examples data - get-component-examples will return empty results",{error:u instanceof Error?u.message:String(u)})}}else r.info("No examples path configured - get-component-examples will return empty results");yr=new xs({name:e.server.name,version:e.server.version},s,i,a),r.info("Starting MCP server..."),await yr.start(),r.info("MCP server started successfully",{name:e.server.name,version:e.server.version,watchForChanges:e.documentation.watchForChanges}),yr.isHealthy()?r.info("Health check passed"):r.warn("Health check failed - server may not be fully operational");let c=yr.getStats();r.debug("Server statistics",c),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 k1(t){let e=ne();e.info("Documentation file changed, reloading...");try{let r=new _o,n=r.build(t);if(yr){yr.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 E1(t){ne().error("Documentation loader error",t)}async function ja(t){if(px)return;px=!0;let e=ne();e.info(`Received ${t}, shutting down gracefully...`);try{yr&&(e.info("Stopping MCP server..."),await yr.stop(),e.info("MCP server stopped")),Ma&&(e.info("Stopping documentation loader..."),await Ma.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 z1(){process.on("SIGINT",()=>{ja("SIGINT")}),process.on("SIGTERM",()=>{ja("SIGTERM")}),process.on("uncaughtException",t=>{ne().error("Uncaught exception",t),ja("uncaughtException")}),process.on("unhandledRejection",t=>{ne().error("Unhandled promise rejection",t instanceof Error?t:new Error(String(t))),ja("unhandledRejection")})}z1();$1().catch(t=>{process.stderr.write(`Fatal error: ${t}
638
+ `)),process.exit(1));let e=t.config,r=Vu({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}),Cc=new Co({path:e.documentation.path,watchForChanges:e.documentation.watchForChanges,reloadDebounce:e.documentation.reloadDebounce,onReload:AL,onError:NL});let n=await Cc.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 Oo,s;try{s=o.build(n.data);let u=o.getStatistics(s);r.info("Index built successfully",{totalCount:u.totalCount,components:u.componentCount,directives:u.directiveCount,pipes:u.pipeCount,services:u.serviceCount})}catch(u){r.error("Failed to build index",u instanceof Error?u:new Error(String(u))),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 IL(e.accessibility.path,e.documentation.timeout),r.info("Accessibility data loaded successfully",{entries:i.length})}catch(u){r.warn("Failed to load accessibility data - tool will be unavailable",{error:u instanceof Error?u.message:String(u)})}}else r.info("No accessibility path configured - get-component-accessibility tool will report not configured");let a=null;if(e.examples?.path){r.info("Loading examples data...",{path:e.examples.path});try{a=await RL(e.examples.path,e.documentation.timeout),r.info("Examples data loaded successfully",{entries:a.length})}catch(u){r.warn("Failed to load examples data - get-component-examples will return empty results",{error:u instanceof Error?u.message:String(u)})}}else r.info("No examples path configured - get-component-examples will return empty results");$r=new Us({name:e.server.name,version:e.server.version},s,i,a),r.info("Starting MCP server..."),await $r.start(),r.info("MCP server started successfully",{name:e.server.name,version:e.server.version,watchForChanges:e.documentation.watchForChanges}),$r.isHealthy()?r.info("Health check passed"):r.warn("Health check failed - server may not be fully operational");let c=$r.getStats();r.debug("Server statistics",c),r.info("Server is ready to accept requests")}catch(t){oe().error("Fatal error during startup",t instanceof Error?t:new Error(String(t))),process.exit(1)}}function AL(t){let e=oe();e.info("Documentation file changed, reloading...");try{let r=new Oo,n=r.build(t);if($r){$r.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 NL(t){oe().error("Documentation loader error",t)}async function Tc(t){if(lS)return;lS=!0;let e=oe();e.info(`Received ${t}, shutting down gracefully...`);try{$r&&(e.info("Stopping MCP server..."),await $r.stop(),e.info("MCP server stopped")),Cc&&(e.info("Stopping documentation loader..."),await Cc.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 jL(){process.on("SIGINT",()=>{Tc("SIGINT")}),process.on("SIGTERM",()=>{Tc("SIGTERM")}),process.on("uncaughtException",t=>{oe().error("Uncaught exception",t),Tc("uncaughtException")}),process.on("unhandledRejection",t=>{oe().error("Unhandled promise rejection",t instanceof Error?t:new Error(String(t))),Tc("unhandledRejection")})}jL();DL().catch(t=>{process.stderr.write(`Fatal error: ${t}
646
639
  `),process.exit(1)});
647
640
  /*! Bundled license information:
648
641